Skip to content

Conversation

@gemenerik
Copy link
Member

This PR adds a startup gate mechanism to prevent radio packet queue overflows during STM32 boot. When clients connect too early, packets arrive before consumer tasks are ready, triggering assert failures in radiolink.c and uart_syslink.c. The STM32 now sends a SYSLINK_RADIO_READY signal after systemStart() completes, which the nRF51 can use to gate radio reception. The signal must be sent after systemStart() because many subsystems block on systemWaitStart() during initialization - sending it earlier causes their uninitialized parameters to return garbage data during the connection handshake. This change is backward compatible; the command is silently ignored by older nRF51 firmware. The full solution requires updated nRF51 firmware that implements the startup gate with a timeout fallback for compatibility.

Fixes #1516

@gemenerik gemenerik self-assigned this Oct 30, 2025
@gemenerik gemenerik requested a review from Copilot October 30, 2025 16:08
Copy link

Copilot AI left a comment

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 implements a ready handshake mechanism between the main system and the nRF51 radio to ensure radio packets are only processed after all system services are initialized.

  • Adds a new SYSLINK_RADIO_READY message type and systemSendRadioReady() function
  • Sends the ready notification after systemStart() completes in the system task
  • Updates the radiolink dispatcher to acknowledge incoming ready messages from the nRF51

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/hal/interface/syslink.h Defines new SYSLINK_RADIO_READY (0x0B) message type constant
src/modules/interface/system.h Declares systemSendRadioReady() function in public API
src/modules/src/system.c Implements systemSendRadioReady() and calls it after system initialization
src/hal/src/radiolink.c Handles incoming SYSLINK_RADIO_READY acknowledgment messages from nRF51

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

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.

Handle early operations without lockups

2 participants