File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
targets/TARGET_STM/TARGET_STM32H7/device Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -803,7 +803,19 @@ __weak HAL_StatusTypeDef HAL_RCC_OscConfig(RCC_OscInitTypeDef *RCC_OscInitStruc
803803 }
804804 else
805805 {
806- return HAL_ERROR ;
806+ /* Do not return HAL_ERROR if request repeats the current configuration */
807+ uint32_t temp1_pllckcfg = RCC -> PLLCKSELR ;
808+ uint32_t temp2_pllckcfg = RCC -> PLL1DIVR ;
809+ if (((RCC_OscInitStruct -> PLL .PLLState ) == RCC_PLL_OFF ) ||
810+ (READ_BIT (temp1_pllckcfg , RCC_PLLCKSELR_PLLSRC ) != RCC_OscInitStruct -> PLL .PLLSource ) ||
811+ ((READ_BIT (temp1_pllckcfg , RCC_PLLCKSELR_DIVM1 ) >> RCC_PLLCKSELR_DIVM1_Pos ) != RCC_OscInitStruct -> PLL .PLLM ) ||
812+ (READ_BIT (temp2_pllckcfg , RCC_PLL1DIVR_N1 ) != (RCC_OscInitStruct -> PLL .PLLN - 1U )) ||
813+ ((READ_BIT (temp2_pllckcfg , RCC_PLL1DIVR_P1 ) >> RCC_PLL1DIVR_P1_Pos ) != (RCC_OscInitStruct -> PLL .PLLP - 1U )) ||
814+ ((READ_BIT (temp2_pllckcfg , RCC_PLL1DIVR_Q1 ) >> RCC_PLL1DIVR_Q1_Pos ) != (RCC_OscInitStruct -> PLL .PLLQ - 1U )) ||
815+ ((READ_BIT (temp2_pllckcfg , RCC_PLL1DIVR_R1 ) >> RCC_PLL1DIVR_R1_Pos ) != (RCC_OscInitStruct -> PLL .PLLR - 1U )))
816+ {
817+ return HAL_ERROR ;
818+ }
807819 }
808820 }
809821 return HAL_OK ;
You can’t perform that action at this time.
0 commit comments