element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Community Hub
Community Hub
Member's Forum RTC on BBB
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Leaderboard
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Community Hub to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Not Answered
  • Replies 5 replies
  • Subscribers 510 subscribers
  • Views 982 views
  • Users 0 members are here
  • rtc
  • bbb
Related

RTC on BBB

Former Member
Former Member over 10 years ago

Hi Guys,

 

I got a BBB rev C. (w debian). I have connected an esternal battery on the right PMIC inputs, I setting the date/hour, but the processors doesn't remember them. I cannot use an external RTC.

Can You help me.

 

Thanks a lot

Enrico

  • Sign in to reply
  • Cancel
  • fvan
    0 fvan over 10 years ago

    What do you mean by "I cannot use an external RTC" ?

     

    As far as I know, the BBB does not have an onboard RTC. There is a guide on Adafruit on how to add an external RTC: https://learn.adafruit.com/adding-a-real-time-clock-to-beaglebone-black/overview

     

    Other alternatives are to configure NTP in case the BBB is connected to the internet via wifi or ethernet.

     

    Frederick

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 10 years ago in reply to fvan

    Hi Frederick,

     

    I want to use the RTC present on AM3358 (see DS http://www.ti.com/lit/ds/symlink/am3358.pdf) processors.

    From the BBB schematic I can see that can use a battery pack, through PMIC, for maintain the RTC in "live" mode....

    I tried it but, after reboot, the system has a bad date/time....

     

    image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • shabaz
    0 shabaz over 10 years ago in reply to Former Member

    Hi Enrico,

     

    The AM335x does have a built-in RTC, but what driver did you use to try to program it and use it? Does the Angstrom or Debian releases support it?

    I don't know anyone who has tried to use it on the BBB.

    Also, I know a LiPo battery can be used with the BBB's PMIC, but I don't know if a Lithium coin cell is supported - I've not checked the schematic.

    I think you'll find an external RTC is way easier, otherwise you'll probably be the one trailblazing here - depends how much time you have.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • clem57
    0 clem57 over 10 years ago

    Now it is time to connect the device and see if you can read the time. execute the following command:

    echo ds1307 0x68 >/sys/bus/i2c/devices/i2c-2/new_device

    If all is well you should get the prompt back with no errors. Now lets make sure it is registered and that you can read it. Enter the following:

    cat /sys/class/rtc/rtc1/name

    You should see:

    [root@BBB-40638 ~]# cat /sys/class/rtc/rtc1/name ds1307

    Which is the name of the RTC chip. Now enter:

    cat /sys/class/rtc/rtc1/time

    You can also substitute 'date' for 'time' but since the clock is not set it will be meaningless. You can later use these commands to look at your RTC directly for testing. The RTC when set is UTC time.

    You should see some random time as the clock is not set. Hit the up-arrow key and re-execute the command. Do this several times and the time should be incrementing like a normal clock.

    Now we are ready to set it but first your system time has to be accurate. If you are already using ntp and the time is set and correct then you can continue on. If not you need to use 'timedatectl' to set the system time and also the time zone correctly.

    timedatectl set-time [TIME]

    The time is entered in the format - "2014-11-15 18:17:16".

    Once you local time is correct as shown by typing 'date' at the Linux prompt you can go on to setting the clock. To synchronize the RTC to the system type the following:

    hwclock -f /dev/rtc1 –w

    This sets the RTC, which is /dev/rtc1, to match the accurately set system time

    Both of these commands can be executed as a script at boot. I choose to put the script in /usr/local/bin and I called it rtc_init. The script simple has the two initialization lines with a delay before reading.

    #!/bin/bash echo ds1307 0x68 >/sys/bus/i2c/devices/i2c-2/new_device sleep 2 hwclock -f /dev/rtc1 -s 

    I then placed the call to this script just after the delay in /usr/local/etc/rc.allstar as shown here:

    # start delay, START_DELAY is configured in the allstar.env file sleep ${START_DELAY}  # Initialize and read the RTC /usr/local/bin/rtc_init  # enable or disable openvpn 

    Because the time is up and stable at this point you could probably lower the boot delay. I have successfully used 10 seconds. I would probably not go less than 5 seconds.

    Note that the rc.allstar script has a write to the hwclock,

    # set clock /usr/bin/hwclock -w 

    after the above entries which is still necessary.

     

    Note: change the name of the chip to yours and the same setup should work. BTW, I use NTP to set my time very accurately at boot time since I have internet!

     

    Clem

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 10 years ago in reply to clem57

    Thanks Guys.

     

    Have a nice WE.

     

    Enrico

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube