RTC reset after Beaglebone boot

68 views
Skip to first unread message

ritishash...@gmail.com

unread,
Sep 14, 2017, 10:25:09 AM9/14/17
to BeagleBoard
Hello,
I have intefaced RTC DS1307 with Beaglbone. However, after the beaglebone boots up, its time is reset and RTC takes this reset time. Use of NTP would not be feasible since Beaglebone would be used in a remote location with no internet connection. What would be the solution to this issue ?

Ritisha

Tarmo Kuuse

unread,
Sep 14, 2017, 12:43:19 PM9/14/17
to BeagleBoard
On Thursday, 14 September 2017 17:25:09 UTC+3, Ritisha Shettigar wrote:
I have intefaced RTC DS1307 with Beaglbone. However, after the beaglebone boots up, its time is reset and RTC takes this reset time. Use of NTP would not be feasible since Beaglebone would be used in a remote location with no internet connection. What would be the solution to this issue ?

There's a reasonably easy hack:

A proper solution would probably involve a kernel change to replace the default RTC device (which is currently the chip's nearly useless internal one at /dev/rtc0). I'd love to figure out how that works, as I need to do the same thing.

--
Kind regards,
Tarmo Kuuse

Robert Nelson

unread,
Sep 14, 2017, 12:51:37 PM9/14/17
to Beagle Board, ritishash...@gmail.com
As of this week, we have an easy solution. (using u-boot overlays of
course), the trick is the rtc "aliases", so that the ds1307 gets rtc0

Seee either :

https://github.com/beagleboard/bb.org-overlays/blob/master/src/arm/BB-I2C1-MCP7940X-00A0.dts

or:

https://github.com/beagleboard/bb.org-overlays/blob/master/src/arm/BB-I2C2-PCF8523-00A0.dts

Regards,

--
Robert Nelson
https://rcn-ee.com/

Robert Nelson

unread,
Sep 14, 2017, 1:03:50 PM9/14/17
to Beagle Board, ritishash...@gmail.com
and here's it working: (eth is disconnected)

debian@beaglebone:~$ dmesg | grep rtc
[ 1.594096] omap_rtc 44e3e000.rtc: already running
[ 1.594335] omap_rtc 44e3e000.rtc: rtc core: registered 44e3e000.rtc as rtc1
[ 1.776976] rtc-ds1307 1-0068: registered as rtc0
[ 1.795900] rtc-ds1307 1-0068: setting system clock to 2017-09-14
17:01:12 UTC (1505408472)

William Hermans

unread,
Sep 14, 2017, 3:12:20 PM9/14/17
to beagl...@googlegroups.com
You could also set time on the second rtc during setup after updating the time via nap date then just run a script at boot, and occasionally  (once a day?) Using a system timer.

With the new fix Robert implemented.  .  
Probably more hassle than it's worth , but it's  not that difficult, and it works.

--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/CAOCHtYjZ3hbMsv7QUYw0A3TtKYr-dmEGENJa5U9kDzYomr4QBQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Tarmo Kuuse

unread,
Sep 18, 2017, 8:13:26 AM9/18/17
to BeagleBoard
Very interesting. Which version of the kernel implements this?

Robert Nelson

unread,
Sep 18, 2017, 12:02:55 PM9/18/17
to Beagle Board, Tarmo Kuuse
Right now v4.9.x+ only, still need to look into backporting the change
that enabled the rtc alisas to work..

Robert Nelson

unread,
Sep 18, 2017, 12:09:18 PM9/18/17
to Ritisha Shettigar, Beagle Board
On Fri, Sep 15, 2017 at 3:43 AM, Ritisha Shettigar
<ritishash...@gmail.com> wrote:
> Also i am getting this error even after executing make
> src/arm/BB-I2C2-PCF8523-00A0.dtbo
>
> Error: BB-I2C2-PCF8523-00A0.dts:9.1-9 syntax error
> FATAL ERROR: Unable to parse input tree

debian@test-bbb-4:/opt/source/bb.org-overlays$ make
src/arm/BB-I2C2-PCF8523-00A0.dtbo
DTC src/arm/BB-I2C2-PCF8523-00A0.dtbo
debian@test-bbb-4:/opt/source/bb.org-overlays$ /usr/bin/dtc --version
Version: DTC 1.4.4

I'm guessing your dtc is too old...
Reply all
Reply to author
Forward
0 new messages