H7 Nucleo board: USB Charger Supply, MCU not starting
I have a Nucleo-H745ZI-Q board and developed an application with STM32CubeIDE and programmed the board via USB ST-Link connector, everything fine.
Next I wanted to use my board without USB-PC connection, instead, simply by powering it with USB-Charger (same connector as during development process). I changed the JP2 to CHGR and the power led is on, but the MCU does not execute the program. I figured out, that
- bringing BOOT (on CN11) to 3.3V
- then plug in power USB cable
- release BOOT0 pin
- press reset button
Starts the flashed MCU program.
Is there any way to directly start the developed program after power up without these steps?
Edit on 11.11.2022:
I found my mistake:
void SystemClock_Config(void)
{
...
//HAL_PWREx_ConfigSupply(PWR_LDO_SUPPLY); //wrong
HAL_PWREx_ConfigSupply(PWR_DIRECT_SMPS_SUPPLY); //correct
while(!__HAL_PWR_GET_FLAG(PWR_FLAG_VOSRDY)) {} //was missing
...