Skip to content
systemcoding.dev
RTOS

What Eclipse ThreadX Is and How It Became Open Source

Eclipse ThreadX is a small real-time kernel that began at Express Logic, became Azure RTOS, and moved to the Eclipse Foundation under an open license in 2023.

6 min read
Summarize in AI
Flat illustration of RTOS tasks taking turns on a timeline, with the C, Arm and Espressif logos.

Few embedded kernels have shipped in as many products as ThreadX, and few have changed hands as often. Written in the 1990s, sold as a commercial library for decades, bought by Microsoft and rebranded, then handed to a foundation and released under an open license, it has been through every business model an RTOS can have. If you meet it in a job, a datasheet or a vendor SDK, it helps to know what it is, what it contains and why its name keeps changing. This post gives that background for beginners and points to the project's own materials: the Eclipse ThreadX project page and its repositories on GitHub under the eclipse-threadx organization. Facts about licensing and history below come from those sources and from the project's announcement; check them for any legal purpose.

What it is

ThreadX is a real-time operating system kernel for microcontrollers and small processors. It provides the pieces every RTOS provides: threads with fixed priorities and a preemptive scheduler, a system tick, timers, mutexes, counting semaphores, message queues, event flags and memory pools. It is written in C with a small amount of assembly for each processor port. Its design goals have always been a small footprint, fast and predictable context switches and a simple, uniform API. The kernel is a library you link into your firmware: there is no separate process model, no file system in the kernel and no dynamic loading, though companion components add networking, file systems and USB.

The API is the thing you notice first. Every function starts with tx_, every object type has a matching TX_ structure, and every call returns a status code, with TX_SUCCESS meaning success. A thread is created with tx_thread_create(), a semaphore with tx_semaphore_create(). Names are consistent, which makes the code easy to scan.

The companion components

ThreadX is the kernel. Around it grew a family of middleware, designed to work together, with the same style and the same quality bar:

  • NetX Duo, a TCP/IP stack with IPv4 and IPv6, sockets, TLS and protocol clients and servers.

  • FileX, a FAT file system, with LevelX providing wear leveling for NOR and NAND flash.

  • USBX, a USB host and device stack.

  • GUIX, a graphical user interface toolkit for displays.

You can use the kernel alone, which is the common case for small devices, or add components when the product needs them.

How it got here

ThreadX was created by William Lamie and sold by his company Express Logic, which licensed it commercially to chip makers and device vendors. It spread widely through vendor SDKs and in consumer and industrial products. In 2019 Microsoft acquired Express Logic. The kernel and its companions were renamed Azure RTOS and integrated with Microsoft's cloud IoT services, while still running on any hardware and without a cloud connection. Under that name the source was available to customers under Microsoft's license terms, and Microsoft later made the code available more broadly on GitHub.

In late 2023 Microsoft announced that it was donating Azure RTOS to the Eclipse Foundation, and the project became Eclipse ThreadX. The code is released under the MIT license, a permissive open-source license. The Eclipse Foundation hosts the project, with a governance model that lets multiple companies and individuals contribute, and the project's repositories on GitHub carry the current releases. This is the reason you will see three names in documentation and code: Express Logic ThreadX in older material, Azure RTOS ThreadX in material from 2019 to 2023 and Eclipse ThreadX now. They refer to the same lineage, and the API is largely continuous across them.

What the license changes for you

The MIT license allows use, copying, modification and distribution, including in commercial products, with the condition that the copyright and license notice are kept. Before the move, using ThreadX in a product was free through some chip vendors' arrangements and through the Azure RTOS terms, but conditions varied. Now there is one license for everyone, which simplifies a legal review. A product that ships the code must still include the notice, and you remain responsible for the rest of your software's licenses.

One thing the license does not give is certification. ThreadX has a history of safety certification for earlier versions, for standards in industrial, medical and transport domains, documented by its previous owners. Whether a particular certificate applies to the open-source version you build is a question for the project and the certification body, and the answer depends on the exact release and your usage. Do not assume it from the name.

What a program looks like

A ThreadX program has a standard shape. The main() function initializes the hardware, then calls tx_kernel_enter(), which never returns. The kernel runs its initialization and then calls a function you write, tx_application_define(), where you create your threads and other objects. When it returns, the scheduler starts. This is a fragment, covered step by step in the next post:

c
int main(void)
{
	/* configure clocks and pins here */
	tx_kernel_enter();
	return 0;
}

void tx_application_define(void *first_unused_memory)
{
	/* create threads, queues, semaphores */
}

Nothing runs concurrently before tx_kernel_enter(), and nothing after it returns to main(). If you remember that structure, every ThreadX example reads naturally.

Where you will find it

Many chip vendors include ThreadX in their SDKs: STMicroelectronics integrates it with its STM32Cube packages, Renesas and NXP and others provide ports and examples. A board's SDK may bundle a copy of the kernel with a ready-made port for the chip, so you rarely write the assembly port yourself. If you start a new project, the upstream repository at github.com/eclipse-threadx/threadx is the source of the current kernel, with ports for Arm Cortex-M and -A, RISC-V and others under the ports directory, and sample projects.

How it compares

Next to FreeRTOS, ThreadX offers a larger built-in feature set in the kernel, such as event flags, mutexes with priority inheritance and preemption-threshold scheduling, and a consistent family of middleware. Next to Zephyr, it is a kernel with companions and not a whole platform with a hardware description language and build system of its own. It has no device model or board support layer in the kernel; you or your vendor provide those. Which fits depends on the project: a team already in a vendor's ThreadX-based SDK has little reason to leave, and a team that wants a big driver collection and a hardware abstraction tends to look at Zephyr.

What to learn first

The thread, the tick and the priority; then the synchronization objects, semaphore, queue, event flags and mutex; then the memory pools. Those cover most programs. The companion components are worth a look when the product needs networking or storage. The next posts in this cluster take each of those in turn on STM32 and other targets.

Share

Keep reading

Get new posts by email

We send one email when a new post is published. No spam.

Unsubscribe in one click. No spam, ever.