On 06/08/2017 06:59 AM, Beagle Boner wrote:
Hi,

i´m using the latest Debian Image an I´m trying to set an external RTC as a hardwareclock for my BBB. I have a different RTC module (PCF8563) but basicly I stick to the following manual:
https://learn.adafruit.com/adding-a-real-time-clock-to-beaglebone-black/set-rtc-time

What I dont understand here is the following:

The author sets the ds1307 as a new i2c device with the command:

echo ds1307 0x68>/sys/class/i2c-adapter/i2c-1/new_device

In the next step he can already access the new rtc1 device.

hwclock -r -f /dev/rtc1

Why is that? How does the system know that the new i2c device connected is a RTC and how to access it. Is there a preinstalled driver for DS1307?

The first command instructs the I2C adapter that there is a device at address 0x68 and to match it with an I2C driver "ds1307". When the driver loads, it creates a new /dev/rtcX device (and also a new /sys/class/rtc/rtcX device).



According to the manual I did the following:

echo pcf8563 0x51 > /sys/class/i2c-adapter/i2c-2/new_device

My PCF8563 is getting recognized as rtc1 (not sure why - I havent installed any drivers?)

The beaglebone kernel includes the driver for this device.


When I try to access

hwclock -r -f /dev/rtc1

I just get

hwclock: ioctl(RTC_RD_TIME) to /dev/rtc1 to read the time failed: Invalid argument

Does anyone have some hints on that?

Which pins are you using? Have you set the pin mux for I2C? Can you read any of the files at /sys/class/rtc/rtc1/* ?


Cheers.




--
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+unsubscr...@googlegroups.com <mailto:beagleboard+unsubscr...@googlegroups.com>. To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/9645489d-9a24-4888-b124-e3eeac3f0811%40googlegroups.com <https://groups.google.com/d/msgid/beagleboard/9645489d-9a24-4888-b124-e3eeac3f0811%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.


--
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/11616938-31d2-b8de-9db7-8dd2b23ec862%40lechnology.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to