Skip to main content
SKuma.24
Associate II
November 20, 2023
Solved

What will happen when I forget to call system clock configuration.

Hi People,

I need to know what will happen when I forget to set the clock configuration by using system clock configuration function. 

Is there any default clock configuration will set in the microcontroller when I forget to set clock configuration?

I'm raising this because I can able to feed the complied code which doesn't have a clock configuration. And still I can able to debug the uploaded code with stm32h7.

This topic has been closed for replies.
STTwo-32
STTwo-32Best answer
ST Technical Moderator
November 20, 2023

Hello @SKuma.24 

As you Can see in the RM0433 part 8.5.6 : "After a system reset, the HSI is selected as system clock and all PLLs are switched OFF". When you forget to call system clock configurations, a default system clock configuration is applied use the registers default parametres. You Can find more details in the reference manual of your MCU.

Best Regards.

STTwo-32

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.

4 replies

AScha.3
Super User
November 20, 2023

i am just guessing:  might be, what CubeMx shows, when you start a project (and set nothing)

AScha3_0-1700503089580.png

HSI driving core and bus...otherwise no start code/your code could start ever.

If you feel a post has answered your question, please click on " Best Answer ".
STTwo-32
STTwo-32Best answer
ST Technical Moderator
November 20, 2023

Hello @SKuma.24 

As you Can see in the RM0433 part 8.5.6 : "After a system reset, the HSI is selected as system clock and all PLLs are switched OFF". When you forget to call system clock configurations, a default system clock configuration is applied use the registers default parametres. You Can find more details in the reference manual of your MCU.

Best Regards.

STTwo-32

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.
Tesla DeLorean
Guru
November 20, 2023

MCU just continues clocking from HSI or MSI clock that it start with by default, and all the AHB / APB are basically at DIV1 settings.

On H7 most will be running at 64 MHz HSI across all buses.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
Tesla DeLorean
Guru
November 20, 2023

You know, you can bring up a UART and print this stuff out

void SystemDiagnostic(void)
{
 printf("\n\nCore=%d, %d MHz\n", SystemCoreClock, SystemCoreClock / 1000000);
 CORECheck();
 IDCODECheck();
 FPUCheck();
 printf("APB1=%d\n", HAL_RCC_GetPCLK1Freq());
 printf("APB2=%d\n", HAL_RCC_GetPCLK2Freq());
}
Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..