2016-04-14 04:48 AM
Hello,
I have noticed that when my system wake up from Standby mode seems to lose some time and RTC loses something like 2 ms for each secondDoes anybody have anytime this kind of problem?I have using an STM32L162.Any idea will be welcomedBest regardsCarmen2016-05-04 04:21 AM
Hi Hannibal,
I have done that you had proposed, and the result is exactly the same.What can we do to fix it up?Carmen2016-05-04 08:42 AM
Hi fernandez.sergio,
You need to give more details about; Hardware you are using ( eval, nucleo, discovey, you own ?? ?) RTC clock source (LSE , LSI .. ?) And about the code, I suggest that you clean your code to keep only related part to standby and RTC to localize the bug if it a related to software . -Hannibal-2016-05-04 11:11 PM
Hi Hannibal,
I'm using my own hardware, with STM32L162RDT6. RTC clock source: LSE.I have cleaned the code, and keep just related to RTC and standby, and the problem persists.Best regardsCarmen2016-05-05 01:30 AM
Hi fernandez.sergio,
Try to share the clean code with me. Meanwhile, check in this application note if you have picked the right LSE crystal (Table 7) and if your design respect the design tips to ensure oscilator stability. Also, the Getting started with STM32L1xx hardware developement'' will give you a help to ensure if you have established you hardware connrectly. -Hannibal-2016-05-05 02:50 AM
Hi Hannibal,
Here is my clean code. I'm checking the hardware to make sure it is correctCarmen2016-05-05 02:51 AM
Hi Hannibal,
Here is my clean code. I'm checking the hardware to make sure it is correctCarmen2016-05-05 02:52 AM
Hi Hannibal,
Here is my clean code. I'm checking the hardware to make sure it is correct Carmen ________________ Attachments : mainStandBy.c.txt : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Htni&d=%2Fa%2F0X0000000aX6%2FAUNSwhh38OU.G97JlvXojLurD5wVVtV_77BOTNjudpA&asPdf=false2016-11-08 03:41 AM
Hi,
I just see your last post now. After checking the shared code, try to do the following : - Delete the tho line on the top about get time and date:HAL_RTC_GetTime (&hrtc, &sTime, FORMAT_BIN);
HAL_RTC_GetDate (&hrtc, &sDate, FORMAT_BIN);
And but them at this location:
if (__HAL_PWR_GET_FLAG(PWR_FLAG_SB) == RESET)
{
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_SB);
/* Configure the RTC module */
RTC_Configuration();
StandbyMode();
}
else
{
/* Read and save the current time */
/* Get the RTC current Time */
HAL_RTC_GetTime(&RTCHandle, &stimestructureget, FORMAT_BIN);
/* Get the RTC current Date */
HAL_RTC_GetDate(&RTCHandle, &sdatestructureget, FORMAT_BIN);
}
-You missed in RTC configuration to call theHAL_RTC_SetTime() function . You should add it
-Hannibal-