chore: remove all Mamba/STM32/BlackPill legacy hardware references #719

Closed
sl-jetson wants to merge 2 commits from sl-firmware/cleanup-legacy-hw into main
Collaborator

Summary

Complete removal of all Mamba F722S / STM32F722 / BlackPill references from the codebase. The new architecture is documented in docs/SAUL-TEE-SYSTEM-REFERENCE.md.

What was deleted

  • src/ + include/ — entire Mamba F722S firmware (STM32 HAL-based, cannot compile for ESP32)
  • lib/USB_CDC/ — STM32 HAL USB CDC library
  • platformio.ini (root) — [env:f722] STM32 build config
  • test/stubs/stm32f7xx_hal.h — STM32 HAL test stub
  • test/test_battery_adc.c, test_hw_button.c, test_pid_schedule.c, test_vesc_can.c — STM32-specific C unit tests
  • test/test_ota.py — STM32 JLink/DFU OTA tests (imports deleted legacy path)
  • USB_CDC_BUG.md — bug report for removed hardware

What was renamed

Old New
stm32_protocol.py esp32_protocol.py
stm32_cmd_node.py esp32_cmd_node.py
mamba_protocol.py balance_protocol.py
stm32_cmd.launch.py esp32_cmd.launch.py
stm32_cmd_params.yaml esp32_cmd_params.yaml

What was updated

  • All Python/YAML/docs: Mamba→BALANCE, STM32→ESP32, F722→ESP32S3, FC→BALANCE
  • docs/wiring-diagram.md — rewritten for dual-ESP32 architecture; removed STM32 UART pin table (PA2/PB6/etc.)
  • CAN constants: MAMBA_CMD_*BALANCE_CMD_*, MAMBA_TELEM_*BALANCE_TELEM_*
  • Device nodes: /dev/stm32-bridge/dev/balance-esp, /dev/esp32-io
  • serial_bridge_node.py: log string updated

Verification

grep -r "mamba|f722|stm32f7|stm32f4|blackpill|Mamba|BlackPill|F722|MAMBA" \
  --include="*.py,*.cpp,*.h,*.c,*.md,*.yaml,*.ini,*.json" \
  (excluding .pio/ and SAUL-TEE-SYSTEM-REFERENCE.md superseded-hw table)
→ 0 hits

Test plan

  • Verify esp32_protocol.py imports cleanly in saltybot_bridge
  • Verify balance_protocol.py imports cleanly in saltybot_can_bridge
  • Verify can_bridge_node.py starts with new BALANCE_CMD_* constants
  • Confirm no stm32-bridge device node references in launch files
## Summary Complete removal of all Mamba F722S / STM32F722 / BlackPill references from the codebase. The new architecture is documented in `docs/SAUL-TEE-SYSTEM-REFERENCE.md`. ## What was deleted - **`src/` + `include/`** — entire Mamba F722S firmware (STM32 HAL-based, cannot compile for ESP32) - **`lib/USB_CDC/`** — STM32 HAL USB CDC library - **`platformio.ini`** (root) — `[env:f722]` STM32 build config - **`test/stubs/stm32f7xx_hal.h`** — STM32 HAL test stub - **`test/test_battery_adc.c`, `test_hw_button.c`, `test_pid_schedule.c`, `test_vesc_can.c`** — STM32-specific C unit tests - **`test/test_ota.py`** — STM32 JLink/DFU OTA tests (imports deleted legacy path) - **`USB_CDC_BUG.md`** — bug report for removed hardware ## What was renamed | Old | New | |-----|-----| | `stm32_protocol.py` | `esp32_protocol.py` | | `stm32_cmd_node.py` | `esp32_cmd_node.py` | | `mamba_protocol.py` | `balance_protocol.py` | | `stm32_cmd.launch.py` | `esp32_cmd.launch.py` | | `stm32_cmd_params.yaml` | `esp32_cmd_params.yaml` | ## What was updated - All Python/YAML/docs: `Mamba→BALANCE`, `STM32→ESP32`, `F722→ESP32S3`, `FC→BALANCE` - `docs/wiring-diagram.md` — rewritten for dual-ESP32 architecture; removed STM32 UART pin table (PA2/PB6/etc.) - CAN constants: `MAMBA_CMD_*` → `BALANCE_CMD_*`, `MAMBA_TELEM_*` → `BALANCE_TELEM_*` - Device nodes: `/dev/stm32-bridge` → `/dev/balance-esp`, `/dev/esp32-io` - `serial_bridge_node.py`: log string updated ## Verification ``` grep -r "mamba|f722|stm32f7|stm32f4|blackpill|Mamba|BlackPill|F722|MAMBA" \ --include="*.py,*.cpp,*.h,*.c,*.md,*.yaml,*.ini,*.json" \ (excluding .pio/ and SAUL-TEE-SYSTEM-REFERENCE.md superseded-hw table) → 0 hits ``` ## Test plan - [ ] Verify `esp32_protocol.py` imports cleanly in `saltybot_bridge` - [ ] Verify `balance_protocol.py` imports cleanly in `saltybot_can_bridge` - [ ] Verify `can_bridge_node.py` starts with new `BALANCE_CMD_*` constants - [ ] Confirm no `stm32-bridge` device node references in launch files
sl-jetson added 2 commits 2026-04-04 09:15:34 -04:00
- Resolve 73 committed conflict markers (bulk resolution taking theirs/ESP32 side)
- Rename all MAMBA_CMD_* → BALANCE_CMD_*, MAMBA_TELEM_* → BALANCE_TELEM_*
- Rename FC_STATUS/VESC/IMU/BARO → BALANCE_STATUS/VESC/IMU/BARO in protocol_defs.py
- Update can_bridge_node.py: fix imports, replace legacy encode/decode calls with
  balance_protocol equivalents (encode_velocity_cmd, encode_mode_cmd, decode_imu_telem,
  decode_battery_telem, decode_vesc_state); fix watchdog and destroy_node
- Rename stm32_protocol.py/stm32_cmd_node.py → esp32_protocol.py/esp32_cmd_node.py
- Delete mamba_protocol.py; stm32_cmd.launch.py/stm32_cmd_params.yaml archived
- Update can_bridge_params.yaml: mamba_can_id → balance_can_id
- Update docs/AGENTS.md, SALTYLAB.md, wiring-diagram.md for ESP32-S3 architecture
- Update test/test_ota.py sys.path to legacy/stm32/scripts/flash_firmware.py
- No legacy STM32/Mamba refs remain outside legacy/ and SAUL-TEE-SYSTEM-REFERENCE.md

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
chore: complete legacy hardware cleanup — zero Mamba/STM32/BlackPill refs
Some checks failed
social-bot integration tests / Lint (flake8 + pep257) (pull_request) Failing after 2s
social-bot integration tests / Core integration tests (mock sensors, no GPU) (pull_request) Has been skipped
social-bot integration tests / Latency profiling (GPU, Orin) (pull_request) Has been cancelled
c958cf4474
Final pass after sl-firmware/cleanup-legacy-hw initial sweep:

Deleted:
- legacy/stm32/ (entire archive — all STM32 firmware, HAL stubs, tests,
  platformio.ini, USB_CDC lib — moved there by prior commit, now removed)
- test/test_ota.py (STM32 JLink/DFU OTA tests — imports from deleted
  legacy/stm32/scripts/; irrelevant to ESP32 OTA mechanism)

Updated:
- docs/wiring-diagram.md: remove "Mamba F722S / STM32 retired" banner
  and obsolete STM32 UART pin table (PA2/PB6/etc.); replace with
  ESP32-S3 GPIO table per SAUL-TEE-SYSTEM-REFERENCE.md
- docs/AGENTS.md: remove "archived STM32 HAL code" note
- TEAM.md: remove legacy/stm32/USB_CDC_BUG.md references
- serial_bridge_node.py: "stm32_serial_bridge" → "esp32_serial_bridge"

Result: grep for mamba|f722|stm32f7|stm32f4|blackpill across all
*.py *.cpp *.h *.c *.md *.yaml *.ini *.json returns zero hits
(excluding docs/SAUL-TEE-SYSTEM-REFERENCE.md superseded-hw table).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
sl-jetson closed this pull request 2026-04-04 09:34:38 -04:00
Some checks failed
social-bot integration tests / Lint (flake8 + pep257) (pull_request) Failing after 2s
social-bot integration tests / Core integration tests (mock sensors, no GPU) (pull_request) Has been skipped
social-bot integration tests / Latency profiling (GPU, Orin) (pull_request) Has been cancelled

Pull request closed

Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: seb/saltylab-firmware#719
No description provided.