# awesome-harmonyos/harmonyos architecture

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

- Interactive diagram: https://gitdiagram.com/awesome-harmonyos/harmonyos
- Repository: https://github.com/awesome-harmonyos/harmonyos

## Overview

This repository is a curated HarmonyOS resource collection, not a complete HarmonyOS implementation. The supplied tree shows a substantial Huawei LiteOS slice, including embedded networking, IoT connectivity, OTA support, filesystems, and ARM/Microcontroller hardware support. A representative device workflow starts at a board entry point, initializes LiteOS and networking, then uses an IoT agent to communicate with a server and handle firmware updates. The README describes broader HarmonyOS capabilities, but those distributed-OS subsystems are not represented by this tree. Connections beyond sampled calls are shown only where module responsibilities are clear.

Main entry points: [`Huawei_LiteOS/components/connectivity/agent_tiny/atiny_lwm2m/atiny_fota_manager.c`](https://github.com/awesome-harmonyos/harmonyos/blob/master/Huawei_LiteOS/components/connectivity/agent_tiny/atiny_lwm2m/atiny_fota_manager.c) (FOTA manager), [`Huawei_LiteOS/components/net/lwip/lwip-2.0.3/src`](https://github.com/awesome-harmonyos/harmonyos/tree/master/Huawei_LiteOS/components/net/lwip/lwip-2.0.3/src) (lwIP networking), [`Huawei_LiteOS/components/connectivity/agent_tiny/atiny_lwm2m`](https://github.com/awesome-harmonyos/harmonyos/tree/master/Huawei_LiteOS/components/connectivity/agent_tiny/atiny_lwm2m) (Tiny LwM2M agent), [`Huawei_LiteOS/components/connectivity/lwm2m/core`](https://github.com/awesome-harmonyos/harmonyos/tree/master/Huawei_LiteOS/components/connectivity/lwm2m/core) (LwM2M protocol)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_boot["LiteOS platform"]
  node_board["Board startup<br/>[main.c]"]
  node_kernel["LiteOS kernel"]
  node_armhw["ARM hardware support<br/>[los_hw.c]"]
end

subgraph group_network["Network stack"]
  node_lwip["lwIP networking<br/>[src]"]
  node_at["AT modem interface<br/>[at_api.c]"]
end

subgraph group_iot["IoT connectivity"]
  node_agent["Tiny LwM2M agent"]
  node_lwm2m["LwM2M protocol"]
  node_mqttagent["Tiny MQTT client<br/>[mqtt_client.c]"]
  node_mqttclient["MQTT client library<br/>[MQTTClient.c]"]
  node_mqttflash["MQTT secret storage<br/>[flash_manager.c]"]
end

subgraph group_update["Firmware update"]
  node_fota["FOTA manager"]
  node_fwobj["Firmware object<br/>[object_firmware.c]"]
  node_flag["OTA flags<br/>[flag_manager.c]"]
end

subgraph group_storage["Filesystems"]
  node_vfs["Virtual filesystem<br/>[los_vfs.c]"]
  node_fat["FAT filesystem<br/>[los_fatfs.c]"]
  node_spiffs["SPI flash filesystem<br/>[los_spiffs.c]"]
end

node_server(("IoT server"))
node_flash[("Device flash")]

node_board -->|"initializes"| node_kernel
node_kernel -->|"uses hardware"| node_armhw
node_board -->|"initializes"| node_lwip
node_agent -->|"uses protocol"| node_lwm2m
node_agent -->|"exchanges data"| node_server
node_lwm2m -->|"sends protocol"| node_server
node_fota -->|"initializes flags"| node_flag
node_fota -->|"updates resource"| node_lwm2m
node_fwobj -->|"manages update"| node_fota
node_fota -.->|"reads/writes flags"| node_flash
node_mqttagent -->|"uses client"| node_mqttclient
node_mqttagent -->|"stores secrets"| node_mqttflash
node_mqttflash -->|"reads/writes secrets"| node_flash
node_agent -.->|"uses networking"| node_lwip
node_mqttclient -.->|"uses networking"| node_lwip
node_at -.->|"provides modem link"| node_lwip
node_vfs -.->|"dispatches filesystem"| node_fat
node_vfs -.->|"dispatches filesystem"| node_spiffs

click node_board "https://github.com/awesome-harmonyos/harmonyos/blob/master/Huawei_LiteOS/targets/STM32F103VET6_NB_GCC/Src/main.c"
click node_kernel "https://github.com/awesome-harmonyos/harmonyos/tree/master/Huawei_LiteOS/arch/arm/arm-m/src"
click node_armhw "https://github.com/awesome-harmonyos/harmonyos/blob/master/Huawei_LiteOS/arch/arm/arm-m/src/los_hw.c"
click node_agent "https://github.com/awesome-harmonyos/harmonyos/tree/master/Huawei_LiteOS/components/connectivity/agent_tiny/atiny_lwm2m"
click node_lwm2m "https://github.com/awesome-harmonyos/harmonyos/tree/master/Huawei_LiteOS/components/connectivity/lwm2m/core"
click node_fota "https://github.com/awesome-harmonyos/harmonyos/blob/master/Huawei_LiteOS/components/connectivity/agent_tiny/atiny_lwm2m/atiny_fota_manager.c"
click node_fwobj "https://github.com/awesome-harmonyos/harmonyos/blob/master/Huawei_LiteOS/components/connectivity/agent_tiny/atiny_lwm2m/object_firmware.c"
click node_flag "https://github.com/awesome-harmonyos/harmonyos/blob/master/Huawei_LiteOS/components/ota/flag_operate/flag_manager.c"
click node_mqttagent "https://github.com/awesome-harmonyos/harmonyos/blob/master/Huawei_LiteOS/components/connectivity/agent_tiny/atiny_mqtt/mqtt_client.c"
click node_mqttclient "https://github.com/awesome-harmonyos/harmonyos/blob/master/Huawei_LiteOS/components/connectivity/mqtt/MQTTClient-C/src/MQTTClient.c"
click node_mqttflash "https://github.com/awesome-harmonyos/harmonyos/blob/master/Huawei_LiteOS/components/connectivity/agent_tiny/atiny_mqtt/flash_manager.c"
click node_lwip "https://github.com/awesome-harmonyos/harmonyos/tree/master/Huawei_LiteOS/components/net/lwip/lwip-2.0.3/src"
click node_at "https://github.com/awesome-harmonyos/harmonyos/blob/master/Huawei_LiteOS/components/net/at_frame/at_api.c"
click node_vfs "https://github.com/awesome-harmonyos/harmonyos/blob/master/Huawei_LiteOS/components/fs/vfs/los_vfs.c"
click node_fat "https://github.com/awesome-harmonyos/harmonyos/blob/master/Huawei_LiteOS/components/fs/fatfs/los_fatfs.c"
click node_spiffs "https://github.com/awesome-harmonyos/harmonyos/blob/master/Huawei_LiteOS/components/fs/spiffs/los_spiffs.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_board,node_kernel,node_armhw toneBlue
class node_lwip,node_at,node_flash toneAmber
class node_agent,node_lwm2m,node_mqttagent,node_mqttclient,node_mqttflash,node_server toneMint
class node_fota,node_fwobj,node_flag toneRose
class node_vfs,node_fat,node_spiffs toneIndigo
```

## Components

### LiteOS platform

- [Board startup](https://github.com/awesome-harmonyos/harmonyos/blob/master/Huawei_LiteOS/targets/STM32F103VET6_NB_GCC/Src/main.c): `Huawei_LiteOS/targets/STM32F103VET6_NB_GCC/Src/main.c`
- [LiteOS kernel](https://github.com/awesome-harmonyos/harmonyos/tree/master/Huawei_LiteOS/arch/arm/arm-m/src): `Huawei_LiteOS/arch/arm/arm-m/src`
- [ARM hardware support](https://github.com/awesome-harmonyos/harmonyos/blob/master/Huawei_LiteOS/arch/arm/arm-m/src/los_hw.c): `Huawei_LiteOS/arch/arm/arm-m/src/los_hw.c`

### Network stack

- [lwIP networking](https://github.com/awesome-harmonyos/harmonyos/tree/master/Huawei_LiteOS/components/net/lwip/lwip-2.0.3/src): `Huawei_LiteOS/components/net/lwip/lwip-2.0.3/src`
- [AT modem interface](https://github.com/awesome-harmonyos/harmonyos/blob/master/Huawei_LiteOS/components/net/at_frame/at_api.c): `Huawei_LiteOS/components/net/at_frame/at_api.c`

### IoT connectivity

- [Tiny LwM2M agent](https://github.com/awesome-harmonyos/harmonyos/tree/master/Huawei_LiteOS/components/connectivity/agent_tiny/atiny_lwm2m): `Huawei_LiteOS/components/connectivity/agent_tiny/atiny_lwm2m`
- [LwM2M protocol](https://github.com/awesome-harmonyos/harmonyos/tree/master/Huawei_LiteOS/components/connectivity/lwm2m/core): `Huawei_LiteOS/components/connectivity/lwm2m/core`
- [Tiny MQTT client](https://github.com/awesome-harmonyos/harmonyos/blob/master/Huawei_LiteOS/components/connectivity/agent_tiny/atiny_mqtt/mqtt_client.c): `Huawei_LiteOS/components/connectivity/agent_tiny/atiny_mqtt/mqtt_client.c`
- [MQTT client library](https://github.com/awesome-harmonyos/harmonyos/blob/master/Huawei_LiteOS/components/connectivity/mqtt/MQTTClient-C/src/MQTTClient.c): `Huawei_LiteOS/components/connectivity/mqtt/MQTTClient-C/src/MQTTClient.c`
- [MQTT secret storage](https://github.com/awesome-harmonyos/harmonyos/blob/master/Huawei_LiteOS/components/connectivity/agent_tiny/atiny_mqtt/flash_manager.c): `Huawei_LiteOS/components/connectivity/agent_tiny/atiny_mqtt/flash_manager.c`

### Firmware update

- [FOTA manager](https://github.com/awesome-harmonyos/harmonyos/blob/master/Huawei_LiteOS/components/connectivity/agent_tiny/atiny_lwm2m/atiny_fota_manager.c): `Huawei_LiteOS/components/connectivity/agent_tiny/atiny_lwm2m/atiny_fota_manager.c`
- [Firmware object](https://github.com/awesome-harmonyos/harmonyos/blob/master/Huawei_LiteOS/components/connectivity/agent_tiny/atiny_lwm2m/object_firmware.c): `Huawei_LiteOS/components/connectivity/agent_tiny/atiny_lwm2m/object_firmware.c`
- [OTA flags](https://github.com/awesome-harmonyos/harmonyos/blob/master/Huawei_LiteOS/components/ota/flag_operate/flag_manager.c): `Huawei_LiteOS/components/ota/flag_operate/flag_manager.c`

### Filesystems

- [Virtual filesystem](https://github.com/awesome-harmonyos/harmonyos/blob/master/Huawei_LiteOS/components/fs/vfs/los_vfs.c): `Huawei_LiteOS/components/fs/vfs/los_vfs.c`
- [FAT filesystem](https://github.com/awesome-harmonyos/harmonyos/blob/master/Huawei_LiteOS/components/fs/fatfs/los_fatfs.c): `Huawei_LiteOS/components/fs/fatfs/los_fatfs.c`
- [SPI flash filesystem](https://github.com/awesome-harmonyos/harmonyos/blob/master/Huawei_LiteOS/components/fs/spiffs/los_spiffs.c): `Huawei_LiteOS/components/fs/spiffs/los_spiffs.c`

### Other components

- **IoT server**
- **Device flash**

## Connections

- Board startup → LiteOS kernel: initializes
- LiteOS kernel → ARM hardware support: uses hardware
- Board startup → lwIP networking: initializes
- Tiny LwM2M agent → LwM2M protocol: uses protocol
- Tiny LwM2M agent → IoT server: exchanges data
- LwM2M protocol → IoT server: sends protocol
- FOTA manager → OTA flags: initializes flags
- FOTA manager → LwM2M protocol: updates resource
- Firmware object → FOTA manager: manages update
- FOTA manager → Device flash: reads/writes flags
- Tiny MQTT client → MQTT client library: uses client
- Tiny MQTT client → MQTT secret storage: stores secrets
- MQTT secret storage → Device flash: reads/writes secrets
- Tiny LwM2M agent → lwIP networking: uses networking
- MQTT client library → lwIP networking: uses networking
- AT modem interface → lwIP networking: provides modem link
- Virtual filesystem → FAT filesystem: dispatches filesystem
- Virtual filesystem → SPI flash filesystem: dispatches filesystem
