# alifsemi/sdk-alif architecture

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

- Interactive diagram: https://gitdiagram.com/alifsemi/sdk-alif
- Repository: https://github.com/alifsemi/sdk-alif

## Overview

The Alif Semiconductor Zephyr SDK is a platform codebase for building real-time applications on Alif devices. Its clearest end-to-end runtime example is the BLE test application: startup configures power, initializes the BLE stack, starts advertising, and then waits while monitoring connection state. The repository also includes independent Matter, IEEE 802.15.4, LE Audio, and Ethos-U capabilities, plus device drivers and display support. Those branches are shown as separate subsystems where sampled evidence does not establish runtime wiring; several are represented by directory paths because their implementation was not excerpted.

Main entry points: [`applications/bletestapp/src/ble_handler.c`](https://github.com/alifsemi/sdk-alif/blob/main/applications/bletestapp/src/ble_handler.c) (BLE service and GAP), [`applications/bletestapp/src/main.c`](https://github.com/alifsemi/sdk-alif/blob/main/applications/bletestapp/src/main.c) (BLE startup loop), [`subsys/modules/ethosu/shell/src/ethosu_shell.cpp`](https://github.com/alifsemi/sdk-alif/blob/main/subsys/modules/ethosu/shell/src/ethosu_shell.cpp) (Ethos-U shell), [`subsys/bluetooth/le_audio`](https://github.com/alifsemi/sdk-alif/tree/main/subsys/bluetooth/le_audio) (LE Audio pipeline)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ble["BLE application"]
  node_blemain["BLE startup loop<br/>[main.c]"]
  node_blehandler["BLE service and GAP<br/>[ble_handler.c]"]
  node_bleshell["BLE shell<br/>[appl_shell.h]"]
  node_blepower["Application power<br/>[power_mgr.c]"]
end

subgraph group_connectivity["Connectivity subsystems"]
  node_blegap["GAPM API<br/>[gapm_api.c]"]
  node_blestorage[("BLE settings storage<br/>[ble_storage.c]")]
  node_btshell["Bluetooth shell<br/>[bt.c]"]
  node_blehost["Advertising services"]
  node_leaudio["LE Audio pipeline"]
  node_ieee["IEEE 802.15.4 messaging<br/>[ahi_msg_lib.c]"]
  node_ieeeshell["802.15.4 shell<br/>[ieee802154_shell.c]"]
end

subgraph group_matter["Matter"]
  node_matterstack["Matter stack<br/>[MatterStack.cpp]"]
  node_binding["Matter binding<br/>[BindingHandler.cpp]"]
  node_icd["ICD subscriptions<br/>[icdHandler.cpp]"]
  node_pwm["Matter PWM device<br/>[PWMDevice.cpp]"]
  node_matterui["Matter UI<br/>[MatterUi.cpp]"]
end

subgraph group_audio["Audio and devices"]
  node_audioenc["Audio encoding<br/>[audio_encoder.c]"]
  node_audiodec["Audio decoding<br/>[audio_decoder.c]"]
  node_i2s["Synchronized I2S<br/>[i2s_sync.c]"]
  node_codec["WM8904 codec<br/>[wm8904.c]"]
  node_clock["SI570 clock<br/>[si570.c]"]
  node_display["Buffered display<br/>[display.c]"]
end

subgraph group_ml["Edge inference"]
  node_ethoshell["Ethos-U shell<br/>[ethosu_shell.cpp]"]
  node_inference["Inference runner"]
  node_model["Keyword spotting models<br/>[model_u55_128.h]"]
  node_bertmodel["BERT Tiny model<br/>[model_u85_256.c]"]
end

node_developer(("Developer"))

node_developer -.->|"starts"| node_blemain
node_blemain -->|"configures power"| node_blepower
node_blemain -->|"waits for input"| node_bleshell
node_blemain -->|"initializes and starts"| node_blehandler
node_blehandler -->|"configures GAP"| node_blegap
node_blehandler -->|"sets advertising data"| node_blehost
node_btshell -.->|"controls BLE"| node_blehandler
node_blehandler -.->|"persists bonds"| node_blestorage
node_leaudio -.->|"encodes audio"| node_audioenc
node_leaudio -.->|"decodes audio"| node_audiodec
node_developer -.->|"uses SDK"| node_matterstack
node_icd -->|"updates subscription state"| node_matterstack
node_developer -.->|"uses SDK"| node_ieee
node_developer -.->|"runs inference"| node_ethoshell
node_ethoshell -->|"runs jobs"| node_inference
node_ethoshell -->|"loads model data"| node_model
node_ethoshell -.->|"selects model"| node_bertmodel

click node_blemain "https://github.com/alifsemi/sdk-alif/blob/main/applications/bletestapp/src/main.c"
click node_blehandler "https://github.com/alifsemi/sdk-alif/blob/main/applications/bletestapp/src/ble_handler.c"
click node_bleshell "https://github.com/alifsemi/sdk-alif/blob/main/applications/bletestapp/src/appl_shell.h"
click node_blepower "https://github.com/alifsemi/sdk-alif/blob/main/applications/bletestapp/src/power_mgr.c"
click node_blegap "https://github.com/alifsemi/sdk-alif/blob/main/subsys/bluetooth/common/gapm_api.c"
click node_blestorage "https://github.com/alifsemi/sdk-alif/blob/main/subsys/bluetooth/common/ble_storage.c"
click node_btshell "https://github.com/alifsemi/sdk-alif/blob/main/subsys/bluetooth/shell/bt.c"
click node_blehost "https://github.com/alifsemi/sdk-alif/tree/main/subsys/bluetooth/host"
click node_leaudio "https://github.com/alifsemi/sdk-alif/tree/main/subsys/bluetooth/le_audio"
click node_ieee "https://github.com/alifsemi/sdk-alif/blob/main/subsys/ieee802154/msglib/src/ahi_msg_lib.c"
click node_ieeeshell "https://github.com/alifsemi/sdk-alif/blob/main/subsys/ieee802154/shell/src/ieee802154_shell.c"
click node_matterstack "https://github.com/alifsemi/sdk-alif/blob/main/subsys/matter/common/MatterStack.cpp"
click node_binding "https://github.com/alifsemi/sdk-alif/blob/main/subsys/matter/binding/BindingHandler.cpp"
click node_icd "https://github.com/alifsemi/sdk-alif/blob/main/subsys/matter/icd/icdHandler.cpp"
click node_pwm "https://github.com/alifsemi/sdk-alif/blob/main/subsys/matter/pwmdevice/PWMDevice.cpp"
click node_matterui "https://github.com/alifsemi/sdk-alif/blob/main/subsys/matter/common/MatterUi.cpp"
click node_audioenc "https://github.com/alifsemi/sdk-alif/blob/main/subsys/bluetooth/le_audio/audio_encoder.c"
click node_audiodec "https://github.com/alifsemi/sdk-alif/blob/main/subsys/bluetooth/le_audio/audio_decoder.c"
click node_i2s "https://github.com/alifsemi/sdk-alif/blob/main/drivers/i2s/i2s_sync/i2s_sync.c"
click node_codec "https://github.com/alifsemi/sdk-alif/blob/main/drivers/codec/wm8904/wm8904.c"
click node_clock "https://github.com/alifsemi/sdk-alif/blob/main/drivers/clock/si570/si570.c"
click node_display "https://github.com/alifsemi/sdk-alif/blob/main/subsys/dbuf_display/display.c"
click node_ethoshell "https://github.com/alifsemi/sdk-alif/blob/main/subsys/modules/ethosu/shell/src/ethosu_shell.cpp"
click node_inference "https://github.com/alifsemi/sdk-alif/blob/main/lib/ethosu_utils/inference_process.cpp"
click node_model "https://github.com/alifsemi/sdk-alif/blob/main/include/ethosu/models/keyword_spotting_cnn_small_int8/u55/model_u55_128.h"
click node_bertmodel "https://github.com/alifsemi/sdk-alif/blob/main/include/ethosu/models/bert_tiny/u85/model_u85_256.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_blemain,node_blehandler,node_bleshell,node_blepower toneBlue
class node_blegap,node_blestorage,node_btshell,node_blehost,node_leaudio,node_ieee,node_ieeeshell toneAmber
class node_matterstack,node_binding,node_icd,node_pwm,node_matterui toneMint
class node_audioenc,node_audiodec,node_i2s,node_codec,node_clock,node_display toneRose
class node_ethoshell,node_inference,node_model,node_bertmodel,node_developer toneIndigo
```

## Components

### BLE application

- [BLE startup loop](https://github.com/alifsemi/sdk-alif/blob/main/applications/bletestapp/src/main.c): `applications/bletestapp/src/main.c`
- [BLE service and GAP](https://github.com/alifsemi/sdk-alif/blob/main/applications/bletestapp/src/ble_handler.c): `applications/bletestapp/src/ble_handler.c`
- [BLE shell](https://github.com/alifsemi/sdk-alif/blob/main/applications/bletestapp/src/appl_shell.h): `applications/bletestapp/src/appl_shell.h`
- [Application power](https://github.com/alifsemi/sdk-alif/blob/main/applications/bletestapp/src/power_mgr.c): `applications/bletestapp/src/power_mgr.c`

### Connectivity subsystems

- [GAPM API](https://github.com/alifsemi/sdk-alif/blob/main/subsys/bluetooth/common/gapm_api.c): `subsys/bluetooth/common/gapm_api.c`
- [BLE settings storage](https://github.com/alifsemi/sdk-alif/blob/main/subsys/bluetooth/common/ble_storage.c): `subsys/bluetooth/common/ble_storage.c`
- [Bluetooth shell](https://github.com/alifsemi/sdk-alif/blob/main/subsys/bluetooth/shell/bt.c): `subsys/bluetooth/shell/bt.c`
- [Advertising services](https://github.com/alifsemi/sdk-alif/tree/main/subsys/bluetooth/host): `subsys/bluetooth/host`
- [LE Audio pipeline](https://github.com/alifsemi/sdk-alif/tree/main/subsys/bluetooth/le_audio): `subsys/bluetooth/le_audio`
- [IEEE 802.15.4 messaging](https://github.com/alifsemi/sdk-alif/blob/main/subsys/ieee802154/msglib/src/ahi_msg_lib.c): `subsys/ieee802154/msglib/src/ahi_msg_lib.c`
- [802.15.4 shell](https://github.com/alifsemi/sdk-alif/blob/main/subsys/ieee802154/shell/src/ieee802154_shell.c): `subsys/ieee802154/shell/src/ieee802154_shell.c`

### Matter

- [Matter stack](https://github.com/alifsemi/sdk-alif/blob/main/subsys/matter/common/MatterStack.cpp): `subsys/matter/common/MatterStack.cpp`
- [Matter binding](https://github.com/alifsemi/sdk-alif/blob/main/subsys/matter/binding/BindingHandler.cpp): `subsys/matter/binding/BindingHandler.cpp`
- [ICD subscriptions](https://github.com/alifsemi/sdk-alif/blob/main/subsys/matter/icd/icdHandler.cpp): `subsys/matter/icd/icdHandler.cpp`
- [Matter PWM device](https://github.com/alifsemi/sdk-alif/blob/main/subsys/matter/pwmdevice/PWMDevice.cpp): `subsys/matter/pwmdevice/PWMDevice.cpp`
- [Matter UI](https://github.com/alifsemi/sdk-alif/blob/main/subsys/matter/common/MatterUi.cpp): `subsys/matter/common/MatterUi.cpp`

### Audio and devices

- [Audio encoding](https://github.com/alifsemi/sdk-alif/blob/main/subsys/bluetooth/le_audio/audio_encoder.c): `subsys/bluetooth/le_audio/audio_encoder.c`
- [Audio decoding](https://github.com/alifsemi/sdk-alif/blob/main/subsys/bluetooth/le_audio/audio_decoder.c): `subsys/bluetooth/le_audio/audio_decoder.c`
- [Synchronized I2S](https://github.com/alifsemi/sdk-alif/blob/main/drivers/i2s/i2s_sync/i2s_sync.c): `drivers/i2s/i2s_sync/i2s_sync.c`
- [WM8904 codec](https://github.com/alifsemi/sdk-alif/blob/main/drivers/codec/wm8904/wm8904.c): `drivers/codec/wm8904/wm8904.c`
- [SI570 clock](https://github.com/alifsemi/sdk-alif/blob/main/drivers/clock/si570/si570.c): `drivers/clock/si570/si570.c`
- [Buffered display](https://github.com/alifsemi/sdk-alif/blob/main/subsys/dbuf_display/display.c): `subsys/dbuf_display/display.c`

### Edge inference

- [Ethos-U shell](https://github.com/alifsemi/sdk-alif/blob/main/subsys/modules/ethosu/shell/src/ethosu_shell.cpp): `subsys/modules/ethosu/shell/src/ethosu_shell.cpp`
- [Inference runner](https://github.com/alifsemi/sdk-alif/blob/main/lib/ethosu_utils/inference_process.cpp): `lib/ethosu_utils/inference_process.cpp`
- [Keyword spotting models](https://github.com/alifsemi/sdk-alif/blob/main/include/ethosu/models/keyword_spotting_cnn_small_int8/u55/model_u55_128.h): `include/ethosu/models/keyword_spotting_cnn_small_int8/u55/model_u55_128.h`
- [BERT Tiny model](https://github.com/alifsemi/sdk-alif/blob/main/include/ethosu/models/bert_tiny/u85/model_u85_256.c): `include/ethosu/models/bert_tiny/u85/model_u85_256.c`

### Other components

- **Developer**

## Connections

- Developer → BLE startup loop: starts
- BLE startup loop → Application power: configures power (evidence: `applications/bletestapp/src/main.c`)
- BLE startup loop → BLE shell: waits for input (evidence: `applications/bletestapp/src/main.c`)
- BLE startup loop → BLE service and GAP: initializes and starts (evidence: `applications/bletestapp/src/main.c`)
- BLE service and GAP → GAPM API: configures GAP (evidence: `applications/bletestapp/src/ble_handler.c`)
- BLE service and GAP → Advertising services: sets advertising data (evidence: `applications/bletestapp/src/ble_handler.c`)
- Bluetooth shell → BLE service and GAP: controls BLE
- BLE service and GAP → BLE settings storage: persists bonds
- LE Audio pipeline → Audio encoding: encodes audio
- LE Audio pipeline → Audio decoding: decodes audio
- Developer → Matter stack: uses SDK
- ICD subscriptions → Matter stack: updates subscription state (evidence: `subsys/matter/icd/icdHandler.cpp`)
- Developer → IEEE 802.15.4 messaging: uses SDK
- Developer → Ethos-U shell: runs inference
- Ethos-U shell → Inference runner: runs jobs (evidence: `subsys/modules/ethosu/shell/src/ethosu_shell.cpp`)
- Ethos-U shell → Keyword spotting models: loads model data (evidence: `subsys/modules/ethosu/shell/src/ethosu_shell.cpp`)
- Ethos-U shell → BERT Tiny model: selects model
