cancel
Showing results for 
Search instead for 
Did you mean: 

stm32f405 rtc help

Angelo1
Associate II
Posted on May 12, 2014 at 09:29

Dear all,

i am using STM32F405 with internal osc. clock.

I connected a 3V lithium battery as VBAT, and would like to use the RTC to keep time when power is off.

I read some samples here and there and implemented some RTC init / setup routines (finally using RTC_SetTime / RTC_SetDate). Until now, i can save time / date to RTC, but if i power off and on after 10 seconds, i see the time set as the same of power off (10 seconds old) while i was expecting the updated time.

Every help is appreciated.

Regards

angelo

19 REPLIES 19
Linda
Associate II
Posted on December 24, 2015 at 21:51

Ai, I still can not fix the problem, time have pass for a few months now, my boss is after me. Any body can help? I will take some of my salary to pay you, otherwise I will lost my job. Please help. 

Posted on December 25, 2015 at 01:28

Now might be a good time for you to clearly define what hardware you have built, and what aspects of its intrinsic functionality you have tested. ie does the LSE oscillate, can you measure the signal on a scope via the MCO, or other pin, and bench mark it against the HSE using the TIM connection internally. The correct functioning of the LSE oscillator is heavily dependent on the component choices, and wire lengths/layout. On DISCO boards the LSE is typically not populated, so components need to be added, and stub connections to pin headers disconnected.

Once we've addressed the basic functionality, then let's examine exactly what is and isn't working on the software side of things, and why that might be occurring.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Linda
Associate II
Posted on December 25, 2015 at 13:45

The hardware is done according the instruction:

X2, c23, c24,  R53, R54 are populated,  SB16 open, SB17 open. I even can not detect any signal in the X2 by using oscilloscope

Linda
Associate II
Posted on December 25, 2015 at 15:08

I also remove R52, connect +3V to pin 6 of STM32F429ZIT6, but didn't connect to pin 1 of STM32F103C8T6.

Linda
Associate II
Posted on December 25, 2015 at 15:42

I don't know why need to open 

SB16 , SB17 ? after open SB16 and S17, X2 connect to no where.

Posted on December 25, 2015 at 15:57

I don't know why need to open SB16 , SB17 ? after open SB16 and S17, X2 connect to no where.

So there aren't long stub traces to the P2 header, that's why, and the X2 pins then have short connections directly to the STM32, the connectivity is indicated in the schematic from the net names. ie PC14-OSC32_IN and PC15-OSC32_OUT

Make sure you have the correct 32.768 KHz crystal, and it is correctly orientated.

The LSE must explicitly be turned ON, make sure your code is doing this before you probe the pins. Ideally you want to measure the frequency using the internal TIM that's connected to the LSE/RTC source.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Linda
Associate II
Posted on December 26, 2015 at 15:42

Thanks a lot.

Linda
Associate II
Posted on December 26, 2015 at 22:31

I still can not make the LSE work, I can not detect any signal from the crystal. 

Posted on December 27, 2015 at 00:13

I still can not make the LSE work, I can not detect any signal from the crystal.

Unfortunately you're going have to get a lot more technically detailed on what suggestions you've tried, and the methods you've used to test and verify the components.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Linda
Associate II
Posted on December 31, 2015 at 23:00

I gave up to use crystal on board, I use external one from PC14, now program stop at backup SRAM.