2022-11-28 03:42 AM
Hello,
I'm dealing with a problem in a STM32WB55, but the doubt is general about STM32 and FreeRTOS.
Among the different tasks initialised in my program, I have a task running that puts the MCU in STOP2 mode. In parallel there is an RTC Alarm programmed every 30 seconds, with a higher priority than the FreeRTOS one. When the MCU is in stop mode (inside the task mentioned before) and the RTC Alarm Handler jumps, sometimes I get a Hard Fault.
The question is, could it be a problem related to the task stack memory? I've read about it, and when there is a system interruption (independent of the FreeRTOS), the RAM utilisation is taken from the memory reserved to the main initialisation, is it true? Should I increase the stack size of any task?
Thank you in advance.
2022-11-28 04:17 AM
Is there code up at 0x084xxxxx addresses?
Look at what's actually faulting, the code and the registers. Check callbacks and pointers.
2022-11-28 04:34 AM
The code ends at address 0x08079000, so there shouldn't be code at this address, why do you ask it?
As for the callback, it works most of the times when leaving the stop2 mode, and it never fails at the same time after power-on the device, it can be hours without failing. That's why I suspect about the stack overflow.
2022-11-28 05:29 PM
Read this article about stack memory and interrupts: