Quality RTOS & Embedded Software

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


Calling vTaskStartScheduler and vTaskEndScheduler

Posted by csanikita92 on June 13, 2018


Is it possible to have something like:

int main() { vTaskStartScheduler(); . . // some task calls vTaskEndScheduler();

  // some task calls  vTaskEndScheduler();


in an application?

That is, after an application calls vTaskStartScheduler and then a task calls vTaskEndScheduler, can the application call vTaskStartScheduler again?

We are performing a static data race detection and data flow analysis on FreeRTOSv10.0.0 which assumes that such a situation will never arise. Is our assumption correct or not?

Thanks, Nikita

Calling vTaskStartScheduler and vTaskEndScheduler

Posted by rtel on June 13, 2018

Very few ports implement vTaskEndScheduler(), perhaps only the Windows and DOS ports. I think in the Windows case ending the scheduler terminates the process, so code after vTaskStartScheduler() will never run. I can't recall what happens in the DOS case as the port is about 15 years old but I think FreeRTOS replaces DOS in memory and then uses a setjmp/lngjmp pair to exit the scheduler - not sure where it goes from there though.

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

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

Latest News

FreeRTOS v10.2.1 is available for immediate download. MIT licensed, includes 64-bit RISC-V, NXP Cortex-M33 demo & Nuvoton Cortex-M23 demo.

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

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

Cadence Tensilica Cortes

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