ThreadX
What is ThreadX?
ThreadX is a real-time operating system designed for embedded devices, managed by the Eclipse Foundation. In addition to the typical RTOS facilities such as threads, message queues, mutexes and semaphores, it also integrates several middleware layers to assist with complex application development.
The core components of ThreadX have safety certification making them suitable for use in SIL 4, ASIL D or Medical Class C products.
While ThreadX has only recently transitioned to being managed by the Eclipse foundation, it has a long history going back to its first release in 1997, and at the time of the transition had been deployed on over 12 billion devices around the world.
The core components of ThreadX have safety certification making them suitable for use in SIL 4, ASIL D or Medical Class C products.
While ThreadX has only recently transitioned to being managed by the Eclipse foundation, it has a long history going back to its first release in 1997, and at the time of the transition had been deployed on over 12 billion devices around the world.
The 3 main challenges of ThreadX
Resource management
ThreadX is designed for resource-constrained embedded devices with limited memory for both code and data, and limited CPU performance. As such, the application needs to be designed carefully to provide the desired features within the constraints of the device.
Real-time Behaviour
Designing an application using multiple threads and RTOS synchronisation primitives helps to keep the design modular. But compared to bare-metal development, this requires careful consideration of thread-safety and the real-time behaviour of the system.
Hardware integration
ThreadX is typically distributed with the tools provided by your MCU silicon vendor. This generally includes a port of ThreadX to the architecture and CPU in use, along with some peripheral driver support for the middleware components
Key features of ThreadX
Efficient kernel
The minimal footprint of ThreadX can be as small as ~2KB of code space, and ~1KB of RAM. A context switch can be performed in under 1 microsecond on a typical processor.
Safety & reliability
The ThreadX core source code is MISRA-C compliant, and ThreadX is IEC 61508, IEC 62304, ISO 26262, and EN 50128 conformance certified by SGS-TÜV Saar.
Add-ons
ThreadX includes several middleware components, providing useful features to develop your application: NetXDuo, FileX, USBX, GUIX…
Holger Schroth
Chief Product Officer
“Witekio delivered or even overdelivered on everything we expected. It makes us happy and confident to have such a skilled and solution focused partner on our side.”
ThreadX vs alternatives pros and cons
The two main contenders to ThreadX are FreeRTOS and Zephyr.
ThreadX lies somewhere in the middle of the scale, where:
FreeRTOS: the RTOS itself is straightforward and easy to port the basics to a new device – the core of the kernel is contained in only three C source files. There are extra features available such as a TCP/IP stack and various IoT protocols, but it is perhaps less feature-rich and well integrated than the alternatives.
ThreadX: contains better integrated middleware with more features than FreeRTOS, such as the USB and graphics stacks. But this means that it is more complex, and porting to a new device is challenging if there is not a port already provided by your silicon vendor
Zephyr: This is more of an embedded application development framework than just an RTOS, with far more features available than the other options. It borrows the devicetree and Kconfig concepts from Linux, allowing a high level of hardware abstraction and a rich configuration system. But this means that it has a bigger learning curve than FreeRTOS or ThreadX, and it would be difficult to integrate Zephyr with an existing application – it would generally be a better approach to port the application over to using Zephyr’s build & configuration system and APIs.
ThreadX licensing model
ThreadX is distributed using the permissive MIT license. This means that it can be used at no cost in a commercial product, without having to release your source code like a copy-left (e.g. GPL) license would require.
What is the Eclipse foundation?
The eclipse foundation is a non-profit organisation which provides a platform for open source software collaboration.
In late 2023, Microsoft announced the transition of Azure RTOS (the previous name of ThreadX) to an open source model, under which it has been donated to the Eclipse foundation. The transition to the Eclipse foundation was completed in April 2024.
Previously the licensing model required that either the end user purchased a license, or the silicon vendor provided a license valid for use on a certain MCU family. Since this transition, it is now distributed under the permissive MIT license. The move also means that open-source contributed features and bugfixes can be included in ThreadX for the first time.
Witekio can support your ThreadX developments
Witekio can offer support for ThreadX development in a variety of ways:
- Application development: designing your application to run on ThreadX, making use of the kernel features and middleware libraries in the most effective way.
- Hardware integration: assist in integrating ThreadX with specific hardware components
- Driver development: writing device drivers to be RTOS-aware, and use kernel synchronisation primitives to run efficiently
- Architecture and code review: analyse your existing system architecture and code ensure best practices for developing in an RTOS environment, and identify opportunities for improvement in thread-safety, synchronisation, performance and efficiency