UART data drop at low priority

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

Post Reply
kmk_321994
Posts: 1
Joined: Thu Jun 27, 2024 1:20 pm

UART data drop at low priority

Post by kmk_321994 »

I am using an STM32F4 series MCU and have enabled two interrupts:

    EXTI for edge trigger with Priority 6
    Serial Driver UART with Priority 12

This means the EXTI interrupt has a higher priority than the UART interrupt. The EXTI interrupt is never missed.

Every time the EXTI interrupt occurs, the following callback is executed:

Code: Select all

chSysLockFromISR();
chVTSetI(..);
chSysUnlockFromISR();


The UART is configured at a baud rate of 230400 and receives approximately 3 kB every 200 ms. Data from the UART data register is read into a message queue with a buffer size of 32. From a thread, the data is then read from the queue into a FIFO buffer.

Byte drop doesn't happen every time. Is UART interrupt not going into pending state because of high priority ISR and hence the byte is dropped?
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: UART data drop at low priority

Post by Giovanni »

Hi,

That could only occur if the EXTI interrupt is triggered at a very high rate. Are you getting overflow events from the serial driver?

You can make an easy test: put UART priority above EXTI.

Giovanni
Post Reply