Tx_CMSIS_Wrapper Application Description

This application provides an example of CMSIS RTOS adaptation layer for Azure RTOS ThreadX, it shows how to develop an application using the CMSIS RTOS 2 APIs. It demonstrates how to create multiple threads using CMSIS RTOS 2 for ThreadX APIs. At the main function, the application creates 2 threads with the same priority which execute in a periodic cycle of 7 seconds :

The function “Led_Toggle()” is the entry function for both threads to toggle the leds.Therefore it is considered as a “critical section” that needs protection with a ‘SyncObject’ flag in the file “app_tx_cmsisrtos.h” Each thread is running in an infinite loop as following:

By default the ‘SyncObject’ is defined as “osMutexId_t” .It is possible to use a semaphore “osSemaphoreId_t” by tuning the compile flags in the file “app_tx_cmsisrtos.h”.

Expected success behavior

Error behaviors

On failure, an error message is printed to the serial port.

Assumptions if any

None

Known limitations

None

Notes

To optimize the application footprint, the following ThreadX configuration options should be enabled in the tx_user.h file:

#define TX_DISABLE_PREEMPTION_THRESHOLD

#define TX_DISABLE_NOTIFY_CALLBACKS

#define TX_DISABLE_REDUNDANT_CLEARING

#define TX_DISABLE_STACK_FILLING

#define TX_NOT_INTERRUPTABLE

#define TX_TIMER_PROCESS_IN_ISR

ThreadX usage hints

Keywords

RTOS, ThreadX, Threading, CMSIS RTOS, Semaphore, Mutex

Hardware and Software environment

How to use it ?

In order to make the program work, you must do the following :