Task interrupt by higher priority task

I have a question about tasks with different priorities and interrupts.

So for example I am using I2C and UART with different tasks and suppose I2C is in the midst of transaction and UART task interrupt is triggered. How this will be handled in nRF SDK API?

For example, I2C byte is transmitting and first 4 bits have already transmitted, what will happen if task is switched to UART at this point? How to avoid this behaviour? I know that DMA can help to overcome such situations but what if there is no DMA? Can this create a soft/hard fault?

I know there is Zephyr working as backend for this feature but not sure exactly how this is done. 

Parents Reply
  • Hi Priyanka,

    Thanks that you reply.

    BTW I was looking for same answer online as well but got the 80% satisfactory answer on dev academy. I do not care for 20%, that will be solved with time and experience. !!

    I also looked at how ESP32 do this, and found that they are using some inter-locking mechanism so that no other peripheral instant get the access to the same device. And also some critical sections coding mechanism to do this.
    So fine for now.! 
    Thanks for you support.


    academy.nordicsemi.com/.../

Children
No Data
Related