Skip to main content
CptHuk
Associate
July 7, 2020
Solved

STM32F09xx USART LIN break interrupt management using HAL drivers

  • July 7, 2020
  • 7 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

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.

7 replies

CptHuk
CptHukAuthor
Associate
June 27, 2023

Ping...

DrPi
Associate
June 6, 2024

Another ping.

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

CptHuk
CptHukAuthor
Associate
June 6, 2024

It seems no one else uses LIN break...

ping ST
Request timed out.

 

DrPi
Associate
June 6, 2024

...and Auto Baud Rate Flag/Error.

mƎALLEm
Technical Moderator
June 6, 2024

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
CptHukAuthor
Associate
June 7, 2024

Very good news!

mƎALLEm
mƎALLEmBest answer
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.

"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."
JBond.1
Senior
March 14, 2026

+1  Any updates?