2026-04-07 9:26 PM - last edited on 2026-04-08 2:50 AM by Andrew Neil
Description:
In STM32U083 series, when multiple UART/LPUART instances share the same NVIC interrupt vector (e.g., `USART3_LPUART1_IRQn`), STM32CubeMX incorrectly generates `HAL_UART_IRQHandler` for all instances, even if one of them is configured in IrDA mode.
This leads to a compilation error because:
1. The handle for the IrDA instance is generated as IRDA_HandleTypeDef hirdax; (correct).
2. However, in stm32u0xx_it.c, it attempts to call HAL_UART_IRQHandler(&huartx); using an undefined huartx handle.
Environment:
Steps to Reproduce:
1. Create a new project for STM32U083RCTx.
2. Configure USART3 mode as IrDA.
3. Configure LPUART1 mode as Asynchronous.
4. In the NVIC Settings tab, enable the interrupt for "USART3 + LPUART1 global interrupt".
5. Generate the code.
6. Check `stm32u0xx_it.c`.
Actual Result:
The generated ISR code looks like this:
/**
* @brief This function handles USART3 (combined with EXTI 24) + LPUART1 global interrupt (combined with EXTI lines 28).
*/
void USART3_LPUART1_IRQHandler(void)
{
/* USER CODE BEGIN USART3_LPUART1_IRQn 0 */
/* USER CODE END USART3_LPUART1_IRQn 0 */
HAL_UART_IRQHandler(&huart3);
HAL_UART_IRQHandler(&hlpuart1);
/* USER CODE BEGIN USART3_LPUART1_IRQn 1 */
/* USER CODE END USART3_LPUART1_IRQn 1 */
}As a result, the compiler throws an error: "huart3 undeclared" because the handle was correctly defined as hirda3.
Expected Result:
The generator should recognize the peripheral mode and call the appropriate HAL handler:
/**
* @brief This function handles USART3 (combined with EXTI 24) + LPUART1 global interrupt (combined with EXTI lines 28).
*/
void USART3_LPUART1_IRQHandler(void)
{
/* USER CODE BEGIN USART3_LPUART1_IRQn 0 */
/* USER CODE END USART3_LPUART1_IRQn 0 */
HAL_IRDA_IRQHandler(&hirda3);
HAL_UART_IRQHandler(&hlpuart1);
/* USER CODE BEGIN USART3_LPUART1_IRQn 1 */
/* USER CODE END USART3_LPUART1_IRQn 1 */
}
Please check the attached ioc file.
Best Regards,
fumihiko
2026-04-08 12:00 AM - edited 2026-04-08 4:56 AM
Hello @Fumihiko
Let me thank you for bringing this issue to our attention.
The issue has been escalated to the development team under this internal ticket : CDM0061487
AS Workaround, I suggest that you change the code manually.
I'll let you know as soon as the issue is fixed.
Thanks.
Mahmoud
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.