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

Change of ADV data in SDK 17

Hello 

We have an application that ADV every second and is based on SDK 14.

We are currently attempting to move to SDK 17. What I have noticed is that if I change and ADV data during advertisement by the help of new API function ble_advertising_advdata_update I see that there will be a delay of ±2 seconds (I see it in air trace) during which there will be no ADV at all.

Even when I configured ADV interval to be 100 milli and data rate change is 1 time at a second I see a delay of 2 seconds over the air until an updated data takes place.

The question is: Is that an expected behaviour? Is there any way to prevent this stop of ADV for 2 seconds?

  • Ok

    I got to the root cause of the problem.

    I hit HardFault handler in the function sd_ble_gap_adv_set_configure

    If I call the function from our main loop - I do not hit any breakpoint and everything works smoothly.

    However when I use our regular flow:

    I hit an error. Is there any restriction or when the sd_ble_gap_adv_set_configure is called or context of the caller?

  • I just wanted to state it more clear - if the function BLE_update_advertise is being called at the context of main loop - no problem

  • One more question: by logger you mean rtt viewer right?

  • And one more observation is that when I disabled usage of man specific data at all and just call for the update of ADV data with the same parameters that I initialised at the beginning I still crash - which may be points to the direction of contexts...

  • Hello,

    KTM said:

    I got to the root cause of the problem.

    I hit HardFault handler in the function sd_ble_gap_adv_set_configure

    If I call the function from our main loop - I do not hit any breakpoint and everything works smoothly.

    Great observation, thank you for clarifying! 

    KTM said:
    I hit an error. Is there any restriction or when the sd_ble_gap_adv_set_configure is called or context of the caller?

    Nothing beyond what is written in the sd_ble_gap_adv_set_configure documentation

    KTM said:
    One more question: by logger you mean rtt viewer right?

    That depends - have you configured the logger module to use the RTT backend?
    In that case, yes, I do mean RTT viewer or the Debug Terminal in SES ( please not that you need to define NRF_FPRINTF_FLAG_AUTOMATIC_CR_ON_LF_ENABLED to 0 for Debug Terminal to work ).
    Are you seeing any output on your RTT Viewer at all, when your program is running?
    While you may continue debugging as you currently are, I would highly recommend making use of the logger module, since this will drastically ease debugging.
    If you are not seeing any logger outputs, then we should solve that problem before continuing the advdata_update issue - since having a logger working will make all future debugging easier.

    KTM said:
    And one more observation is that when I disabled usage of man specific data at all and just call for the update of ADV data with the same parameters that I initialised at the beginning I still crash - which may be points to the direction of contexts...

    Yes, I too would say this points in the direction of the context.
    What context is the advdata update function called from in your regular program? Could you change the priority of the interrupt that triggers the update, to see if this affects your issue?

    Looking forward to resolving this issue together!

    Best regards,
    Karl

Related