# stmicroelectronics/stm32cubeg5 architecture

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

- Interactive diagram: https://gitdiagram.com/stmicroelectronics/stm32cubeg5
- Repository: https://github.com/stmicroelectronics/stm32cubeg5

## Overview

STM32CubeG5 is an embedded-software package for developing and debugging STM32G5 applications. Its documented package-level workflow is to use the HAL and low-layer APIs together with middleware, utilities, and part drivers; the repository also supplies board examples. The tree shows advanced provisioning and dual-slot root-of-trust examples, but no source excerpts were provided, so their internal flows and connections are not asserted.

Main entry points: [`README.md`](https://github.com/stmicroelectronics/stm32cubeg5/blob/main/README.md) (STM32CubeG5 package), [`examples`](https://github.com/stmicroelectronics/stm32cubeg5/tree/main/examples) (Board examples), [`examples/hal`](https://github.com/stmicroelectronics/stm32cubeg5/tree/main/examples/hal) (HAL APIs), [`arch`](https://github.com/stmicroelectronics/stm32cubeg5/tree/main/arch) (LL APIs)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_core["Device APIs"]
  node_hal["HAL APIs"]
  node_ll["LL APIs"]
  node_cmsis["CMSIS support"]
  node_cmsis_dsp["CMSIS-DSP"]
end

subgraph group_components["Reusable Components"]
  node_middleware["Middleware"]
  node_utilities["Utilities"]
  node_drivers["Part drivers"]
end

subgraph group_examples["Board Examples"]
  node_examples["Board examples"]
  node_da_example["Device provisioning"]
  node_rot_example["Dual-slot RoT"]
  node_hwcrypto_example["Hardware-crypto RoT"]
end

node_developer(("Application developer"))
node_package["STM32CubeG5 package<br/>[README.md]"]

node_developer -->|"uses to develop"| node_package
node_package -->|"includes HAL"| node_hal
node_package -->|"includes LL"| node_ll
node_package -->|"includes middleware"| node_middleware
node_package -->|"includes utilities"| node_utilities
node_package -->|"includes drivers"| node_drivers
node_package -->|"supplies examples"| node_examples
node_examples -.-> node_da_example
node_examples -.-> node_rot_example
node_examples -.-> node_hwcrypto_example
node_package -.-> node_cmsis
node_package -.-> node_cmsis_dsp

click node_package "https://github.com/stmicroelectronics/stm32cubeg5/blob/main/README.md"
click node_hal "https://github.com/stmicroelectronics/stm32cubeg5/tree/main/examples/hal"
click node_ll "https://github.com/stmicroelectronics/stm32cubeg5/tree/main/arch"
click node_cmsis "https://github.com/stmicroelectronics/stm32cubeg5/tree/main/arch/cmsis"
click node_cmsis_dsp "https://github.com/stmicroelectronics/stm32cubeg5/tree/main/arch/cmsis_dsp"
click node_middleware "https://github.com/stmicroelectronics/stm32cubeg5/tree/main/middleware"
click node_utilities "https://github.com/stmicroelectronics/stm32cubeg5/tree/main/utilities"
click node_drivers "https://github.com/stmicroelectronics/stm32cubeg5/tree/main/part_drivers"
click node_examples "https://github.com/stmicroelectronics/stm32cubeg5/tree/main/examples"
click node_da_example "https://github.com/stmicroelectronics/stm32cubeg5/tree/main/examples/advanced/da/stda"
click node_rot_example "https://github.com/stmicroelectronics/stm32cubeg5/tree/main/examples/advanced/rot/oemirot_dualslot"
click node_hwcrypto_example "https://github.com/stmicroelectronics/stm32cubeg5/tree/main/examples/advanced/rot/oemirot_dualslot_hwcrypto"

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_hal,node_ll,node_cmsis,node_cmsis_dsp toneBlue
class node_middleware,node_utilities,node_drivers toneAmber
class node_examples,node_da_example,node_rot_example,node_hwcrypto_example toneMint
class node_developer toneIndigo
class node_package toneTeal
```

## Components

### Device APIs

- [HAL APIs](https://github.com/stmicroelectronics/stm32cubeg5/tree/main/examples/hal): `examples/hal`
- [LL APIs](https://github.com/stmicroelectronics/stm32cubeg5/tree/main/arch): `arch`
- [CMSIS support](https://github.com/stmicroelectronics/stm32cubeg5/tree/main/arch/cmsis): `arch/cmsis`
- [CMSIS-DSP](https://github.com/stmicroelectronics/stm32cubeg5/tree/main/arch/cmsis_dsp): `arch/cmsis_dsp`

### Reusable Components

- [Middleware](https://github.com/stmicroelectronics/stm32cubeg5/tree/main/middleware): `middleware`
- [Utilities](https://github.com/stmicroelectronics/stm32cubeg5/tree/main/utilities): `utilities`
- [Part drivers](https://github.com/stmicroelectronics/stm32cubeg5/tree/main/part_drivers): `part_drivers`

### Board Examples

- [Board examples](https://github.com/stmicroelectronics/stm32cubeg5/tree/main/examples): `examples`
- [Device provisioning](https://github.com/stmicroelectronics/stm32cubeg5/tree/main/examples/advanced/da/stda): `examples/advanced/da/stda`
- [Dual-slot RoT](https://github.com/stmicroelectronics/stm32cubeg5/tree/main/examples/advanced/rot/oemirot_dualslot): `examples/advanced/rot/oemirot_dualslot`
- [Hardware-crypto RoT](https://github.com/stmicroelectronics/stm32cubeg5/tree/main/examples/advanced/rot/oemirot_dualslot_hwcrypto): `examples/advanced/rot/oemirot_dualslot_hwcrypto`

### Other components

- **Application developer**
- [STM32CubeG5 package](https://github.com/stmicroelectronics/stm32cubeg5/blob/main/README.md): `README.md`

## Connections

- Application developer → STM32CubeG5 package: uses to develop (evidence: `README.md`)
- STM32CubeG5 package → HAL APIs: includes HAL (evidence: `README.md`)
- STM32CubeG5 package → LL APIs: includes LL (evidence: `README.md`)
- STM32CubeG5 package → Middleware: includes middleware (evidence: `README.md`)
- STM32CubeG5 package → Utilities: includes utilities (evidence: `README.md`)
- STM32CubeG5 package → Part drivers: includes drivers (evidence: `README.md`)
- STM32CubeG5 package → Board examples: supplies examples (evidence: `README.md`)
- Board examples → Device provisioning
- Board examples → Dual-slot RoT
- Board examples → Hardware-crypto RoT
- STM32CubeG5 package → CMSIS support
- STM32CubeG5 package → CMSIS-DSP
