How vedderb/bldc works
VESC is embedded firmware for DC, BLDC, and FOC motor controllers. At boot, main initializes motor control, command handling, and communications; configured applications provide controller inputs, while the motor-control implementation drives the hardware. Commands and configuration are also exposed to external tools, including firmware upload over USB. The tree and excerpts support the boot, application-selection, and FOC paths; many other capabilities are visible only from the file tree or README, so their internal links are omitted rather than inferred.
Main entry points: main.c Boot and runtime · motor Motor interface · app.c App selection · comm_usb.c USB transport
Components 20
Firmware runtime
- Boot and runtime
main.c - Configuration
conf_general.c - EEPROM storage
driver/eeprom.c - Flash operations
flash_helper.c
Motor control
- Motor interface
motor - FOC control
motor/mcpwm_foc.c
Inputs and communications
- Command processing
comm/commands.c - USB transport
comm/comm_usb.c - CAN transport
comm/comm_can.c - Packet framing
comm/packet.c - App selection
applications/app.c - Controller inputs
applications
Hardware and sensing
- Encoder support
encoder/encoder.c - IMU support
imu - Board hardware
hwconf - STM32 HAL
ChibiOS_3.0.5/os/hal
Firmware extensions
- Battery management
bms.c - LispBM extensions
lispBM/lispif_vesc_extensions.c
Other components
- SWD debugger
- VESC Tool
Connections 10
- Boot and runtime → Command processing: initializes
main.c - Boot and runtime → Motor interface: initializes
main.c - Boot and runtime → USB transport: initializes
main.c - Boot and runtime → Flash operations: erases code
main.c - Boot and runtime → Configuration: loads settings
- Boot and runtime → App selection: initializes UART app
main.c - App selection → Controller inputs: starts selected app
applications/app.c - Motor interface → FOC control: delegates control
motor/mcpwm_foc.c - VESC Tool → USB transport: uploads firmware
- SWD debugger → Boot and runtime: enables flashing