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

SoftDevice consuming too much CPU when BLE connection poor.

We're using an nRF52840 with S140 SoftDevice.  It's configured as a peripheral device.  Our application uses FreeRTOS with several cooperating tasks.  When connected with the central (iPhone app), it typically uploads quite a bit of data to the central.

When BLE signals are fairly strong everything works well.

However, if signals get weak we've observed the SoftDevice consume an inordinate amount of CPU, starving important FreeRTOS tasks for many seconds.

Is there something we can do about this?  Could tweaking connection parameters help?  Which parameter settings are likely to help in this use case?

Do you have any suggestions on how to troubleshoot what is going on?

Thanks!

Bruce

Parents
  • You wrote, "...what happens ...if the buffers fill up and you are unable to send the data..."

    That is very likely the problem.  I found a couple instances in our code where the send operation is immediately tried again with no delay.  That is surely the problem.  The task doing this needs to delay, giving up the CPU for a while.  Otherwise it will starve lower priority tasks.

    Thanks for the help!

Reply
  • You wrote, "...what happens ...if the buffers fill up and you are unable to send the data..."

    That is very likely the problem.  I found a couple instances in our code where the send operation is immediately tried again with no delay.  That is surely the problem.  The task doing this needs to delay, giving up the CPU for a while.  Otherwise it will starve lower priority tasks.

    Thanks for the help!

Children
Related