Skip to main content
Associate II
August 5, 2024
Solved

How to program empty STM32f042C4U6 from UART1 instead of SWCLK-SWDIO?

  • August 5, 2024
  • 2 replies
  • 2390 views

UART_prograaming.jpg

 Is it possible to program an empty STM32F042 using UART1 instead of SWCLK-SWDIO?

I want to flash programming of STM32F042 which is zero. 

Best answer by TDK

Yes

2 replies

TDK
August 5, 2024

If you hold BOOT0 high during reset, it will boot into the bootloader. You can then use UART to program it.

STM32CubeProgrammer can do this for you if you have a USB to UART adapter and hook it up to the correct pins. See AN2606 for supported pinout.

cd00167594-stm32-microcontroller-system-memory-boot-mode-stmicroelectronics.pdf

UART bootloader protocol is detailed here:

cd00264342-usart-protocol-used-in-the-stm32-bootloader-stmicroelectronics.pdf

"If you feel a post has answered your question, please click ""Accept as Solution""."
Associate II
August 5, 2024

If I do BOOT0 high (always pulled up) and connect USB to UART adapter TX-RX to STM32f042C4U6 as picture, May I program all flash with STM32CubeProgrammer?

 

Tesla DeLorean
Guru
August 5, 2024

BOOT0 will need to be Low for normal operation once programmed.

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
Associate II
August 5, 2024

Ok, so when programming from UART BOOT0 must be high, after programming we have to do low BOOT0 for normal operation, right?