# youssef-fd/stm32f429-bootloader architecture

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

- Interactive diagram: https://gitdiagram.com/youssef-fd/stm32f429-bootloader
- Repository: https://github.com/youssef-fd/stm32f429-bootloader

## Overview

This repository contains two independent STM32F429 firmware images: a reset-time bootloader and a demo application. The principal workflow is bootloader initialization and UART status reporting, a user-button decision that can hold execution in the loader, then a reset-state handoff to the application, which runs its LED demo. The map includes the documented CRC and application-version capabilities. The README supports the handoff and flash-layout relationships; source excerpts are partial, so unsampled application behavior is represented only as documented.

Main entry points: [`Stm32f429_Bootloader/Core/Src/main.c`](https://github.com/youssef-fd/stm32f429-bootloader/blob/main/Stm32f429_Bootloader/Core/Src/main.c) (Boot sequence), [`Stm32f429_Application/Core/Src/main.c`](https://github.com/youssef-fd/stm32f429-bootloader/blob/main/Stm32f429_Application/Core/Src/main.c) (Application demo), [`Stm32f429_Application/Drivers/BSP/STM32F429I-Discovery/stm32f429i_discovery.c`](https://github.com/youssef-fd/stm32f429-bootloader/blob/main/Stm32f429_Application/Drivers/BSP/STM32F429I-Discovery/stm32f429i_discovery.c) (Board button and LEDs), [`Stm32f429_Application/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal.h`](https://github.com/youssef-fd/stm32f429-bootloader/blob/main/Stm32f429_Application/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal.h) (STM32 HAL)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_boot["Bootloader"]
  node_boot_main["Boot sequence<br/>[main.c]"]
  node_boot_button["Button override<br/>[main.c]"]
  node_handoff["Application handoff<br/>[main.c]"]
  node_crc["CRC readiness<br/>[main.c]"]
end

subgraph group_app["Demo application"]
  node_app_main["Application demo<br/>[main.c]"]
  node_app_version["Application version<br/>[main.c]"]
end

subgraph group_platform["Board and hardware"]
  node_flash_images[("Flash image regions")]
  node_uart["USART1 terminal"]
  node_board_io["Board button and LEDs"]
  node_hal["STM32 HAL<br/>[stm32f4xx_hal.h]"]
end

node_reset(("Reset"))

node_reset -->|"starts"| node_boot_main
node_boot_main -.->|"logs status"| node_uart
node_boot_main -.->|"checks button"| node_board_io
node_board_io -.->|"button state"| node_boot_button
node_boot_button -.->|"launches if released"| node_handoff
node_boot_button -.->|"reports hold"| node_uart
node_boot_main -.->|"dispatches"| node_handoff
node_handoff -->|"jumps to reset handler"| node_app_main
node_handoff -->|"reads app vector"| node_flash_images
node_flash_images -->|"stores image at offset"| node_app_main
node_app_main -.->|"logs demo"| node_uart
node_app_main -.->|"blinks LED"| node_board_io
node_app_main -.->|"exposes version"| node_app_version
node_boot_main -.->|"enables peripheral"| node_crc
node_boot_main -.->|"initializes HAL"| node_hal

click node_boot_main "https://github.com/youssef-fd/stm32f429-bootloader/blob/main/Stm32f429_Bootloader/Core/Src/main.c"
click node_boot_button "https://github.com/youssef-fd/stm32f429-bootloader/blob/main/Stm32f429_Bootloader/Core/Src/main.c"
click node_handoff "https://github.com/youssef-fd/stm32f429-bootloader/blob/main/Stm32f429_Bootloader/Core/Src/main.c"
click node_crc "https://github.com/youssef-fd/stm32f429-bootloader/blob/main/Stm32f429_Bootloader/Core/Src/main.c"
click node_app_main "https://github.com/youssef-fd/stm32f429-bootloader/blob/main/Stm32f429_Application/Core/Src/main.c"
click node_app_version "https://github.com/youssef-fd/stm32f429-bootloader/blob/main/Stm32f429_Application/Core/Src/main.c"
click node_board_io "https://github.com/youssef-fd/stm32f429-bootloader/blob/main/Stm32f429_Application/Drivers/BSP/STM32F429I-Discovery/stm32f429i_discovery.c"
click node_hal "https://github.com/youssef-fd/stm32f429-bootloader/blob/main/Stm32f429_Application/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal.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_boot_main,node_boot_button,node_handoff,node_crc toneBlue
class node_app_main,node_app_version toneAmber
class node_flash_images,node_uart,node_board_io,node_hal toneMint
class node_reset toneIndigo
```

## Components

### Bootloader

- [Boot sequence](https://github.com/youssef-fd/stm32f429-bootloader/blob/main/Stm32f429_Bootloader/Core/Src/main.c): `Stm32f429_Bootloader/Core/Src/main.c`
- [Button override](https://github.com/youssef-fd/stm32f429-bootloader/blob/main/Stm32f429_Bootloader/Core/Src/main.c): `Stm32f429_Bootloader/Core/Src/main.c`
- [Application handoff](https://github.com/youssef-fd/stm32f429-bootloader/blob/main/Stm32f429_Bootloader/Core/Src/main.c): `Stm32f429_Bootloader/Core/Src/main.c`
- [CRC readiness](https://github.com/youssef-fd/stm32f429-bootloader/blob/main/Stm32f429_Bootloader/Core/Src/main.c): `Stm32f429_Bootloader/Core/Src/main.c`

### Demo application

- [Application demo](https://github.com/youssef-fd/stm32f429-bootloader/blob/main/Stm32f429_Application/Core/Src/main.c): `Stm32f429_Application/Core/Src/main.c`
- [Application version](https://github.com/youssef-fd/stm32f429-bootloader/blob/main/Stm32f429_Application/Core/Src/main.c): `Stm32f429_Application/Core/Src/main.c`

### Board and hardware

- **Flash image regions**
- **USART1 terminal**
- [Board button and LEDs](https://github.com/youssef-fd/stm32f429-bootloader/blob/main/Stm32f429_Application/Drivers/BSP/STM32F429I-Discovery/stm32f429i_discovery.c): `Stm32f429_Application/Drivers/BSP/STM32F429I-Discovery/stm32f429i_discovery.c`
- [STM32 HAL](https://github.com/youssef-fd/stm32f429-bootloader/blob/main/Stm32f429_Application/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal.h): `Stm32f429_Application/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal.h`

### Other components

- **Reset**

## Connections

- Reset → Boot sequence: starts
- Boot sequence → USART1 terminal: logs status
- Boot sequence → Board button and LEDs: checks button
- Board button and LEDs → Button override: button state
- Button override → Application handoff: launches if released (evidence: `Stm32f429_Bootloader/Core/Src/main.c`)
- Button override → USART1 terminal: reports hold
- Boot sequence → Application handoff: dispatches (evidence: `Stm32f429_Bootloader/Core/Src/main.c`)
- Application handoff → Application demo: jumps to reset handler
- Application handoff → Flash image regions: reads app vector
- Flash image regions → Application demo: stores image at offset
- Application demo → USART1 terminal: logs demo
- Application demo → Board button and LEDs: blinks LED
- Application demo → Application version: exposes version (evidence: `Stm32f429_Application/Core/Src/main.c`)
- Boot sequence → CRC readiness: enables peripheral (evidence: `Stm32f429_Bootloader/Core/Src/main.c`)
- Boot sequence → STM32 HAL: initializes HAL (evidence: `Stm32f429_Bootloader/Core/Src/main.c`)
