2014-04-15 02:09 AM
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?
2014-04-15 08:43 AM
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?