cancel
Showing results for 
Search instead for 
Did you mean: 

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

SKuma.24
Associate II

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.

1 ACCEPTED SOLUTION

Accepted Solutions
STTwo-32
ST Employee

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.

View solution in original post

4 REPLIES 4
AScha.3
Chief III

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 "Accept as Solution".
STTwo-32
ST Employee

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.

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
Up vote any posts that you find helpful, it shows what's working..

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
Up vote any posts that you find helpful, it shows what's working..