What is NetX Duo?
NetX Duo (full name Eclipse ThreadX NetX Duo) is an industrial-grade TCP/IP network protocol stack launched by Microsoft/the Microsoft open-source community, specifically designed for deeply embedded real-time systems and IoT devices. It supports both IPv4 and IPv6, and tightly integrates the ThreadX real-time kernel with the NetX Duo network stack, creating a “unified” development experience. In other words, if you want to run networking, security, and cloud protocols on an MCU, simply incorporating NetX Duo into your project means you won’t have to implement most of the underlying details yourself.
What pain points does it address?
| Pain Points of Traditional Approaches | NetX Duo’s Solutions |
| Manually writing a TCP/IP stack is cumbersome and debugging is difficult. | A complete protocol stack that has been implemented and industrially validated, with direct API calls. |
| Weak IPv6 support and poor compatibility. | Dual-stack design, with both IPv4 and IPv6 available simultaneously and easy switching. |
| Security layers (TLS/DTLS) require porting OpenSSL, which is large. | Built-in NetX Secure, a lightweight TLS/DTLS solution tailored for MCU resource constraints. |
| Various cloud protocols (MQTT, Azure IoT, HTTP) require additional libraries. | Addons directory provides plugins for common protocols like MQTT, HTTP, FTP, DHCP, DNS, etc. |
| High porting costs across multiple platforms, with inconsistent toolchains. | Based on CMake + Ninja, supporting mainstream toolchains like Arm GNU, IAR, Keil, etc. |
| Fragmented documentation and steep learning curve. | The official provides Getting Started, sample code, and hero development board guides for a one-stop onboarding experience. |
In summary:“If you don’t want to struggle with low-level networking anymore, use NetX Duo!”
Installation & Usage Guide
⚡ Tip: If you are already using SDKs from ST, NXP, Renesas, or Microchip, simply treat NetX Duo as a submodule, and you will hardly need to modify your existing project.
- 1. Clone the repository (with submodules)
git clone --recursive https://github.com/eclipse-threadx/netxduo.git cd netxduo - 2. Prepare the build tools (choose any one)
- • CMake ≥ 3.0
- • Arm GNU Toolchain (
<span>arm-none-eabi</span>) - • Ninja (optional for acceleration)
- • Copy
<span>nx_user_sample.h</span>to<span>nx_user.h</span>and enable/disable the required addons (e.g.,<span>#define NX_ENABLE_HTTP</span>).
cmake -Bbuild -GNinja -DCMAKE_TOOLCHAIN_FILE=cmake/cortex_m4.cmake .
cmake --build ./build
- • If you are using Keil/IAR, simply add the
<span>netxduo</span>directory to the IDE’s Include Paths and Library, then add<span>libnetxduo.a</span>during the linking stage.
- • Choose a suitable example from
<span>samples</span><code><span> (e.g., </span><code><span>http_server</span>), copy it to your project, compile and flash it, then open the serial port to see logs like “HTTP Server listening on 0.0.0.0:80”.
Friendly Reminder: The first compilation may fail due to mismatched MCU header file paths; check the MCU-specific variables in the
<span>cmake</span>script.
Pros and Cons Overview
| Pros | Cons |
| Industrial-grade reliability: Verified by multiple chip manufacturers, compatible with mainstream MCUs like STM, NXP, Renesas. | Learning curve: Although documentation is comprehensive, first-time users of CMake/Addons will still need some time. |
| Lightweight: The core library is only a few hundred KB, suitable for resource-constrained MCUs. | Feature trimming: If unconventional protocols (like custom P2P) are needed, they still need to be implemented manually. |
| Dual-stack + Security: Simultaneous support for IPv4/IPv6, built-in TLS/DTLS. | Community size: Compared to lwIP and FreeRTOS-Plus-TCP, the community is smaller, with limited third-party examples. |
| Plugin-based: The addons directory provides common cloud protocols, file transfer, etc. | IDE integration: Some older IDEs (like IAR 7.x) require manual CMake configuration, which can be cumbersome. |
| Cross-platform: CMake + Ninja supports various compilers and operating systems. | Update frequency: The master branch is a development version; the official GA version needs to be monitored via Tags. |
Conclusion
NetX Duo is not a magic wand that solves all networking issues with a single click, but it packages the three core functionalities of network protocol stack, security layer, and cloud protocol plugins into a customizable, portable, industrial-grade library, allowing embedded developers to focus more on business logic and product innovation rather than the tedious details of low-level protocols.
If you are preparing to develop an IoT gateway, real-time sensor node, in-vehicle communication, or industrial control, and your MCU resources are tight with high real-time requirements, NetX Duo is definitely worth a try. After incorporating it into your project, you will find that networking code shifts from “hundreds of lines of handwritten code” to “a few lines of API calls,” and debugging time reduces from “days” to “hours.”
Project Address: https://github.com/eclipse-threadx/netxduo