I am using S132 v7.0.1 on an NRF52832 to do a basic scan for BLE advertisements for 30 seconds (10 seconds on each primary advertising channel):
#define SCANTIME 10 // sec
#define sec2slots(s) ((s) * 1600)
#define sec2tenms(s) ((s) * 100)
static const ble_gap_scan_params_t scanparams = {
.interval = sec2slots(SCANTIME),
.window = sec2slots(SCANTIME),
.timeout = sec2tenms(3 * SCANTIME),
};
This works fine and as expected on my current development board.
I am now in the middle of bringing up a new revision of the production board, and I am now on this new board getting an SD fault handler call during the GAP scan operation:
sd_fault_handler id=1, pc=0x00014CBC, info=0
I realized that this error happens exactly 10 seconds after the start of the scan operation, i.e. right when the scan interval/window expires and the SD should switch to the next channel. If I shorten the scan interval/window to, e.g., 5 seconds, the problem goes away. Coupled with the fact that this only occurs on the new hardware, this leads me to believe it could be a timing-related issue, such as the 32 kHz oscillator possibly being out-of-spec causing a timing check to throw an assertion.
Any information as to what causes the assertion at the above-mentioned PC would be appreciated in finding the root cause!
Thanks,
Mike