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

Scanner freezes application without debugger connected on SD 6.0.0

Hello

The scanner causes the code to freeze when a debugger is not connected.

We are developing a system where one of our units is to run on the nRF52832. During development of the application we ran in to a problem after porting to SDK15 from 14.2 (and also from SoftDevice 5.0.0 to 6.0.0.
We are advertising and scanning for advertising packet data in intervals less than a second, every five seconds. With the new SoftDevice API, and the possibility for longer advertising packets we need to "continue" the scanner after recieving an advertisement packet using sd_ble_gap_scan_start(NULL, adv_report_buffer). This is done by the ble_event_handler as shown below:

This event also calls the advertising packet parser, which copies the advertisement data into a new variable from the buffer before parsing it. 
The code runs fine on PCA10040 DK while the internal or an external jlink debugger is connected to Segger Embedded Studio.
When we disconnect the debugger the code freezes within 30 seconds.
We have tried commenting out all instances which starts the scanner, and this leads to the advertiser and the rest of the code is working fine with or without a debugger connected.
This leads us to believe the scanner is the problem. We have diagnosed the problem using the Power Profiler, both externally and as a shield on the DK with the code.
While the debugger is connected it looks like this:
While if we disconnect the debugger it looks like this:
For the ones not familliar with the PPK, it will use less power when not connected do a debugger which is why the base line is lower on the second picture. 
At the time where you can see the power peak and stay high the DK stops responding to its application and does not send any more advertising packets.
Any idea what this could be?
  • I was able to resolve this issue by setting RTT config mode:

    The problem was we had this in block, after some troubleshooting on our own hardware. This caused the chip to halt.