# squadracorsepolito/dashboard architecture

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

- Interactive diagram: https://gitdiagram.com/squadracorsepolito/dashboard
- Repository: https://github.com/squadracorsepolito/dashboard

## Overview

#### Purpose and deliverables
This repository builds firmware for the DASH infotainment/dashboard ECU and a separately built OpenBLT bootloader for the same STM32F446RE target. It produces two flashable images: the main dashboard application and a CAN-updatable bootloader. Primary build roots are `Makefile` and `openblt_f446re/Makefile`.

#### Firmware entry and startup
The application entry point is `Core/Src/main.c`, with MCU startup/vector support in `startup_stm32f446xx.s` and system initialization in `Core/Src/system_stm32f4xx.c`. Interrupt dispatch is centralized in `Core/Src/stm32f4xx_it.c`. The application is bare-metal STM32 firmware based on CMSIS and STM32F4 HAL, rather than a host or web runtime.

#### Application orchestration and board boundary
`Core/Src/bsp.c` is the board-support boundary, while `Core/Src/main.c` coordinates initialization and runtime behavior. Shared application-level configuration and utility interfaces are represented by `Core/Inc/conf.h`, `Core/Inc/bsp.h`, and `Core/Src/utils.c`. Hardware-specific setup is split into Cube-style peripheral units, isolating application/dashboard behavior from HAL register and clock setup.

#### Dashboard UI and local input/output
The dashboard-facing subsystem is centered on `Core/Src/dashboard.c` and `Core/Inc/dashboard.h`. User input is handled through `Core/Src/button.c`; output capabilities include DAC and display support. The repository includes an ST7032 LCD library at `Lib/STM32_HAL_ST7032_LCD_LIBRARY/STM32_ST7032.c` and relevant display documentation in `Doc/NHD-C0220BiZ-FSW-FBW-3V3M.pdf`. This forms the local interaction flow: physical inputs → dashboard logic → display/analog outputs.

#### Vehicle and peripheral I/O
CAN is a primary external boundary for vehicle-network communication, implemented in `Core/Src/can.c` with its interface in `Core/Inc/can.h`; the hardware documentation includes an SN65HVD232 CAN transceiver (`Doc/sn65hvd232.pdf`). Peripheral drivers configure ADC, DAC, DMA, I2C, SPI, timers, GPIO, and UART—for example `Core/Src/adc.c`, `Core/Src/i2c.c`, and `Core/Src/usart.c`. I2C likely connects board peripherals such as the PCA9555 I/O expander, whose library/documentation are under `Lib/PCA9555` and `Doc/PCA9555.pdf`.

#### Reliability, hardware platform, and build/flash paths
The target is an STM32F446RE Cortex-M4, defined by `STM32F446RETx_FLASH.ld`, `dashboard.ioc`, and CMSIS device headers such as `Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f446xx.h`. Watchdog handling is explicit in `Core/Src/wdg.c` and `Core/Src/iwdg.c`. STM32 HAL is vendored in `Drivers/STM32F4xx_HAL_Driver`.

The main image is built with GNU Arm tooling and flashed via OpenOCD/ST-LINK using `openocd.cfg`. The alternate update flow first installs the bootloader, then uses BootCommander/libopenblt over CAN.

#### Bootloader subsystem
`openblt_f446re/` is a standalone firmware project with its own entry point, linker configuration, HAL/CMSIS copies, and OpenOCD configuration. Its core lifecycle and transport components are `openblt_f446re/Core/Src/main.c`, `openblt_f446re/Core/Src/BLT/boot.c`, and `openblt_f446re/Core/Src/BLT/can.c`. OpenBLT manages communication, flash programming, plausibility, and XCP-related update protocol logic through `openblt_f446re/Core/Src/BLT/com.c`, `openblt_f446re/Core/Src/BLT/flash.c`, and `openblt_f446re/Core/Src/BLT/xcp.c`. The application/bootloader boundary is therefore flash-resident image handoff, with CAN as the field-update transport.

Main entry points: [`Core/Src/main.c`](https://github.com/squadracorsepolito/dashboard/blob/master/Core/Src/main.c) (Application orchestration), [`Core/Src/dashboard.c`](https://github.com/squadracorsepolito/dashboard/blob/master/Core/Src/dashboard.c) (Dashboard UI), [`Makefile`](https://github.com/squadracorsepolito/dashboard/blob/master/Makefile) (Application build), [`Core/Src/bsp.c`](https://github.com/squadracorsepolito/dashboard/blob/master/Core/Src/bsp.c) (Board support)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Dashboard application"]
  node_app_build["Application build<br/>GNU Arm build"]
  node_app_main["Application orchestration<br/>bare-metal entry<br/>[main.c]"]
  node_bsp["Board support<br/>board boundary<br/>[bsp.c]"]
  node_app_config["App configuration<br/>shared interfaces<br/>[conf.h]"]
  node_dashboard["Dashboard UI<br/>dashboard logic<br/>[dashboard.c]"]
  node_buttons["Physical input<br/>button driver<br/>[button.c]"]
  node_lcd["LCD output<br/>ST7032 driver<br/>[STM32_ST7032.c]"]
  node_can_app["Vehicle CAN<br/>CAN transport<br/>[can.c]"]
  node_peripherals["Peripheral drivers<br/>HAL peripheral setup<br/>[adc.c]"]
  node_watchdog["Watchdog<br/>reliability driver<br/>[wdg.c]"]
end

subgraph group_platform["Target platform"]
  node_startup["Startup vectors<br/>MCU startup"]
  node_system_init["System initialization<br/>clock and system setup<br/>[system_stm32f4xx.c]"]
  node_interrupts["Interrupt dispatch<br/>ISR routing<br/>[stm32f4xx_it.c]"]
  node_mcu{{"STM32F446RE<br/>Cortex-M4 target<br/>[stm32f446xx.h]"}}
  node_hal["STM32 HAL<br/>vendored hardware abstraction"]
  node_app_linker["Application flash layout<br/>linker script"]
end

subgraph group_boot["OpenBLT bootloader"]
  node_boot_build["Bootloader build<br/>GNU Arm build"]
  node_boot_main["Bootloader entry<br/>bare-metal entry<br/>[main.c]"]
  node_boot_lifecycle["Boot lifecycle<br/>image handoff<br/>[boot.c]"]
  node_update_transport["CAN update transport<br/>OpenBLT CAN<br/>[can.c]"]
  node_update_protocol["Update protocol<br/>XCP communication<br/>[xcp.c]"]
  node_flash_programming["Flash programming<br/>image validation and write<br/>[flash.c]"]
end

node_field_updater["BootCommander<br/>CAN update tool"]
node_debug_flash["OpenOCD / ST-LINK<br/>programming path<br/>[openocd.cfg]"]

node_app_build -->|"builds"| node_app_main
node_app_build -->|"links with"| node_app_linker
node_startup -->|"starts"| node_system_init
node_system_init -->|"enters"| node_app_main
node_app_main -->|"initializes"| node_bsp
node_app_main -->|"runs"| node_dashboard
node_app_main -->|"uses"| node_can_app
node_app_main -->|"services"| node_watchdog
node_bsp -->|"configures"| node_peripherals
node_app_config -.->|"configures"| node_app_main
node_buttons -->|"input"| node_dashboard
node_dashboard -->|"renders to"| node_lcd
node_dashboard -->|"drives analog I/O"| node_peripherals
node_can_app -->|"vehicle data"| node_dashboard
node_interrupts -->|"dispatches events"| node_can_app
node_hal -->|"hardware API"| node_bsp
node_mcu -.->|"target"| node_startup
node_boot_build -->|"builds"| node_boot_main
node_boot_main -->|"runs"| node_boot_lifecycle
node_boot_lifecycle -->|"hands off to image"| node_app_main
node_field_updater -->|"CAN update"| node_update_transport
node_update_transport -->|"carries"| node_update_protocol
node_update_protocol -->|"authorizes image"| node_flash_programming
node_flash_programming -->|"stores application"| node_boot_lifecycle
node_debug_flash -->|"flashes image"| node_app_build
node_debug_flash -->|"installs bootloader"| node_boot_build

click node_app_build "https://github.com/squadracorsepolito/dashboard/blob/master/Makefile"
click node_app_main "https://github.com/squadracorsepolito/dashboard/blob/master/Core/Src/main.c"
click node_bsp "https://github.com/squadracorsepolito/dashboard/blob/master/Core/Src/bsp.c"
click node_app_config "https://github.com/squadracorsepolito/dashboard/blob/master/Core/Inc/conf.h"
click node_dashboard "https://github.com/squadracorsepolito/dashboard/blob/master/Core/Src/dashboard.c"
click node_buttons "https://github.com/squadracorsepolito/dashboard/blob/master/Core/Src/button.c"
click node_lcd "https://github.com/squadracorsepolito/dashboard/blob/master/Lib/STM32_HAL_ST7032_LCD_LIBRARY/STM32_ST7032.c"
click node_can_app "https://github.com/squadracorsepolito/dashboard/blob/master/Core/Src/can.c"
click node_peripherals "https://github.com/squadracorsepolito/dashboard/blob/master/Core/Src/adc.c"
click node_watchdog "https://github.com/squadracorsepolito/dashboard/blob/master/Core/Src/wdg.c"
click node_startup "https://github.com/squadracorsepolito/dashboard/blob/master/startup_stm32f446xx.s"
click node_system_init "https://github.com/squadracorsepolito/dashboard/blob/master/Core/Src/system_stm32f4xx.c"
click node_interrupts "https://github.com/squadracorsepolito/dashboard/blob/master/Core/Src/stm32f4xx_it.c"
click node_mcu "https://github.com/squadracorsepolito/dashboard/blob/master/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f446xx.h"
click node_hal "https://github.com/squadracorsepolito/dashboard/tree/master/Drivers/STM32F4xx_HAL_Driver"
click node_app_linker "https://github.com/squadracorsepolito/dashboard/blob/master/STM32F446RETx_FLASH.ld"
click node_boot_build "https://github.com/squadracorsepolito/dashboard/blob/master/openblt_f446re/Makefile"
click node_boot_main "https://github.com/squadracorsepolito/dashboard/blob/master/openblt_f446re/Core/Src/main.c"
click node_boot_lifecycle "https://github.com/squadracorsepolito/dashboard/blob/master/openblt_f446re/Core/Src/BLT/boot.c"
click node_update_transport "https://github.com/squadracorsepolito/dashboard/blob/master/openblt_f446re/Core/Src/BLT/can.c"
click node_update_protocol "https://github.com/squadracorsepolito/dashboard/blob/master/openblt_f446re/Core/Src/BLT/xcp.c"
click node_flash_programming "https://github.com/squadracorsepolito/dashboard/blob/master/openblt_f446re/Core/Src/BLT/flash.c"
click node_debug_flash "https://github.com/squadracorsepolito/dashboard/blob/master/openocd.cfg"

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_app_build,node_app_main,node_bsp,node_app_config,node_dashboard,node_buttons,node_lcd,node_can_app,node_peripherals,node_watchdog toneBlue
class node_startup,node_system_init,node_interrupts,node_mcu,node_hal,node_app_linker toneAmber
class node_boot_build,node_boot_main,node_boot_lifecycle,node_update_transport,node_update_protocol,node_flash_programming toneMint
class node_field_updater,node_debug_flash toneNeutral
```

## Components

### Dashboard application

Main STM32 firmware image.

- [Application build](https://github.com/squadracorsepolito/dashboard/blob/master/Makefile): GNU Arm build · `Makefile`
- [Application orchestration](https://github.com/squadracorsepolito/dashboard/blob/master/Core/Src/main.c): bare-metal entry · `Core/Src/main.c`
- [Board support](https://github.com/squadracorsepolito/dashboard/blob/master/Core/Src/bsp.c): board boundary · `Core/Src/bsp.c`
- [App configuration](https://github.com/squadracorsepolito/dashboard/blob/master/Core/Inc/conf.h): shared interfaces · `Core/Inc/conf.h`
- [Dashboard UI](https://github.com/squadracorsepolito/dashboard/blob/master/Core/Src/dashboard.c): dashboard logic · `Core/Src/dashboard.c`
- [Physical input](https://github.com/squadracorsepolito/dashboard/blob/master/Core/Src/button.c): button driver · `Core/Src/button.c`
- [LCD output](https://github.com/squadracorsepolito/dashboard/blob/master/Lib/STM32_HAL_ST7032_LCD_LIBRARY/STM32_ST7032.c): ST7032 driver · `Lib/STM32_HAL_ST7032_LCD_LIBRARY/STM32_ST7032.c`
- [Vehicle CAN](https://github.com/squadracorsepolito/dashboard/blob/master/Core/Src/can.c): CAN transport · `Core/Src/can.c`
- [Peripheral drivers](https://github.com/squadracorsepolito/dashboard/blob/master/Core/Src/adc.c): HAL peripheral setup · ADC, DAC, DMA, I2C, SPI, timers, GPIO, and UART. · `Core/Src/adc.c`
- [Watchdog](https://github.com/squadracorsepolito/dashboard/blob/master/Core/Src/wdg.c): reliability driver · `Core/Src/wdg.c`

### Target platform

STM32F446RE hardware and vendor runtime.

- [Startup vectors](https://github.com/squadracorsepolito/dashboard/blob/master/startup_stm32f446xx.s): MCU startup · `startup_stm32f446xx.s`
- [System initialization](https://github.com/squadracorsepolito/dashboard/blob/master/Core/Src/system_stm32f4xx.c): clock and system setup · `Core/Src/system_stm32f4xx.c`
- [Interrupt dispatch](https://github.com/squadracorsepolito/dashboard/blob/master/Core/Src/stm32f4xx_it.c): ISR routing · `Core/Src/stm32f4xx_it.c`
- [STM32F446RE](https://github.com/squadracorsepolito/dashboard/blob/master/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f446xx.h): Cortex-M4 target · `Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f446xx.h`
- [STM32 HAL](https://github.com/squadracorsepolito/dashboard/tree/master/Drivers/STM32F4xx_HAL_Driver): vendored hardware abstraction · `Drivers/STM32F4xx_HAL_Driver`
- [Application flash layout](https://github.com/squadracorsepolito/dashboard/blob/master/STM32F446RETx_FLASH.ld): linker script · `STM32F446RETx_FLASH.ld`

### OpenBLT bootloader

Separately built CAN-update firmware.

- [Bootloader build](https://github.com/squadracorsepolito/dashboard/blob/master/openblt_f446re/Makefile): GNU Arm build · `openblt_f446re/Makefile`
- [Bootloader entry](https://github.com/squadracorsepolito/dashboard/blob/master/openblt_f446re/Core/Src/main.c): bare-metal entry · `openblt_f446re/Core/Src/main.c`
- [Boot lifecycle](https://github.com/squadracorsepolito/dashboard/blob/master/openblt_f446re/Core/Src/BLT/boot.c): image handoff · `openblt_f446re/Core/Src/BLT/boot.c`
- [CAN update transport](https://github.com/squadracorsepolito/dashboard/blob/master/openblt_f446re/Core/Src/BLT/can.c): OpenBLT CAN · `openblt_f446re/Core/Src/BLT/can.c`
- [Update protocol](https://github.com/squadracorsepolito/dashboard/blob/master/openblt_f446re/Core/Src/BLT/xcp.c): XCP communication · `openblt_f446re/Core/Src/BLT/xcp.c`
- [Flash programming](https://github.com/squadracorsepolito/dashboard/blob/master/openblt_f446re/Core/Src/BLT/flash.c): image validation and write · `openblt_f446re/Core/Src/BLT/flash.c`

### Other components

- **BootCommander**: CAN update tool · Uses libopenblt to deliver field updates.
- [OpenOCD / ST-LINK](https://github.com/squadracorsepolito/dashboard/blob/master/openocd.cfg): programming path · `openocd.cfg`

## Connections

- Application build → Application orchestration: builds
- Application build → Application flash layout: links with
- Startup vectors → System initialization: starts
- System initialization → Application orchestration: enters
- Application orchestration → Board support: initializes
- Application orchestration → Dashboard UI: runs
- Application orchestration → Vehicle CAN: uses
- Application orchestration → Watchdog: services
- Board support → Peripheral drivers: configures
- App configuration → Application orchestration: configures
- Physical input → Dashboard UI: input
- Dashboard UI → LCD output: renders to
- Dashboard UI → Peripheral drivers: drives analog I/O
- Vehicle CAN → Dashboard UI: vehicle data
- Interrupt dispatch → Vehicle CAN: dispatches events
- STM32 HAL → Board support: hardware API
- STM32F446RE → Startup vectors: target
- Bootloader build → Bootloader entry: builds
- Bootloader entry → Boot lifecycle: runs
- Boot lifecycle → Application orchestration: hands off to image
- BootCommander → CAN update transport: CAN update
- CAN update transport → Update protocol: carries
- Update protocol → Flash programming: authorizes image
- Flash programming → Boot lifecycle: stores application
- OpenOCD / ST-LINK → Application build: flashes image
- OpenOCD / ST-LINK → Bootloader build: installs bootloader
