Overview of Azure RTOS ThreadX

Azure RTOS ThreadX is Microsoft's advanced industrial grade Real-Time Operating System (RTOS) designed specifically for deeply embedded, real-time, and IoT applications. Azure RTOS ThreadX provides advanced scheduling, communication, synchronization, timer, memory management, and interrupt management facilities. In addition, Azure RTOS ThreadX has many advanced features, including its picokernel™ architecture, preemption-threshold™ scheduling, event-chaining,™ execution profiling, performance metrics, and system event tracing. Combined with its superior ease-of-use, Azure RTOS ThreadX is the ideal choice for the most demanding of embedded applications. As of 2017, Azure RTOS ThreadX has over 6.2 billion deployments, in a wide variety of products, including consumer devices, medical electronics, and industrial control equipment.

API Protocols

Azure RTOS ThreadX API

  • Intuitive and consistent API
  • Noun-verb naming convention
  • All APIs have leading tx_ to easily identify as Azure RTOS ThreadX
  • Blocking APIs have optional thread timeout
  • Many APIs are directly available from application ISRs

Azure RTOS ThreadX Services

  • Dynamic thread creation
  • No limits on the number of threads
  • Main thread APIs include:
    • tx_thread_create
    • tx_thread_delete
    • tx_thread_preemption_change
    • tx_thread_priority_change
    • tx_thread_relinquish
    • tx_thread_reset
    • tx_thread_resume
    • tx_thread_sleep
    • tx_thread_suspend
    • tx_thread_terminate
    • tx_thread_wait_abort
  • Additional information and performance APIs

Message Queues

  • Dynamic queue creation
  • No limits on the number of queues
  • Messages copied by value (or by reference via pointer)
  • Message sizes from 1 to 16 32-bit words
  • Optional thread suspension on empty and full
  • Optional timeout on all suspension
  • Main message queue APIs include:
    • tx_queue_create
    • tx_queue_delete
    • tx_queue_flush
    • tx_queue_front_send
    • tx_queue_receive
    • tx_queue_send_notify
  • Additional information and performance APIs

Counting Semaphores

  • Dynamic semaphore creation
  • No limits on the number of semaphores
  • 32-bit counting semaphores (0 to 4,294,967,295)
  • Supports consumer-producer or resource protection
  • Optional thread suspension when semaphore unavailable
  • Optional timeout on all suspension
  • Main semaphore APIs include:
    • tx_semaphore_create
    • tx_semaphore_delete
    • tx_semaphore_get
    • tx_semaphore_put
    • tx_semaphore_put_notify
  • Additional information and performance APIs

Mutexes

  • Dynamic mutex creation
  • No limits on the number of mutexes
  • Nested resource protection supported
  • Optional priority inheritance supported
  • Optional thread suspension when mutex unavailable
  • Optional timeout on all suspension
  • Main mutex APIs include:
    • tx_mutex_create
    • tx_mutex_delete
    • tx_mutex_get
    • tx_mutex_put
  • Additional information and performance APIs

Event Flags

  • Dynamic event flag group creation
  • No limits on the number of event flag groups
  • Synchronization of one thread or multiple threads
  • Atomic get and clear supported
  • Optional multithread suspension on AND/OR set of events
  • Optional timeout on all suspension
  • Main event flag APIs include:
    • tx_event_flags_create
    • tx_event_flags_delete
    • tx_event_flags_get
    • tx_event_flags_set
    • tx_event_flags_set_notify
  • Additional information and performance APIs

Block Memory Pools

  • Dynamic block pool creation
  • No limits on the number of block pools
  • No limits on size of fixed-size blocks or size of pool
  • Fastest possible memory allocation/deal-location
  • Optional thread suspension on empty pool
  • Optional timeout on all suspension
  • Main block pool APIs include:
    • tx_block_pool_create
    • tx_block_pool_delete
    • tx_block_allocate
    • tx_block_release
  • Additional information and performance APIs

Byte Memory Pools

  • Dynamic byte pool creation
  • No limits on the number of byte pools
  • No limits on size of byte pool
  • Most flexible variable-length memory allocation/deallocation
  • Allocation size locality supported
  • Optional thread suspension on empty pool
  • Optional timeout on all suspension
  • Main byte pool APIs include:
    • tx_byte_pool_create
    • tx_byte_pool_delete
    • tx_byte_allocate
    • tx_byte_release
  • Additional information and performance APIs

Application Timers

  • Dynamic timer creation
  • No limits on the number of timers
  • Periodic or one-shot timers supported
  • Periodic timers may have different initial expiration value
  • No searching on timer activation or deactivation
  • All timers driven from one hardware timer interrupt
  • Main timer APIs include:
    • tx_timer_create
    • tx_timer_delete
    • tx_timer_activate
    • tx_timer_change
    • tx_timer_deactivate
  • Additional information and performance APIs

Azure RTOS ThreadX Core Scheduler

  • Minimal 2KB FLASH,1KB RAM footprint
  • Fast, sub-microsecond context-switch
  • Fully deterministic regardless of number of threads
  • Priority-based, fully preemptive-scheduling
  • 32 default priority levels, optionally up to 1024 levels
  • Cooperative scheduling within priority level (FIFO)
  • Preemption-threshold technology
  • Optional timer services, including:
    • Per-thread optional time-slice
    • Optional timeout on all blocking
    • APIs Requires on hardware timer interrupt
  • Execution profiling
  • System-level Trace
  • Safety certified to many standards

Most deployed RTOS

Azure RTOS ThreadX has over 6.2 billion deployments worldwide, according to the leading M2M market intelligence firm, VDC Research. The popularity of Azure RTOS ThreadX is a testament to its reliability, quality, size, performance, advanced features, ease-of-use, and overall time-to-market advantages.

“We have followed the growth trajectory of THREADX in the wireless and IoT markets since the company’s founding, and are increasingly impressed by the widespread industry adoption of THREADX.” – Chris Rommel, Executive Vice President, VDC Research

Small footprint

Azure RTOS ThreadX requires a remarkably small 2KB instruction area and 1KB of RAM for its minimal footprint. This is largely due to its non-layered picokernel™ architecture and automatic scaling. Automatic scaling means that only the services (and supporting infrastructure) used by the application are included in the final image at link time.

Here are some typical Azure RTOS ThreadX size characteristics:

Azure RTOS ThreadX Service Typical Size in Bytes
Core Services (Require) 2,000
Queue Services 900
Event Flag Services 900
Semaphore Services 450
Mutex Services 1,200
Block Memory Services 550
Byte Memory Services 900

Fast execution

Azure RTOS ThreadX achieves a sub-microsecond context switch on most popular processors and is significantly faster overall than other commercial RTOSes. In addition to being fast, Azure RTOS ThreadX is also highly deterministic. It achieves the same fast performance whether there are 200 threads ready, or just one.

Here are some typical performance characteristics of Azure RTOS ThreadX:

  • Fast Boot: Azure RTOS ThreadX boots in less than 120 cycles.

  • Optional Removal of basic error checking: Basic Azure RTOS ThreadX error checking can be skipped at compile time. This can be useful when the application code is verified and no longer requires error checking on each parameter. Note that this can be done on a compilation unit, rather than system-wide.

  • Picokernel™ Design: Services are not layered on each other, thus eliminating unnecessary function call overhead.

  • *Optimized Interrupt Processing: Only scratch registers are saved/restored upon ISR entry/exit, unless preemption is necessary.

  • Optimized API Processing:

    Azure RTOS ThreadX Service Service Time in Microseconds*
    Thread Suspend 0.6
    Thread Resume 0.6
    Queue Send 0.3
    Queue Receive 0.3
    Get Semaphore 0.2
    Put Semaphore 0.2
    Context Switch 0.4
    Interrupt Response 0.0 – 0.6

    *Performance figures based on typical processor running at 200MHz.

Pre-certified by TUV and UL to many safety standards

Azure RTOS ThreadX and Azure RTOS ThreadX SMP have been certified by SGS-TUV Saar for use in safety-critical systems, according to IEC-61508 SIL 4, IEC-62304 SW Safety Class C, ISO 26262 ASIL D and EN 50128. The certification confirms that Azure RTOS ThreadX and Azure RTOS ThreadX SMP can be used in the development of safety-related software for the highest safety integrity levels of IEC-61508, IEC-62304, ISO 26262 and EN 50128 for the “Functional Safety of electrical, electronic, and programmable electronic safety-related systems.” SGS-TUV Saar, formed through a joint venture of Germany’s SGS-Group and TUV Saarland, has become the leading accredited, independent company for testing, auditing, verifying and certifying embedded software for safety-related systems worldwide. The industrial safety standard IEC 61508, and all standards that are derived from it, including IEC-62304, ISO 26262 and EN 50128, are used to ensure the functional safety of electrical, electronic, and programmable electronic safety-related medical devices, process control systems, industrial machinery, automobiles and railway control systems.

SGS TUV SAAR certification

Azure RTOS ThreadX and Azure RTOS ThreadX SMP have been recognized by UL for compliance with UL 60730-1 Annex H, CSA E60730-1 Annex H, IEC 60730-1 Annex H, UL 60335-1 Annex R, IEC 60335-1 Annex R, and UL 1998 safety standards for software in programmable components. UL is a global, independent, safety-science company with more than a century of expertise innovating safety solutions, ranging from the public adoption of electricity to breakthroughs in sustainability, renewable energy, and nanotechnology.

UL certification

Artifacts (Certificate, Safety Manual, Test Report, etc.) associated with the TUV and UL certifications are available for sale.

EAL4+ Common Criteria security certification

Azure RTOS has achieved EAL4+ Common Criteria security certification. The Target of Evalution (TOE) covers Azure RTOS ThreadX, Azure RTOS NetX-Duo, Azure RTOS NetX Secure TLS, and Azure RTOS NetX MQTT. This represents the most typical IoT protocols required by deeply embedded sensors, devices, edge routers, and gateways.

EAL certification

The IT Security Evaluation Facility used for the Azure RTOS security certification is Brightsight BV and the Certification Authority is SERTIT.

Simple, easy to use

Azure RTOS ThreadX is very simple to use. The Azure RTOS ThreadX API is both intuitive and highly functional. The API names are made of real words and not the alphabet soup of highly abbreviated names that are so common in other RTOS products. All Azure RTOS ThreadX APIs have a leading tx_ and follow a noun-verb naming convention. Furthermore, there is a functional consistency throughout the API. For example, all APIs that suspend have an optional timeout that functions in an identical manner for APIs.

Building an Azure RTOS ThreadX application is easy. The application needs to include tx_api.h, call tx_kernel_enter from main, define the tx_application_define function and create one thread, define the thread entry point function, and link against the Azure RTOS ThreadX library (typically tx.a).

Azure RTOS ThreadX also boasts the highest caliber of documentation available.

Advanced technology

Azure RTOS ThreadX is advanced technology whose most notable feature is preemption-threshold scheduling. This feature is unique to Azure RTOS ThreadX and has been the subject of extensive academic research. For example, see Scheduling Fixed-Priority Tasks with Preemption Threshold, by Yun Wang, Concordia University, and Manas Saksena, University of Pittsburgh.

Consider the capabilities of Azure RTOS ThreadX:

  • Complete and Comprehensive Multitasking Facilities
    • Threads, application timers, message queues, counting semaphores, mutexes, event flags, block and byte memory pools
  • Priority-Based Preemptive Scheduling
  • Priority Flexibility – Up to 1024 Priority Levels
  • Cooperative Scheduling
  • Preemption-Threshold™ – Unique to Azure RTOS ThreadX, helps reduce context switches and help guarantee schedulability (per academic research)
  • Memory Protection via Azure RTOS ThreadX MODULES
  • Fully Deterministic
  • Event Trace – Capture last n system/application events
  • Event Chaining™ – Register an application-specific “notify” callback function for each Azure RTOS ThreadX communication or synchronization object
  • Azure RTOS ThreadX MODULES with Optional Memory Protection
  • Run-Time Performance Metrics
    • Number of thread resumptions
    • Number of thread suspensions
    • Number of solicited thread preemptions
    • Number of asynchronous thread interrupt preemptions
    • Number of thread priority inversions
    • Number of thread relinquishes
  • Execution Profile Kit (EPK)
  • Separate Interrupt Stack
  • Run-Time Stack Analysis
  • Optimized Timer Interrupt Processing

Multicore support (AMP & SMP)

Standard Azure RTOS ThreadX is often used in an Asymmetric Multiprocessing (AMP) fashion, where a separate copy of Azure RTOS ThreadX and the application (or Linux) execute on each core and communicate with each other via shared memory or an inter-processor communication mechanism such as OpenAMP (Azure RTOS ThreadX supports OpenAMP). This is the most typical multicore configuration using Azure RTOS ThreadX and can be the most efficient if the application is able to effectively load the processors.

For environments where loading the processors is highly dynamic, Azure RTOS ThreadX Symetric Multiprocessing (SMP) is available for the following processor families:

  • ARM Cortex-Ax
  • ARM Cortex-Rx
  • ARM Cortex-A5x 64-bit
  • MIPS 34K, 1004K, and interAptiv
  • PowerPC
  • Synopsys ARC HS
  • x86

Azure RTOS ThreadX SMP performs dynamic load balancing across n processors and allows all Azure RTOS ThreadX resources (queues, semaphores, event flags, memory pools, etc.) to be accessed by any thread on any core. Azure RTOS ThreadX SMP enables the complete Azure RTOS ThreadX API on all cores and introduces the following new API’s applicable to SMP operation:

  • UINT tx_thread_smp_core_exclude(TX_THREAD *thread_ptr, ULONG exclusion_map);
  • UINT tx_thread_smp_core_exclude_get(TX_THREAD *thread_ptr, ULONG *exclusion_map_ptr);
  • UINT tx_thread_smp_core_get(void);
  • UINT tx_timer_smp_core_exclude(TX_TIMER *timer_ptr, ULONG exclusion_map);
  • UINT tx_timer_smp_core_exclude_get(TX_TIMER *timer_ptr, ULONG *exclusion_map_ptr);

Memory protection via Azure RTOS ThreadX Modules

An add-on product called Azure RTOS ThreadX MODULES enables one or more application threads to be bundled into a “Module” that can be dynamically loaded and run (or executed in place) on the target.

Modules enable field upgrade, bug fixing, and program partitioning to allow large applications to occupy only the memory needed by active threads.

Modules also have a completely separate address space from Azure RTOS ThreadX itself. This enables Azure RTOS ThreadX to place memory protection (via MPU or MMU) around the Module such that accidental access outside the module will not be able to corrupt any other software component.

Fastest time-to-market

Azure RTOS ThreadX is easy to install, learn, use, debug, verify, certify and maintain. As a result, Azure RTOS ThreadX has been the leading time-to-market RTOS for the last seven consecutive years, per the Embedded Market Forecasters (EMF) surveys. The surveys consistently show that 70% of designs using Azure RTOS ThreadX get to market on time – surpassing all other RTOSes.

The following are reasons for our consistent time-to-market advantage:

  • Quality Documentation
  • Complete Source Code Availability
  • Easy-to-Use API
  • Comprehensive and Advanced Feature Set
  • Broad 3rd Party Tools Integration – Especially IAR’s Embedded Workbench™

Royalty free

There is no cost to use and test the source code and no cost for production licenses when deployed to pre-licensed devices, all other devices need a simple annual license.

Full, highest-quality source code

From the very beginning, Azure RTOS ThreadX was designed to be an Industrial Grade RTOS, distributed with full C source code. Azure RTOS ThreadX source code has set the bar in quality and ease of understanding. In addition, the convention of having one function per file provides for easy source navigation.

Azure RTOS ThreadX conforms to strict coding conventions, including the requirement that every line of C code has a meaningful comment. In addition, the Azure RTOS ThreadX source has been certified to the highest standards.

MISRA compliant

Azure RTOS ThreadX and Azure RTOS ThreadX SMP souce code is MISRA-C:2004 and MISRA C:2012 compliant. MISRA C is a set of programming guidelines for critical systems using the C programming language. The original MISRA C guidelines were primarily targeted toward automotive applications; however, MISRA C is now widely recognized as being applicable to any safety-critical application. Azure RTOS ThreadX is compliant with all required and mandatory rules of MISRA-C:2004 and MISRA C:2012.

Misra certification

Azure RTOS ThreadX runs on most popular 32/64-bit microprocessors, out-of-the-box, fully tested and fully supported, including the following:

  • Analog Devices: SHARC, Blackfin, CM4xx
  • Andes Core: RISC-V
  • Ambiqmicro: Apollo MCUs
  • ARM: ARM7, ARM9, ARM11, Cortex-M0/M3/M4/M7/A15/A5/A7/A8/A9/A5x 64-bi/A7x 64-bit/R4/R5, TrustZone ARMv8-M
  • Cadence: Xtensa, Diamond
  • CEVA: PSoC, PSoC 4, PSoC 5, PSoC 6, FM0+, FM3, MF4, WICED WiFi
  • Cypress: RISC-V
  • EnSilica: eSi-RISC
  • Infineon: XMC1000, XMC4000, TriCore
  • Intel & Intel FPGA: x36/Pentium, XScale, NIOS II, Cyclone, Arria 10
  • Microchip: AVR32, ARM7, ARM9, Cortex-M3/M4/M7, SAM3/4/7/9/A/C/D/E/G/L/SV, PIC24/PIC32
  • Microsemi: RISC-V
  • NXP: LPC, ARM7, ARM9, PowerPC, 68K, i.MX, ColdFire, Kinetis Cortex-M3/M4
  • Renesas: SH, HS, V850, RX, RZ, Synergy
  • Silicon Labs: EFM32
  • Synopsys: ARC 600, 700, ARC EM, ARC HS
  • ST: STM32, ARM7, ARM9, Cortex-M3/M4/M7
  • Tl: C5xxx, C6xxx, Stellaris, Sitara, Tiva-C
  • Wave Computing: MIPS32 4K, 24K, 34K, 1004K, MIPS64 5K, microAptiv, interAptiv, proAptiv, M-Class
  • Xilinx: MicroBlaze, PowerPC 405, ZYNQ, ZYNQ UltraSCALE

Azure RTOS ThreadX supports most popular embedded development tools, including IAR’s Embedded Workbench™, which also has the most comprehensive Azure RTOS ThreadX kernel awareness available. Additional tool integration includes GNU (GCC), ARM DS-5/uVision®, Green Hills MULTI®, Wind River Workbench™, Imagination Codescape, Renesas e2studio, Metaware SeeCode™, NXP CodeWarrior, Lauterbach TRACE32®, TI Code-Composer Studio, CrossCore and all analog devices.