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

Supporting a real-time task

My 51822 needs to support some realtime control code that runs for about 75mS. During that time I need to mask all interrupts. With a logic analyzer I can see that my realtime code is getting interrupted every 25mS or so, I guess by the SoftDevice. I tried using CRITICAL_REGION_ENTER/CRITICAL_REGION_EXIT but that does not mask the interrupts.

  1. How can I mask interrupts so that my realtme code will not be interrupted no matter what the radio is doing?
  2. Is there a way to do this such that I don't unduly disturb the SoftDevice?

Regards, Bret

Parents
  • Audun,

    Like many real-time tasks, mine happens asynchronously in response to a GPIO signal. When that signal occurs, I have just a couple of mS to begin the control loop. I can't wait for the radio to give me a time window.

    It sounds like the best approach is to disable the radio at the start of my real-time task or perhaps to break the connection or stop advertising. I recognize that this might disrupt the BLE stack and I'm willing to re-init the stack or even do a software reset when my real-time task is over.

    So my question is now this: If I am willing to disrupt the BLE communication, is there a way to asynchronously prevent interrupts from the radio?

    Thanks, Bret

Reply
  • Audun,

    Like many real-time tasks, mine happens asynchronously in response to a GPIO signal. When that signal occurs, I have just a couple of mS to begin the control loop. I can't wait for the radio to give me a time window.

    It sounds like the best approach is to disable the radio at the start of my real-time task or perhaps to break the connection or stop advertising. I recognize that this might disrupt the BLE stack and I'm willing to re-init the stack or even do a software reset when my real-time task is over.

    So my question is now this: If I am willing to disrupt the BLE communication, is there a way to asynchronously prevent interrupts from the radio?

    Thanks, Bret

Children
No Data
Related