4.3. SafeRTOS

4.3.1. Introduction

SafeRTOS is a pre-emptive, pre-certified real time operating system that delivers unprecedented levels of determinism and robustness to embedded systems. Based on FreeRTOS functional model, but specifically re-designed for the safety market. SafeRTOS has been independently certified by TUV SUD to IEC 61508 SIL3 and ISO26262 ASIL D.

  • Developed by WITTENSTEIN high integrity systems (WHIS) ®.
  • Customers need to procure SafeRTOS from WHIS and get it licensed by WHIS. For more details, please contact WHIS.
  • Supports a wide variety of international development standatds.
  • Based on the FreeRTOS functional model.
  • Pre-certified to IEC 61508-3 SIL 3 by TUV SUD.
  • Pre-certified to ISO 26262 ASIL D by TUV SUD.
  • Includes Design Assurance Pack (DAP) with comprehensive safety analysis.

The main differences between FreeRTOS and SafeRTOS are:

  • Memory allocation is all static and dynamic allocation APIs of FreeRTOS are not supported.
  • SafeRTOS only supports core components of FreeRTOS like task, semaphore, timer, list, queue, mutex, event groups.
  • Additional parameter checking and return values in SafeRTOS.
  • Additional error hook callbacks in SafeRTOS.

PDK supports SafeRTOS on R5F, C66x, C7x CPUs for J721E. OSAL support and PDK Drivers running with SafeRTOS are available in this release. SafeRTOS is not supported on A72 core.

4.3.2. SafeRTOS packages tested with this SDK

ISA SafeRTOS Package Version
R5F 009-004-199-024-219-001
C66 009-002-201-005-219-002
C7X 009-004-230-005-219-001

Warning

Please note that there can be build failures or functional issues due to compatibility of other SafeRTOS Packages with this SDK version. Check with WHIS or TI for compatibility.

4.3.3. Features Supported

  • SafeRTOS Kernel v9

    • Tasks, semaphores, mutex, queues, timers, list, event groups.
    • Preemptive priority-based scheduler.
    • Static memory allocation Mode.
    • SafeRTOS debug awareness is supported in Lauterbach.
  • In order to keep the PDK drivers/examples OS agnostic, additionally below OSAL modules are implemented to call SafeRTOS APIs underneath:-

    • Clock, Task, Semaphore, Event, Mailbox, Mutex, Queue, Cache, HW Interrupts, HW Timers, Cycleprofiler, Heap.

4.3.4. Features Not Supported

  • CCS ROV is not supported for SafeRTOS.
  • OSAL Load module is not supported.

4.3.5. Integrating SafeRTOS with PDK

The following steps need to be taken for the integration of SafeRTOS with PDK:

  1. Download and install PROCESSOR-SDK-RTOS.
    • The installation directory will be referred as ${PSDK_RTOS}
  2. Unzip the SafeRTOS Packages for requried SOC and ISA from WHIS.
    • The installation directories for an SOC and an ISA will be referred as ${SAFERTOS_<SOC>_<ISA>}. NOTE: Make sure that the installation paths DO NOT have any spaces in them, else the builds in the following steps will fail.

Warning

  • The safeRTOS packages need to be procured from WITTENSTEIN high integrity systems (WHIS).
  1. Run the safertos_setup.sh script from the build directory <PSDK_RTOS>/pdk/packages/ti/build/ to enable SafeRTOS Builds in SDK. The safertos_setup.sh script takes as argument the path to the SafeRTOS packages provided by WHIS. The arguments are of the form –<SOC>_<ISA>_path.

    This script does the following:

    • Sets the env variables for safertos installation paths for various ISAs to be used in makefile builds, i.e., updates SAFERTOS_<SOC>_<ISA>_INSTALL_PATH in ${PSDK_RTOS}>/pdk_jacinto_xx_xx_xx_xx/packages/ti/build/safertos_version.mk. If the build fails during the script, please check the path provided to SafeRTOS Package. This should be the path to the directory which contains folders like “source_code_and_projects”, “Documentation”, etc.

      Note

      If the path provided to SafeRTOS Package unzip location is not correct, following builds will fail.

    • Builds safertos and osal_safertos lib for all cores. (SDK already has all other libs included)

    • Builds sciserver_testapp_safertos and checks in the .xer5f and .rprc to sciclient tools folder. This is required for SBL appimage generation of non-mcu1_0 apps and used by CCS No-Boot mode launch.js script to load to mcu1_0.

    For example:

./safertos_setup.sh --j721e_r5f_path=<path to j721e r5f package> --j721e_c7x_path=<path to j721e c7x package> --j721e_c66_path=<path to j721e c66 package>.

The above execution of the safertos_setup.sh enables safertos builds for r5f, c66 and c7x ISA for J721E.

4.3.6. SafeRTOS documentations available in WHIS Package

The following SafeRTOS documentations are provided by WHIS:

Document name Document location
Upgrading from FreeRTOS to SafeRTOS <SAFERTOS_INSTALL_DIR>/Documentation/Manuals/`Upgrading from FreeRTOS to SafeRTOS.pdf`
Using a generic SafeRTOS Demo <SAFERTOS_INSTALL_DIR>/Documentation/Manuals/`Using a Generic SafeRTOS Demo.pdf`
SafeRTOS v9 user manual <SAFERTOS_INSTALL_DIR>/`SAFERTOS v9 User Manual.pdf`

4.3.7. SafeRTOS Usage and Migration Guidelines

See SafeRTOS Usage and Migration Guidelines for SafeRTOS migration & comparison to FreeRTOS.