How eduarmproject/stm32_driver works
This repository is firmware for an STM32-based robotic-arm motor controller, with a CAN-addressed motor interface and reusable stepper-driver and encoder components. The visible startup workflow initializes MCU peripherals, reads the motor address from DIP switches, and configures CAN filtering; a CAN receive callback stores incoming commands. Although command opcodes and a state machine are defined, the sampled runtime does not show commands being executed: the main loop is idle, and its separate motor FSM entry point is not called. The README is empty, so capability descriptions are limited to the tree and sampled code.
Main entry points: fdcan.c CAN controller · main.c Application entry · Src Peripheral setup · canfd_protocol.c CAN configuration
Components 11
Firmware startup
- Application entry
Core/Src/main.c - Peripheral setup
Core/Src
CAN motor control
- Motor state and commands
EduArmLib/FSM/motor_can.c - CAN configuration
EduArmLib/Protocols/canfd_protocol.c - CAN controller
Core/Src/fdcan.c
Motor and encoder drivers
- TMC2209 driver
EduArmLib/Components/tmc2209.c - AS5047 encoder
EduArmLib/Components/as5047.c
Device protocols
- UART half-duplex
EduArmLib/Protocols/uart_protocol.c - SPI transfer
EduArmLib/Protocols/spi_protocol.c
Other components
- Motor network
- Magnetic encoder
Connections 10
- Application entry → Peripheral setup: initializes
Core/Src/main.c - Application entry → Motor state and commands: reads address
Core/Src/main.c - Application entry → CAN configuration: configures CAN
Core/Src/main.c - Peripheral setup → CAN controller: initializes
Core/Src/fdcan.c - CAN configuration → CAN controller: starts interface
EduArmLib/Protocols/canfd_protocol.c - Motor network → CAN controller: sends commands
- CAN controller → Motor state and commands: delivers received frame
EduArmLib/FSM/motor_can.c - TMC2209 driver → UART half-duplex: transmits registers
EduArmLib/Components/tmc2209.c - AS5047 encoder → SPI transfer: uses SPI transfer
- Magnetic encoder → AS5047 encoder: provides measurements