Skip to main content
xmart
Associate II
Aug 17, 2020 11:46 PM UTC
Solved

uart receives the same byte!!!

I am using Stm32l0 and am receiving data from GPS via uart but I am facing this problem.

uart receives the first byte and then repeats the number of bytes it wanted to receive

For example:

AL_UART_Receive (& huart1, buf, 80, 200);

It receives the first letter "$" eighty times !!

like this $$$$$$$$$$$$$$$$$........80 time

This topic has been closed for replies.
Tesla DeLorean
Tesla DeLoreanBest answer
Guru
Aug 18, 2020 12:18 AM UTC

That's great, but what do you expect anyone to do with one line of code outside any context?

Is this a custom board, or one someone else might be familiar with?

Which UART is the GPS attached too?

Is there another UART debug information can be printed too?

Attach, not-inline, a single source file if it contains all the code for clocks, pins and peripheral initialization, or a whole project as a single .ZIP file.

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

4 replies

Tesla DeLorean
Tesla DeLoreanBest answer
Guru
Aug 18, 2020 12:18 AM UTC

That's great, but what do you expect anyone to do with one line of code outside any context?

Is this a custom board, or one someone else might be familiar with?

Which UART is the GPS attached too?

Is there another UART debug information can be printed too?

Attach, not-inline, a single source file if it contains all the code for clocks, pins and peripheral initialization, or a whole project as a single .ZIP file.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
TDK
Aug 18, 2020 12:18 AM UTC

Do you have the ability to probe the lines to see what is actually being sent?

Bump up the timeout from 200 to HAL_MAX_DELAY to see if that changes things.

Ensure your clock settings are correct.

"If you feel a post has answered your question, please click ""Accept as Solution""."
waclawek.jan
Super User
Aug 18, 2020 5:02 AM UTC

> It receives the first letter "$" eighty times !!

How do you know?

JW

Pavel A.
Aug 18, 2020 5:56 PM UTC

Are the UART1 registers opened in debugger view? (not a good idea)

-- pa