
The FreeRTOS™
Reference Manual
This reference manual is for FreeRTOS V9.0.0. Check http://www.FreeRTOS.org regularly for
updates, FreeRTOS tutorial books, and additional online documentation.
This text is being provided for free. In return we ask that you use the business contact email
link on http://www.FreeRTOS.org/contact to provide feedback, comments and corrections.
Thank you.


The FreeRTOS™
Reference Manual
API Functions and Configuration Options
Real Time Engineers ltd.

Reference Manual for FreeRTOS version 9.0.0 issue 2.
All text, source code and diagrams are the exclusive property of Real Time Engineers Ltd.
Distribution, use in presentations, or publication in any form is strictly prohibited without prior
written authority from Real Time Engineers Ltd.
© Real Time Engineers Ltd. 2016. All rights reserved.
FreeRTOS™, FreeRTOS.org™ and the FreeRTOS logo are trademarks of Real Time
Engineers Ltd.
http://www.FreeRTOS.org
http://www.FreeRTOS.org/plus
http://www.FreeRTOS.org/labs

v
Contents
Contents ................................................................................................................................... 5
List of Figures ........................................................................................................................... 8
List of Code Listings ................................................................................................................. 9
List of Tables .......................................................................................................................... 15
List of Notation ........................................................................................................................ 15
Chapter 1 About This Manual ............................................................................................... 16
1.1 Scope........................................................................................................................ 17
Chapter 2 Task and Scheduler API ...................................................................................... 20
2.1 portSWITCH_TO_USER_MODE() ............................................................................ 21
2.2 vTaskAllocateMPURegions() .................................................................................... 22
2.3 xTaskAbortDelay() .................................................................................................... 25
2.4 xTaskCallApplicationTaskHook() ............................................................................... 27
2.5 xTaskCheckForTimeOut() ......................................................................................... 30
2.6 xTaskCreate() ........................................................................................................... 32
2.7 xTaskCreateStatic() .................................................................................................. 37
2.8 xTaskCreateRestricted() ........................................................................................... 41
2.9 vTaskDelay() ............................................................................................................. 46
2.10 vTaskDelayUntil() ...................................................................................................... 48
2.11 vTaskDelete() ............................................................................................................ 51
2.12 taskDISABLE_INTERRUPTS() ................................................................................. 53
2.13 taskENABLE_INTERRUPTS() .................................................................................. 55
2.14 taskENTER_CRITICAL() ........................................................................................... 56
2.15 taskENTER_CRITICAL_FROM_ISR() ....................................................................... 59
2.16 taskEXIT_CRITICAL() ............................................................................................... 61
2.1 taskEXIT_CRITICAL_FROM_ISR() ........................................................................... 63
2.2 xTaskGetApplicationTaskTag() ................................................................................. 65
2.3 xTaskGetCurrentTaskHandle().................................................................................. 67
2.4 xTaskGetIdleTaskHandle() ........................................................................................ 68
2.1 xTaskGetHandle() ..................................................................................................... 69
2.2 uxTaskGetNumberOfTasks() .................................................................................... 71
2.3 vTaskGetRunTimeStats() .......................................................................................... 72
2.4 xTaskGetSchedulerState() ........................................................................................ 76
2.5 uxTaskGetStackHighWaterMark() ............................................................................. 77
2.6 eTaskGetState() ........................................................................................................ 79
2.7 uxTaskGetSystemState() .......................................................................................... 81
2.8 vTaskGetTaskInfo() ................................................................................................... 85
2.9 pvTaskGetThreadLocalStoragePointer() ................................................................... 87