2021-03-10 05:51 PM
I have a question about clock config.
Is this a right way to execute program from boot and set clock config like HSE and PLL, then execute program from user app and set clock config again?
Actually, there is an error when executing user app.
It seems the problem is in PLL, here is an error code below :
・ file ; stm32f4xx_hal_rcc.c
・function ; __weak HAL_StatusTypeDef HAL_RCC_OscConfig(RCC_OscInitTypeDef *RCC_OscInitStruct)
・error code on user app
pll_config = RCC->PLLCFGR;
if((READ_BIT(pll_config, RCC_PLLCFGR_PLLSRC) != RCC_OscInitStruct->PLL.PLLSource) ||
(READ_BIT(pll_config, RCC_PLLCFGR_PLLM) != RCC_OscInitStruct->PLL.PLLM) ||
(READ_BIT(pll_config, RCC_PLLCFGR_PLLN) != RCC_OscInitStruct->PLL.PLLN) ||
(READ_BIT(pll_config, RCC_PLLCFGR_PLLP) != RCC_OscInitStruct->PLL.PLLP) ||
(READ_BIT(pll_config, RCC_PLLCFGR_PLLQ) != RCC_OscInitStruct->PLL.PLLQ))
→those four bolded sentence are in trouble.
I have no idea how to figure this out.
I have already checked flash latency and found out they are fine.
wondering if anyone would give me some advice, thank you.