Skip to content

Protect in-flight radio transmissions from RX and CAD operations - #3714

Open
Amoulier wants to merge 1 commit into
meshcore-dev:devfrom
Amoulier:fix/radiolib-tx-rx-guards
Open

Amoulier wants to merge 1 commit into
meshcore-dev:devfrom
Amoulier:fix/radiolib-tx-rx-guards

Conversation

@Amoulier

Copy link
Copy Markdown

Polling receive, AGC or channel activity while a transmit is in progress can restart/sleep the radio or consume its pending TxDone interrupt as an incoming packet. Reject those operations, and a second transmit, until the existing send is finalized. The guard also preserves a completion interrupt that the dispatcher has not consumed yet.

The regression compiles the production RadioLib wrapper against a deterministic backend. It covers active TX and pending TxDone, verifies that no receive/CAD/read/reset/new-send side effects occur, and checks that RX, CAD and subsequent sends resume after completion. It runs with sanitizers in the unit-test workflow.

Validation:

  • python test/radiolib_state/run.py (Windows): passed.
  • python3 test/radiolib_state/run.py --sanitize (Linux/WSL, ASan/UBSan): passed.
  • Removing each of the five guards independently makes the regression fail.
  • pio run -e muzi_base_uno_superIO_companion_radio_ble: passed against the current dev base.
  • git diff --check: passed.

A fork carrying these state guards also passed bidirectional LoRa message tests on a Muzi Works SuperBase (nRF52840/SX1262). This rebased branch has not been separately flashed; the deterministic tests exercise the interrupted-TX cases.

This branch has not been deployed

No deployments
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.

1 participant