Skip to main content
benyBoy
Associate III
May 8, 2017
Question

line break in USART HAL code , end of message

  • May 8, 2017
  • 2 replies
  • 1345 views
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.

    This topic has been closed for replies.

    2 replies

    benyBoy
    benyBoyAuthor
    Associate III
    May 8, 2017
    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
    benyBoyAuthor
    Associate III
    May 8, 2017
    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.