cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeMX from IDE: generate buggy SystemClock_Config() ?

JCuna.1
Senior

I run a generated code from stm32cube IDE with LL drivers, and the debug process stops.

0693W00000Lz7zWQAR.png

6 REPLIES 6
TDK
Guru

Did it hard fault? What do the hard fault registers indicate? Is HSE_VALUE used and set correctly?

Known good hardware or a custom board?

If you feel a post has answered your question, please click "Accept as Solution".

0693W00000Lz8IOQAZ.png0693W00000Lz8ITQAZ.pngHSE is 16Mhz, it is configured correctly in clock

0693W00000Lz8InQAJ.png 

It is a custom hardware.

JCuna.1
Senior

When I change from LL to HAL for RCC, the problem is solved.

I am using cube h7 1.10.0 and cube ide 1.9.0.

Hi @Community member​ ,

Thanks for sharing your finding, that is quite interesting to be investigated by our STM32CubeMX expert @Sara BEN HADJ YAHYA​ . Could you please share your ioc file to be able to reproduce your issue?

-Amel

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.

Yes, just select LL again for RCC peripheral.

Nikita91
Lead II

LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL1);

should be set AFTER

LL_RCC_SetAHBPrescaler(LL_RCC_AHB_DIV_2);

Intermediate AHB prescaler 2 when target frequency clock is higher than 80 MHz