2019-06-02 06:08 AM
I am using USART2 (with IRQ) of STM32F4 for MIDI Receive (31250 bd, 8 Bit, 1Start/Stop Bit). A MIDI Message has normally 3 Bytes following directly on each other, which gives each Byte a duration of ca. 320us.
In 1 of 10-30 events one Byte (always Byte 2 or 3) is missing and the ORE Bit is on. This is strange because USART2 IRQ has highest priority, and the IRQ Routine takes max. 30us (measured not estimated). No other routine blocks this IRQ.
I checked the USART2-In port of the STM32F4 with my Logic Analyser. On the Analyser all 3 Bytes are present (if ORE Bit is on).
Has anybody an idea??
2019-06-02 07:05 AM
Dig 1: what is the clock source min-max tolerance and its impact on baud rate innacuracy? Please specify SYSCLK value in MHz
Dig 2: Show us the interrupt routine code extract.
Dig 3: Use oscilloscope to look at signal level and quality. Always use scope before lyzer...
2019-06-02 08:23 AM
Check NVIC Grouping settings to ensure you are actually PREEMPTING other interrupts and not simply defining the order of servicing at the dispatch/tail-chaining point.
2019-06-03 07:24 AM
Yes, I did not define priority grouping. I changed it to: NVIC_SetPriorityGrouping(0); and now it works. Thank you very much for help!