diff --git a/miosix/config/Makefile.inc b/miosix/config/Makefile.inc
index 1d233de48b65e64bea978d0367e59ff2297d31bd..c10d25595e272c1541236dfaadff2f1f4186f19c 100644
--- a/miosix/config/Makefile.inc
+++ b/miosix/config/Makefile.inc
@@ -1597,7 +1597,8 @@ else ifeq ($(ARCH),cortexM4_stm32f4)
         ## The command must provide a way to program the board, or print an
         ## error message saying that 'make program' is not supported for that
         ## board.
-        PROG ?= stm32flash -w $(if $(ROMFS_DIR), image.bin, main.bin) -v /dev/ttyUSB0
+        PROG ?= st-flash --connect-under-reset --reset write \
+                $(if $(ROMFS_DIR), image.bin, main.bin) 0x08000000make
         
     ##-------------------------------------------------------------------------
     ## BOARD: stm32f429zi_stm32f4discovery
diff --git a/miosix/config/arch/cortexM4_stm32f4/stm32f407vg_bitsboard/board_settings.h b/miosix/config/arch/cortexM4_stm32f4/stm32f407vg_bitsboard/board_settings.h
index 99ac82f23a19a40c8309b683d816a08b609853cb..dbe35aa7f420ebfba409bd7cf6c6cb94a0580dbc 100644
--- a/miosix/config/arch/cortexM4_stm32f4/stm32f407vg_bitsboard/board_settings.h
+++ b/miosix/config/arch/cortexM4_stm32f4/stm32f407vg_bitsboard/board_settings.h
@@ -60,15 +60,15 @@ const bool defaultSerialDma=true;
 //using defaultSerialRtsPin = Gpio<GPIOA_BASE,12>;
 //using defaultSerialCtsPin = Gpio<GPIOA_BASE,11>;
 // Default serial 2 pins (uncomment when using serial 2)
-using defaultSerialTxPin = Gpio<GPIOA_BASE,2>;
-using defaultSerialRxPin = Gpio<GPIOA_BASE,3>;
-using defaultSerialRtsPin = Gpio<GPIOA_BASE,1>;
-using defaultSerialCtsPin = Gpio<GPIOA_BASE,0>;
+//using defaultSerialTxPin = Gpio<GPIOA_BASE,2>;
+//using defaultSerialRxPin = Gpio<GPIOA_BASE,3>;
+//using defaultSerialRtsPin = Gpio<GPIOA_BASE,1>;
+//using defaultSerialCtsPin = Gpio<GPIOA_BASE,0>;
 // Default serial 3 pins (uncomment when using serial 3)
-//using defaultSerialTxPin = Gpio<GPIOB_BASE,10>;
-//using defaultSerialRxPin = Gpio<GPIOB_BASE,11>;
-//using defaultSerialRtsPin = Gpio<GPIOB_BASE,14>;
-//using defaultSerialCtsPin = Gpio<GPIOB_BASE,13>;
+using defaultSerialTxPin = Gpio<GPIOB_BASE,10>;
+using defaultSerialRxPin = Gpio<GPIOB_BASE,11>;
+using defaultSerialRtsPin = Gpio<GPIOB_BASE,14>;
+using defaultSerialCtsPin = Gpio<GPIOB_BASE,13>;
 
 //SD card driver
 static const unsigned char sdVoltage=30; //Board powered @ 3.0V