cancel
Showing results for 
Search instead for 
Did you mean: 

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

MehmetKaya
Associate III

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. 

1 ACCEPTED SOLUTION

Accepted Solutions

Yes

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

5 REPLIES 5
TDK
Guru

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".
MehmetKaya
Associate III

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?

 

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

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

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

Yes

If you feel a post has answered your question, please click "Accept as Solution".