NuttX
nuttx-12.12.0Features
-
Strict adherence to POSIX and ANSI standards for high application portability.
-
Scalable architecture supporting 8-bit, 16-bit, 32-bit, and 64-bit microcontroller environments.
-
Small footprint optimized for resource-constrained deeply embedded systems.
-
Modular design allowing developers to include only necessary components for a specific build.
-
Built-in simulator enabling development and testing on host terminal environments (Linux, macOS, Windows).
-
Comprehensive support for Symmetric Multiprocessing (SMP) on multi-core hardware.
-
Extensive Virtual File System (VFS) supporting FAT, ROMFS, SMART, and NFS client.
-
Full TCP/IP networking stack with support for IPv4, IPv6, and standard BSD socket APIs.
-
Integrated NX Graphics Subsystem for display management and user interface development.
-
Support for loadable binary formats including ELF and the specialized NXFLAT format.
-
Real-time scheduling with priority inheritance to mitigate priority inversion issues.
-
Unified device driver framework for character, block, network, and specialized hardware devices.
-
Dedicated audio and video subsystems for multimedia-capable embedded applications.
-
Native support for modern programming languages including C++ and Rust.
-
Advanced debugging features including Kernel Address Sanitizer (KASAN), GDB integration, and core dumps.
-
Support for OpenAMP to facilitate Asymmetric Multiprocessing (AMP) communication.
Architecture
Apache NuttX follows a modular, microkernel-like architectural philosophy while maintaining a monolithic structure for performance in its default configuration. The core of the system is built around a strict POSIX-compliant interface, which abstracts hardware complexities and provides a standardized environment for application development. The architecture is divided into several distinct layers: the Hardware Abstraction Layer (HAL) or Architecture-Specific Logic, the RTOS Kernel, and the Application Space.
A key architectural feature is the Virtual File System (VFS), which allows devices, sockets, and files to be accessed through a unified set of standard APIs (e.g., open, read, write). This design pattern extends to its driver model, where hardware is represented as device nodes in the /dev directory. NuttX also supports various build modes, including a Flat Build (all code in one address space), a Protected Build (using an MPU to separate kernel and user space), and a Kernel Build (using an MMU for full process isolation), providing flexibility based on the target hardware’s capabilities.
Core Components
- NuttShell (NSH): A comprehensive interactive shell for system management and debugging.
- Scheduler: A real-time, multi-tasking scheduler supporting FIFO and Round Robin policies.
- Network Stack: A full-featured, BSD-compatible stack supporting various protocols from link to application layer.
- Memory Management: Advanced allocators including support for CCM (Core Coupled Memory) and external RAM.
Use Cases
This RTOS is ideal for:
- Industrial Automation: Suitable for PLC and sensor controllers requiring high reliability and real-time determinism.
- IoT Gateways: Ideal for devices needing complex networking (IPv6, MQTT) and wireless connectivity (WiFi, BLE).
- Consumer Electronics: Used in smartwatches, audio equipment, and appliances that require a small footprint but rich feature sets.
- Automotive Systems: Applicable for telematics and body control modules, leveraging its support for CAN, CANFD, and S32K architectures.
- Drones and Robotics: Excellent for flight controllers and robotic actuators requiring low-latency interrupt handling and SMP support.
- Legacy System Migration: A perfect target for porting legacy Unix/Linux applications to microcontrollers due to its high POSIX compliance.
Getting Started
To begin development with Apache NuttX, developers should first set up their build environment by installing the necessary toolchains for their target architecture (e.g., arm-none-eabi-gcc or riscv64-unknown-elf-gcc). The build system is based on kconfig and make, similar to the Linux kernel. A typical workflow involves selecting a predefined configuration using the ./tools/configure.sh script, followed by running make to generate the binary image.
For those without physical hardware, the NuttX Simulator provides an excellent starting point, allowing the RTOS to run as a native process on Linux, macOS, or Windows. Detailed documentation, including board-specific guides and API references, can be found at the official Apache NuttX Documentation page. Community support is active through GitHub issues and the project’s mailing lists.
Related Projects (47)
Apache NuttX for SF2000
A port of the Apache NuttX real-time operating system targeting the Data Frog SF2000 handheld console. It provides a POSIX-compliant environment with a small footprint, supporting 8-bit to 64-bit microcontroller environments with a focus on standards and modularity.
Apache NuttX RTOS for Pine64 Star64
A comprehensive port of the Apache NuttX RTOS to the Pine64 Star64 64-bit RISC-V single-board computer. It provides hardware support for the StarFive JH7110 SoC, including PLIC interrupts, UART, and display controller integration, supported by automated daily builds and extensive technical documentation.
Apache NuttX RTOS for PinePhone
A comprehensive port of the Apache NuttX Real-Time Operating System to the Pine64 PinePhone. It features drivers for the Allwinner A64 SoC, including MIPI DSI display, touch panel, 4G LTE modem, and LVGL graphics integration with multi-core SMP support.
Apache NuttX RTOS on 64-bit RISC-V
A project focused on porting, building, and testing the Apache NuttX RTOS on 64-bit RISC-V architectures. It supports various platforms including QEMU emulation and single-board computers like Star64, Ox64, and Oz64, featuring automated CI workflows and specialized kernel build configurations.
LoRa Test App for Semtech SX1262 and Apache NuttX
A test application for the Semtech SX1262 LoRa transceiver running on the Apache NuttX RTOS. It provides functionality for initializing the radio driver, reading registers, and performing basic PING/PONG message exchanges. The project supports hardware platforms like BL602 and ESP32.
LVGL for PinePhone and WebAssembly with Zig and Apache NuttX RTOS
A project demonstrating the development of a feature phone user interface using the Zig programming language and the LVGL graphics library. It targets the PinePhone running Apache NuttX RTOS while providing a WebAssembly-based simulation environment for rapid UI development in the browser.
NuttX API Examples
A collection of example applications demonstrating the use of various Apache NuttX RTOS APIs, including task management, semaphores, message queues, and system logging. These examples are designed for NuttX version 12.3 and lower, providing practical implementations for common embedded system tasks.
NuttX Development Docker Environment
A Docker-based development environment for the NuttX RTOS. It provides a pre-configured Ubuntu container with all necessary toolchains and dependencies, including ARM cross-compilers and Kconfig tools, to build and run NuttX projects across Linux, macOS, and Windows.
NuttX ESP32 Environment for WSL2
A specialized development environment designed to build and deploy Apache NuttX on ESP32 microcontrollers within Windows Subsystem for Linux (WSL2). It utilizes Docker containers to provide a consistent build toolchain and includes scripts for automated board configuration and custom application integration.
NuttX Real-Time Operating System
NuttX is a standards-compliant real-time operating system (RTOS) designed for 8-bit to 32-bit microcontrollers. It features a modular architecture, POSIX/ANSI compatibility, and extensive support for diverse hardware architectures including ARM, RISC-V, and ESP32.
NuttX RTOS Experiments
A collection of personal experiments and modifications for the Apache NuttX Real-Time Operating System. The repository includes custom board configurations and driver implementations designed to extend the core functionality of NuttX for specific embedded hardware targets.
Nxslib
A Python client library for the Apache NuttX NxScope real-time logging module. It enables real-time data streaming and decoding from NuttX-based embedded systems via serial or Segger RTT interfaces. The library includes a built-in simulator for application development without physical hardware.
PineDio Stack BL604 on Apache NuttX RTOS
A comprehensive implementation of the Apache NuttX RTOS for the Pine64 PineDio Stack BL604 microcontroller board. It features integrated support for the ST7789 display, LVGL graphics library, SX1262 LoRa transceiver, and various onboard sensors using a shared SPI bus architecture.
Rust I2C Driver for Bosch BME280 on Apache NuttX
A project demonstrating how to use Rust to communicate with a Bosch BME280 sensor via I2C on the Apache NuttX RTOS. It implements a NuttX-specific version of the Rust Embedded HAL and provides examples for the Pine64 PineCone BL602 and ESP32 platforms.
Rust Stub Library for Apache NuttX
A stub library that provides the necessary build system integration and C-side stubs to run Rust code on the Apache NuttX RTOS. It facilitates the inclusion of Rust applications into the NuttX build process, targeting hardware such as ESP32 and BL602 microcontrollers.
SAMA5D27 Resource Sharing
A comprehensive resource repository for the Microchip SAMA5D27 Cortex-A5 MPU, providing extensive documentation and guides for Linux development, bare-metal programming, and various RTOS ports. It features in-depth tutorials for NuttX, RT-Thread, and ThreadX, including driver integration for LVGL, EtherCAT, and TensorFlow Lite.
Sony Spresense SDK
The official software development kit for the Sony Spresense development board, built upon the NuttX real-time operating system. It provides a comprehensive environment for developing high-performance IoT applications with support for multi-core processing and edge AI through the Neural Network Runtime.
TinyCBOR Test App for Apache NuttX
A demonstration application for Apache NuttX RTOS that showcases how to encode sensor data using the TinyCBOR library. It provides practical examples of serializing structured data into compact binary formats for efficient transmission on platforms like ESP32 and BL602.
Unicorn Emulator for Apache NuttX on Avaota-A1 Arm64 SBC
A Rust-based emulator using the Unicorn Engine to run Apache NuttX RTOS on Arm64 platforms, specifically targeting the Allwinner A527-based Avaota-A1 SBC and the PinePhone. It provides tools for debugging the NuttX boot flow, handling Arm64 exceptions, and implementing system call hooks within the emulation environment.
Visual Programming for Zig with NuttX Sensors
A development framework that enables visual programming for Zig applications on the Apache NuttX RTOS using Blockly. It provides a Zig interface for reading IoT sensors on RISC-V hardware, featuring automated C-to-Zig translation, type-safe sensor data handling, and CBOR encoding for LoRaWAN transmission.
Zig LVGL Touchscreen App on Apache NuttX RTOS
This project demonstrates the integration of the Zig programming language with the LVGL graphics library on Apache NuttX RTOS. It provides a proof-of-concept for building safer, idiomatic touchscreen applications on RISC-V hardware by wrapping the C-based LVGL API in Zig.
Zig on RISC-V BL602 with Apache NuttX RTOS
A comprehensive project demonstrating how to build and run Zig applications on the RISC-V BL602 microcontroller using the Apache NuttX RTOS. It covers everything from basic 'Hello World' examples to complex LoRaWAN implementations, including technical workarounds for ABI compatibility and C-to-Zig translation.
LVGL Terminal for PinePhone on Apache NuttX
A touchscreen terminal application for the PinePhone running the Apache NuttX RTOS. It utilizes the LVGL graphics library to provide a graphical interface for interacting with the NuttX NSH shell, enabling command execution directly on the device's display.
MControl
A PX4/NuttX application designed to activate offboard control mode and manage drone flight internally on Pixhawk hardware. It utilizes the uORB inter-process communication layer and POSIX threads to provide high-level autonomous commands without requiring an external companion computer.
IKEA VINDRIKTNING Air Quality Sensor for Apache NuttX
An application for Apache NuttX OS that interfaces with the IKEA VINDRIKTNING air quality sensor to read and decode PM 2.5 data. It targets the PineDio Stack BL604 and ESP32 platforms, enabling sensor data transmission via LoRaWAN to The Things Network.
FMoto - Motorola FM Transmitter Moto Mod
A hardware modification for the Motorola Moto Z that implements an FM transmitter using the NuttX RTOS. It leverages the Si4713 transmitter and UDA1334 DAC to broadcast audio via I2C and I2S signals. The project is built using the Moto Mods Developer Kit and follows the Greybus protocol for Android integration.
Apache NuttX Driver for Bosch BME280 Sensor
A comprehensive sensor driver for the Bosch BME280 (Temperature, Humidity, and Pressure) ported from Zephyr OS to Apache NuttX. It supports I2C communication and is optimized for platforms like the BL602 and ESP32, providing standard NuttX sensor character device interfaces.
BL602 ADC and Temperature Sensor Library for Apache NuttX
A hardware abstraction library for Apache NuttX that enables access to the BL602 microcontroller's ADC and internal temperature sensor. Ported from the official BL602 MCU SDK, it provides a functional bridge for developers until a native NuttX ADC driver is available for the platform.
BL602 GPIO Expander for Apache NuttX
A specialized GPIO expander driver for BL602 and BL604 microcontrollers running the Apache NuttX RTOS. It simplifies development by mapping physical pins directly to standard GPIO device paths and provides robust interrupt demultiplexing and pin-reuse validation.
Hynitron CST816S Touch Controller Driver for Apache NuttX
A specialized device driver for the Hynitron CST816S touch controller, integrated with the Apache NuttX RTOS. It provides support for I2C-based touch data retrieval and GPIO interrupt handling, primarily targeting the PineDio Stack BL604 and other RISC-V or ESP32 platforms.