# rajssss/arm_bare-metal architecture

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

- Interactive diagram: https://gitdiagram.com/rajssss/arm_bare-metal
- Repository: https://github.com/rajssss/arm_bare-metal

## Overview

This repository is a collection of five independent bare-metal STM32F446RE-Nucleo learning programs, not one application pipeline. Their workflows range from emitting SWD debug text and reporting Cortex-M4 type sizes to blinking an LED and reacting to GPIO input. The GPIO peripheral example adds register-layout types as an internal API layer. The excerpts show the GPIO behavior and SWD syscall implementation; the README documents the programs’ purposes. Hardware and console links are limited to relationships supported by those sources.

Main entry points: [`001HelloWorld/Src/main.c`](https://github.com/rajssss/arm_bare-metal/blob/master/001HelloWorld/Src/main.c) (Hello World), [`002Sizeof/Src/main.c`](https://github.com/rajssss/arm_bare-metal/blob/master/002Sizeof/Src/main.c) (Type sizes), [`005GPIOPeripheral/Src/main.c`](https://github.com/rajssss/arm_bare-metal/blob/master/005GPIOPeripheral/Src/main.c) (GPIO API example), [`001HelloWorld/Src/syscalls.c`](https://github.com/rajssss/arm_bare-metal/blob/master/001HelloWorld/Src/syscalls.c) (ITM output)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_debug["Debug demos"]
  node_hello["Hello World<br/>[main.c]"]
  node_sizeof["Type sizes<br/>[main.c]"]
  node_itm["ITM output<br/>[syscalls.c]"]
end

subgraph group_gpio["GPIO exercises"]
  node_led["LED blink<br/>[main.c]"]
  node_pincontrol["Pin input control<br/>[main.c]"]
end

subgraph group_api["GPIO API"]
  node_gpioexample["GPIO API example<br/>[main.c]"]
  node_registertypes["Register types<br/>[GPIOPeripheral.h]"]
end

node_reset(("Board startup"))
node_console(("SWD console"))
node_board["STM32F446RE board"]

node_reset -->|"starts"| node_hello
node_reset -->|"starts"| node_sizeof
node_reset -->|"starts"| node_led
node_reset -->|"starts"| node_pincontrol
node_reset -->|"starts"| node_gpioexample
node_hello -.->|"prints through"| node_itm
node_sizeof -->|"prints through"| node_itm
node_itm -->|"sends characters"| node_console
node_hello -->|"demonstrates SWD"| node_console
node_sizeof -->|"reports sizes"| node_console
node_led -->|"toggles LED"| node_board
node_pincontrol -->|"reads and drives pins"| node_board
node_gpioexample -->|"uses types"| node_registertypes
node_gpioexample -->|"reads and drives pins"| node_board

click node_hello "https://github.com/rajssss/arm_bare-metal/blob/master/001HelloWorld/Src/main.c"
click node_sizeof "https://github.com/rajssss/arm_bare-metal/blob/master/002Sizeof/Src/main.c"
click node_itm "https://github.com/rajssss/arm_bare-metal/blob/master/001HelloWorld/Src/syscalls.c"
click node_led "https://github.com/rajssss/arm_bare-metal/blob/master/003LEDControl/Src/main.c"
click node_pincontrol "https://github.com/rajssss/arm_bare-metal/blob/master/004PinControl/Src/main.c"
click node_gpioexample "https://github.com/rajssss/arm_bare-metal/blob/master/005GPIOPeripheral/Src/main.c"
click node_registertypes "https://github.com/rajssss/arm_bare-metal/blob/master/005GPIOPeripheral/Inc/GPIOPeripheral.h"

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_hello,node_sizeof,node_itm toneBlue
class node_led,node_pincontrol toneAmber
class node_gpioexample,node_registertypes toneMint
class node_reset,node_console,node_board toneIndigo
```

## Components

### Debug demos

- [Hello World](https://github.com/rajssss/arm_bare-metal/blob/master/001HelloWorld/Src/main.c): `001HelloWorld/Src/main.c`
- [Type sizes](https://github.com/rajssss/arm_bare-metal/blob/master/002Sizeof/Src/main.c): `002Sizeof/Src/main.c`
- [ITM output](https://github.com/rajssss/arm_bare-metal/blob/master/001HelloWorld/Src/syscalls.c): `001HelloWorld/Src/syscalls.c`

### GPIO exercises

- [LED blink](https://github.com/rajssss/arm_bare-metal/blob/master/003LEDControl/Src/main.c): `003LEDControl/Src/main.c`
- [Pin input control](https://github.com/rajssss/arm_bare-metal/blob/master/004PinControl/Src/main.c): `004PinControl/Src/main.c`

### GPIO API

- [GPIO API example](https://github.com/rajssss/arm_bare-metal/blob/master/005GPIOPeripheral/Src/main.c): `005GPIOPeripheral/Src/main.c`
- [Register types](https://github.com/rajssss/arm_bare-metal/blob/master/005GPIOPeripheral/Inc/GPIOPeripheral.h): `005GPIOPeripheral/Inc/GPIOPeripheral.h`

### Other components

- **Board startup**
- **SWD console**
- **STM32F446RE board**

## Connections

- Board startup → Hello World: starts (evidence: `README.md`)
- Board startup → Type sizes: starts (evidence: `README.md`)
- Board startup → LED blink: starts (evidence: `README.md`)
- Board startup → Pin input control: starts (evidence: `README.md`)
- Board startup → GPIO API example: starts (evidence: `README.md`)
- Hello World → ITM output: prints through
- Type sizes → ITM output: prints through (evidence: `002Sizeof/Src/main.c`)
- ITM output → SWD console: sends characters (evidence: `001HelloWorld/Src/syscalls.c`)
- Hello World → SWD console: demonstrates SWD (evidence: `README.md`)
- Type sizes → SWD console: reports sizes (evidence: `README.md`)
- LED blink → STM32F446RE board: toggles LED (evidence: `003LEDControl/Src/main.c`)
- Pin input control → STM32F446RE board: reads and drives pins (evidence: `004PinControl/Src/main.c`)
- GPIO API example → Register types: uses types (evidence: `005GPIOPeripheral/Src/main.c`)
- GPIO API example → STM32F446RE board: reads and drives pins (evidence: `005GPIOPeripheral/Src/main.c`)
