docs: explicit WiFi⊕BT contract + hardware bring-up checklist#1
Merged
Conversation
…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.
There was a problem hiding this comment.
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 on lines
+15
to
+16
| ## 1. Radio mutual exclusion (WiFi XOR BT) | ||
|
|
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 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 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Makes the radio mutual-exclusion guarantee explicit and adds an on-device verification checklist.
Changes
RadioManagercontract — (1) never bring up a radio outsideRadioManager; (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-only; CI re-runs native tests + board compile matrix + shellcheck to confirm nothing regressed.