Skip to main content
Visitor II
July 7, 2020
Solved

STM32F09xx USART LIN break interrupt management using HAL drivers

  • July 7, 2020
  • 6 replies
  • 3000 views

Hi everyone,

I tried to manage the USAR LIN break detection interrupt using only HAL driver functions but I did not find a way to do that. I had to modify the file stm32f0xx_hal_uasrt.c adding some code to manage the LIN break interrupt.

Is there a way to detect the LIN break in my application without modifying the driver code?

This is the code I added to the aforementioned HAL driver file:

// At the beginning of the file, where other prototypes are placed
 
#if defined (USART_CR2_LINEN) 
extern void HAL_UART_LINBreakCallback(UART_HandleTypeDef *);
#endif
 
//...
 
// Inside function HAL_UART_IRQHandler
 
#if defined (USART_CR2_LINEN)
 /* UART LIN break has been detected ----------------------------------------*/
 if(isrflags & USART_ISR_LBDF)
 {
 __HAL_UART_CLEAR_IT(huart, UART_CLEAR_LBDF);
 
 /* Call the callback function to signal LIN break detection */
 HAL_UART_LINBreakCallback(huart);
 }
#endif /* USART_CR2_LINEN */

If the function is currently unavailable, is there a way to tell STM to add it to the official driver so I can use the CUbeMX without needing to patch it every time?

Thank you so much,

Diego

    This topic has been closed for replies.
    Best answer by mƎALLEm

    Hello,

    The answer from our Dev team. There will be no plan to implement that in the near future. But we will take that into account in the newer implementations.

    Thank you.

    6 replies

    CptHukAuthor
    Visitor II
    June 27, 2023

    Ping...

    Visitor II
    June 6, 2024

    Another ping.

    It is very surprising the LIN break detection callback has not been added to the driver.

    CptHukAuthor
    Visitor II
    June 6, 2024

    It seems no one else uses LIN break...

    ping ST
    Request timed out.

     

    Visitor II
    June 6, 2024

    ...and Auto Baud Rate Flag/Error.

    Technical Moderator
    June 6, 2024

    Hello @CptHuk ,

    Internal ticket 183583 (not accessible by community member) has been created for follow-up.

     

     

    CptHukAuthor
    Visitor II
    June 7, 2024

    Very good news!

    mƎALLEmAnswer
    Technical Moderator
    April 18, 2025

    Hello,

    The answer from our Dev team. There will be no plan to implement that in the near future. But we will take that into account in the newer implementations.

    Thank you.