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

Using timeslot API and fds

Hi all,

I am working on a project that requires simultaneous usage of BLE and ESB. I implemented that with the timeslot API and it basically works. However, I need to store some data to flash using fds when a certain packet is received using ESB. I am experiencing a lot of problems to get this to work properly, most notably fds functions returning errors (1, FDS_ERR_OPERATION_TIMEOUT). it seems to make sense to me that the softdevice APIs can't be used during a timeslot. I suppose I must postpone the write action until the softdevice is active again, that is: the timeslot has ended. But what event can I use to be sure the softdevice is ready to be used again, so that I can handle my fds stuff there?

Regards,

Bert

Parents Reply
  • Hi Bert, 

    It the Timer 0 Interrupt handler has a higher priority than 4, then calling the sd_- API will result in a HardFault, see Interrupt priority levels.  

    The priorities of the interrupts reserved by the SoftDevice cannot be changed. 
    This includes the SVC interrupt. Handlers running at a priority level higher
    than 4 (lower numerical priority value) have neither access to SoftDevice functions 
    nor to application specific SVCs or RTOS functions running at lower priority levels
    (higher numerical priority values).

    So if the Timer0 handler has a higher priority than 4 you need to schedule the sd_radio_session_close() call to be called from a lower priority or  from main's context. 

    Best regards

    Bjørn

Children
Related