Skip to main content
SKuma.24
Associate II
Nov 20, 2023 5:47 PM UTC
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
Nov 20, 2023 6:06 PM UTC

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
Nov 20, 2023 5:59 PM UTC

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
Nov 20, 2023 6:06 PM UTC

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
Nov 20, 2023 6:13 PM UTC

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
Nov 20, 2023 6:16 PM UTC

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