# Apache NuttX — Mature Real-Time Embedded Operating System > A standards-compliant, POSIX-compatible real-time operating system for microcontrollers and embedded systems, incubated at the Apache Software Foundation. ## Install Save in your project root: # Apache NuttX — Mature Real-Time Embedded Operating System ## Quick Use ```bash # Install prerequisites pip install kconfiglib # Clone NuttX and apps git clone https://github.com/apache/nuttx.git git clone https://github.com/apache/nuttx-apps.git apps # Configure for a board (e.g., STM32F4Discovery) cd nuttx && ./tools/configure.sh stm32f4discovery:nsh # Build make # Flash to board openocd -f board/stm32f4discovery.cfg -c "program nuttx.bin verify reset exit" ``` ## Introduction Apache NuttX is a real-time operating system designed for deeply embedded microcontrollers. It emphasizes standards compliance (POSIX, ANSI C) and a scalable architecture that runs on everything from 8-bit MCUs with 32 KB of RAM to 64-bit application processors, while maintaining real-time guarantees. ## What NuttX Does - Provides a POSIX-compatible API for embedded applications, reducing the learning curve for systems programmers - Supports 300+ board configurations across ARM, RISC-V, x86, Xtensa, and other architectures - Includes a built-in shell (NSH), filesystem support (FAT, LittleFS, NFS), and TCP/IP networking - Offers hard real-time task scheduling with priority inheritance and preemptive multitasking - Ships with drivers for SPI, I2C, UART, CAN, USB, Ethernet, and Wi-Fi peripherals ## Architecture Overview NuttX uses a flat or protected-mode memory model depending on the target MCU capabilities. The kernel provides POSIX-compliant system calls (open, read, write, ioctl, pthread) on top of a priority-based preemptive scheduler. Device drivers follow a Unix-like character/block device model registered under /dev. The network stack implements BSD sockets with support for IPv4, IPv6, TCP, UDP, and ICMP. Build configuration uses Kconfig, the same system used by the Linux kernel. ## Self-Hosting & Configuration - Build on Linux, macOS, or WSL with a cross-compilation toolchain (GCC ARM, RISC-V, etc.) - Use Kconfig-based `make menuconfig` to select features, drivers, and subsystems - Choose between flat address space (smaller MCUs) or protected mode (MPU-equipped chips) - Flash firmware via OpenOCD, J-Link, or vendor-specific programming tools - Pre-built board configs for popular dev boards ship in the `boards/` directory ## Key Features - POSIX and ANSI C compliance that lets developers reuse desktop code on embedded targets - Scales from 8-bit MCUs (8 KB code, 32 KB RAM) up to 64-bit application processors - Real-time scheduler with priority inheritance, round-robin, and sporadic policies - Built-in TCP/IP stack, USB device/host support, and filesystem drivers - Apache 2.0 license with commercial-friendly terms and active Foundation governance ## Comparison with Similar Tools - **Zephyr RTOS** — Linux Foundation backed; stronger IoT connectivity stack, but less POSIX-compliant than NuttX - **FreeRTOS** — most popular embedded RTOS; simpler API but no built-in POSIX layer or filesystem - **RIOT OS** — IoT-focused; good networking support but less mature driver ecosystem than NuttX - **Mbed OS** — ARM-focused; tighter hardware integration with ARM chips but narrower architecture support ## FAQ **Q: Can I run Linux applications on NuttX?** A: Many POSIX applications can be ported with minimal changes. NuttX implements enough of the POSIX API that simple command-line tools and networking code often compiles directly. **Q: What is the minimum hardware requirement?** A: NuttX runs on MCUs with as little as 32 KB RAM and 128 KB Flash, though more complex configurations need more resources. **Q: Is NuttX used in commercial products?** A: Yes. It is deployed in consumer electronics, drones, industrial controllers, and automotive systems by companies worldwide. Sony used NuttX in their audio products. **Q: How active is the community?** A: NuttX is an Apache Software Foundation project with regular releases, an active mailing list, and contributors from major embedded companies. ## Sources - https://github.com/apache/nuttx - https://nuttx.apache.org/docs/latest/ --- Source: https://tokrepo.com/en/workflows/asset-e5a3d81d Author: AI Open Source