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

nRF52840 unexpectedly stops scanning

Hello,

I have a running system constituted of a central and 15 peripherals using nRF52840 devices. The central is set to scan the peripherals for 5 seconds then stop and restart the scanning 30 seconds after and so on. After 5 seconds, the scan callback should receive a "NRF_BLE_SCAN_EVT_SCAN_TIMEOUT" event from the softdevice which should trigger a scan completed event in my code. However, after I let the system run for multiple hours, randomly at some point (sometimes after 5 hours, 12 hours, 1 hour), the scan callback is not called at all at the end of the 5 seconds and I don't understand why. I have tried to stop an on-going scan when the system wants to start scanning again for peripherals with the previous scanning sequence not officially completed. Unfortunately the software is not able to get out of the previous uncompleted scanning and is not able to perform device discoveries anymore even if I stopped the previous scan. Can somebody help me with this problem? Thanks.

Parents
  • Hello, 

    I'm afraid can't think of any obvious reasons for this behavior. Are you able to share your project or relevant pieces of your code so I can try to review it here? I can make the ticket private if needed. 

    After 5 seconds, the scan callback should receive a "NRF_BLE_SCAN_EVT_SCAN_TIMEOUT" event from the softdevice which should trigger a scan completed event in my code.

     Will the timer handler start scanning every 30 seconds even if you don't get this event. Also, does your code check the return value from "scan start"? 

    Unfortunately the software is not able to get out of the previous uncompleted scanning and is not able to perform device discoveries anymore even if I stopped the previous scan. Can somebody help me with this problem? Thanks.

    Is it possible that the program may have become "stuck" in the app error handler or the hardfault handler? Maybe you can attach a debugger to the device when this happens and read out the program counter value to check if this may be the case. You can use the nrfjprog command '--readregs' command for reading the core registers.

  • Hello Vida,

    We decided internally to reboot the Nordic when it happens. We have not implemented it yet nor tested it. I will come back to you once it will be done. The issue is random and can occur anytime from couple of minutes to days but usually within 3 days.

    Thanks.

  • Hello,

    It sounds like a reasonable workaround. It would of course have been nice to know the root cause of this. I kept my test running over the weekend but still no failures on my side. 

Reply Children
No Data
Related