cancel
Showing results for 
Search instead for 
Did you mean: 

interrupt are miss or not ?

khodifadlalit
Associate II

Hello STM32 community,

I am currently working on a project utilizing the STM32H757 microcontroller, which boasts 8 UART interfaces. In my application, I have configured all UARTs to operate in interrupt mode for receiving data.

My concern arises when multiple UART RX interrupts occur simultaneously. Specifically, if four RX interrupts are triggered at the same time, I would like to ensure that none of these interrupts are missed ?

please give answer

 

 

 

khodifad lalit

4 REPLIES 4

Missed how?

The NVIC will keep forcing service until the source is cleared.

Service will be in priority order, and usually best not to preempt. Service quickly, and do heavy processing elsewhere.

Would suggest tracking overflow/underflow situations to understand if failing to keep up. Consider if DMA use would be appropriate. 

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Pavel A.
Evangelist III

As Tesla D. wrote, the NVIC and UARTS themselves ensure UART interrupts will not be "miss". But the received data can be lost unless the program reads it in time. Additional measures to avoid RX data loss:

* Use DMA instead of interrupts, this eliminates the interrupt latency issues.

* If still using interrupts, enable the FIFO of the UARTs.

 

Saket_Om
ST Employee

Hello @Pavel A. 

You can manage the interrupt priorities among all UART instances by setting the NVIC priorities. Please see the instruction below as an example. 

 

HAL_NVIC_SetPriority(UART4_IRQn, 0, 0);

  

If your question is answered, please close this topic by clicking "Accept as Solution".

If your question is answered, please close this topic by clicking "Accept as Solution".

Thanks
Omar

@Saket_Om  thank you

* Properly assigning interrupt priorities of the UARTs can help too, but not as efficiently as DMA.