Skip to main content
JCuna.1
Senior
April 26, 2022
Question

STM32CubeMX from IDE: generate buggy SystemClock_Config() ?

  • April 26, 2022
  • 6 replies
  • 1570 views

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

0693W00000Lz7zWQAR.png

This topic has been closed for replies.

6 replies

TDK
April 26, 2022

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""."
JCuna.1
JCuna.1Author
Senior
April 26, 2022

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

0693W00000Lz8InQAJ.png 

It is a custom hardware.

JCuna.1
JCuna.1Author
Senior
April 27, 2022

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.

Amel NASRI
ST Technical Moderator
April 27, 2022

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 "Best Answer" on the reply which solved your issue or answered your question.
JCuna.1
JCuna.1Author
Senior
April 27, 2022

Yes, just select LL again for RCC peripheral.

Nikita91
Lead II
April 27, 2022

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