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