Skip to content

docs: explicit WiFi⊕BT contract + hardware bring-up checklist#1

Merged
MichaelAdamGroberman merged 1 commit into
mainfrom
docs/radio-xor-contract
May 24, 2026
Merged

docs: explicit WiFi⊕BT contract + hardware bring-up checklist#1
MichaelAdamGroberman merged 1 commit into
mainfrom
docs/radio-xor-contract

Conversation

@MichaelAdamGroberman

Copy link
Copy Markdown
Owner

Makes the radio mutual-exclusion guarantee explicit and adds an on-device verification checklist.

Changes

  • architecture.md: document the RadioManager contract — (1) never bring up a radio outside RadioManager; (2) stop hooks must fully deinit (WiFi.mode(WIFI_OFF), NimBLEDevice::deinit(true)) so the heap is reclaimed before the other radio starts. Without this the WiFi⊕BT heap guarantee can be defeated on RAM-constrained chips. Also fixes the ESP32 WireGuard lib name (felipedadison fork, not ciniml).
  • docs/hardware-bringup.md (new): on-device checklist, including a free-heap-across-switch step that cycles WiFi⇄BT ~10× and confirms free heap is stable (no leak) and the two radios never coexist.
  • README: links the checklist from Build and test.

Docs-only; CI re-runs native tests + board compile matrix + shellcheck to confirm nothing regressed.

…g-up checklist

- architecture.md: spell out the contract — all radio bring-up must go through
  RadioManager and stop hooks must fully deinit (else the heap guarantee is
  defeated). Also corrects the ESP32 WG lib name (felipedadison fork, not ciniml).
- docs/hardware-bringup.md (new): on-device checklist incl. a free-heap-across-
  switch step to confirm the radios never coexist and the stack is reclaimed.
- README: link the hardware checklist from Build and test.
Copilot AI review requested due to automatic review settings May 24, 2026 22:38

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR strengthens the project’s documentation around the WiFi⊕BT mutual-exclusion design by making the RadioManager contract explicit and adding an on-device validation checklist to confirm behavior on real hardware.

Changes:

  • Document the RadioManager “all transitions go through the manager + stop hooks fully deinit” contract to preserve the heap guarantee.
  • Add a new hardware bring-up checklist, including repeated WiFi⇄BT switching with free-heap checks to detect leaks.
  • Link the new checklist from the README build/test section.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
README.md Adds a link from “Build and test” to the new hardware bring-up checklist.
docs/hardware-bringup.md New on-device verification checklist for radio XOR behavior and heap stability across switches.
docs/architecture.md Documents the RadioManager contract more explicitly and updates ESP32 WireGuard backend library naming/details.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/hardware-bringup.md
Comment on lines +15 to +16
## 1. Radio mutual exclusion (WiFi XOR BT)

Comment thread docs/hardware-bringup.md
Comment on lines +3 to +4
The host tests (`pio test -e native`, 20/20) and the CI compile matrix prove
the logic and that the firmware builds. They cannot prove on-device behavior.
Comment thread docs/architecture.md
Comment on lines +47 to +50
2. **Each stop hook MUST fully deinitialize its stack before returning**, so
the heap is reclaimed before the other radio starts. The reference hooks do
this: `stopWifi()` → `WiFi.mode(WIFI_OFF)` (deinitializes the WiFi driver),
`stopBt()` → `NimBLEDevice::deinit(true)` (frees the entire BLE stack). A
Comment thread docs/architecture.md
Comment on lines +110 to +112
Wraps `felipedadison/WireGuard-ESP32` (a fork of `ciniml/WireGuard-ESP32`
updated for arduino-esp32 3.x / IDF5 — the original `#include`s the removed
`tcpip_adapter.h`). lwIP-based. Implements `WgBackend::begin()` (configure
@MichaelAdamGroberman MichaelAdamGroberman merged commit 25ac4aa into main May 24, 2026
10 checks passed
@MichaelAdamGroberman MichaelAdamGroberman deleted the docs/radio-xor-contract branch May 24, 2026 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants