# epflxplore/power_hw architecture

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

- Interactive diagram: https://gitdiagram.com/epflxplore/power_hw
- Repository: https://github.com/epflxplore/power_hw

## Overview

The README describes KiCad power-board designs and points to a separate software repository, but the supplied tree is STM32 firmware. The visible startup workflow initializes the MCU and configured peripherals, including USB; the firmware also contains RTOS and USB CDC components. Those latter components are represented as subsystems, but their runtime connections are not established by the excerpts. The graph therefore focuses on the evidenced startup calls and does not infer a hardware-control or CDC data pipeline.

Main entry points: [`GEODE/rev1/Geode_FW/Core/Src/main.c`](https://github.com/epflxplore/power_hw/blob/master/GEODE/rev1/Geode_FW/Core/Src/main.c) (MCU startup), [`GEODE/rev1/Geode_FW/Core/Src/gpio.c`](https://github.com/epflxplore/power_hw/blob/master/GEODE/rev1/Geode_FW/Core/Src/gpio.c) (GPIO), [`GEODE/rev1/Geode_FW/Core/Src/crc.c`](https://github.com/epflxplore/power_hw/blob/master/GEODE/rev1/Geode_FW/Core/Src/crc.c) (CRC), [`GEODE/rev1/Geode_FW/Core/Src/fdcan.c`](https://github.com/epflxplore/power_hw/blob/master/GEODE/rev1/Geode_FW/Core/Src/fdcan.c) (FDCAN)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Firmware runtime"]
  node_startup["MCU startup<br/>[main.c]"]
  node_rtos["RTOS application<br/>[app_freertos.c]"]
  node_root["Root task<br/>[RootTask.cpp]"]
  node_kernel["Kernel<br/>[Kernel.cpp]"]
  node_threads["Threads<br/>[Threads.cpp]"]
end

subgraph group_drivers["Board peripherals"]
  node_gpio["GPIO<br/>[gpio.c]"]
  node_crc["CRC<br/>[crc.c]"]
  node_fdcan["FDCAN<br/>[fdcan.c]"]
  node_i2c["I2C<br/>[i2c.c]"]
  node_watchdog["Watchdog<br/>[iwdg.c]"]
  node_spi["SPI<br/>[spi.c]"]
  node_hal["STM32 HAL"]
  node_cmsis["CMSIS device support<br/>[stm32g483xx.h]"]
end

subgraph group_usb["USB device"]
  node_usbinit["USB initialization<br/>[usb_device.c]"]
  node_usbcore["USB device core<br/>[usbd_core.c]"]
  node_cdc["CDC class<br/>[usbd_cdc.c]"]
  node_cdcinterface["CDC interface<br/>[usbd_cdc_if.c]"]
  node_usbport["USB port layer<br/>[usbd_conf.c]"]
end

node_startup -->|"initializes"| node_gpio
node_startup -->|"initializes"| node_crc
node_startup -->|"initializes"| node_fdcan
node_startup -->|"initializes"| node_i2c
node_startup -->|"initializes"| node_watchdog
node_startup -->|"initializes"| node_spi
node_startup -->|"initializes"| node_usbinit

click node_startup "https://github.com/epflxplore/power_hw/blob/master/GEODE/rev1/Geode_FW/Core/Src/main.c"
click node_rtos "https://github.com/epflxplore/power_hw/blob/master/GEODE/rev1/Geode_FW/Core/Src/app_freertos.c"
click node_root "https://github.com/epflxplore/power_hw/blob/master/GEODE/rev1/Geode_FW/System/Core/Src/RootTask.cpp"
click node_kernel "https://github.com/epflxplore/power_hw/blob/master/GEODE/rev1/Geode_FW/System/Kernel/Src/Kernel.cpp"
click node_threads "https://github.com/epflxplore/power_hw/blob/master/GEODE/rev1/Geode_FW/System/Threads/Src/Threads.cpp"
click node_gpio "https://github.com/epflxplore/power_hw/blob/master/GEODE/rev1/Geode_FW/Core/Src/gpio.c"
click node_crc "https://github.com/epflxplore/power_hw/blob/master/GEODE/rev1/Geode_FW/Core/Src/crc.c"
click node_fdcan "https://github.com/epflxplore/power_hw/blob/master/GEODE/rev1/Geode_FW/Core/Src/fdcan.c"
click node_i2c "https://github.com/epflxplore/power_hw/blob/master/GEODE/rev1/Geode_FW/Core/Src/i2c.c"
click node_watchdog "https://github.com/epflxplore/power_hw/blob/master/GEODE/rev1/Geode_FW/Core/Src/iwdg.c"
click node_spi "https://github.com/epflxplore/power_hw/blob/master/GEODE/rev1/Geode_FW/Core/Src/spi.c"
click node_usbinit "https://github.com/epflxplore/power_hw/blob/master/GEODE/rev1/Geode_FW/USB_Device/App/usb_device.c"
click node_usbcore "https://github.com/epflxplore/power_hw/blob/master/GEODE/rev1/Geode_FW/Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_core.c"
click node_cdc "https://github.com/epflxplore/power_hw/blob/master/GEODE/rev1/Geode_FW/Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Src/usbd_cdc.c"
click node_cdcinterface "https://github.com/epflxplore/power_hw/blob/master/GEODE/rev1/Geode_FW/USB_Device/App/usbd_cdc_if.c"
click node_usbport "https://github.com/epflxplore/power_hw/blob/master/GEODE/rev1/Geode_FW/USB_Device/Target/usbd_conf.c"
click node_hal "https://github.com/epflxplore/power_hw/tree/master/GEODE/rev1/Geode_FW/Drivers/STM32G4xx_HAL_Driver/Src"
click node_cmsis "https://github.com/epflxplore/power_hw/blob/master/GEODE/rev1/Geode_FW/Drivers/CMSIS/Device/ST/STM32G4xx/Include/stm32g483xx.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_startup,node_rtos,node_root,node_kernel,node_threads toneBlue
class node_gpio,node_crc,node_fdcan,node_i2c,node_watchdog,node_spi,node_hal,node_cmsis toneAmber
class node_usbinit,node_usbcore,node_cdc,node_cdcinterface,node_usbport toneMint
```

## Components

### Firmware runtime

- [MCU startup](https://github.com/epflxplore/power_hw/blob/master/GEODE/rev1/Geode_FW/Core/Src/main.c): `GEODE/rev1/Geode_FW/Core/Src/main.c`
- [RTOS application](https://github.com/epflxplore/power_hw/blob/master/GEODE/rev1/Geode_FW/Core/Src/app_freertos.c): `GEODE/rev1/Geode_FW/Core/Src/app_freertos.c`
- [Root task](https://github.com/epflxplore/power_hw/blob/master/GEODE/rev1/Geode_FW/System/Core/Src/RootTask.cpp): `GEODE/rev1/Geode_FW/System/Core/Src/RootTask.cpp`
- [Kernel](https://github.com/epflxplore/power_hw/blob/master/GEODE/rev1/Geode_FW/System/Kernel/Src/Kernel.cpp): `GEODE/rev1/Geode_FW/System/Kernel/Src/Kernel.cpp`
- [Threads](https://github.com/epflxplore/power_hw/blob/master/GEODE/rev1/Geode_FW/System/Threads/Src/Threads.cpp): `GEODE/rev1/Geode_FW/System/Threads/Src/Threads.cpp`

### Board peripherals

- [GPIO](https://github.com/epflxplore/power_hw/blob/master/GEODE/rev1/Geode_FW/Core/Src/gpio.c): `GEODE/rev1/Geode_FW/Core/Src/gpio.c`
- [CRC](https://github.com/epflxplore/power_hw/blob/master/GEODE/rev1/Geode_FW/Core/Src/crc.c): `GEODE/rev1/Geode_FW/Core/Src/crc.c`
- [FDCAN](https://github.com/epflxplore/power_hw/blob/master/GEODE/rev1/Geode_FW/Core/Src/fdcan.c): `GEODE/rev1/Geode_FW/Core/Src/fdcan.c`
- [I2C](https://github.com/epflxplore/power_hw/blob/master/GEODE/rev1/Geode_FW/Core/Src/i2c.c): `GEODE/rev1/Geode_FW/Core/Src/i2c.c`
- [Watchdog](https://github.com/epflxplore/power_hw/blob/master/GEODE/rev1/Geode_FW/Core/Src/iwdg.c): `GEODE/rev1/Geode_FW/Core/Src/iwdg.c`
- [SPI](https://github.com/epflxplore/power_hw/blob/master/GEODE/rev1/Geode_FW/Core/Src/spi.c): `GEODE/rev1/Geode_FW/Core/Src/spi.c`
- [STM32 HAL](https://github.com/epflxplore/power_hw/tree/master/GEODE/rev1/Geode_FW/Drivers/STM32G4xx_HAL_Driver/Src): `GEODE/rev1/Geode_FW/Drivers/STM32G4xx_HAL_Driver/Src`
- [CMSIS device support](https://github.com/epflxplore/power_hw/blob/master/GEODE/rev1/Geode_FW/Drivers/CMSIS/Device/ST/STM32G4xx/Include/stm32g483xx.h): `GEODE/rev1/Geode_FW/Drivers/CMSIS/Device/ST/STM32G4xx/Include/stm32g483xx.h`

### USB device

- [USB initialization](https://github.com/epflxplore/power_hw/blob/master/GEODE/rev1/Geode_FW/USB_Device/App/usb_device.c): `GEODE/rev1/Geode_FW/USB_Device/App/usb_device.c`
- [USB device core](https://github.com/epflxplore/power_hw/blob/master/GEODE/rev1/Geode_FW/Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_core.c): `GEODE/rev1/Geode_FW/Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_core.c`
- [CDC class](https://github.com/epflxplore/power_hw/blob/master/GEODE/rev1/Geode_FW/Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Src/usbd_cdc.c): `GEODE/rev1/Geode_FW/Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Src/usbd_cdc.c`
- [CDC interface](https://github.com/epflxplore/power_hw/blob/master/GEODE/rev1/Geode_FW/USB_Device/App/usbd_cdc_if.c): `GEODE/rev1/Geode_FW/USB_Device/App/usbd_cdc_if.c`
- [USB port layer](https://github.com/epflxplore/power_hw/blob/master/GEODE/rev1/Geode_FW/USB_Device/Target/usbd_conf.c): `GEODE/rev1/Geode_FW/USB_Device/Target/usbd_conf.c`

## Connections

- MCU startup → GPIO: initializes (evidence: `GEODE/rev1/Geode_FW/Core/Src/main.c`)
- MCU startup → CRC: initializes (evidence: `GEODE/rev1/Geode_FW/Core/Src/main.c`)
- MCU startup → FDCAN: initializes (evidence: `GEODE/rev1/Geode_FW/Core/Src/main.c`)
- MCU startup → I2C: initializes (evidence: `GEODE/rev1/Geode_FW/Core/Src/main.c`)
- MCU startup → Watchdog: initializes (evidence: `GEODE/rev1/Geode_FW/Core/Src/main.c`)
- MCU startup → SPI: initializes (evidence: `GEODE/rev1/Geode_FW/Core/Src/main.c`)
- MCU startup → USB initialization: initializes (evidence: `GEODE/rev1/Geode_FW/Core/Src/main.c`)
