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:
2025-01-08 05:36 AM - edited 2025-01-08 05:37 AM
Hello @tykhaytschaar ,
I'm not reproducing the behavior for both projects and HAL_UART_IRQHandler() is there:
Please use the latest version of CubeMx 6.13.0
2025-01-08 05:46 AM - edited 2025-01-08 05:53 AM
Thanks for the prompt response, @SofLit .
In the meantime I tried to generate code on an ubuntu 22.04 machine with fresh installation of cubeIDE.
STM32CubeMX - STM32 Device Configuration Tool
Version: 6.13.0-RCS
Build: 20241122-0809 (UTC)
The issue occurs on this machine also.
Edit:
2025-01-08 05:54 AM
I don't have neither Ubuntu machine nor MacOS to reproduce the exact environnement as yours I'm on windows and didn't reproduce the behavior.
Did you download CubeMx from this link?
From where you downloaded the version 6.13.0-RCS ?
2025-01-08 06:00 AM
I've downloaded official STM32CubeIDE installer from here: https://www.st.com/en/development-tools/stm32cubeide.html (chose "STM32CubeIDE Generic Linux Installer 1.17" exactly. CubeMX came as part of the IDE, so selecting RCS wasn't my decision.
2025-01-08 06:01 AM - edited 2025-01-08 06:14 AM
Ah! So try to generate the code from the standalone version of CubeMx 6.13.0 and see what happens. It could be an issue in the CubeMx version integrated in the CubeIDE.
2025-01-08 06:17 AM
I installed the standalone version of CubeMX on the ubuntu machine and tried generating the code with it as well. The issue still persists.
2025-01-08 06:19 AM
Could you copy your ioc file to another location and regenerate the code with the standalone version of CubeMx and see what happens?
2025-01-08 06:39 AM
I did, the result is the same.
2025-01-08 06:49 AM - edited 2025-01-08 06:49 AM
Ok since I don't have the same environment as yours I will escalate the issue internally so the teams will try to reproduce the behavior on the same environment. Internal ticket for follow-up: 199844 (not accessible by the community users)