cancel
Showing results for 
Search instead for 
Did you mean: 

Missing LL calls during SystemClock_Config in generated main.c

Yaël Boutreux
Associate II

Hi,
I found the same issue as in.

https://community.st.com/t5/stm32cubemx-mcus/found-a-bug-with-the-latest-rev-of-stm32cubemx-rev-5-3-0/td-p/279154

(thank you @MSilv for reporting this btw).

Since a STM32CubeMx update and STM32F4 Cube update, the generated main.c is missing two lines in the end of the generated void SystemClock_Config(void) function :

LL_Init1msTick(100000000);
LL_SYSTICK_SetClkSource(LL_SYSTICK_CLKSOURCE_HCLK);

The update was quite a big leap :
CubeMx: from 5.2.1 to 6.16.1
STM32Cube FW_F4: from 1.24.1 to 1.28.3

Without those lines the code is stuck.
Adding them back in the user-code following SystemClock_Config(void) mitigates the issue, but it looks like those lines shouldn't have been deleted in the first place.

2 REPLIES 2
Ghofrane GSOURI
ST Employee

Hello @Yaël Boutreux 

It would be useful if you could share your IOC.

Thx

Ghofrane

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.

Hello @Ghofrane GSOURI,
You'll find in this reply the IOCs.

- Original IOC is in folder "6.5 SW4STM32", it can be opened with CubeMx 6.5
- The next IOC is in folder "6.5 CubeIDE",  this is the IOC in "6.5 SW4STM32" that has been opened with CubeMx 6.5 to convert the project from a SW4STM32 to a CubeIDE project (so it can be updated to 6.16.1)
- The final IOC is in folder "6.16.1 CubeIDE", this is the IOC in "6.5 CubeIDE" updated to CubeMx 6.16.1, and STM32Cube FW_FW from 1.24.1 to 1.28.3.

Doing a three way file-comparison on the generated Src/main.c there is n
o difference on the generated code between "6.5 SW4STM32" and "6.5 CubeIDE", but there is some between version 6.5 and 6.16.1.

There is also some unwanted changes on peripheral configurations, like the auto-reload of a timer being changed from 0 to 65535, losing pull-up on GPIOs.