This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Extended ADV function return assert when called from Uart callback thread

Hi,

I tested Extended advertising for my data using sdk connect 1.9.1 and 1.8.0, the code is attached.

With both the SDK, I observed different behaviour. First of all with 1.9.1, Extended ADV is not able to set data on uart callback which is okay with SDK 1.8.0.

But with SDK 1.8.0, it is unable to initiate start ext adv in uart callback function.

Can you please check, I have added a flag (enablestartstop) to modify the code for these two scenarios?

ext_adv_nordic.zip

Parents
  • Hi Ashish

    Håkon is currently unavailable, and I will help out with your case instead. 

    In general it is very limited which functions you can call directly from interrupt callbacks, and this includes a lot of the Bluetooth API's. 

    One way to work around this problem is to use work queue to schedule your Bluetooth calls to be run from a thread (not interrupt) context. This is described in more detail here.

    Alternatively you can push a message to a message queue, and read out messages from the queue in a thread. 

    If you have any problem getting this to work just let me know, and I will do my best to help. 

    Best regards
    Torbjørn

Reply
  • Hi Ashish

    Håkon is currently unavailable, and I will help out with your case instead. 

    In general it is very limited which functions you can call directly from interrupt callbacks, and this includes a lot of the Bluetooth API's. 

    One way to work around this problem is to use work queue to schedule your Bluetooth calls to be run from a thread (not interrupt) context. This is described in more detail here.

    Alternatively you can push a message to a message queue, and read out messages from the queue in a thread. 

    If you have any problem getting this to work just let me know, and I will do my best to help. 

    Best regards
    Torbjørn

Children
No Data
Related