2016-01-30 02:13 PM
See line 678 :
while (__HAL_RCC_GET_SYSCLK_SOURCE() != RCC_SYSCLKSOURCE_STATUS_PLLRCLK)
The intend is to check System clock switch status (SWS field of RCC_CFGR) after writing to System clock switch (SW field of RCC_CFGR). But the definition of RCC_SYSCLKSOURCE_STATUS_PLLRCLK
is wrong. As a result that statement never gets false which leads to timeout. In turn, that leads to skipping initialization of PPRE1 and PPRE2 of RCC_CFGR. The consequence is: APB1 and APB2 clocks are the same as AHB clock when AHB prescaler = 1. So, if SYSCLK is 180 MHz the APB1 will run at the same clock (should be 45 MHz max) ! Wow!
Conclusion: The definition of RCC_SYSCLKSOURCE_STATUS_PLLRCLKs
hould point to bits 3:2 instead of 1:0 of RCC_CFGR register
#stm32f4x-hal-library2016-02-01 03:38 AM
Hikhazhakyan.ruben,
I confirm the reported issue. In fact,RCC_SYSCLKSOURCE_STATUS_PLLRCLK has to be defined as:#define RCC_SYSCLKSOURCE_STATUS_PLLRCLK ((uint32_t)(RCC_CFGR_SWS_0 | RCC_CFGR_SWS_1)) /*!< PLLR used as system clock */
This bug is reported internally and will be fixed in a coming release.
Thanks for your interest on our solutions.
-Mayla-
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.