This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Bug report: SoftDevice S110 crashes when radio pre activation hook is activated after advertising start and a connection is established

Hi,

I'm usind SoftDevice S110 version 7.1.0

Since I implemented a Radio Activation Hook, my software crashes when a connection is being established. I get the following information in the error handler:

  • Error code: 0xDEADBEEF
  • File: src\ll_lm.s0.c
  • Line: 1340

The radio activation SWI is called 800µs before radio activates. It is running on NRF_APP_PRIORITY_LOW and it evaluates a GPIO ports and updates the advertising data with sd_ble_gap_adv_data_set(). [I am using manufacturer specific data in the advertising data and have to calculate the current values right before each advertising event.]

The error occurs when a Central is trying to connect immediately to the Peripheral after receiving the first advertising signal. When the Central tries connecting some seconds later (after the Peripheral has been started and advertising has been wunning for a while), the error does not seem to occur.

My initialization sequence is:

  • List item
  • Initialize SoftDevice
  • Initialize Bluetooth (GAP, Service etc.)
  • Start advertising
  • Initialize Radio Activation Hook

When I change the initialization sequence and initialize the Radio Activation Hook before calling sd_ble_gap_adv_start(), everything seems to work fine. This is not an option for out final software, though, because we need to enable the Radio Activation Hook only under certain conditions (to save energy).

All of this seems to me like a bug in the SoftDevice. Can anyone confirm this? How can I activate/deactivate the Radio Activation Hook in a save way while advertising (or a connection) is active?

  • Hi

    I have partly reproduced this issue on my side. In my case, the device does not crash, it only fails to connect. I try to connect with Master Control Panel and I get the following message in the MCP log:

    Lost connection to device. Reason: BTLE_CONN_FAILED_TO_BE_ESTABLISHED
    

    But as you say, if I initialize the radio notification before start advertising or after connecting, then it works fine. I am not sure why the device halts in your case, but I guess it has something to do with your specific implementation. But I suspect that the root cause is the same. I attach my testing code, which is just the ble_app_template example with radio notification enabled.

    ble_app_template_with_radio_notification_after_adv_start.zip

    I have reported the issue internally. I do not know when a fix will be available.

Related