# zephyrproject-rtos/zephyr architecture

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

- Interactive diagram: https://gitdiagram.com/zephyrproject-rtos/zephyr
- Repository: https://github.com/zephyrproject-rtos/zephyr

## Overview

Zephyr is a scalable, security-focused real-time operating system for resource-constrained devices. Its runtime brings up architecture-specific kernel support and board hardware, then exposes drivers and higher-level services to embedded applications. The graph highlights documented architecture and board breadth, plus sampled storage, networking, Bluetooth, and LoRaWAN components. Source excerpts are selective, so several subsystem connections are shown as unverified rather than asserted as call paths.

Main entry points: [`CMakeLists.txt`](https://github.com/zephyrproject-rtos/zephyr/blob/main/CMakeLists.txt) (Zephyr RTOS), [`drivers`](https://github.com/zephyrproject-rtos/zephyr/tree/main/drivers) (Device drivers), [`arch`](https://github.com/zephyrproject-rtos/zephyr/tree/main/arch) (Architecture support), [`subsys/net/lib/lwm2m/lwm2m_engine.c`](https://github.com/zephyrproject-rtos/zephyr/blob/main/subsys/net/lib/lwm2m/lwm2m_engine.c) (LwM2M engine)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_kernel["Kernel and architectures"]
  node_zephyr["Zephyr RTOS<br/>[CMakeLists.txt]"]
  node_arch["Architecture support"]
  node_arm["ARM support"]
  node_riscv["RISC-V support"]
end

subgraph group_hardware["Boards and drivers"]
  node_boards["Board support"]
  node_drivers["Device drivers"]
  node_i2c["NPCX I2C"]
  node_nvme["NVMe controller<br/>[nvme_controller.c]"]
  node_nvme_defs["NVMe definitions<br/>[nvme.h]"]
end

subgraph group_connectivity["Connectivity services"]
  node_lwm2m["LwM2M engine<br/>[lwm2m_engine.c]"]
  node_lwm2m_api["LwM2M object API<br/>[lwm2m_object.h]"]
  node_lwm2m_obs["LwM2M observations"]
  node_media_shell["Media controller shell<br/>[media_controller.c]"]
  node_media_proxy["Media proxy"]
  node_lorawan_engine["LoRaWAN engine<br/>[engine.c]"]
  node_lorawan_mac["LoRaWAN MAC interface<br/>[mac.h]"]
end

subgraph group_security["Storage and security"]
  node_updatehub["UpdateHub storage"]
  node_secure_storage["PSA protected storage"]
  node_fido_storage["FIDO2 storage"]
end

node_application(("Embedded application"))

node_application -.->|"runs on"| node_zephyr
node_zephyr -->|"supports architectures"| node_arch
node_arch -->|"includes"| node_arm
node_arch -->|"includes"| node_riscv
node_zephyr -->|"supports boards"| node_boards
node_zephyr -.->|"uses"| node_drivers
node_drivers -.->|"includes"| node_i2c
node_drivers -.->|"includes"| node_nvme
node_nvme -->|"uses definitions"| node_nvme_defs
node_i2c -.->|"implements driver API"| node_drivers
node_zephyr -.->|"provides service"| node_lwm2m
node_lwm2m -->|"uses object model"| node_lwm2m_api
node_lwm2m -->|"uses observations"| node_lwm2m_obs
node_application -.->|"issues commands"| node_media_shell
node_media_shell -->|"calls controls"| node_media_proxy
node_application -->|"posts requests"| node_lorawan_engine
node_lorawan_engine -->|"dispatches requests"| node_lorawan_mac
node_application -.->|"requests updates"| node_updatehub
node_application -.->|"stores protected data"| node_secure_storage
node_application -.->|"uses credential storage"| node_fido_storage

click node_zephyr "https://github.com/zephyrproject-rtos/zephyr/blob/main/CMakeLists.txt"
click node_arch "https://github.com/zephyrproject-rtos/zephyr/tree/main/arch"
click node_arm "https://github.com/zephyrproject-rtos/zephyr/tree/main/arch/arm"
click node_riscv "https://github.com/zephyrproject-rtos/zephyr/tree/main/arch/riscv"
click node_boards "https://github.com/zephyrproject-rtos/zephyr/tree/main/boards"
click node_drivers "https://github.com/zephyrproject-rtos/zephyr/tree/main/drivers"
click node_i2c "https://github.com/zephyrproject-rtos/zephyr/blob/main/drivers/i2c/i2c_npcx_controller.c"
click node_nvme "https://github.com/zephyrproject-rtos/zephyr/blob/main/drivers/disk/nvme/nvme_controller.c"
click node_nvme_defs "https://github.com/zephyrproject-rtos/zephyr/blob/main/drivers/disk/nvme/nvme.h"
click node_lwm2m "https://github.com/zephyrproject-rtos/zephyr/blob/main/subsys/net/lib/lwm2m/lwm2m_engine.c"
click node_lwm2m_api "https://github.com/zephyrproject-rtos/zephyr/blob/main/subsys/net/lib/lwm2m/lwm2m_object.h"
click node_lwm2m_obs "https://github.com/zephyrproject-rtos/zephyr/blob/main/subsys/net/lib/lwm2m/lwm2m_observation.h"
click node_media_shell "https://github.com/zephyrproject-rtos/zephyr/blob/main/subsys/bluetooth/audio/shell/media_controller.c"
click node_media_proxy "https://github.com/zephyrproject-rtos/zephyr/blob/main/subsys/bluetooth/audio/media_proxy_internal.h"
click node_lorawan_engine "https://github.com/zephyrproject-rtos/zephyr/blob/main/subsys/lorawan/native/engine.c"
click node_lorawan_mac "https://github.com/zephyrproject-rtos/zephyr/blob/main/subsys/lorawan/native/mac/mac.h"
click node_updatehub "https://github.com/zephyrproject-rtos/zephyr/blob/main/subsys/mgmt/updatehub/updatehub_storage.c"
click node_secure_storage "https://github.com/zephyrproject-rtos/zephyr/blob/main/subsys/secure_storage/include/psa/protected_storage.h"
click node_fido_storage "https://github.com/zephyrproject-rtos/zephyr/blob/main/subsys/authentication/fido2/storage/fido2_storage_settings.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_zephyr,node_arch,node_arm,node_riscv toneBlue
class node_boards,node_drivers,node_i2c,node_nvme,node_nvme_defs toneAmber
class node_lwm2m,node_lwm2m_api,node_lwm2m_obs,node_media_shell,node_media_proxy,node_lorawan_engine,node_lorawan_mac toneMint
class node_updatehub,node_secure_storage,node_fido_storage toneRose
class node_application toneIndigo
```

## Components

### Kernel and architectures

- [Zephyr RTOS](https://github.com/zephyrproject-rtos/zephyr/blob/main/CMakeLists.txt): `CMakeLists.txt`
- [Architecture support](https://github.com/zephyrproject-rtos/zephyr/tree/main/arch): `arch`
- [ARM support](https://github.com/zephyrproject-rtos/zephyr/tree/main/arch/arm): `arch/arm`
- [RISC-V support](https://github.com/zephyrproject-rtos/zephyr/tree/main/arch/riscv): `arch/riscv`

### Boards and drivers

- [Board support](https://github.com/zephyrproject-rtos/zephyr/tree/main/boards): `boards`
- [Device drivers](https://github.com/zephyrproject-rtos/zephyr/tree/main/drivers): `drivers`
- [NPCX I2C](https://github.com/zephyrproject-rtos/zephyr/blob/main/drivers/i2c/i2c_npcx_controller.c): `drivers/i2c/i2c_npcx_controller.c`
- [NVMe controller](https://github.com/zephyrproject-rtos/zephyr/blob/main/drivers/disk/nvme/nvme_controller.c): `drivers/disk/nvme/nvme_controller.c`
- [NVMe definitions](https://github.com/zephyrproject-rtos/zephyr/blob/main/drivers/disk/nvme/nvme.h): `drivers/disk/nvme/nvme.h`

### Connectivity services

- [LwM2M engine](https://github.com/zephyrproject-rtos/zephyr/blob/main/subsys/net/lib/lwm2m/lwm2m_engine.c): `subsys/net/lib/lwm2m/lwm2m_engine.c`
- [LwM2M object API](https://github.com/zephyrproject-rtos/zephyr/blob/main/subsys/net/lib/lwm2m/lwm2m_object.h): `subsys/net/lib/lwm2m/lwm2m_object.h`
- [LwM2M observations](https://github.com/zephyrproject-rtos/zephyr/blob/main/subsys/net/lib/lwm2m/lwm2m_observation.h): `subsys/net/lib/lwm2m/lwm2m_observation.h`
- [Media controller shell](https://github.com/zephyrproject-rtos/zephyr/blob/main/subsys/bluetooth/audio/shell/media_controller.c): `subsys/bluetooth/audio/shell/media_controller.c`
- [Media proxy](https://github.com/zephyrproject-rtos/zephyr/blob/main/subsys/bluetooth/audio/media_proxy_internal.h): `subsys/bluetooth/audio/media_proxy_internal.h`
- [LoRaWAN engine](https://github.com/zephyrproject-rtos/zephyr/blob/main/subsys/lorawan/native/engine.c): `subsys/lorawan/native/engine.c`
- [LoRaWAN MAC interface](https://github.com/zephyrproject-rtos/zephyr/blob/main/subsys/lorawan/native/mac/mac.h): `subsys/lorawan/native/mac/mac.h`

### Storage and security

- [UpdateHub storage](https://github.com/zephyrproject-rtos/zephyr/blob/main/subsys/mgmt/updatehub/updatehub_storage.c): `subsys/mgmt/updatehub/updatehub_storage.c`
- [PSA protected storage](https://github.com/zephyrproject-rtos/zephyr/blob/main/subsys/secure_storage/include/psa/protected_storage.h): `subsys/secure_storage/include/psa/protected_storage.h`
- [FIDO2 storage](https://github.com/zephyrproject-rtos/zephyr/blob/main/subsys/authentication/fido2/storage/fido2_storage_settings.c): `subsys/authentication/fido2/storage/fido2_storage_settings.c`

### Other components

- **Embedded application**

## Connections

- Embedded application → Zephyr RTOS: runs on
- Zephyr RTOS → Architecture support: supports architectures
- Architecture support → ARM support: includes
- Architecture support → RISC-V support: includes
- Zephyr RTOS → Board support: supports boards
- Zephyr RTOS → Device drivers: uses
- Device drivers → NPCX I2C: includes (evidence: `drivers/i2c/i2c_npcx_controller.c`)
- Device drivers → NVMe controller: includes (evidence: `drivers/disk/nvme/nvme_controller.c`)
- NVMe controller → NVMe definitions: uses definitions (evidence: `drivers/disk/nvme/nvme_controller.c`)
- NPCX I2C → Device drivers: implements driver API (evidence: `drivers/i2c/i2c_npcx_controller.c`)
- Zephyr RTOS → LwM2M engine: provides service
- LwM2M engine → LwM2M object API: uses object model (evidence: `subsys/net/lib/lwm2m/lwm2m_engine.c`)
- LwM2M engine → LwM2M observations: uses observations
- Embedded application → Media controller shell: issues commands
- Media controller shell → Media proxy: calls controls (evidence: `subsys/bluetooth/audio/shell/media_controller.c`)
- Embedded application → LoRaWAN engine: posts requests (evidence: `subsys/lorawan/native/engine.c`)
- LoRaWAN engine → LoRaWAN MAC interface: dispatches requests (evidence: `subsys/lorawan/native/engine.c`)
- Embedded application → UpdateHub storage: requests updates
- Embedded application → PSA protected storage: stores protected data
- Embedded application → FIDO2 storage: uses credential storage
