Warm tip: This article is reproduced from stackoverflow.com, please click
bootloader embedded serial-port stm32 uart

Is there a way for me to flash my code on a STM32F4 board via UART bridge?

发布于 2020-04-21 11:00:41

So, I have a STM32f407vet6 board and a Silicon Labs cp210x USB to UART bridge. Is there a way for me to flash my project onto the board using the bridge?

Preferably I would like to use it with µVision to flash a project with FreeRTOS. I had trouble finding the answer since the only guides online recommend I use ST-Link or similar programmers, and most IDE-s show them as the only option.

Questioner
Pisoj61
Viewed
44
Clifford 2018-12-27 00:44

STM32F407VET6 describes a chip not a board, and as such it is not possible to tell whether you can do it with your board. You have to be able to assert the boot pins to boot from system memory, which initiates the bootloader in mask ROM. Using that it is possible to program the flash memory via USART1 (PA9/PA10), USART3 (PC10/PC11 or PB10/PB11), CAN2 (PB5/PB13), and USB OTG FS in Device mode (PA11/PA12) through DFU (device firmware upgrade).

So whether it is possible depends on your board design and whether the boot pins can be set appropriately and whether either UART1 or UART3 are available on the specified pins.

Even then you are, unlikely to find such support in your IDE since the IDE's main purpose is development and debugging, while the built-in bootloader is suitable only for programming and is intended for in-field update rather then development. For any serious development you will want a JTAG or SWI device such as an ST-Link. Many low cost development boards from ST include an ST-Link integrated on the board, with a header to support connection to other boards without one.

There is an article on loading STM32F4 devices over UART at http://stm32f4-discovery.net/2014/09/program-stm32f4-with-uart/