STM32Cube MCU Full Package for the STM32F4 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))
Other
897
stars
424
forks
source link
Check value of pllm in function HAL_RCC_GetSysClockFreq of stm32f4xx_hal_rcc.c:911 #147
Check value of pllm in function HAL_RCC_GetSysClockFreq of stm32f4xx_hal_rcc.c:911
Hi Community,
There seems to be a bug in the latest version of STM32CubeF4, stm32f4xx_hal_rcc.c line 911. A division by zero is possible given RCC->PLLCFGR is 0.
Triggering the Bug
The bug can be triggered if switch case
RCC_CFGR_SWS_PLL
is reached andRCC->PLLCFGR
is set to 0.Possible Fixes
Handling the value of pllm by checking it against 0 can be one of the possible fixes.
If you feel that this bug is valid, I'd be happy to send over a PR as well :).