Compatibility for OSEK

The OSEK Compatibility Kit for ThreadX is designed for customers needing seamless OSEK support. The OSEK Compatibility Kit for ThreadX is BCC1, BCC2, ECC1, and ECC2 compliant and leverages the inherent size and speed characteristics of ThreadX to provide an extremely robust OSEK solution.

Compatibility Kit Source

The Compatibility Kit source code is designed for simplicity and is comprised of only two files, namely tx_osek.h and tx_osek.c. The tx_osek.h file defines all the necessary OSEK constants and subroutine prototypes, while tx_osek.c contains the actual OSEK compatibility source. These Compatibility Kit source files are common to all THREADX support packages.

Compatibility Kit Documentation

The Compatibility Kit User Guide provides an overview of the porting process, including various caveats and pitfalls to watch out for. In addition, each covered OSEK subroutine is documented, including information about supported/unsupported options, limitations, deviations, and suggestions on how to work around any limitations.

Compatibility Kit Services

The current release of the Compatibility Kit includes support of the following calls:

Task related subroutines:

CreateTask, ActivateTask, GetTaskID, TerminateTask, DeleteTask, ChainTask, GetTaskState

Resource related subroutines:

CreateResource, GetResource, ReleaseResource, DeleteResource

Event related subroutines:

SetEvents, ClearEvent, GetEvent, WaitEvent

Interrupt related subroutines:

EnableInterrupt, DisableInterrupt, GetInterruptDescriptor

Counter related subroutines:

InitCounter, GetCounterValue, CreateCounter, DeleteCounter

Alarm related subroutines:

CreateAlarm, GetAlarmBase, SetAbsAlarm, SetRelAlarm, CancelAlarm, GetAlarm, DeleteAlarm

Compatibility Kit Error Handling

There is one “error handling” function defined in tx_osek.c and used throughout the Compatibility Kit, as follows:


In general this routine is called when a basic usage error occurs. This may be used as a place to catch errors that are not detected if the application source is not checking the return status. The default processing for this routine is a simple spin loop.

Demonstration System

The file osek_demo.c contains a demonstration system that utilizes OSEK services. This Demo application will demonstrate some of the basic OS objects of OSEK such as: Tasks, Events, and Resources. This demo application should be used as an example of how to integrate the Compatibility Kit into your application.


THREADX is a registered trademark of Express Logic. OSEK Compatibility Kit is a trademark of Express Logic.

Subscribe to our news