04Firmware

Five subsystems, each its own folder under firmware/ — flash or swap a board without touching the rest. No vendor tools required: the REV SPARK CAN stack is reverse-engineered natively, and every setup task a vendor GUI would do ships as a script. The per-folder master table is firmware/CLAUDE.md.

Overview

SubsystemPathBoardFlash
Swerve basefirmware/swerve_drive/Teensy 4.1PlatformIO
Arms linkfirmware/openarm/Teensy 4.1PlatformIO
Liftfirmware/lift/RP2040 PicoMicroPython (mpremote)
ORCA handsfirmware/orca_hand/none — host-drivenno flash; servos close their own loops
Neckhost-drivennoneDynamixel pair over the U2D2, yaw on CAN

Base Teensy — swerve drive

cd firmware/swerve_drive
pio run -e teensy41 -t upload

Arms Teensy — CAN gateway

cd firmware/openarm
pio run -e mabel_main -t upload       # main arms firmware
pio run -e mabel_armlink -t upload    # ArmLink UDP↔MIT-CAN Ethernet gateway
The reference robot in these docs ran a pre-release arms build (openarm-dual, at 192.168.124.11) that predates the in-repo ArmLink gateway (192.168.125.10, host lane set by hardware_bridge/install/setup_arms_lane.sh). For a new build, flash the in-repo envs above and use the 192.168.125.x lane; the software resolves either through its port-agnostic Teensy discovery.

Lift Pico — MicroPython

pip install mpremote
firmware/lift/tools/deploy.sh         # copies the module set + main.py to the Pico
deploy.sh resolves the Pico by USB identity (usb-MicroPython*). Never use mpremote connect auto: the first serial port on the robot's hub is the base Teensy.

Hands — servo setup, no flash

python firmware/orca_hand/feetech/setup/precheck.py   # pings servo IDs 1..17 on a chain

CAN bring-up helpers

firmware/can_up.sh        # SocketCAN up — handles gs_usb and slcan adapters
firmware/can_scan.sh      # who's on the bus
firmware/can_down.sh

macOS has no SocketCAN; the tools fall back to a gs_usb-over-libusb backend, so bench setup works from a Mac too.

Firmware completion check