cancel
Showing results for 
Search instead for 
Did you mean: 

How can I recover my STM32H7 board after facing a power configuration deadlock?

Stefanie LAU
ST Employee
After programming my STM32H7 and performing a reset, I find that I can no longer connect to my target using STLINK. Why does this happen? How can I recover my board?Note that your STM32H7’s SMPS or LDO firmware power configuration must match with the board’s hardware configuration. If not, you will face a deadlock situation such that after the reset the STLINK can no longer be used to connect to the target.
The firmware’s power configuration is located in the main.c file, namely in the function SystemClock_Config(). Depending on your target’s hardware power configuration, modify your SystemClock_Config function to use the corresponding line of code:
1. Direct SMPS Hardware Power Configuration 
/*!< Supply configuration update enable */
HAL_PWREx_ConfigSupply(PWR_DIRECT_SMPS_SUPPLY);
2. LDO Hardware Power Configuration 
/*!< Supply configuration update enable */
HAL_PWREx_ConfigSupply(PWR_LDO_SUPPLY);

If at any time a deadlock situation is faced due to a mismatch between the target’s hardware power configuration and firmware setting, you can recover the board by doing the following:
Step 1. Power off the board
Step 2. Locate the BOOT0 pin and connect the BOOT0 pin to VDD using a wire. This pulls the BOOT0 pin to HIGH, which changes the device’s boot address to start the bootloader in system memory instead of booting from the target’s flash memory (which currently houses the firmware that is setting the incorrect SMPS/LDO configuration).
Step 3. Power on the board and connect to the target using STM32CubeProgrammer.
Step 4. Perform a mass erase.
Step 5. Power off the board and remove the wire between BOOT0 and VDD.
Step 6. The recovery is now completed; you can once again connect to the target using the STLINK and use the board as normal.
For additional information on this warning, please refer to UM2408, in specific the section concerning Internal SMPS / LDO Configuration. 
Comments
VOLKS
Associate

This answer helped to me, thank you very much.

Please note that: before do this, be ensure that your VDDA should not be floating. if your VDDA pin is floating, please connect with a dupont/jumper cable to VDD or 3.3V. 

Version history
Last update:
‎2021-12-16 12:09 AM
Updated by: