I am experiencing a strange problem with stopping a scan. I am using the mesh from github.com/.../nRF51-ble-bcast-mesh together with interval scanning, meaning start scanning, wait 2 sec, stop scanning, pause 2 sec, start scanning, etc. At one point, the program simply stops in the call to sd_ble_gap_scan_stop, without error or hardfault or anything. The failure time is not the same, so I can't really reproduce the error. But I am reasonably sure that it has to do with the combination of mesh and scanning, because if I disable the mesh, the error doesn't happen. Since I have no way of checking what happens in the sd_ble_gap_scan_stop I am at a loss. Can somebody tell me why the function would deadlock without any error or timeout?
I am using: Softdevice s132 v2.0, nrf5 SDK 11.0.0, and a PCA10040 board