Problem with BLE scanning - event 0x1D overflow

Hi, I'm a having a serious issue with the workings of my device. The device normally scans for external ble devices to connect to. It uses BLE (anf ANT+ but not simultanously) to do that. It goes through a list of devices and tries to connect to each one, one after another. I don't use bonding and there are actually two types of BLE devices my device wants to find - BLE HRM (it uses the type 180D + name filter) and a LED driver (also know type + name filter).

It works normally when the devices are found within maybe couple of hours. If the use leaves my device ON and there are no devices to connect to, my device will try in a loop but after some longer type, couple of hours, sometime like 10 hours, my device is overflooded with "00> <debug> nrf_sdh_ble: BLE event: 0x1D." and it becomes unresponsive.

I don't know what is the reason. It seems that maybe the number of BLE devices in vicinity causes the problem to arise sooner. 

I tried mnipulaling the BLE parameters in sdk_config. I can get longer runs but then the device takes too long to find and connect to my devices. 

My guess is, there is some sort of memory leak in the softdevice. I can't think of anything else. Is this some sort of a known bug? Or am I crazy and do something wrong? Please advice. I need to be able to leave the device working all around the clock and not worry about it being stuck.

My sdk is 17.0.2, my softdevice is S340

My relevant sdl_config parameters:

#define NRF_BLE_SCAN_SCAN_DURATION 350 // 330 // 5s
#endif

// <o> NRF_BLE_SCAN_SCAN_WINDOW - Scanning window. Determines the scanning window in units of 0.625 millisecond.
#ifndef NRF_BLE_SCAN_SCAN_WINDOW
#define NRF_BLE_SCAN_SCAN_WINDOW 320 // 160 // = 100 ms
#endif

// <o> NRF_BLE_SCAN_MIN_CONNECTION_INTERVAL - Determines minimum connection interval in milliseconds.
#ifndef NRF_BLE_SCAN_MIN_CONNECTION_INTERVAL
#define NRF_BLE_SCAN_MIN_CONNECTION_INTERVAL 7.5
#endif

// <o> NRF_BLE_SCAN_MAX_CONNECTION_INTERVAL - Determines maximum connection interval in milliseconds.
#ifndef NRF_BLE_SCAN_MAX_CONNECTION_INTERVAL
#define NRF_BLE_SCAN_MAX_CONNECTION_INTERVAL 60//30
#endif

// <o> NRF_BLE_SCAN_SLAVE_LATENCY - Determines the slave latency in counts of connection events.
#ifndef NRF_BLE_SCAN_SLAVE_LATENCY
#define NRF_BLE_SCAN_SLAVE_LATENCY 0
#endif

// <o> NRF_BLE_SCAN_SUPERVISION_TIMEOUT - Determines the supervision time-out in units of 10 millisecond.
#ifndef NRF_BLE_SCAN_SUPERVISION_TIMEOUT
#define NRF_BLE_SCAN_SUPERVISION_TIMEOUT 800

Parents
  • Hi,

    BLE event 0x1D is BLE_GAP_EVT_ADV_REPORT, so apparently you are receiving a lot of advertising reports (meaning receiving a lot of advertising packets). That itself is no error, but perhaps it means that you are scanning when you did not intend to, or are not filtering as you intended to? Also, if there are a lot of advertisers around and you print all incoming messages in the log, simply logging could cause problems (due to the amount of logging and time required to process the logs etc).

Reply
  • Hi,

    BLE event 0x1D is BLE_GAP_EVT_ADV_REPORT, so apparently you are receiving a lot of advertising reports (meaning receiving a lot of advertising packets). That itself is no error, but perhaps it means that you are scanning when you did not intend to, or are not filtering as you intended to? Also, if there are a lot of advertisers around and you print all incoming messages in the log, simply logging could cause problems (due to the amount of logging and time required to process the logs etc).

Children
Related