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

When can NRF_EVT_RADIO_CANCELED occur?

Hello,

I'm trying to run the s132 (and s140) softdevice while running a proprietary mesh network stack. Naturally I'm requesting a hefty amount of radio slots. I need to know when the softdevice can cancel my requested slots, specifically if this can occur while I'm in a granted slot. It would be nice to be 'safe' within a slot, and not having to worry about aborting a radio session at interrupt level mid-send.

I've scoured the forum, and the documentation only specifies the case where we get the canceled event before the requested slot starts.

Thankful for any input!

//Johannes   

Parents
  • Hello Johannes,

    The documentation states that : 

    NRF_EVT_RADIO_CANCELED Timeslot status: The scheduled timeslot was canceled due to overlapping activity of higher priority.

    So this can only occur before the timeslot has begun, and not while you are in the timeslot.

    Are you experiencing these events? I assume that they occur is "unexpected" events in the softdevice. When you are in a connection, or when you are advertising the softdevice is actually very predictable. The unexpected behavior may occur if you are e.g. scanning 100% of the time (SCAN_WINDOW == SCAN_INTERVAL), and in addition you are advertising, and/or in a connection. Obviously, in this case, the radio can't scan and do other things at the same time (May also occur even if you don't scan 100%). Some times when the softdevice has overlapping events, it will re-prioritize and re-schecule events. 

    Let us say that you are advertising while you are scanning. Since advertisements has a random delay added to the advertising interval, it will drift between 0 and 10ms each interval. At one point it will crash with a scan window. This means that one of these events are skipped. When an event is skipped, it will increase the priority for the next time. 

    So if e.g. a scan window has increased it's priority, and now it is crashing with your scheduled radio timeslot, you may get this event.

    Please see page 40-41 in the softdevice documentation.

    Best regards,

    Edvin

  • Thank you, Edvin, for your response!

    Perfect! Then I don't need to handle that case.

    I am not experiencing these events. I'm just planning my code and didn't find anything explicit that guarantees that I always can keep my slot once I've gotten it.

    //Johannes

Reply Children
No Data
Related