How rctestflight/trail_tracer_mower works
This is ESP32 firmware for the WFRX TrailTracer receiver/controller. Its principal workflow is to receive sensor, status, and charging packets from an STM32 over UART, use firmware control logic to manage steering and charging, and exchange commands and telemetry with connected systems. At startup, it loads device settings through a USB mass-storage configuration interface and applies them. The graph includes the sampled PWM capture and stuck-detection modules; unsampled behavior is represented only where documented or referenced, so some internal control and integration links are omitted.
Main entry points: src/main.cpp Firmware coordinator · usb_msc_fat.cpp Configuration service · src_public_release/main.cpp Telemetry broadcast · rctf_wfrx_esp32.cpp Stuck detection
Components 14
Firmware runtime
- Firmware coordinator
src/main.cpp - Telemetry broadcast
src_public_release/main.cpp
Vehicle control
- Stuck detection
src_public_release/rctf_wfrx_esp32.cpp - Steering control
src_public_release/main.cpp - Charge management
src/main.cpp
Device configuration
- Configuration service
src/usb_msc_fat.cpp - Configuration API
include/usb_msc_fat.h - Flash-backed storage
src/usb_msc_fat.cpp - FAT config files
src/usb_msc_fat.cpp
Hardware interfaces
- UART packet contract
include/wfrx_stm32_comms.h - Status bit definitions
include/rctf_wfrx_status_bits.h - PWM input capture
src/pwm_read_rmt.c
Other components
- USB host
- STM32 controller
Connections 13
- STM32 controller → Firmware coordinator: sends UART packets
src/main.cpp - Firmware coordinator → UART packet contract: uses packet format
src/main.cpp - Firmware coordinator → Status bit definitions: uses status bits
src/main.cpp - Firmware coordinator → Configuration service: initializes settings
src/main.cpp - Firmware coordinator → PWM input capture: imports capture API
src/main.cpp - Firmware coordinator → Steering control: computes steering
src_public_release/main.cpp - Firmware coordinator → Charge management: runs charge control
src/main.cpp - Firmware coordinator → Telemetry broadcast: queues telemetry
src_public_release/main.cpp - Firmware coordinator → Stuck detection: uses detector
- USB host → Configuration service: edits config
- Configuration service → Configuration API: implements API
src/usb_msc_fat.cpp - Configuration service → Flash-backed storage: reads and writes
src/usb_msc_fat.cpp - Configuration service → FAT config files: loads and saves JSON
src/usb_msc_fat.cpp