cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F09xx USART LIN break interrupt management using HAL drivers

CptHuk
Associate II

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

6 REPLIES 6
CptHuk
Associate II

Ping...

DrPi
Associate

Another ping.

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

CptHuk
Associate II

It seems no one else uses LIN break...

ping ST Request timed out.

 

...and Auto Baud Rate Flag/Error.

SofLit
ST Employee

Hello @CptHuk ,

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

 

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
CptHuk
Associate II

Very good news!