Skip to main content
xmart
Associate II
August 17, 2020
Solved

uart receives the same byte!!!

  • August 17, 2020
  • 4 replies
  • 1170 views

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.
Best answer by Tesla DeLorean

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.

4 replies

Tesla DeLorean
Tesla DeLoreanBest answer
Guru
August 18, 2020

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 VenmoUp vote any posts that you find helpful, it shows what's working..
TDK
Super User
August 18, 2020

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
August 18, 2020

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

How do you know?

JW

Pavel A.
Super User
August 18, 2020

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

-- pa