0

`

void SystemClock_Config(void)
{
 LL_FLASH_SetLatency(LL_FLASH_LATENCY_4);
 while(LL_FLASH_GetLatency()!= LL_FLASH_LATENCY_4)
 {
 }
// PWR Clock Enable?
//
 LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE1);
 while (LL_PWR_IsActiveFlag_VOS() != 0)
 {
 }
 LL_RCC_HSE_Enable();
 /* Wait till HSE is ready */
 while(LL_RCC_HSE_IsReady() != 1)
 {
 }
 LL_RCC_LSI_Enable();
 /* Wait till LSI is ready */
 while(LL_RCC_LSI_IsReady() != 1)
 {
 }
 LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_HSE, LL_RCC_PLLM_DIV_1, 10, LL_RCC_PLLR_DIV_2);
 LL_RCC_PLL_EnableDomain_SYS();
 LL_RCC_PLL_Enable();
 /* Wait till PLL is ready */
 while(LL_RCC_PLL_IsReady() != 1)
 {
 }
 LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL);
 /* Wait till System clock is ready */
 while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL)
 {
 }
 LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1);
 LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_2);
 LL_RCC_SetAPB2Prescaler(LL_RCC_APB2_DIV_1);
 LL_SetSystemCoreClock(80000000);
 /* Update the time base */
 if (HAL_InitTick (TICK_INT_PRIORITY) != HAL_OK)
 {
 Error_Handler();
 }
}

This code is generated by the STM32 Cube Ide, but I think the code that enables the PWR Clock must be called first. ex(LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_PWR)) If there is really a problem with the code generated by STM32 Cube, I would appreciate it if you could reply to see if my thoughts are correct.

asked Jan 14, 2025 at 10:31
2
  • You do have to enable it, but maybe not there. Try searching the rest of the generated project. Commented Jan 14, 2025 at 13:31
  • Thank, I found Clock Enable Codes Commented Jan 15, 2025 at 3:17

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.