2025-11-06 2:58 AM - last edited on 2025-11-06 3:08 AM by Andrew Neil
I flashed firmware that sets. Now STM32Cubeprogrammer refuses to connect to the STLINK portion.
How to recover from this / debrick the boards ? I tried pulling up PA14 / boot0 pin with a pull-up to CN7 pin 7, but no such luck...
Solved! Go to Solution.
2025-11-06 7:37 AM
The factory-loaded option bytes do not enable the BOOT0 pin to select boot mode. By default, it will always boot to flash as long as there's a program there.
2025-11-06 3:07 AM
Having the ST-Link connect under hardware reset should do it.
2025-11-06 3:48 AM
Nope...
12:42:17 : UR connection mode is defined with the HWrst reset mode
12:42:22 : UR connection mode is defined with the HWrst reset mode
12:42:22 : ST-LINK error (DEV_USB_COMM_ERR)
12:42:22 : Error: Problem occured while trying to connect
Serial console through STLINK _is_ working, and shows my startup message, so the USB connection is good.
2025-11-06 6:05 AM
Hold reset, click connect, then release reset. You may have to play around a bit to get the timing exactly right. STM32CubeProgrammer needs to connect after NRST is high but before PA14 is reassigned. How quick this happens depends on your program.
2025-11-06 6:08 AM
@TDK wrote:STM32CubeProgrammer needs to connect after NRST is high but before PA14 is reassigned. How quick this happens depends on your program.
@pdornier1 so it's a good idea to have a delay in there - to give time for a debugger or programmer to connect...
2025-11-06 7:19 AM
My code is bare metal (actually assembly language), so the debugger will never be fast enough. Theoretically the STLINK portion should be able to pull NRST low and BOOT0 high, then NRST high, but that doesn't seem to be happening.
Should I consider the boards "bricked" ? As long as the boot bits in flash are not set - I don't touch them - there should always be a way back to the boot loader, not a "catch 22" like this.
2025-11-06 7:37 AM
The factory-loaded option bytes do not enable the BOOT0 pin to select boot mode. By default, it will always boot to flash as long as there's a program there.
2025-11-06 8:08 AM
Thank you & ouch...