cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F031K6Tx BOOT Mode for Programming using UART and SWD

S.Kamath
Associate II

I'm using STM32F031K6Tx in my design. I have given provision for both UART (PA9/PA10) & SWD (SWDIO/SWCLK) for programming MCU using test fixture in the factory. Either one will be used

1) Is BOOT0 (0 = Main Flash Memory; 1 = System Memory) needs to be pulled high during programming using both a) UART & b) SWD ?

2) In NUCLEO-F031K6, I see that BOOT0 is always pulled Low and STM32 MCU, F031 is programmed through ST-Link v2 MCU, STM32F103CBT6. How it works without making BOOT0 pulled High

1 ACCEPTED SOLUTION

Accepted Solutions

>>CubeProgrammer throws an Error "Error: No STM32 target found!". It works fine with BOOT0=HIGH.

Wouldn't that be indicative that code you are put on the device is ballsing up the pins related to the debug interface, disabling or entering a low power mode we they are turned off completely?

#UpHillSkiing

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

View solution in original post

4 REPLIES 4

The SWD interface connects with the processor core, it doesn't matter if the firmware is running from ROM, or FLASH. The benefit of BOOT0=HIGH in this context is that it won't reconfigure or break the PA13/PA14 connectivity, whereas software you load might.

With BOOT0=HIGH the ROM based system loader provided for UART1 connectivity

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

I tried to connect STM32 board using SWD (SWDIO/SWCLK) with STM32 MCU's BOOT0=LOW. CubeProgrammer throws an Error "Error: No STM32 target found!".

It works fine with BOOT0=HIGH.

External ST-link used to connect STM32 board

How STM32 MCU flashing is working in NUCLEO-F031K6 without making BOOT0=HIGH? BOOT0 is always LOW in NUCLEO-F031K6 (Any STM32 board)

External ST-link programmer:

0693W000001t9BlQAI.jpg

>>CubeProgrammer throws an Error "Error: No STM32 target found!". It works fine with BOOT0=HIGH.

Wouldn't that be indicative that code you are put on the device is ballsing up the pins related to the debug interface, disabling or entering a low power mode we they are turned off completely?

#UpHillSkiing

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

Reflashed MCU with BOOT0=1 with SWD (PA13/PA14) enabled code. I'm able to flash MCU in BOOT0=0 now..!