# apache/nuttx architecture

> Architecture diagram of the GitHub repository apache/nuttx, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/apache/nuttx
- Repository: https://github.com/apache/nuttx

## Overview

Apache NuttX is a small-footprint, POSIX-oriented RTOS for embedded systems. Its user-facing workflow is application code using OS interfaces to access hardware and services; the supplied tree shows examples including AI-engine control, USB mass storage and Xbox input, audio, and multicast listener handling. ARM support spans architecture-specific exception and interrupt code plus many chip-family drivers. The excerpts do not expose the kernel’s general syscall, scheduler, filesystem, or device-registration implementations, so those connections are not inferred here.

Main entry points: [`arch/arm/src/arm`](https://github.com/apache/nuttx/tree/master/arch/arm/src/arm) (ARM core support), [`include/nuttx/aie/ai_engine.h`](https://github.com/apache/nuttx/blob/master/include/nuttx/aie/ai_engine.h) (AI engine API), [`drivers/aie/ai_engine.c`](https://github.com/apache/nuttx/blob/master/drivers/aie/ai_engine.c) (AI engine driver), [`drivers/usbhost/usbhost_xboxcontroller.c`](https://github.com/apache/nuttx/blob/master/drivers/usbhost/usbhost_xboxcontroller.c) (Xbox USB driver)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_arm["ARM platform"]
  node_armcore["ARM core support"]
  node_armv6["ARMv6-M runtime"]
  node_armv7m["ARMv7-M runtime"]
  node_armv8m["ARMv8-M runtime"]
  node_am335x["AM335x drivers"]
  node_at32["AT32 drivers"]
end

subgraph group_devices["Device interfaces"]
  node_aieapi["AI engine API<br/>[ai_engine.h]"]
  node_aiedriver["AI engine driver<br/>[ai_engine.c]"]
  node_aiehardware["AI engine lower half"]
  node_usbstorage["USB mass storage<br/>[usbhost_storage.c]"]
  node_usbprotocol["Mass-storage protocol<br/>[storage.h]"]
  node_xboxdriver["Xbox USB driver"]
  node_xboxapi["Controller API<br/>[xbox-controller.h]"]
  node_audio["Audio subsystem<br/>[audio.c]"]
end

subgraph group_network["Networking"]
  node_mldquery["MLD query handling<br/>[mld_query.c]"]
end

subgraph group_libc["C library"]
  node_dtoa["Decimal conversion<br/>[lib_dtoa_engine.c]"]
end

node_application(("Application"))
node_usbdevice(("USB device"))
node_ipv6router(("IPv6 router"))

node_application -->|"uses API"| node_aieapi
node_aieapi -->|"registers driver"| node_aiedriver
node_aiedriver -->|"dispatches operations"| node_aiehardware
node_usbdevice -->|"exchanges commands"| node_usbprotocol
node_usbdevice -->|"connects to"| node_usbstorage
node_usbdevice -->|"connects to"| node_xboxdriver
node_application -->|"uses API"| node_xboxapi
node_xboxdriver -->|"provides reports"| node_xboxapi
node_application -->|"uses audio"| node_audio
node_ipv6router -->|"handles queries"| node_mldquery
node_application -->|"formats numbers"| node_dtoa
node_armcore -->|"supports runtime"| node_armv6
node_armcore -->|"supports runtime"| node_armv7m
node_armcore -->|"supports runtime"| node_armv8m
node_am335x -->|"uses ARM support"| node_armcore
node_at32 -->|"uses ARM support"| node_armcore

click node_armcore "https://github.com/apache/nuttx/tree/master/arch/arm/src/arm"
click node_armv6 "https://github.com/apache/nuttx/tree/master/arch/arm/src/armv6-m"
click node_armv7m "https://github.com/apache/nuttx/tree/master/arch/arm/src/armv7-m"
click node_armv8m "https://github.com/apache/nuttx/tree/master/arch/arm/src/armv8-m"
click node_am335x "https://github.com/apache/nuttx/tree/master/arch/arm/src/am335x"
click node_at32 "https://github.com/apache/nuttx/tree/master/arch/arm/src/at32"
click node_aieapi "https://github.com/apache/nuttx/blob/master/include/nuttx/aie/ai_engine.h"
click node_aiedriver "https://github.com/apache/nuttx/blob/master/drivers/aie/ai_engine.c"
click node_usbstorage "https://github.com/apache/nuttx/blob/master/drivers/usbhost/usbhost_storage.c"
click node_usbprotocol "https://github.com/apache/nuttx/blob/master/include/nuttx/usb/storage.h"
click node_xboxdriver "https://github.com/apache/nuttx/blob/master/drivers/usbhost/usbhost_xboxcontroller.c"
click node_xboxapi "https://github.com/apache/nuttx/blob/master/include/nuttx/input/xbox-controller.h"
click node_audio "https://github.com/apache/nuttx/blob/master/audio/audio.c"
click node_mldquery "https://github.com/apache/nuttx/blob/master/net/mld/mld_query.c"
click node_dtoa "https://github.com/apache/nuttx/blob/master/libs/libc/stream/lib_dtoa_engine.c"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_armcore,node_armv6,node_armv7m,node_armv8m,node_am335x,node_at32 toneBlue
class node_aieapi,node_aiedriver,node_aiehardware,node_usbstorage,node_usbprotocol,node_xboxdriver,node_xboxapi,node_audio toneAmber
class node_mldquery,node_ipv6router toneMint
class node_dtoa toneRose
class node_application,node_usbdevice toneIndigo
```

## Components

### ARM platform

- [ARM core support](https://github.com/apache/nuttx/tree/master/arch/arm/src/arm): `arch/arm/src/arm`
- [ARMv6-M runtime](https://github.com/apache/nuttx/tree/master/arch/arm/src/armv6-m): `arch/arm/src/armv6-m`
- [ARMv7-M runtime](https://github.com/apache/nuttx/tree/master/arch/arm/src/armv7-m): `arch/arm/src/armv7-m`
- [ARMv8-M runtime](https://github.com/apache/nuttx/tree/master/arch/arm/src/armv8-m): `arch/arm/src/armv8-m`
- [AM335x drivers](https://github.com/apache/nuttx/tree/master/arch/arm/src/am335x): `arch/arm/src/am335x`
- [AT32 drivers](https://github.com/apache/nuttx/tree/master/arch/arm/src/at32): `arch/arm/src/at32`

### Device interfaces

- [AI engine API](https://github.com/apache/nuttx/blob/master/include/nuttx/aie/ai_engine.h): `include/nuttx/aie/ai_engine.h`
- [AI engine driver](https://github.com/apache/nuttx/blob/master/drivers/aie/ai_engine.c): `drivers/aie/ai_engine.c`
- **AI engine lower half**
- [USB mass storage](https://github.com/apache/nuttx/blob/master/drivers/usbhost/usbhost_storage.c): `drivers/usbhost/usbhost_storage.c`
- [Mass-storage protocol](https://github.com/apache/nuttx/blob/master/include/nuttx/usb/storage.h): `include/nuttx/usb/storage.h`
- [Xbox USB driver](https://github.com/apache/nuttx/blob/master/drivers/usbhost/usbhost_xboxcontroller.c): `drivers/usbhost/usbhost_xboxcontroller.c`
- [Controller API](https://github.com/apache/nuttx/blob/master/include/nuttx/input/xbox-controller.h): `include/nuttx/input/xbox-controller.h`
- [Audio subsystem](https://github.com/apache/nuttx/blob/master/audio/audio.c): `audio/audio.c`

### Networking

- [MLD query handling](https://github.com/apache/nuttx/blob/master/net/mld/mld_query.c): `net/mld/mld_query.c`

### C library

- [Decimal conversion](https://github.com/apache/nuttx/blob/master/libs/libc/stream/lib_dtoa_engine.c): `libs/libc/stream/lib_dtoa_engine.c`

### Other components

- **Application**
- **USB device**
- **IPv6 router**

## Connections

- Application → AI engine API: uses API
- AI engine API → AI engine driver: registers driver
- AI engine driver → AI engine lower half: dispatches operations
- USB device → Mass-storage protocol: exchanges commands
- USB device → USB mass storage: connects to
- USB device → Xbox USB driver: connects to
- Application → Controller API: uses API
- Xbox USB driver → Controller API: provides reports
- Application → Audio subsystem: uses audio
- IPv6 router → MLD query handling: handles queries
- Application → Decimal conversion: formats numbers
- ARM core support → ARMv6-M runtime: supports runtime
- ARM core support → ARMv7-M runtime: supports runtime
- ARM core support → ARMv8-M runtime: supports runtime
- AM335x drivers → ARM core support: uses ARM support
- AT32 drivers → ARM core support: uses ARM support
