# yacineamara/rtos architecture

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

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

## Overview

This is bare-metal STM32F446 firmware with a simple main loop: initialize the FPU and GPIO, USART2, and SysTick, then delay, toggle a GPIO output, and print a message. The repository also includes STM32 device definitions and a broad CMSIS core-header collection. The main-loop calls are visible in `Src/main.c`; peripheral implementation details are only partially sampled, so relationships beyond those calls are omitted.

Main entry points: [`Src/main.c`](https://github.com/yacineamara/rtos/blob/main/Src/main.c) (Firmware loop), [`Drivers/CMSIS/Include`](https://github.com/yacineamara/rtos/tree/main/Drivers/CMSIS/Include) (Cortex core headers), [`Src/timer.c`](https://github.com/yacineamara/rtos/blob/main/Src/timer.c) (Timer and SysTick), [`Drivers/CMSIS/Include/cmsis_compiler.h`](https://github.com/yacineamara/rtos/blob/main/Drivers/CMSIS/Include/cmsis_compiler.h) (Compiler abstraction)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_firmware["Firmware"]
  node_boot["Firmware loop<br/>[main.c]"]
  node_utilities["FPU utilities<br/>[util.c]"]
end

subgraph group_peripherals["Peripheral drivers"]
  node_gpio["GPIO control<br/>[gpio.c]"]
  node_timer["Timer and SysTick<br/>[timer.c]"]
  node_serial["USART2<br/>[usart.c]"]
  node_interrupts["Interrupt handling<br/>[interrupt.c]"]
end

subgraph group_cmsis["CMSIS platform"]
  node_device["STM32F446 definitions<br/>[stm32f446xx.h]"]
  node_system["STM32 system support<br/>[system_stm32f4xx.h]"]
  node_compiler["Compiler abstraction<br/>[cmsis_compiler.h]"]
  node_compiler_backends["Compiler backends"]
  node_cmsis_version["CMSIS version<br/>[cmsis_version.h]"]
  node_core_headers["Cortex core headers"]
  node_mpu_headers["MPU support"]
end

node_mcu(("STM32F446 MCU"))

node_boot -->|"initializes FPU"| node_utilities
node_boot -->|"initializes and toggles"| node_gpio
node_boot -->|"initializes USART"| node_serial
node_boot -->|"initializes and delays"| node_timer
node_interrupts -->|"uses definitions"| node_device
node_timer -->|"uses definitions"| node_device
node_compiler -->|"selects backend"| node_compiler_backends
node_core_headers -->|"uses abstraction"| node_compiler
node_core_headers -->|"uses version"| node_cmsis_version
node_core_headers -->|"uses MPU support"| node_mpu_headers
node_boot -->|"controls"| node_mcu

click node_boot "https://github.com/yacineamara/rtos/blob/main/Src/main.c"
click node_gpio "https://github.com/yacineamara/rtos/blob/main/Src/gpio.c"
click node_timer "https://github.com/yacineamara/rtos/blob/main/Src/timer.c"
click node_serial "https://github.com/yacineamara/rtos/blob/main/Src/usart.c"
click node_utilities "https://github.com/yacineamara/rtos/blob/main/Src/util.c"
click node_interrupts "https://github.com/yacineamara/rtos/blob/main/Src/interrupt.c"
click node_device "https://github.com/yacineamara/rtos/blob/main/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f446xx.h"
click node_system "https://github.com/yacineamara/rtos/blob/main/Drivers/CMSIS/Device/ST/STM32F4xx/Include/system_stm32f4xx.h"
click node_compiler "https://github.com/yacineamara/rtos/blob/main/Drivers/CMSIS/Include/cmsis_compiler.h"
click node_compiler_backends "https://github.com/yacineamara/rtos/tree/main/Drivers/CMSIS/Include"
click node_cmsis_version "https://github.com/yacineamara/rtos/blob/main/Drivers/CMSIS/Include/cmsis_version.h"
click node_core_headers "https://github.com/yacineamara/rtos/tree/main/Drivers/CMSIS/Include"
click node_mpu_headers "https://github.com/yacineamara/rtos/tree/main/Drivers/CMSIS/Include"

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_boot,node_utilities toneBlue
class node_gpio,node_timer,node_serial,node_interrupts toneAmber
class node_device,node_system,node_compiler,node_compiler_backends,node_cmsis_version,node_core_headers,node_mpu_headers toneMint
class node_mcu toneIndigo
```

## Components

### Firmware

- [Firmware loop](https://github.com/yacineamara/rtos/blob/main/Src/main.c): `Src/main.c`
- [FPU utilities](https://github.com/yacineamara/rtos/blob/main/Src/util.c): `Src/util.c`

### Peripheral drivers

- [GPIO control](https://github.com/yacineamara/rtos/blob/main/Src/gpio.c): `Src/gpio.c`
- [Timer and SysTick](https://github.com/yacineamara/rtos/blob/main/Src/timer.c): `Src/timer.c`
- [USART2](https://github.com/yacineamara/rtos/blob/main/Src/usart.c): `Src/usart.c`
- [Interrupt handling](https://github.com/yacineamara/rtos/blob/main/Src/interrupt.c): `Src/interrupt.c`

### CMSIS platform

- [STM32F446 definitions](https://github.com/yacineamara/rtos/blob/main/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f446xx.h): `Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f446xx.h`
- [STM32 system support](https://github.com/yacineamara/rtos/blob/main/Drivers/CMSIS/Device/ST/STM32F4xx/Include/system_stm32f4xx.h): `Drivers/CMSIS/Device/ST/STM32F4xx/Include/system_stm32f4xx.h`
- [Compiler abstraction](https://github.com/yacineamara/rtos/blob/main/Drivers/CMSIS/Include/cmsis_compiler.h): `Drivers/CMSIS/Include/cmsis_compiler.h`
- [Compiler backends](https://github.com/yacineamara/rtos/tree/main/Drivers/CMSIS/Include): `Drivers/CMSIS/Include`
- [CMSIS version](https://github.com/yacineamara/rtos/blob/main/Drivers/CMSIS/Include/cmsis_version.h): `Drivers/CMSIS/Include/cmsis_version.h`
- [Cortex core headers](https://github.com/yacineamara/rtos/tree/main/Drivers/CMSIS/Include): `Drivers/CMSIS/Include`
- [MPU support](https://github.com/yacineamara/rtos/tree/main/Drivers/CMSIS/Include): `Drivers/CMSIS/Include`

### Other components

- **STM32F446 MCU**

## Connections

- Firmware loop → FPU utilities: initializes FPU (evidence: `Src/main.c`)
- Firmware loop → GPIO control: initializes and toggles (evidence: `Src/main.c`)
- Firmware loop → USART2: initializes USART (evidence: `Src/main.c`)
- Firmware loop → Timer and SysTick: initializes and delays (evidence: `Src/main.c`)
- Interrupt handling → STM32F446 definitions: uses definitions (evidence: `Src/interrupt.c`)
- Timer and SysTick → STM32F446 definitions: uses definitions (evidence: `Src/timer.c`)
- Compiler abstraction → Compiler backends: selects backend (evidence: `Drivers/CMSIS/Include/cmsis_compiler.h`)
- Cortex core headers → Compiler abstraction: uses abstraction (evidence: `Drivers/CMSIS/Include/core_cm33.h`)
- Cortex core headers → CMSIS version: uses version (evidence: `Drivers/CMSIS/Include/core_cm33.h`)
- Cortex core headers → MPU support: uses MPU support (evidence: `Drivers/CMSIS/Include/core_cm33.h`)
- Firmware loop → STM32F446 MCU: controls (evidence: `Src/main.c`)
