cancel
Showing results for 
Search instead for 
Did you mean: 

line break in USART HAL code , end of message

benyBoy
Associate II
Posted on May 08, 2017 at 05:30

HI ,

I have a UART devise hooked up to STM32F7 and working with HAL interrupt callback..

HAL_UART_Receive_IT(&UartHandle,*ActiveUartBuff,sizebuf) != HAL_OK)

How do we read line break ( end of message )  , Can anyone suggest a way to do this? do I need to hack the

call back code or is this already implimented in USART HAL code?

I have short 6 to 12 byte commands I need to write to buffer as commands.

2 REPLIES 2
benyBoy
Associate II
Posted on May 08, 2017 at 13:14

ah, just seen HAL_LIN_Init in  HAL_UART.c 

will try ,  

HAL_LIN_Init(&UartHandle,UART_LINBREAKDETECTLENGTH_10B);

benyBoy
Associate II
Posted on May 08, 2017 at 17:49

nope, I initialized with  HAL_LIN_Init(&UartHandle,UART_LINBREAKDETECTLENGTH_10B);

and the data appears to continually arrive ignoring line breaks

how do I start a new write to the Recieve buffer on line break ? It seams like its just appending 8 char messsage to my 16 char array from the UART.