STM32U5 error when wake up from Stop mode 2 without ST-LINK
After entering in Stop mode 2, it wakes up by RTC or EXTI2 using those functions:
__HAL_RCC_RTCAPB_CLKAM_ENABLE();
HAL_SuspendTick();
HAL_PWREx_EnterSTOP2Mode(PWR_STOPENTRY_WFI);
SystemClock_Config();
HAL_ResumeTick();
When I load the program with the ST-LINK/V2, at that moment everything runs correctly, it wakes up, read LPTIM1 etc. But once the code is loaded, when I reset the system it gets stuck in the SystemClock_Config();. Specifically in the HAL_PWREx_ControlVoltageScaling(PWR_REGULATOR_VOLTAGE_SCALE2) function.
I am using a custom board and the SMPS Power Regulator.
