cancel
Showing results for 
Search instead for 
Did you mean: 

UART over run

jdowdster
Associate II
Posted on February 16, 2017 at 21:03

I'm running on a STM32L4 processor running FreeRTOS. I do use the HAL s/w for the drivers and their API to read/write to 4 USART interfaces. I'm currently running all of them as just a character interrupt on the receive side. I don't use interrupts for the transmit side.

One USART is connected to a GPS device which is running at 4800,8,N,1 no flow control. I'm getting a lot of over run errors from that interface. When I read up on it apparently this is a sign that I'm just not servicing the interface quickly enough. I was able to make the situation better by slowing down one of the other UART interfaces but the problem did not away.

My question is, will putting in DMA to service this interface help alleviate this problem? Will the MCU appear to be less busy and therefore allow the system to receive the incoming data on the UART's Rx register?

Cheers!!

#uart
2 REPLIES 2
Posted on February 16, 2017 at 23:00

The streaming nature of the GPS would make it a reasonable target for RX DMA. The L4 really should be able to sustain RXE interrupts for a couple of USARTs at 4800 baud without breaking a sweat.

You should perhaps look at exact what interactions are going on, and whether interrupt preemption levels are set appropriately, and handlers aren't taking an excessive amount of time or blocking. Instrumenting with GPIOs and viewing with a scope might shed some light on the tasks and handlers contributing to the over-runs.

Confirm you are not writing or erasing FLASH (or EEPROM)

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on February 16, 2017 at 23:13

I have the ability to access the flash but during this test I am not doing so. I have the LPUART doing autobaud for a very small amount of data that is in fact not being used during normal operation. 1 UART at 115200 (connected to a GSM chip) and a debug console doing 57600 and of course this one doing 4800.

I do need to spend some time on the interrupt priority levels. I don't allow for any blocking in the handlers. It's a straight copy to a queue and then out. For error handling I just increment a counter and carry on receiving.

Thanks for your advice.

Cheers!!