Skip to content

feat(HAL/ZEPHYR): Zephyr core + serial-network HAL bound to a radio byte PHY#505

Open
nicolas-rabault wants to merge 4 commits into
feat/shared_libfrom
feat/zephyr-hal
Open

feat(HAL/ZEPHYR): Zephyr core + serial-network HAL bound to a radio byte PHY#505
nicolas-rabault wants to merge 4 commits into
feat/shared_libfrom
feat/zephyr-hal

Conversation

@nicolas-rabault
Copy link
Copy Markdown
Member

ZEPHYR HAL port for luos_engine

Adds a Zephyr RTOS port of the core LuosHAL plus a serial-network HAL bound to a radio byte PHY, enabling luos_engine to run a serial network over a wireless link on Zephyr targets (bench-verified on nRF54L15).

What's here

  • engine/HAL/ZEPHYR/ — core LuosHAL port: timing (systick) + IRQ enable/disable, with luos_hal_config.h providing the *_MUTEX_LOCK/UNLOCK no-op macros every other HAL defines (the engine's single-loop model needs no real locks).
  • network/serial_network/HAL/ZEPHYR/ — serial-network HAL driving the radio byte PHY.

Notable design point — synchronous TX

serial_network.c busy-waits on the sending flag in paths that never pump the HAL (e.g. the while (sending == true); spin at the top of Serial_RunTopology), and every other Luos serial HAL clears sending from the TX-complete path. A deferred (SerialHAL_Loop-driven) design deadlocks there: the TX-done IRQ fires but Serial_TransmissionEnd is never reached, so sending stays true forever.

SerialHAL_Send therefore transmits, waits for the radio TX-done IRQ, then calls Serial_TransmissionEnd() from caller context — never from the ISR, which would re-enter radio_send.

Verification

Bench-verified end to end on nRF54L15: node detected over the air and an LED driven across the radio serial network.

Scope is limited to the 5 new HAL files (+186 lines); no engine, binding, or build-script changes. Targets feat/shared_lib.

🤖 Generated with Claude Code

nicolas-rabault and others added 4 commits June 2, 2026 12:19
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…yte PHY

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The ZEPHYR luos_hal_config.h omitted MSGALLOC_MUTEX_LOCK/UNLOCK and
LUOS_MUTEX_LOCK/UNLOCK that every other HAL defines, causing build
errors in luos_engine.c, service.c, luos_io.c and luos_phy.c.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
serial_network.c busy-waits on `sending` in spots that never pump the HAL
(the `while (sending == true);` spin at the top of Serial_RunTopology), and
every other Luos serial HAL clears `sending` from the TX-complete path. The
deferred-via-SerialHAL_Loop design deadlocked there: tx_done fired (IRQ) but
Serial_TransmissionEnd was never reached, so `sending` stayed true forever.
SerialHAL_Send now transmits, waits for the radio TX-done IRQ, then calls
Serial_TransmissionEnd() from caller context (never the ISR, which would
re-enter radio_send). Bench-verified: node detected + LED driven over the air.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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