STMicroelectronics / STM32CubeH7

STM32Cube MCU Full Package for the STM32H7 series - (HAL + LL Drivers, CMSIS Core, CMSIS Device, MW libraries plus a set of Projects running on all boards provided by ST (Nucleo, Evaluation and Discovery Kits))
https://www.st.com/en/embedded-software/stm32cubeh7.html
Other
490 stars 302 forks source link

implicit declaration LL_RCC_CalcPLLClockFreq #210

Closed daniel-starke closed 5 months ago

daniel-starke commented 2 years ago

Describe the set-up

Describe the bug stm32h7xx_ll_utils.c uses LL_RCC_CalcPLLClockFreq() in several places. stm32h7xx_ll_rcc.h is included, which declares the function. However, the declaration of this function is gates by the definition of USE_FULL_LL_DRIVER. Failing to define USE_FULL_LL_DRIVER results in a compiler warning "implicit declaration of function 'LL_RCC_CalcPLLClockFreq'". This may result in linker issues.

How To Reproduce Compile stm32h7xx_ll_utils.c with the compiler flag -Wimplicit-function-declaration and without defining USE_FULL_LL_DRIVER.

Additional context I propose to move the declaration of LL_RCC_CalcPLLClockFreq() outside of the USE_FULL_LL_DRIVER block in stm32h7xx_ll_rcc.h.

The warning was given for this line: https://github.com/STMicroelectronics/STM32CubeH7/blob/b340b13929e36a3427b8d94e8b1006022f82273f/Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_ll_utils.c#L929

HBOSTM commented 1 year ago

Hello @daniel-starke,

First of all thank you for this contribution. You cannot use this driver without the USE_FULL_LL_DRIVER definition.

Best Regards, Houssine

daniel-starke commented 1 year ago

I know. The point is that USE_FULL_LL_DRIVER does not gate all places in a consistent manner.

KRASTM commented 7 months ago

ST Internal Reference: 171944

TOUNSTM commented 5 months ago

Fixed in abbf9ca1b36c9abdb9339e86f0b7b2f4e79edc35