Skip to main content
sanctified
Associate III
June 25, 2018
Question

STM32L152 recieves garbage via USART3

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

    This topic has been closed for replies.

    4 replies

    AvaTar
    Senior III
    June 25, 2018
    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.

    sanctified
    Associate III
    June 26, 2018
    Posted on June 26, 2018 at 13:23

    thank you very much fro your suggestions.

    I fixed it. 

    Tesla DeLorean
    Guru
    June 25, 2018
    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 (See Profile) Up vote any posts that you find helpful, it shows what's working..
    sanctified
    Associate III
    June 26, 2018
    Posted on June 26, 2018 at 13:24

    thank you very much for your suggestions.

    I fixed it.