Quality RTOS & Embedded Software

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




Loading

Setting up context for the scheduler

Posted by Joseph Dupre on July 8, 2010
I use timers and interrupts prior to calling vTaskStartScheduler() as part of a startup routine. Aside from calling portDISABLE_INTERRUPTS(), is there any other cleanup required to define the proper context before starting the scheduler???

RE: Setting up context for the scheduler

Posted by Dave on July 14, 2010
I'm not sure exactly what the question is, but as long as you don't try doing a context switch before the scheduler has started you should be ok. Normally interrupts will get disabled by calling an API function if the scheduler is not started in any case.

RE: Setting up context for the scheduler

Posted by Joseph Dupre on July 14, 2010
I'm just asking what the required state be when starting the scheduler for the first time. As far as I know (for an ARM), it's just:
1) interrupts disabled.
2) in supervisor mode.

RE: Setting up context for the scheduler

Posted by Dave on July 14, 2010
“1) interrupts disabled.
2) in supervisor mode.”


That is correct. FreeRTOS will disable interrupts temporarily while the scheduler is being started in any case. Interrupts will be enabled when the first task actually starts executing (by default in any case).


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




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

Latest News

FreeRTOS kernel V10 is available for immediate download. Now MIT licensed.


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

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