2015-09-08 01:07 PM
Topic says it all, I get an error in the
RTC
after updating the library version to 1.8.0 In the oldstm32f407xx
.h files I find:/******************** Bits definition forRTC_PRERregister *****************/
#defineRTC_PRER_PREDIV_A ((uint32_t)0x007F0000)
#defineRTC_PRER_PREDIV_S ((uint32_t)0x00001FFF)
In the new
stm32f407xx
.h files I find:/******************** Bits definition forRTC_PRERregister *****************/
#defineRTC_PRER_PREDIV_A ((uint32_t)0x007F0000)
#defineRTC_PRER_PREDIV_S ((uint32_t)0x00007FFF)
I'm unable to test right now if this is the cause of my problems but if someone can clear light on why the register definitions changed I would be grateful. I don't seem to find any mention of this in the release notes.
Thanks Steven2015-09-08 02:29 PM
According to the manual, page 812, the PREDIV_S field of the RTC_PRER register is 15 bits wide. Therefore an acceptance mask should be 0x00007FFF.
Why the difference? Other than the obvious, because the new version would be correct.2015-09-08 02:33 PM
BTW, your subject doesn't say it all, what error are you getting?
2015-09-09 06:05 AM
Hi steevke,
Assaid, the value defined in this file is a mask, and RTC_PRER_PREDIV_S extends on 15 bits, that's why the value should be 0x0007FFF and not 0x0001FFF. And the correction is done since version 1.6.
And what is the faulty behaviour in tyour code caused by this change? -Shahrzad-2015-09-09 07:26 AM
Hello Sharzad,
Thank you for the clarification. The error I get is HAL_TIMEOUT in HAL_StatusTypeDef RTC_EnterInitMode(RTC_HandleTypeDef* hrtc)./* Wait till RTC is in INIT state and if Time out is reached exit */
while
((hrtc->Instance->ISR & RTC_ISR_INITF) == (uint32_t)RESET)
{
if
((HAL_GetTick() - tickstart ) > RTC_TIMEOUT_VALUE)
{
return
HAL_TIMEOUT;
}
}
I only get the error when reseting, if I power down/up the RTC inits OK.
Edit: using 1.5.0 the RTC inits OK, with 1.8.0 not.
2015-09-11 08:24 AM
Hi steevke,
After searching differences between stm32f4xx_hal_rtc.c driver in 1.5.0 and 1.8.0, there is no difference in the function RTC_EnterInitMode. There is a modification in the function HAL_RTC_GetTime() which can not be the reason of the dispalyed error. Try to keep your code with the pachakge 1.8.0 and modify the value of RTC_PRER_PREDIV_S, so you can see if this modification is the source of error. -Shahrzad-