2025-01-08 05:20 AM
Hi everyone,
I'm encountering an issue with the STM32 Device Configuration Tool: it doesn't properly generate the global interrupt handler function for one of the UARTs in my project:
The generated interrupt handlers for USART1 and USART2 include call of the default HAL interrupt handler (HAL_UART_IRQHandler(&huartX);) but the handler for USART6 is missing this line.
/**
* @brief This function handles USART1 global interrupt.
*/
void USART1_IRQHandler(void)
{
/* USER CODE BEGIN USART1_IRQn 0 */
/* USER CODE END USART1_IRQn 0 */
HAL_UART_IRQHandler(&huart1);
/* USER CODE BEGIN USART1_IRQn 1 */
/* USER CODE END USART1_IRQn 1 */
}
/**
* @brief This function handles USART2 global interrupt.
*/
void USART2_IRQHandler(void)
{
/* USER CODE BEGIN USART2_IRQn 0 */
/* USER CODE END USART2_IRQn 0 */
HAL_UART_IRQHandler(&huart2);
/* USER CODE BEGIN USART2_IRQn 1 */
/* USER CODE END USART2_IRQn 1 */
}
/**
* @brief This function handles USART6 global interrupt.
*/
void USART6_IRQHandler(void)
{
/* USER CODE BEGIN USART6_IRQn 0 */
// missing from here:
/* USER CODE END USART6_IRQn 0 */
/* USER CODE BEGIN USART6_IRQn 1 */
/* USER CODE END USART6_IRQn 1 */
}
I have another project (coprocessor_vica) with the same processor and a very similar configuration.
To investigate, I:
I've attached both .ioc files.
Thanks in advance for any insights or advice!
Solved! Go to Solution.
2025-01-08 09:59 AM - edited 2025-01-08 10:00 AM
@SofLit
I found the cause, and it was (partly?) my mistake: in the System Core > NVIC > Code Generation tab, the Call HAL handler checkbox for the USART6 Global Interrupt was not checked. After enabling it, the code generation works correctly.
However, there are still a few things I don't understand: