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

scan stop problem

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.

Parents
  • 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.

Reply
  • 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.

Children
No Data
Related