How yong-uno/drone works
This is STM32F4 robot-control firmware. Its principal workflow is to read operator input, compute gimbal and shooter motor commands, and transmit them over CAN; the README specifically documents RS05/DM4310 CAN control. The tree also shows sensor, display/referee UI, and USB/VPC capabilities. Source evidence is partial: the excerpts show peripheral initialization and shooter control, while most application wiring is unsampled, so uncertain links are dashed and marked unverified.
Main entry points: shoot_control.c Shooter control · bsp_can.c CAN board driver · dbus.c Remote input · freertos.c RTOS tasks
Components 20
Startup and RTOS
- Firmware startup
Core/Src/main.c - RTOS tasks
Core/Src/freertos.c
Robot control
- Gimbal control
User/Application/gimbal/gimbal_control_pitch.cpp - Shooter control
User/Application/shoot/shoot_control.c - Control switch
User/Application/control_switch/control_switch.c - PID algorithms
User/Modules/Algorithm/PID/pid.c - Robot status
User/Modules/robot_status/robot_status.c
Board I/O
- Remote input
User/BSP/UART/dbus.c - CAN board driver
User/BSP/CAN/bsp_can.c - I2C board driver
User/BSP/IIC/bsp_iic.c - BMI088 SPI driver
User/BSP/SPI/spi_bmi088/bsp_spi_bmi088.c - USB CDC interface
USB_DEVICE/App/usbd_cdc_if.c
Devices and UI
- RS05 motor protocol
User/Modules/RS05/RS05.cpp - IMU sensors
User/Modules/bmi088/bmi088.c - Display task
User/Application/display/display.c - SSD1306 display
User/Modules/ssd1306/ssd1306.c - Referee UI
User/Modules/ui/dev_referee_ui.c - VPC connectivity
User/Application/VPC/vpc.cpp
Other components
- Operator
- USB host
Connections 17
- Operator → Remote input: sends input
- Remote input → Shooter control: provides controls
- Remote input → Gimbal control: provides controls
- RTOS tasks → Shooter control: runs task
- RTOS tasks → Gimbal control: runs task
- Shooter control → PID algorithms: calculates control
- Shooter control → CAN board driver: sends motor commands
User/Application/shoot/shoot_control.c - Gimbal control → CAN board driver: uses CAN driver
User/Application/gimbal/gimbal_control_pitch.cpp - CAN board driver → RS05 motor protocol: uses motor protocol
User/BSP/CAN/bsp_can.c - IMU sensors → BMI088 SPI driver: uses SPI driver
- IMU sensors → I2C board driver: uses I2C driver
- Display task → SSD1306 display: renders display
User/Application/display/display.c - Referee UI → USB host: exchanges referee UI
- USB host → USB CDC interface: connects USB
- USB CDC interface → VPC connectivity: passes data
USB_DEVICE/App/usbd_cdc_if.c - Firmware startup → CAN board driver: initializes CAN
Core/Src/main.c - Firmware startup → RTOS tasks: starts scheduler