cancel
Showing results for 
Search instead for 
Did you mean: 

[CubeMX 6.5.0] STM32 HAL MSP initializes RCC interrupts twice

MDiep.1
Associate II

Hello,

I have found a new bug in CubeMX generated code.

My setup:

STM32WubeIDE 1.9.0

CubeMX 6.5.0

Chip STM32WB55VGYx

Firmware pack V1.13.2

If you configure your project to enable RCC interrupts, CubeMX will generate twice the lines

 /* RCC_IRQn interrupt configuration */
 HAL_NVIC_SetPriority(RCC_IRQn, 0, 0);
 /* RCC_IRQn interrupt configuration */
 HAL_NVIC_EnableIRQ(RCC_IRQn);

By searching through the template files in the CubeMX plugin sources for STM32CubeIDE, I was able to locate the source of the problem.

The following code is from the file "STM32CubeIDE/plugins/com.st.stm32cube.common.mx_6.5.0.202202251913/db/templates/stm32xx_hal_c.ftl"

The code is generated once in the section located in lines 161-183 and then generated a second time in section located in lines 184-207.

The second section especially targets the initialization of the RCC module, however it does contain exactly the same code as the previous section (including some conditions that will never be true because they targets interrupt vectors which are not RCC_IRQn). The only possibility would be that the secodn section of code would force the code to be generated even if the driver used for the RCC module is the LL driver instead of the LL driver. I do not know if this is an intended behaviour however.

A quick fix would be to remove section in lines 184-207 to go back to the behaviour of CubeMX 6.4.0.

Regards,

Morgan

1 ACCEPTED SOLUTION

Accepted Solutions
Aziz BRIGUI
ST Employee

Hello @MDiep.1​ ,

I reproduced the issue and I confirm your findings. The issue is reported to the dev team to be fixed. I will keep you posted with updates.

Internal ticket number: 124946 (This is an internal tracking number and is not accessible or usable by customers).

If your issue is solved or reported, please close this post by clicking the "Select as Best" button. This will help other members of the community find this response more quickly 🙂

Thanks for your contribution,

Best regards,

Aziz


In order 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.

View solution in original post

2 REPLIES 2
Aziz BRIGUI
ST Employee

Hello @MDiep.1​ ,

I reproduced the issue and I confirm your findings. The issue is reported to the dev team to be fixed. I will keep you posted with updates.

Internal ticket number: 124946 (This is an internal tracking number and is not accessible or usable by customers).

If your issue is solved or reported, please close this post by clicking the "Select as Best" button. This will help other members of the community find this response more quickly 🙂

Thanks for your contribution,

Best regards,

Aziz


In order 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.
Aziz BRIGUI
ST Employee

Hello @MDiep.1​,

Issue fixed in STM32CubeMX latest release.

V6.6.0 is now available under this Link.

Thank you for your contribution.

Best regards,

Aziz.


In order 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.