Skip to main content
S.Kamath
Associate III
July 15, 2020
Solved

STM32F031K6Tx BOOT Mode for Programming using UART and SWD

  • July 15, 2020
  • 4 replies
  • 1424 views

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

This topic has been closed for replies.
Best answer by Tesla DeLorean

>>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

4 replies

Tesla DeLorean
Guru
July 15, 2020

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 (See Profile) Up vote any posts that you find helpful, it shows what's working..
S.Kamath
S.KamathAuthor
Associate III
July 18, 2020

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

Tesla DeLorean
Tesla DeLoreanBest answer
Guru
July 18, 2020

>>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 (See Profile) Up vote any posts that you find helpful, it shows what's working..
S.Kamath
S.KamathAuthor
Associate III
July 18, 2020

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