cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L152 recieves garbage via USART3

sanctified
Associate II
Posted on June 25, 2018 at 13:33

Hi,

I am new to STM32 and  using the STM32L152 to transmit and receive characters via USART. I can transmit data with no problem but when i want to recieve data using the Hterminal, the mcu always gets an extra character in the buffer. and the extra character comes from the string that was transmitted. My baudrate is 9600.

I guess i have to kind of disable the transmit pin just before i recieve data but am not sure if thats the problem and if it is, how do o go about it?

Thank You

4 REPLIES 4
AvaTar
Lead
Posted on June 25, 2018 at 13:51

I guess i have to kind of disable the transmit pin just before i recieve data ...

No, you don't. Receive and transmit could work concurrently.

Have you checked output at the PC for proper baudrate and polarity ?

Do you have proper levels ? The 3.3V levels of the STM32 TX don't work.

Posted on June 25, 2018 at 14:53

Sorry have no visibility into your code, or what you're actually doing to cause this.

Perhaps use strlen() rather than sizeof() or arbitrary lengths?

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

thank you very much fro your suggestions.

I fixed it. 

Posted on June 26, 2018 at 13:24

thank you very much for your suggestions.

I fixed it.