Skip to main content
Associate II
Mar 29, 2024 10:58 AM UTC
Question

interrupt are miss or not ?

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

This topic has been closed for replies.

4 replies

Tesla DeLorean
Guru
Mar 29, 2024 11:10 AM UTC

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 (See Profile) Up vote any posts that you find helpful, it shows what's working..
Pavel A.
Mar 29, 2024 6:45 PM UTC

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.

 

ST Technical Moderator
Apr 2, 2024 2:05 PM UTC

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".

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Saket_Om
Pavel A.
Apr 2, 2024 10:03 PM UTC

@Saket_Om  thank you

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