4.2. FreeRTOS

4.2.1. Notes

This is the alpha release with FreeRTOS Support on R5F cores in J721E .

  • Only limited testing is done to verify basic OS functionality.
  • The intent is to enable evaluation of FreeRTOS and start planning for migration.
  • All drivers in PDK continue to use TI-RTOS itself.
  • OSAL Library support for FreeRTOS is not available in this release. This will be available in the next release.
  • Drivers/Examples in PDK are not ported and validated with FreeRTOS. This will be available in the next release.

4.2.2. Introduction

FreeRTOS is a market-leading real-time operating system (RTOS) for microcontrollers and small microprocessors. Distributed freely under the MIT open source license, FreeRTOS includes a kernel and a growing set of libraries suitable for use across all industry sectors. FreeRTOS is built with an emphasis on reliability and ease of use.

PDK supports FreeRTOS on R5F CPUs for J721E. Only CPU Port is available in this release.

4.2.3. Features Supported

  • FreeRTOS Kernel 10.4.3

    • Tasks, semaphores, mutex, queues, timers, list, heap
    • preemptive priority-based scheduler
    • static and/or dynamic memory allocation Mode

4.2.4. Features Not Supported

  • Co-routines, event groups, stream buffer are not enabled.
  • Tickless IDLE mode
  • Task level memory protection wrapper
  • On R5F, nested interrupts are not supported.
  • On R5F, the ISR handler does not save the FPU context, hence floating-point operations can’t be used within ISRs.

4.2.5. Important files and directory structure

FreeRTOS source is distributed along with PDK and given below are some important files and folders related to FreeRTOS.

${PDK_INSTALL_PATH}/packages/ti/kernel
│
├────────────────────────────────── freertos
│                                    ├────── FreeRTOS-LTS   <= FreeRTOS Kernel source code. PDK simply clones the code from
│                                    │                         FreeRTOS Github and does not modify anything in this folder
│                                    │
│                                    ├────── config         <= FreeRTOS configuration header files for different SOCs and CPUs
│                                    │
│                                    └────── portable       <= FreeRTOS porting related files for supported cores
│
└────────────────────────────────── test
                                     └────── freertos       <= FreeRTOS Examples and Unit Test

4.2.6. FreeRTOS Examples

Example Application Name Description Cores Supported
FreeRTOS Task Switch freertos_test_task_switch The FreeRTOS Task Switch Example test performs the following: 1. switch between ping and pong tasks using semaphores 2. switch between ping and pong tasks using direct-to-task notifications 3. switch from ping task to ISR to pong task and back to ping task using semaphores, here there is a task switch mcu1_0, mcu1_1, mcu2_0, mcu2_1, mcu3_0, mcu3_1
FreeRTOS Unit Test freertos_test_ut The FreeRTOS Unit Test performs the following: 1. switch between ping and pong tasks using semaphores 2. switch between ping and pong tasks using direct-to-task notifications 3. just invoke the task switch logic (Task Yield) without any semaphores or direct-to-task notifications 4. switch from ping to ISR and back to the same task using semaphores, here there is no task switch 5. switch from ping to ISR and back to the same task using direct-to-task notify, here there is no task switch 6. switch from ping task to ISR to pong task and back to ping task using semaphores, here there is a task switch 7. switch from ping task to ISR to pong task and back to ping task using direct-to-task notify, here there is a task switch 8. switch between ping and pong tasks and do float operations in between 9. Test TaskDelay mcu1_0, mcu1_1, mcu2_0, mcu2_1, mcu3_0, mcu3_1

4.2.7. FreeRTOS Guidelines

See FreeRTOS Usage Guidelines for FreeRTOS usage guidelines and comparison to SysBIOS.

4.2.8. Additional references

Document Description Weblink
Easy to read FreeRTOS book https://www.freertos.org/Documentation/RTOS_book.html
FreeRTOS user docs https://www.freertos.org/features.html
User API reference https://www.freertos.org/a00106.html
FreeRTOS core kernel source code https://github.com/FreeRTOS/FreeRTOS-Kernel
FreeRTOS core kernel example source code https://github.com/FreeRTOS/FreeRTOS/tree/master/FreeRTOS
Additional FreeRTOS.org maintained libraries (POSIX, TCP, Filesystem, …) https://www.freertos.org/FreeRTOS-Labs/index.html
https://www.freertos.org/FreeRTOS-Plus/index.html
https://github.com/FreeRTOS