[STM32U585] FreeRTOS hard fault after wake up from STOP3 mode
Hello everyone.
I have an application that is based on FreeRTOS and works in power saving mode with STOP3 mode. I have configured each WakeUp pin and all the necessary arrangements for the entrance and exit from low power mode. However, so far I've experienced big troubles at Wake Up: the microcontroller detects a hard fault in the FreeRTOS utilities (debugging from __get_PSP() I've got the Program Counter and Link Register related to the uxQueueMessagesWaiting function, every single time the fault is detected).
I've tried everything: increasing the size of the stack to be allocated to the OS, being careful to be within the maximum size, re-initializing the system with SystemInit()... the microcontroller resets giving no more information than I shared. I attach the main features of the system in use:
- Interrupt Vector Table relocated at: (0x20000000UL)
- Boot loader at 0x08000000 which verifies program file integrity then jumps at it
- Main application at 0x08026000
The main application basically creates all of the tasks, do some stuff in order to initialize all the peripherals and data structures, then enters in STOP3 mode with these three simple HAL functions.
HAL_PWR_EnableWakeUpPin(PWR_WAKEUP_PIN2_HIGH_2);
HAL_NVIC_SetPriority(PWR_S3WU_IRQn, 0, 0);
HAL_NVIC_EnableIRQ(PWR_S3WU_IRQn);
/* Enter in STOP3 mode */
HAL_SuspendTick();
HAL_PWREx_EnterSTOP3Mode(PWR_STOPENTRY_WFI);
/* Exit from STOP3 Mode */
SystemClock_Config();
HAL_ResumeTick();
At last but not least:
- on STOP2 mode the issue never occurs
- on debug (no low power mode enabled) this issue never occurs.
Thanks in advance,
Paolo
