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

maximum blocking time for application

Hi

in the communication with an SPI peripheral device, a communication cycle might take up to 5 ms. It is implemented as a blocking function, meaning that app_sched_execute() might not be called during that time. Interrupts are not blocked.

Is this a problem? What is the maximum period that i can 'hijack' the processor like that? Are there Softdevice functions that will give an exception because of this? Which interrupts will context switch away from my blocking function and come back? And how long would those take?

Best regards

Wim

Parents
  • You can wait as long as you want in the main thread context.
    Waiting for 5ms will not make softdevice assert because its most time critical processing is done at priority 0 which cannot be interrupted.

    What is the maximum period that i can 'hijack' the processor like that?

    As long as you are waiting in the priority less than the SPI driver interrupt priority then you can wait as long as you want because the others will hijack CPU from you when they need it because they are running on higher priority.

    Which interrupts will context switch away from my blocking function and come back? And how long would those take?

    All peripherals used by softdevice and those have interrupts enabled will be running on higher priority than your blocking function. SPI preferrably is on higher priority and will also hijack CPU from you. How long? is difficult to say. You should look into softdevice specification to find that out for softdevice and I do not know which SPI driver you are using to tell its interrupt execution time.

Reply Children
No Data
Related