The Wombat robot uses a two-processor architecture. A Raspberry Pi handles high-level logic, vision, networking, and user code. An STM32F427 microcontroller handles everything that requires hard real-time guarantees: motor PWM generation, back-EMF sampling, closed-loop motor control, sensor ADC scanning, and IMU data acquisition. This split is not optional — the Linux scheduler on the Pi cannot provide the microsecond-level timing that back-EMF based position tracking requires.
This section documents the firmware running on the STM32 and the full data pipeline connecting it to user Python code.
Sections
- Architecture Overview — what each processor does and why
- SPI Communication Protocol — the shared-memory duplex buffers between Pi and STM32
- Motor Control — PWM generation, back-EMF measurement, PID loops, operating modes
- Sensor Reading — analog ports, digital ports, battery voltage, IMU
- Data Pipeline — the full path from physical signal to Python API
- Build and Flash — how to compile and program the firmware
Source Repositories
| Repository | Location |
|---|---|
| STM32 firmware | Firmware-Stp/ |
| Pi-side SPI bridge | stm32-data-reader/ |
| libstp hardware abstraction | library/modules/libstp-platforms/wombat/ |
| raccoon-transport (LCM wrapper) | library/raccoon-transport/ |
| Shared SPI protocol header | stm32-data-reader/shared/spi/pi_buffer.h |