I am working on stm32 with freeRTOS, I created four tasks and they are properly manage but the last task which is “SleepMode” after executing it, the device reset itself why? i know the issue is not in task but once all task execute themselves then the device reset itself which is not good for my appliction, please suggest the solution?
Is that “SleepMode” task putting the processor into a deep sleep? Some of the deepest sleep modes do a reset to wake up, so aren’t really usable in a real time application unless it IS prepared to need a reset.
osEventFlagsWait(sleepModeEventHandle,
SLEEP_CONNECT_AND_SEND_EVENT_FLAG,
osFlagsWaitAny,
osWaitForever);
IterationCount++;
power_pre_sleep_processing();
DeInitEverything(IterationCount<ITERATION_DEBUG_COUNT);
HAL_SuspendTick();
HAL_PWREx_EnterSTOP2Mode(PWR_STOPENTRY_WFI);
HAL_ResumeTick();
power_post_sleep_processing();
InitEverything();
HAL_WWDG_Refresh(&hwwdg);
// Notify configuration and adxl tasks to unblock them for the next iteration
xTaskNotifyGive(configurationAndAdxlHandle);
taskYIELD();
this is the code where it goes to reset. yes, you are right i figure out that it is due to when it goes out from sleep mode. so how can i resolve it?
Hello,
I think the SleepMode task exits properly without triggering critical errors or stack overflows. Stack sizes and memory allocations across all tasks to prevent resource exhaustion.
I posted this query, and I received wonderful responses. I appreciate your help.
I figured out the reason: if all of the tasks enter to a block state, and there is not other task in process that’s why the device reset itself.