Question
STM32U575 freezes when exiting STOP2 mode after power cycle
The MCU works fine the first time it gets programmed. However, after one power cycle, it freezes completely after an external interrupt happens. Doesn’t even enter the error handler. I have SMPS enabled. Thanks for your help
int main(void)
{
/* USER CODE BEGIN 1 */
/* USER CODE END 1 */
/* MCU Configuration--------------------------------------------------------*/
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
HAL_Init();
/* USER CODE BEGIN Init */
/* USER CODE END Init */
/* Configure the System Power */
SystemPower_Config();
/* Configure the system clock */
SystemClock_Config();
/* USER CODE BEGIN SysInit */
/* USER CODE END SysInit */
/* Initialize all configured peripherals */
MX_GPIO_Init();
MX_RTC_Init();
MX_UART4_Init();
/* USER CODE BEGIN 2 */
GreenLEDOn();
HAL_Delay(5000);
GreenLEDOff();
/* USER CODE END 2 */
/* Infinite loop */
/* USER CODE BEGIN WHILE */
while (1)
{
if(!HAL_GPIO_ReadPin(V_Fu_Trig_GPIO_Port, V_Fu_Trig_Pin))//Fuse voltage fault
{
fault = true;
Enter_Stop2_Mode();
NVIC_SystemReset();
}
else
flashRedLED();
HAL_Delay(2000);
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
}
/* USER CODE END 3 */
}
static void Enter_Stop2_Mode(void)
{
HAL_SuspendTick();
HAL_PWREx_EnterSTOP2Mode(PWR_SLEEPENTRY_WFI);
}
