2020-11-26 01:03 AM
I use STM32CubeF4 1.25.2. I found bug about PLL checking code. Please confirm the following.
--- a/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c
+++ b/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c
@@ -542,9 +542,9 @@ __weak HAL_StatusTypeDef HAL_RCC_OscConfig(RCC_OscInitTypeDef *RCC_OscInitStruc
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))
+ (READ_BIT(pll_config, RCC_PLLCFGR_PLLN) != (RCC_OscInitStruct->PLL.PLLN << RCC_PLLCFGR_PLLN_Pos)) ||
+ (READ_BIT(pll_config, RCC_PLLCFGR_PLLP) != (((RCC_OscInitStruct->PLL.PLLP >> 1U) - 1U) << RCC_PLLCFGR_PLLP_Pos)) ||
+ (READ_BIT(pll_config, RCC_PLLCFGR_PLLQ) != (RCC_OscInitStruct->PLL.PLLQ << RCC_PLLCFGR_PLLQ_Pos)))
{
return HAL_ERROR;
}
Solved! Go to Solution.
2020-11-26 07:43 AM
Hello @KOkun.1048 ,
Thanks for pointing out this issue and for your contribution to improve our products; it is much appreciated!
Our development team is currently working to fix this in the coming release of STM32CubeF4.
Imen
2020-11-26 01:08 AM
HAL_RCC_OscConifig() writes PLLCFGR with bit shifts.
But, HAL_RCC_OscConfig() checks PLLCFGR without bit shifts.
2020-11-26 06:18 AM
@Imen DAHMEN
Would you check about this?
Best regards
2020-11-26 07:43 AM
Hello @KOkun.1048 ,
Thanks for pointing out this issue and for your contribution to improve our products; it is much appreciated!
Our development team is currently working to fix this in the coming release of STM32CubeF4.
Imen
2020-11-26 03:47 PM
Hello @Imen DAHMEN ,
Thank you for your quick response. I hope that you release the updated STM32CubeF4 soon!
Koji
2021-02-19 10:30 AM
@Imen DAHMEN Any updates on the release of this bugfix? I just ran into this myself and was curious if/when this fix will be released?
2021-02-25 11:48 PM
Hi @JBick.1 , @KOkun.1048 ,
Sorry for the late reply on this, but I have come back with good news :)
I would inform you that the fix of this issue is now available with the new release of STM32CubeF4 V1.26.0.
Please update and use the latest release which contains fixes and enhancement.
Thank you for your patience while we work on this.
Imen
2021-02-25 11:59 PM
@Imen DAHMEN
Thank you for your new release!
I will check it soon.
2021-02-27 05:56 AM
Those "my.st.com" links don't work, when one has not signed in. As this forum is viewed by many people from all of the world, it would be better to give general globally valid links like this:
2021-02-27 01:00 PM
@Piranha , you are right.
Thanks for your feedback and for providing the valid link.