Skip to main content
Visitor II
November 26, 2020
Solved

[BUG] about PLL checking code in STM32F4xx

  • November 26, 2020
  • 6 replies
  • 2650 views

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;
 }

    This topic has been closed for replies.
    Best answer by Imen.D

    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

    6 replies

    Visitor II
    November 26, 2020

    @Imen DAHMEN​ 

    Would you check about this?

    Best regards

    Imen.DAnswer
    Technical Moderator
    November 26, 2020

    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

    Visitor II
    November 26, 2020

    Hello @Imen DAHMEN​ ,

    Thank you for your quick response. I hope that you release the updated STM32CubeF4 soon!

    Koji

    Visitor II
    February 19, 2021

    @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?

    Technical Moderator
    February 26, 2021

    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

    Graduate II
    February 27, 2021

    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:

    https://www.st.com/en/embedded-software/stm32cubef4.html

    Technical Moderator
    February 27, 2021

    @Piranha​ , you are right.

    Thanks for your feedback and for providing the valid link.

    Visitor II
    February 26, 2021

    @Imen DAHMEN​ 

    Thank you for your new release!

    I will check it soon.

    Explorer
    August 10, 2021

    Still an issue with STM32CubeF4 1.26.2