MaJerle / stm32fxxx-hal-libraries

Libraries for STM32F4xx and STM32F7xx built on HAL drivers from ST
MIT License
764 stars 434 forks source link

TM_RTC_Config #5

Closed qermit closed 8 years ago

qermit commented 8 years ago

TM_RTC_Config does not set all RCC_PeriphCLKInitTypeDef struct entries. PeriphClockSelection may have random value and HAL_RCCEx_PeriphCLKConfig will hang.

MaJerle commented 8 years ago

Let me know about yourfix. According to the clock you wanna init, these options are used and other ignored.

Waiting your fix. Have a nice day.

Edit: I have check your "bug" post. As you can see from HAL_RCCEx_PeriphCLKConfig function, it first check for which clock TYPE it goes. If RTCCLK is selected, then it does not use any other types of structure, only these.

qermit commented 8 years ago

I've created pull request #6 I'm not sure if this is correct (works with stm32f429l-discovery).

qermit commented 8 years ago

Edit: I have check your "bug" post. As you can see from HAL_RCCEx_PeriphCLKConfig function, it first check for which clock TYPE it goes. If RTCCLK is selected, then it does not use any other types of structure, only these.

HAL_RCCEx_PeriphCLKConfig is correct, however nothing is selected in TM_RTC_Config and RCC_PeriphCLKInitTypeDef.PeriphClockSelection has some garbage that was previously in this memory area. So in my case (24-STM32Fxxx_RTC_LCD) RCC_PeriphCLKInitTypeDef.PeriphClockSelection was equal to 1

tm_rtc

MaJerle commented 8 years ago

Yes, true that. I've fixed it, just must upload code.

Thanks for that.