Unbricking an STM32 device

Typically an STM32 device gets bricked when it is flashed with an algorithm that references nonexistent memory during boot up. That puts the device in a hard fault state that won’t allow a JTAG connection. An unhelpful error message is displayed — like No STM32 MCU found — is displayed.  

A hard fault lock-up can happen if you flash to the wrong part or if your algorithm indexes past the end of an array or gets a bad pointer. To unbrick your device:

1.    Download and run stm32cubeprogrammer.

2.    Under Mode, select Under reset.

 A screenshot of a computer

Description automatically generated

3.    Unplug your device.

4.    Press and hold the Reset button on the device while you:

a.    Plug in your device.

b.    In stem32cube programmer, click Connect.

c.    Count to three, then release the Reset button.

5.    In stm32cubeprogrammer, click Erasing and Programming, then select index 0 of flash and click Erase selected sectors.