2024-03-29 03:58 AM
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
2024-03-29 04:10 AM
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.
2024-03-29 11:45 AM
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.
2024-04-02 07:05 AM
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".
2024-04-02 03:03 PM
@Saket_Om thank you
* Properly assigning interrupt priorities of the UARTs can help too, but not as efficiently as DMA.