Function HAL_RCC_GetSysClockFreq() casts numbers to uint64_t when calculating pllvco.
This is far beyond what is needed and results in inclusion of additional code from gcc library and in turn increases code size.
In my case code size was increased for over 700 bytes for no reason.
Function HAL_RCC_GetSysClockFreq() casts numbers to uint64_t when calculating pllvco. This is far beyond what is needed and results in inclusion of additional code from gcc library and in turn increases code size. In my case code size was increased for over 700 bytes for no reason.
Describe the set-up
Additional context Problematic lines: https://github.com/STMicroelectronics/stm32l0xx_hal_driver/blob/86984275fa7dbaa617713d0309575fc2c2fa1448/Src/stm32l0xx_hal_rcc.c#L1245 https://github.com/STMicroelectronics/stm32l0xx_hal_driver/blob/86984275fa7dbaa617713d0309575fc2c2fa1448/Src/stm32l0xx_hal_rcc.c#L1251 https://github.com/STMicroelectronics/stm32l0xx_hal_driver/blob/86984275fa7dbaa617713d0309575fc2c2fa1448/Src/stm32l0xx_hal_rcc.c#L1255
Removing casts reduces code size without any additional penalty.