# aj-0/5-dof-robotic-arm-using-stm32 architecture

> Architecture diagram of the GitHub repository aj-0/5-dof-robotic-arm-using-stm32, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aj-0/5-dof-robotic-arm-using-stm32
- Repository: https://github.com/aj-0/5-dof-robotic-arm-using-stm32

## Overview

This repository is embedded firmware for an STM32 NUCLEO-F411RE robotic arm controller. The documented user-to-motion workflow is mobile app over Wi‑Fi → ESP32 → UART commands → STM32 firmware → timer-generated PWM → servo-driven arm. The sampled main routine starts interrupt-driven UART reception and configures timers; the excerpts do not show command parsing or the receive callback, so those links are documented at the README level. Platform support nodes aggregate the substantial CMSIS and STM32 HAL modules listed in the source index.

Main entry points: [`Core/Src/main.c`](https://github.com/aj-0/5-dof-robotic-arm-using-stm32/blob/main/Core/Src/main.c) (Firmware startup), [`Drivers/STM32F4xx_HAL_Driver`](https://github.com/aj-0/5-dof-robotic-arm-using-stm32/tree/main/Drivers/STM32F4xx_HAL_Driver) (STM32 HAL drivers), [`Drivers/CMSIS/Device/ST/STM32F4xx/Include`](https://github.com/aj-0/5-dof-robotic-arm-using-stm32/tree/main/Drivers/CMSIS/Device/ST/STM32F4xx/Include) (STM32 device support), [`Core/Inc/stm32f4xx_hal_conf.h`](https://github.com/aj-0/5-dof-robotic-arm-using-stm32/blob/main/Core/Inc/stm32f4xx_hal_conf.h) (HAL configuration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_command["Command transport"]
  node_esp32["ESP32 bridge"]
end

subgraph group_firmware["Arm firmware"]
  node_stm32["STM32 controller"]
  node_main["Firmware startup<br/>[main.c]"]
  node_uart["UART reception<br/>[main.c]"]
  node_servo_control["Servo PWM control<br/>[main.c]"]
end

subgraph group_platform["MCU platform"]
  node_hal_config["HAL configuration"]
  node_interrupts["Interrupt handlers<br/>[stm32f4xx_it.c]"]
  node_msp["Peripheral setup"]
  node_hal_drivers["STM32 HAL drivers"]
  node_cmsis_device["STM32 device support"]
  node_cmsis_core["CMSIS core support"]
end

subgraph group_actuation["Servo actuation"]
  node_servos["SG90 servos"]
  node_arm["Robotic arm"]
end

node_mobile(("Mobile app"))

node_mobile -->|"sends commands"| node_esp32
node_esp32 -->|"transmits UART"| node_uart
node_uart -->|"receives commands"| node_stm32
node_main -->|"starts reception"| node_uart
node_main -->|"configures timers"| node_servo_control
node_servo_control -->|"outputs PWM"| node_servos
node_servos -->|"moves joints"| node_arm
node_main -.->|"initializes HAL"| node_hal_drivers
node_hal_config -->|"configures modules"| node_hal_drivers
node_interrupts -.->|"handles callbacks"| node_main
node_msp -.->|"sets up peripherals"| node_hal_drivers
node_hal_drivers -.->|"uses device layer"| node_cmsis_device
node_cmsis_device -.->|"uses core support"| node_cmsis_core

click node_main "https://github.com/aj-0/5-dof-robotic-arm-using-stm32/blob/main/Core/Src/main.c"
click node_uart "https://github.com/aj-0/5-dof-robotic-arm-using-stm32/blob/main/Core/Src/main.c"
click node_servo_control "https://github.com/aj-0/5-dof-robotic-arm-using-stm32/blob/main/Core/Src/main.c"
click node_hal_config "https://github.com/aj-0/5-dof-robotic-arm-using-stm32/blob/main/Core/Inc/stm32f4xx_hal_conf.h"
click node_interrupts "https://github.com/aj-0/5-dof-robotic-arm-using-stm32/blob/main/Core/Src/stm32f4xx_it.c"
click node_msp "https://github.com/aj-0/5-dof-robotic-arm-using-stm32/blob/main/Core/Src/stm32f4xx_hal_msp.c"
click node_hal_drivers "https://github.com/aj-0/5-dof-robotic-arm-using-stm32/tree/main/Drivers/STM32F4xx_HAL_Driver"
click node_cmsis_device "https://github.com/aj-0/5-dof-robotic-arm-using-stm32/tree/main/Drivers/CMSIS/Device/ST/STM32F4xx/Include"
click node_cmsis_core "https://github.com/aj-0/5-dof-robotic-arm-using-stm32/tree/main/Drivers/CMSIS/Include"

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_esp32 toneBlue
class node_stm32,node_main,node_uart,node_servo_control toneAmber
class node_hal_config,node_interrupts,node_msp,node_hal_drivers,node_cmsis_device,node_cmsis_core toneMint
class node_servos,node_arm toneRose
class node_mobile toneIndigo
```

## Components

### Command transport

- **ESP32 bridge**

### Arm firmware

- **STM32 controller**
- [Firmware startup](https://github.com/aj-0/5-dof-robotic-arm-using-stm32/blob/main/Core/Src/main.c): `Core/Src/main.c`
- [UART reception](https://github.com/aj-0/5-dof-robotic-arm-using-stm32/blob/main/Core/Src/main.c): `Core/Src/main.c`
- [Servo PWM control](https://github.com/aj-0/5-dof-robotic-arm-using-stm32/blob/main/Core/Src/main.c): `Core/Src/main.c`

### MCU platform

- [HAL configuration](https://github.com/aj-0/5-dof-robotic-arm-using-stm32/blob/main/Core/Inc/stm32f4xx_hal_conf.h): `Core/Inc/stm32f4xx_hal_conf.h`
- [Interrupt handlers](https://github.com/aj-0/5-dof-robotic-arm-using-stm32/blob/main/Core/Src/stm32f4xx_it.c): `Core/Src/stm32f4xx_it.c`
- [Peripheral setup](https://github.com/aj-0/5-dof-robotic-arm-using-stm32/blob/main/Core/Src/stm32f4xx_hal_msp.c): `Core/Src/stm32f4xx_hal_msp.c`
- [STM32 HAL drivers](https://github.com/aj-0/5-dof-robotic-arm-using-stm32/tree/main/Drivers/STM32F4xx_HAL_Driver): `Drivers/STM32F4xx_HAL_Driver`
- [STM32 device support](https://github.com/aj-0/5-dof-robotic-arm-using-stm32/tree/main/Drivers/CMSIS/Device/ST/STM32F4xx/Include): `Drivers/CMSIS/Device/ST/STM32F4xx/Include`
- [CMSIS core support](https://github.com/aj-0/5-dof-robotic-arm-using-stm32/tree/main/Drivers/CMSIS/Include): `Drivers/CMSIS/Include`

### Servo actuation

- **SG90 servos**
- **Robotic arm**

### Other components

- **Mobile app**

## Connections

- Mobile app → ESP32 bridge: sends commands
- ESP32 bridge → UART reception: transmits UART
- UART reception → STM32 controller: receives commands
- Firmware startup → UART reception: starts reception (evidence: `Core/Src/main.c`)
- Firmware startup → Servo PWM control: configures timers (evidence: `Core/Src/main.c`)
- Servo PWM control → SG90 servos: outputs PWM
- SG90 servos → Robotic arm: moves joints
- Firmware startup → STM32 HAL drivers: initializes HAL
- HAL configuration → STM32 HAL drivers: configures modules (evidence: `Core/Inc/stm32f4xx_hal_conf.h`)
- Interrupt handlers → Firmware startup: handles callbacks
- Peripheral setup → STM32 HAL drivers: sets up peripherals
- STM32 HAL drivers → STM32 device support: uses device layer (evidence: `Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_rcc.h`)
- STM32 device support → CMSIS core support: uses core support
