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

Is it possible to set BLE and FDS's interrupt priorities separately?

Hi everyone,

Hope you are doing well!

I am using BLE and FDS simutinuously but since they share the same interrupt priority (SD_EVT_IRQn = 4), fds events will be blocked if they are triggered within ble interrupts.

One way to solve this issure is to call fds write and erase functions in main loop and set flags in ble interrupts but specifically, that will complex my project so I am wondering if there's a way to set BLE and FDS's interrupt priorities separately?

Thanks for your help in advance!

Best regards,

RJ

Parents
  • Hi Fang,

    FDS uses fstorage.

    Inside nrf_fstorage_sd.c you can see that it uses SDH observer priority of 0.

    NRF_SDH_SOC_OBSERVER(m_sys_obs, 0, nrf_fstorage_sys_evt_handler, NULL);

    and in the SDK config you can see that NRF_SDH_SOC_STACK_OBSERVER_PRIO is also set to 0. These are software priorities based on the same interrupt line SWI2_IRQn that are used by softdevice to notify both BLE/ANT and also fstorage events.

    These events are queued inside softdevice and these software priorities only define the order in which the handlers for these events are called. In your case, the BLE events and Fstorage events are of same priority, so if BLE events comes first in the queue they are processed first and if fstorage events comes first in the queue, they are processed first delaying the BLE event processing. If you want to change this behavior, you need to change the priorities of these as to how you want priority preference between BLE and fstorage events.

  • Hi Susheel,

    Thanks for your reply! Could you please specify what should I do if I want to set FDS's interrupt priority higher then BLE's priority?

Reply Children
Related