Page 2 of 2
Re: Unwanted RTC reset at reboot
Posted: Fri Apr 05, 2013 8:03 pm
by barthess
I have no good ideas. This is not a BKP reset because reset value of RTCSEL is 0x0. As RM0090 says:
Once the RTC clock source has been selected, it cannot be changed anymore unless the Backup domain is reset.
Probably some supply/clock glitches?
Re: Unwanted RTC reset at reboot
Posted: Mon Apr 08, 2013 9:17 am
by Laurent
After some intensive debugging I found it was a problem on my side... I'm really sorry. Everything works fine now.
Re: Unwanted RTC reset at reboot
Posted: Mon Apr 08, 2013 9:38 am
by Tectu
May you tell us what the problem was and how you fixed it? This is very essential for people coming across a similar problem in the future.
~ Tectu
Re: Unwanted RTC reset at reboot
Posted: Mon Apr 08, 2013 9:49 am
by Laurent
I forgot that my firmware was not run directly upon startup, it is launched by a custom bootloader. It's been there for so long that I completely forgot about it. And the one who wrote the bootloader (which uses ChibiOS too) configured the RTC to use the LSI clock.
That was really stupid

Re: Unwanted RTC reset at reboot
Posted: Mon Apr 08, 2013 9:59 am
by Tectu
Don't worry, we all do, and there's nobody excluded, make "stupid" mistakes. That's actually making things even still for experts interesting.
Glad to her that you got it working now, enjoy the hacking!
~ Tectu
Re: Unwanted RTC reset at reboot
Posted: Mon Apr 08, 2013 3:07 pm
by barthess
Hi Laurent,
1) Please mark this topic as [SOLVED].
2) Tectu is correct. We spent our time trying to solve problem and we interested a lot in solution. Even there is not Chibios problem we want to know where problem may come from. Do not be lazy (or confused) to explain where problem exactly was.
Re: Unwanted RTC reset at reboot
Posted: Mon Apr 08, 2013 3:59 pm
by Laurent
1) Please mark this topic as [SOLVED].
How?
Re: Unwanted RTC reset at reboot
Posted: Mon Apr 08, 2013 4:17 pm
by Tectu
Go to your first post, click the 'edit' button and then edit the Subject.
And just a small example: I spend 10 and a half hour one saturday, ending up in a stupid problem... I wrote some new board files. I took an existing one as a template since it's only slightly different. Everything worked great, I copied it, edited it and included the new board.mk correctly. However, As I found out after what painful amount of time, I didn't edit the board.mk content. Therefore, I did include the correct Makefile, but the paths in that Makefile still referred to the old board.
~ Tectu
Re: Unwanted RTC reset at reboot
Posted: Thu Apr 11, 2013 11:35 am
by Laurent
Sorry to look like such a noob, but I can't seem to be able to edit my first post. I can only edit the last one.
And I noticed that no other thread on this forum (at least in the few sections I looked) is marked "[SOLVED]". Strange.