cancel
Showing results for 
Search instead for 
Did you mean: 

USART stops

John Doe_2
Associate
Posted on April 01, 2018 at 15:36

Hey guys,

I am trying to receive the nmea sentences from my gps module. I am putting the received bytes in an array and if I get the '\n' I want to transmit the array. 

Problem is it only works once, then it stops:

https://pastebin.com/ZeqKtAV2

 

What could be the problem?

&sharpstm32l4discovery

#discovery #receive #problem #uart #stm32l4discovery #trasnmit #byte
2 REPLIES 2
Posted on April 01, 2018 at 15:48

This should be scoped with i, the data length actually receive, not the maximal empty buffer length

HAL_UART_Transmit(&huart2, rx_buffer, sizeof(rx_buffer), 1000);

Also be aware that this with block for multiple byte times, resulting in data loss and overrun errors on HAL_UART_Receive() that also blocks.

Please try to keep your progress in a single thread rather than forking it at every hurdle.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on April 01, 2018 at 15:58

https://community.st.com/0D50X00009XkWVWSA3

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..