cancel
Showing results for 
Search instead for 
Did you mean: 

[BUG] about PLL checking code in STM32F4xx

KOkun.1048
Associate III

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

1 ACCEPTED SOLUTION

Accepted Solutions

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

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen

View solution in original post

12 REPLIES 12
KOkun.1048
Associate III

@Imen DAHMEN​ 

Would you check about this?

Best regards

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

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen

Hello @Imen DAHMEN​ ,

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

Koji

JBick.1
Associate

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

Imen.D
ST Employee

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

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
KOkun.1048
Associate III

@Imen DAHMEN​ 

Thank you for your new release!

I will check it soon.

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

@Piranha​ , you are right.

Thanks for your feedback and for providing the valid link.

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen