Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem


Resuming scheduler after restart

Posted by evgeny-erlihman on December 6, 2017

I am working with stm32h7 MCU, one of its features is BAM (batch acquisition mode). In this mode the MCU goes into a low power mode to gather data. To wake up from this mode, the MCU resets, but the clock configuration is not changed as well as the memory content. So theoretically, if there was a way to make the system continue runing from the same place it left of, which is PreSleepProcessing, the system state can be retained. Is there a way to resume the FreRTOS scheduler instead of restarting it? Because all tasks and current state is still in the memory. And we know when we are about to reset, so we can save memory, regs etc before......

Resuming scheduler after restart

Posted by rtel on December 6, 2017

Sorry I don't fully understand your question. If everything is still in memory what is being reset? Is it just the program counter that gets set back to the reset vector? If so you could potentially use the pre-sleep configPRESLEEPPROCESSING() (https://www.freertos.org/low-power-ARM-cortex-rtos.html) macro to save the state of the program counter too then have the reset code check to see why the CPU was reset and take appropriate action on wake - but this is not really something FreeRTOS can do for you.

Resuming scheduler after restart

Posted by evgeny-erlihman on December 7, 2017

Sure, i figured out that i would have to save the call stack and PC before i put the system in low power mode, inside configPRESLEEPPROCESSING, and restore it once i land in main() after reset. Was hoping that there is already an infrastructure inplace for this functionlality. Would try it out later, if ST hasn't provided its costumers with the port by then.......

[ Back to the top ]    [ About FreeRTOS ]    [ Privacy ]    [ Sitemap ]    [ ]

Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

Meet Richard Barry and learn about running FreeRTOS on RISC-V at FOSDEM 2019

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


FreeRTOS and other embedded software careers at AWS.

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers


STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS

Xilinx Microblaze and Zynq partner