cancel
Showing results for 
Search instead for 
Did you mean: 

high baud rates dropping carachters

bakhti
Associate II

hi i'm using the stm32h750 and in it using the baud rate of 500000 well i want ot go higher but everytime i increase the baud rate there is some charachters dropped or missing in the final received message i tried DMA its worst not filling the buffer

my question is this i'm using HAL can i have high baud rates and use DMA circular to read from the UART

16 REPLIES 16
BTrem.1
Senior II

Do you have any higher priority interrupts? Try disabling those and see if the problem persists. This at least gives a place to start looking if it does.

Where you respond to the DMA are you using any non-static variables you might drop if interrupted by a higher priority?

BT

>> i'm using HAL can i have high baud rates and use DMA circular to read from the UART

Yes, but you don't have too.

The H7 should support a FIFO also, I'd expect 500 kbaud would be capable of working under interrupt.

The HAL adds more complexity than benefit.

Consider if your processing of data is the issue, having long running or blocking code should be avoided under interrupt/callback. Queue the data and manage it in another thread.

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

i tried with a new projects using only uart same problem

the processing is getting the message and verifying if there is an EOL code to start working on processing the message

Here we run two projects on H753, reading at baudrate 921600, with RS422 PHY.

One with circular DMA based on Tilen Majarle's example, another with simple polling (but not using HAL driver either).

-- pa

"the processing is getting the message and verifying if there is an EOL code to start working on processing the message"

are you trying to do that per-character in the receive interrupt?

To check whether the problem lies in the baud rate itself, or the rate at which bytes can be processed - try inserting a delay between bytes at your sending end.

Andrew Neil
Evangelist III

What is your stm32h750 communicating with?

How are they connected?

Have you used an oscilloscope to verify that the signals are well-formed, at the correct baud rate, etc?

Is your code checking for receiver errors - overruns, framing, etc?

"some charachters dropped or missing in the final received message"

It's not clear where this is happening: is this in your stm32h750, or at whatever other thing your stm32h750  connected to?

hi Pavel i'm really new to Stm32 and c programming in general HAL is really helping me now i saw Tilen Majarle's example but couldn't implement it i tried it but no luck

hi Andrew yes i'm doing it per-character in the receive interrupt because the RxCpltCallback doesnt fire until pre defined numer of bytes are received and i have multiple messages with different lengths