2013-10-31 07:08 AM
Hi everybody,
I'm using a STM32 L152CB microcontroller with external clock. Initially I used it without USB and the RTC_SetTime worked. Since I configured the USB, the function (RTC_SetTime) doesn't work and my RTC_TimeTypeDef struct is always to 0 for each parameters (day, month, etc..) The micro's frequency is 16Mhz and the USB's clock is 48Mhz. Have you suggestions? Thanks! #rtc #clock #usb2014-10-13 02:56 AM
I can show all the project code if you want, but I'm afraid this will bother you since this will introduce lots of code.
2014-10-13 03:05 AM
I found the root cause. When USB enter and exit low power mode, as Suspend and Resume do, it calls stuffs like SystemInit to reinitialize the whole system. So adding reinitialization code of RTC right before RTC_SetTime solved this problem.