HI,
I have some problems with the function sd_ble_gap_scan_stop(). I want to stop scanning into the RTC1 event handler but when I use this function (sd_ble_gap_scan_stop()) there is an hard fault...why this happens ???
thanks.
HI,
I have some problems with the function sd_ble_gap_scan_stop(). I want to stop scanning into the RTC1 event handler but when I use this function (sd_ble_gap_scan_stop()) there is an hard fault...why this happens ???
thanks.
What is the priority of the RTC1 interrupt? Have you set it?
Now I have set the RTC1 priority interrupt to 1 but the problem persists...
SoftDevice API (sd_*) functions can only be called from lower interrupt priority when compared to the SVC priority. The SVC priority is 2, so you can't use 1(Application High - App(H)), you need to use 3(Application Low - App(L)).
Or you can set a flag in the interrupt handler and check this flag in the main loop and then stop scanning.
For more information about this see this, Section Application Program Interface (API) and Exception (interrupt) management with a SoftDevice.