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

BLE: Receive multiple packets per connection interval

Hello,

My application is based on the example "ble_thread_dyn_mtd_coap_cli" (nRF5_SDK_for_Thread_and_Zigbee_v4.1.0).
I would like to be able to send large files via Bluetooth with my smartphone.

During my tests, the smartphone (Samsung S10) sends 233 bytes every 30ms (the connection interval is around 49ms).
Usually, everything works fine, but it sometimes happens that the smartphone sends up to 6 packets in a connection interval: the problem is that when this happens, the Nordic chip crashes.

In fact, the problem comes from the fact that "appsh_events_poll ()" is called too often: the scheduller then fills up with calls to this function until it is full.

Do you have any idea why it crashes when the Nordic chip receives 6 packets per connection interval (whereas it works fine when it only receives 2)?

Thank you

  • Hi,

    As you get NRF_ERROR_NO_MEM returned from app_sched_event_put() this means that the scheduler queue is full, because tasks are added to the queue before they are processed. If this is just caused by a temporary burst when you get a lot of data in a BLE connection event, then perhaps it is enough to increase the queue size. If not, you need to find a way to optimize things so that this does not happen. If you know that the queue can be full sometimes and resetting in these cases is not an option, then you need to handle that somehow instead of just catching the error with an APP_ERROR_CHECK.

Related