cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L - UART data processing

benjaminguillot.699
Associate II
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

2 REPLIES 2
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 Venmo
Up vote any posts that you find helpful, it shows what's working..
benjaminguillot.699
Associate II
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!