# istarc/stm32 architecture

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

- Interactive diagram: https://gitdiagram.com/istarc/stm32
- Repository: https://github.com/istarc/stm32

## Overview

This repository is a collection of STM32F4-Discovery firmware examples, reusable CMSIS-DSP and board-support libraries, and small mbed/RTOS sample applications. The representative firmware workflow starts in an application entry point, initializes board peripherals, and runs a demo; the Demonstration app also configures the accelerometer and USB features. Other examples independently exercise peripherals or demonstrate RTOS tasks and queue-based signaling. The README describes building, deploying, and testing projects, but those are environment workflows rather than runtime components. Connections are limited to relationships visible in the excerpts or source index; unsampled DSP and example internals are grouped by their exact directories.

Main entry points: [`STM32F4-Discovery_FW_V1.1.0/Project/Demonstration/main.c`](https://github.com/istarc/stm32/blob/master/STM32F4-Discovery_FW_V1.1.0/Project/Demonstration/main.c) (Demo Application), [`mbed-project-wizard/mbed-freertos/main.cpp`](https://github.com/istarc/stm32/blob/master/mbed-project-wizard/mbed-freertos/main.cpp) (FreeRTOS Sample), [`STM32F4-Discovery_FW_V1.1.0/Project/Demonstration/main.h`](https://github.com/istarc/stm32/blob/master/STM32F4-Discovery_FW_V1.1.0/Project/Demonstration/main.h) (Demo Configuration), [`STM32F4-Discovery_FW_V1.1.0/Libraries/STM32_USB_Device_Library/Class/hid/inc/usbd_hid_core.h`](https://github.com/istarc/stm32/blob/master/STM32F4-Discovery_FW_V1.1.0/Libraries/STM32_USB_Device_Library/Class/hid/inc/usbd_hid_core.h) (USB HID Class)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_demo["Board Demonstration"]
  node_demo_app["Demo Application<br/>[main.c]"]
  node_demo_headers["Demo Configuration<br/>[main.h]"]
  node_usb_hid["USB HID Class<br/>[usbd_hid_core.h]"]
  node_usb_user["USB User Callbacks<br/>[usbd_usr.h]"]
  node_usb_desc["USB Descriptors<br/>[usbd_desc.h]"]
end

subgraph group_libraries["Firmware Libraries"]
  node_mems_driver["LIS302DL Driver"]
  node_audio_driver["Audio Codec Support"]
  node_dsp_basic["Basic Math<br/>[BasicMathFunctions]"]
  node_dsp_complex["Complex Math"]
  node_dsp_filter["Digital Filters<br/>[FilteringFunctions]"]
  node_dsp_matrix["Matrix Math<br/>[MatrixFunctions]"]
  node_dsp_stats["Statistics"]
  node_dsp_fast["Fast Math<br/>[FastMathFunctions]"]
  node_dsp_controller["Control Functions"]
  node_msc_storage["MSC Storage Callbacks"]
end

subgraph group_peripherals["Peripheral Samples"]
  node_periph_samples["Peripheral Examples"]
  node_audio_sample["Audio Playback<br/>[main.c]"]
end

subgraph group_mbed["mbed Applications"]
  node_freertos_app["FreeRTOS Sample<br/>[main.cpp]"]
  node_mbedrtos_app["mbed RTOS Sample<br/>[main.cpp]"]
  node_bare_mbed_app["Bare-metal Sample<br/>[main.cpp]"]
  node_interrupt_manager["Interrupt Manager"]
end

node_user(("Board User"))

node_user -->|"operates"| node_demo_app
node_demo_app -->|"uses definitions"| node_demo_headers
node_demo_app -->|"uses HID"| node_usb_hid
node_demo_app -->|"uses callbacks"| node_usb_user
node_demo_app -->|"uses descriptors"| node_usb_desc
node_demo_app -->|"configures and reads"| node_mems_driver
node_freertos_app -.->|"demonstrates board I/O"| node_periph_samples

click node_demo_app "https://github.com/istarc/stm32/blob/master/STM32F4-Discovery_FW_V1.1.0/Project/Demonstration/main.c"
click node_demo_headers "https://github.com/istarc/stm32/blob/master/STM32F4-Discovery_FW_V1.1.0/Project/Demonstration/main.h"
click node_usb_hid "https://github.com/istarc/stm32/blob/master/STM32F4-Discovery_FW_V1.1.0/Libraries/STM32_USB_Device_Library/Class/hid/inc/usbd_hid_core.h"
click node_usb_user "https://github.com/istarc/stm32/blob/master/STM32F4-Discovery_FW_V1.1.0/Libraries/STM32_USB_Device_Library/Core/inc/usbd_usr.h"
click node_usb_desc "https://github.com/istarc/stm32/blob/master/STM32F4-Discovery_FW_V1.1.0/Project/Demonstration/usbd_desc.h"
click node_mems_driver "https://github.com/istarc/stm32/blob/master/STM32F4-Discovery_FW_V1.1.0/Utilities/STM32F4-Discovery/stm32f4_discovery_lis302dl.h"
click node_audio_driver "https://github.com/istarc/stm32/blob/master/STM32F4-Discovery_FW_V1.1.0/Utilities/STM32F4-Discovery/stm32f4_discovery_audio_codec.h"
click node_dsp_basic "https://github.com/istarc/stm32/tree/master/STM32F4-Discovery_FW_V1.1.0/Libraries/CMSIS/DSP_Lib/Source/BasicMathFunctions"
click node_dsp_complex "https://github.com/istarc/stm32/tree/master/STM32F4-Discovery_FW_V1.1.0/Libraries/CMSIS/DSP_Lib/Source/ComplexMathFunctions"
click node_dsp_filter "https://github.com/istarc/stm32/tree/master/STM32F4-Discovery_FW_V1.1.0/Libraries/CMSIS/DSP_Lib/Source/FilteringFunctions"
click node_dsp_matrix "https://github.com/istarc/stm32/tree/master/STM32F4-Discovery_FW_V1.1.0/Libraries/CMSIS/DSP_Lib/Source/MatrixFunctions"
click node_dsp_stats "https://github.com/istarc/stm32/tree/master/STM32F4-Discovery_FW_V1.1.0/Libraries/CMSIS/DSP_Lib/Source/StatisticsFunctions"
click node_dsp_fast "https://github.com/istarc/stm32/tree/master/STM32F4-Discovery_FW_V1.1.0/Libraries/CMSIS/DSP_Lib/Source/FastMathFunctions"
click node_dsp_controller "https://github.com/istarc/stm32/tree/master/STM32F4-Discovery_FW_V1.1.0/Libraries/CMSIS/DSP_Lib/Source/ControllerFunctions"
click node_msc_storage "https://github.com/istarc/stm32/blob/master/STM32F4-Discovery_FW_V1.1.0/Libraries/STM32_USB_Device_Library/Class/msc/src/usbd_storage_template.c"
click node_periph_samples "https://github.com/istarc/stm32/tree/master/STM32F4-Discovery_FW_V1.1.0/Project/Peripheral_Examples"
click node_audio_sample "https://github.com/istarc/stm32/blob/master/STM32F4-Discovery_FW_V1.1.0/Project/Audio_playback_and_record/src/main.c"
click node_freertos_app "https://github.com/istarc/stm32/blob/master/mbed-project-wizard/mbed-freertos/main.cpp"
click node_mbedrtos_app "https://github.com/istarc/stm32/blob/master/mbed-project-wizard/mbed-mbedrtos/main.cpp"
click node_bare_mbed_app "https://github.com/istarc/stm32/blob/master/mbed-project-wizard/mbed-none/main.cpp"
click node_interrupt_manager "https://github.com/istarc/stm32/blob/master/examples-xunit/native/NativeSemihosting.mbed-cpput/lib/mbed/common/InterruptManager.cpp"

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_demo_app,node_demo_headers,node_usb_hid,node_usb_user,node_usb_desc,node_user toneBlue
class node_mems_driver,node_audio_driver,node_dsp_basic,node_dsp_complex,node_dsp_filter,node_dsp_matrix,node_dsp_stats,node_dsp_fast,node_dsp_controller,node_msc_storage toneAmber
class node_periph_samples,node_audio_sample toneMint
class node_freertos_app,node_mbedrtos_app,node_bare_mbed_app,node_interrupt_manager toneRose
```

## Components

### Board Demonstration

- [Demo Application](https://github.com/istarc/stm32/blob/master/STM32F4-Discovery_FW_V1.1.0/Project/Demonstration/main.c): `STM32F4-Discovery_FW_V1.1.0/Project/Demonstration/main.c`
- [Demo Configuration](https://github.com/istarc/stm32/blob/master/STM32F4-Discovery_FW_V1.1.0/Project/Demonstration/main.h): `STM32F4-Discovery_FW_V1.1.0/Project/Demonstration/main.h`
- [USB HID Class](https://github.com/istarc/stm32/blob/master/STM32F4-Discovery_FW_V1.1.0/Libraries/STM32_USB_Device_Library/Class/hid/inc/usbd_hid_core.h): `STM32F4-Discovery_FW_V1.1.0/Libraries/STM32_USB_Device_Library/Class/hid/inc/usbd_hid_core.h`
- [USB User Callbacks](https://github.com/istarc/stm32/blob/master/STM32F4-Discovery_FW_V1.1.0/Libraries/STM32_USB_Device_Library/Core/inc/usbd_usr.h): `STM32F4-Discovery_FW_V1.1.0/Libraries/STM32_USB_Device_Library/Core/inc/usbd_usr.h`
- [USB Descriptors](https://github.com/istarc/stm32/blob/master/STM32F4-Discovery_FW_V1.1.0/Project/Demonstration/usbd_desc.h): `STM32F4-Discovery_FW_V1.1.0/Project/Demonstration/usbd_desc.h`

### Firmware Libraries

- [LIS302DL Driver](https://github.com/istarc/stm32/blob/master/STM32F4-Discovery_FW_V1.1.0/Utilities/STM32F4-Discovery/stm32f4_discovery_lis302dl.h): `STM32F4-Discovery_FW_V1.1.0/Utilities/STM32F4-Discovery/stm32f4_discovery_lis302dl.h`
- [Audio Codec Support](https://github.com/istarc/stm32/blob/master/STM32F4-Discovery_FW_V1.1.0/Utilities/STM32F4-Discovery/stm32f4_discovery_audio_codec.h): `STM32F4-Discovery_FW_V1.1.0/Utilities/STM32F4-Discovery/stm32f4_discovery_audio_codec.h`
- [Basic Math](https://github.com/istarc/stm32/tree/master/STM32F4-Discovery_FW_V1.1.0/Libraries/CMSIS/DSP_Lib/Source/BasicMathFunctions): `STM32F4-Discovery_FW_V1.1.0/Libraries/CMSIS/DSP_Lib/Source/BasicMathFunctions`
- [Complex Math](https://github.com/istarc/stm32/tree/master/STM32F4-Discovery_FW_V1.1.0/Libraries/CMSIS/DSP_Lib/Source/ComplexMathFunctions): `STM32F4-Discovery_FW_V1.1.0/Libraries/CMSIS/DSP_Lib/Source/ComplexMathFunctions`
- [Digital Filters](https://github.com/istarc/stm32/tree/master/STM32F4-Discovery_FW_V1.1.0/Libraries/CMSIS/DSP_Lib/Source/FilteringFunctions): `STM32F4-Discovery_FW_V1.1.0/Libraries/CMSIS/DSP_Lib/Source/FilteringFunctions`
- [Matrix Math](https://github.com/istarc/stm32/tree/master/STM32F4-Discovery_FW_V1.1.0/Libraries/CMSIS/DSP_Lib/Source/MatrixFunctions): `STM32F4-Discovery_FW_V1.1.0/Libraries/CMSIS/DSP_Lib/Source/MatrixFunctions`
- [Statistics](https://github.com/istarc/stm32/tree/master/STM32F4-Discovery_FW_V1.1.0/Libraries/CMSIS/DSP_Lib/Source/StatisticsFunctions): `STM32F4-Discovery_FW_V1.1.0/Libraries/CMSIS/DSP_Lib/Source/StatisticsFunctions`
- [Fast Math](https://github.com/istarc/stm32/tree/master/STM32F4-Discovery_FW_V1.1.0/Libraries/CMSIS/DSP_Lib/Source/FastMathFunctions): `STM32F4-Discovery_FW_V1.1.0/Libraries/CMSIS/DSP_Lib/Source/FastMathFunctions`
- [Control Functions](https://github.com/istarc/stm32/tree/master/STM32F4-Discovery_FW_V1.1.0/Libraries/CMSIS/DSP_Lib/Source/ControllerFunctions): `STM32F4-Discovery_FW_V1.1.0/Libraries/CMSIS/DSP_Lib/Source/ControllerFunctions`
- [MSC Storage Callbacks](https://github.com/istarc/stm32/blob/master/STM32F4-Discovery_FW_V1.1.0/Libraries/STM32_USB_Device_Library/Class/msc/src/usbd_storage_template.c): `STM32F4-Discovery_FW_V1.1.0/Libraries/STM32_USB_Device_Library/Class/msc/src/usbd_storage_template.c`

### Peripheral Samples

- [Peripheral Examples](https://github.com/istarc/stm32/tree/master/STM32F4-Discovery_FW_V1.1.0/Project/Peripheral_Examples): `STM32F4-Discovery_FW_V1.1.0/Project/Peripheral_Examples`
- [Audio Playback](https://github.com/istarc/stm32/blob/master/STM32F4-Discovery_FW_V1.1.0/Project/Audio_playback_and_record/src/main.c): `STM32F4-Discovery_FW_V1.1.0/Project/Audio_playback_and_record/src/main.c`

### mbed Applications

- [FreeRTOS Sample](https://github.com/istarc/stm32/blob/master/mbed-project-wizard/mbed-freertos/main.cpp): `mbed-project-wizard/mbed-freertos/main.cpp`
- [mbed RTOS Sample](https://github.com/istarc/stm32/blob/master/mbed-project-wizard/mbed-mbedrtos/main.cpp): `mbed-project-wizard/mbed-mbedrtos/main.cpp`
- [Bare-metal Sample](https://github.com/istarc/stm32/blob/master/mbed-project-wizard/mbed-none/main.cpp): `mbed-project-wizard/mbed-none/main.cpp`
- [Interrupt Manager](https://github.com/istarc/stm32/blob/master/examples-xunit/native/NativeSemihosting.mbed-cpput/lib/mbed/common/InterruptManager.cpp): `examples-xunit/native/NativeSemihosting.mbed-cpput/lib/mbed/common/InterruptManager.cpp`

### Other components

- **Board User**

## Connections

- Board User → Demo Application: operates (evidence: `STM32F4-Discovery_FW_V1.1.0/Project/Demonstration/main.c`)
- Demo Application → Demo Configuration: uses definitions (evidence: `STM32F4-Discovery_FW_V1.1.0/Project/Demonstration/main.c`)
- Demo Application → USB HID Class: uses HID (evidence: `STM32F4-Discovery_FW_V1.1.0/Project/Demonstration/main.c`)
- Demo Application → USB User Callbacks: uses callbacks (evidence: `STM32F4-Discovery_FW_V1.1.0/Project/Demonstration/main.c`)
- Demo Application → USB Descriptors: uses descriptors (evidence: `STM32F4-Discovery_FW_V1.1.0/Project/Demonstration/main.c`)
- Demo Application → LIS302DL Driver: configures and reads (evidence: `STM32F4-Discovery_FW_V1.1.0/Project/Demonstration/main.c`)
- FreeRTOS Sample → Peripheral Examples: demonstrates board I/O
