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

SoftDevice Interrupt Timing

I am using SoftDevice S132 v3.1.0 and I have a high priority application ISR that cannot tolerate being interrupted by the SoftDevice. The ISR occurs once every connection interval and takes about 50 us to complete. I have the ability to locate the ISR to occur any time within the connection interval. Where in the connection interval should I locate this ISR?

My current plan is to locate the application ISR just before the next connection event begins to avoid the SoftDevice processing during a connection event. The SoftDevice specification specifies two SoftDevice processing times that occur before a connection event: radio prepare and radio start (see figure below). The spec gives the maximum processing time for each SoftDevice ISR, but it does not specify when these occur relative to the beginning of the connection event. I have found that the radio start ISR occurs about 150 us (+/- 50 us) before the radio starts receiving and the radio prepare ISR occurs about 1500 us before that. Can I expect this timing to stay consistent? Even for different connection intervals? Any additional information about the timing of these SoftDevice ISRs?

My device is a peripheral only device with only one connection at a time. The connection interval is typically around 15 ms, but may vary between 11.25 to 50 ms. The connection event extension option is enabled.

Thanks,

Austin

Interrupt Processing Figure 51 from SoftDevice Spec

  • Hi Austin

    This won't be a reliable way to go about this. The timing of the radio start ISR is not expected to stay consistent within the connection interval. Sadly I don't think there is a reliable way to accomplish what you are trying to do.

    Best regards,

    Simon

  • Simon,

    Thanks for your reply. I assume you meant the radio prepare ISR, as the radio start ISR seems to be very consistently about 140 us before radio reception starts (as signaled by the LNA being enabled). I guessed that the radio prepare ISR could not be guaranteed to not come at a particular time, but I thought I would ask if there were additional details or bounds.

    I did find more information in the Radio Nofication section of the SoftDevice spec (S132 v3.1). The numbers in this specification give a range for when the radio prepare ISR could occur (t_prep ranges from 167 us to 1542 us). I think my app ISR should be safe most of the time if it is outside of this range by some margin. For instance, 2.5 ms before the connection event starts. Your thoughts on this approach?

    Austin

  • Hi Austin

    Yes, prepare ISR of course. Putting your ISR outside of the range stated in the spec should work, but this won't be a 100% failsafe solution either. I would increase the margin with as much time I could spare. This will probably be the safest approach of accomplishing this, but I would be thorough with testing it before sticking to it. 

    Best regards,

    Simon

  • Simon,

    Understood. I am working on how to recover if my high-priority ISR does not run when it should. Hopefully staying outside the radio prepare window should suffice 98% of the time. The Radio Notification specification lines up well with what I measured.

    Thanks for your help,

    Austin

Related