cancel
Showing results for 
Search instead for 
Did you mean: 

Overrun errors with two USART interrupts

jonathanmoreton9
Associate
Posted on April 15, 2014 at 11:09

Using two USARTs running at 115200 baud on a STM32F2, one to communicate with a radio module and one for serial from a PC. The clock speed is 120MHz.

When receiving data from both USARTs simultaneously overrun errors can occur on one USART or the other. Doing some quick back of the envelope calculations there should be enough time to process both, as the interrupts are just simple copy the byte to a circular buffer.

In both theory and from measurement the interrupt code to push byte to buffer should/does run in the order of 2-4µS, at 115200 baud we have around 70us to process each char.

Why are we seeing occassional OREs on one or other USART?

1 REPLY 1
Posted on April 15, 2014 at 17:43

Are you using an RTOS? Do you have other interrupts running? Do the USART interrupts preempt the others? Are you writing to FLASH? In your experiments, have you observed the behaviour of the service routine wrt the time the overruns occur? Is the processor running at the speed you think it is?

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