AM62x MCU+ SDK  09.02.00
FreeRTOS Task Switch Example

Introduction

This example shows usage of direct FreeRTOS APIs, i.e not via the DPL APIs. It shows usage of task APIs, task notification APIs, semaphore and delay APIs. It also shows how to signal to FreeRTOS task from ISRs.

The example does the below

  • Creates two semaphores
  • Creates two tasks, ping and pong
  • Ping and pong tasks signal each other using semaphores and task notifications
  • A HW ISR is also created and ping task is signaled from the ISR
  • Task delay API usage is shown

Supported Combinations

Parameter Value
CPU + OS m4fss0-0 nortos
Toolchain ti-arm-clang
Boards am62x-sk, am62x-sk-lp, am62x-sip-sk
Example folder examples/kernel/freertos/task_switch

Steps to Run the Example

See Also

FreeRTOS

Sample Output

Shown below is a sample output when the application is run,

[FreeRTOS] ping task ... start !!!
execution time for task switches = 1526081 us
number of task switches = 2000000
time per task switch (semaphore give/take) = 763 ns
execution time for task switches = 1117010 us
number of task switches = 2000000
time per task switch (direct-to-task notification give/take) = 558 ns
execution time for task - ISR - task - task switches = 2140666 us
number of ISRs = 2000000
time per task - ISR - task switch (semaphore give/take) = 1070 ns
[FreeRTOS] ping task ... done !!!
All tests have passed!!