Skip to main content
abelloni
Associate
October 31, 2013
Question

USB configuration conflicts with RTC_SetTime

  • October 31, 2013
  • 11 replies
  • 2491 views
Posted on October 31, 2013 at 15:08

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 #usb
This topic has been closed for replies.

11 replies

kevin1078
Associate
October 13, 2014
Posted on October 13, 2014 at 12:05

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.