Skip to main content
benjaminguillot.699
Associate II
February 28, 2014
Question

STM32L - UART data processing

  • February 28, 2014
  • 2 replies
  • 568 views
Posted on February 28, 2014 at 15:27

Hi every body,

Im using the stm32L discovery.

My UART is well configured. UART1 on PB6/PB7.

I try to get data via GPS transmeter.

I got a ot of problem in data acquisition.

So i try to get data from GPS and send them instantanely to see what happened on a scope.

What i see is strange.. I must receive lot of data, but what i resend from my board are data comptletely different from the acquisiton!

What i do in my while:

if (USART_GetFlagStatus(USART1, USART_IT_RXNE) != RESET) // Received character?

  {

         rx =  USART_ReceiveData(USART1);

         USART_SendData(USART1,rx);

    }

But i only send 3 data, i think i dont understand how its work!

Data i have to receive are like this : $PSRF100,4,38400,8,1,0*38<CR><LF>

I dont know for now how i rebuild this, so i try to get the first word, and resend it.

Is it possible ?

What i do wrong!

Thank you all for any answer! Im alone on this project so some help would be very... helfull

    This topic has been closed for replies.

    2 replies

    Tesla DeLorean
    Guru
    February 28, 2014
    Posted on February 28, 2014 at 15:36

    if (USART_GetFlagStatus(USART1, USART_IT_RXNE) != RESET) // Received character?

     

    GetFlagStatus should generally be used with USART_FLAG_xxx defines, ie USART_FLAG_RXNE

    Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
    benjaminguillot.699
    Associate II
    February 28, 2014
    Posted on February 28, 2014 at 15:58

    Hi Sir,

    Thank you, i didn't see this mistake!

    Well, im lost anyway! really lost!

    But i have so new idea, i will test them! and come back probably : )

    Thank you for the answer!

    Have a good afternoon!