dewille
Posts: 7
Joined: Fri May 11, 2018 2:32 pm

RTC module and I2C-0 problem

Fri May 11, 2018 2:50 pm

I got DS3231 RTC module and Pi Zero which I need to connect to I2C-0.

It works well connected to IC2-1

Code: Select all

[email protected]:~ $ sudo hwclock
2018-05-11 15:54:00.210619+0200

it register well

Code: Select all

[email protected]:~ $ dmesg | grep rtc
[   21.213237] rtc-ds1307 1-0068: registered as rtc0

shows up in devices

Code: Select all

[email protected]:~ $ ls -la /dev/rtc*
lrwxrwxrwx 1 root root      4 May 11 16:17 /dev/rtc -> rtc0
crw------- 1 root root 253, 0 May 11 16:17 /dev/rtc0

and of course it's detected by i2c-1 as well

Code: Select all

[email protected]:~ $ i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- UU -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

I've connected rtc module into I2C-0 because I need to free I2C-1 pins up - they're in use by my other device.
I enabled I2C-0 as ALT0 (as well as I2C-1)

Code: Select all

[email protected]:~ $ gpio readall
 +-----+-----+---------+------+---+-Pi Zero--+---+------+---------+-----+-----+
 | BCM | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | BCM |
 +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
 |     |     |    3.3v |      |   |  1 || 2  |   |      | 5v      |     |     |
 |   2 |   8 |   SDA.1 | ALT0 | 1 |  3 || 4  |   |      | 5v      |     |     |
 |   3 |   9 |   SCL.1 | ALT0 | 1 |  5 || 6  |   |      | 0v      |     |     |
 |   4 |   7 | GPIO. 7 |   IN | 1 |  7 || 8  | 1 | ALT0 | TxD     | 15  | 14  |
 |     |     |      0v |      |   |  9 || 10 | 1 | ALT0 | RxD     | 16  | 15  |
 |  17 |   0 | GPIO. 0 |   IN | 0 | 11 || 12 | 0 | IN   | GPIO. 1 | 1   | 18  |
 |  27 |   2 | GPIO. 2 |   IN | 0 | 13 || 14 |   |      | 0v      |     |     |
 |  22 |   3 | GPIO. 3 |   IN | 0 | 15 || 16 | 0 | IN   | GPIO. 4 | 4   | 23  |
 |     |     |    3.3v |      |   | 17 || 18 | 0 | IN   | GPIO. 5 | 5   | 24  |
 |  10 |  12 |    MOSI | ALT0 | 0 | 19 || 20 |   |      | 0v      |     |     |
 |   9 |  13 |    MISO | ALT0 | 0 | 21 || 22 | 0 | IN   | GPIO. 6 | 6   | 25  |
 |  11 |  14 |    SCLK | ALT0 | 0 | 23 || 24 | 1 | OUT  | CE0     | 10  | 8   |
 |     |     |      0v |      |   | 25 || 26 | 1 | OUT  | CE1     | 11  | 7   |
 |   0 |  30 |   SDA.0 | ALT0 | 1 | 27 || 28 | 1 | ALT0 | SCL.0   | 31  | 1   |
 |   5 |  21 | GPIO.21 |   IN | 1 | 29 || 30 |   |      | 0v      |     |     |
 |   6 |  22 | GPIO.22 |   IN | 1 | 31 || 32 | 0 | IN   | GPIO.26 | 26  | 12  |
 |  13 |  23 | GPIO.23 |   IN | 0 | 33 || 34 |   |      | 0v      |     |     |
 |  19 |  24 | GPIO.24 |   IN | 0 | 35 || 36 | 0 | IN   | GPIO.27 | 27  | 16  |
 |  26 |  25 | GPIO.25 |   IN | 0 | 37 || 38 | 0 | IN   | GPIO.28 | 28  | 20  |
 |     |     |      0v |      |   | 39 || 40 | 0 | IN   | GPIO.29 | 29  | 21  |
 +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
 | BCM | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | BCM |
 +-----+-----+---------+------+---+-Pi Zero--+---+------+---------+-----+-----+


I2C-0 is detecting 'some' device is connected

Code: Select all

[email protected]:~ $ i2cdetect -y 0
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- 68 -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

but it looks like it doesn't recognize it's rtc module

During boot rtc has been registered with error

Code: Select all

[email protected]:~ $ dmesg | grep rtc
[   37.366480] rtc-ds1307: probe of 1-0068 failed with error -121

and it doesn't shows up in devices

Code: Select all

[email protected]:~ $ ls -la /dev/rtc*
ls: cannot access '/dev/rtc': No such file or directory

and hwclock is not working obviously

Code: Select all

[email protected]:~ $ sudo hwclock
hwclock: Cannot access the Hardware Clock via any known method.
hwclock: Use the --debug option to see the details of our search for an access method.

My current Pi version is fresh from latest image. I had the same problem on kernel 3.x from some old image.

Code: Select all

$ uname -a
Linux pi 4.14.34+ #1110 Mon Apr 16 14:51:42 BST 2018 armv6l GNU/Linux

My question is: is it even possible to use I2C-0 with non-eeprom device and make it works ? It seems like I2C-0 discover connected device but it cannot communicate properly. Have you guys any idea how sort this out ?

Rgds

User avatar
DougieLawson
Posts: 36522
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: RTC module and I2C-0 problem

Fri May 11, 2018 5:19 pm

What have you got in /boot/config.txt? You should have:

Code: Select all

dtoverlay=i2c-rtc,ds3231
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

dewille
Posts: 7
Joined: Fri May 11, 2018 2:32 pm

Re: RTC module and I2C-0 problem

Fri May 11, 2018 6:01 pm

yes I put this line already into /boot/config.txt
RTC module is working on i2c-1. i2c-0 is enabled as ALT0 and it even detects that some device is connected into but it doesn't communicate with it I guess
This GPIO (27 & 28) are described as
These pins are generally reserved for i2c communication with an EEPROM.
Connect those pins for auto configuration, if the board provides the feature (check the board description for details of EEPROM functionality).
It seems like devices without EEPROM are not supported by these gpio's but well... maybe there's some trick already discovered ;)

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7522
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: RTC module and I2C-0 problem

Fri May 11, 2018 8:55 pm

Have you got I2C pull up resistors fitted on your device? They are present on GPIO 2&3 for i2c-1 but not on i2c-0 as they are expected to be provided by the HAT.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

dewille
Posts: 7
Joined: Fri May 11, 2018 2:32 pm

Re: RTC module and I2C-0 problem

Mon May 14, 2018 10:58 am

yes I already pulled them out. They're 2.4 kOhm 3.3V

Image

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7522
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: RTC module and I2C-0 problem

Mon May 14, 2018 11:59 am

Hang on, have you only got "dtoverlay=i2c-rtc,ds3231" in config.txt, or have you edited that overlay first to point at i2c-0?
Note https://github.com/raspberrypi/linux/bl ... lay.dts#L9
target = <&i2c_arm>;
If you want to attach to i2c-0 then you need an overlay with "target = <&i2c_vc>;".
The fact you're still getting UU reported against 0x68 on i2c-1, and a device reporting on 0x68 of i2c-0 says you're pointing DT at the wrong place.

Code: Select all

wget https://raw.githubusercontent.com/raspberrypi/linux/rpi-4.14.y/arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts
<edit it to replace all instances of i2c_arm with i2c_vc>
dtc -I dts -O dtb -o i2c0_rtc.dtbo i2c-rtc-overlay.dts
sudo cp i2c0_rtc.dtbo /boot/overlays
<edit /boot/config.txt to load i2c0-rtc instead of i2c-rtc>
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

dewille
Posts: 7
Joined: Fri May 11, 2018 2:32 pm

Re: RTC module and I2C-0 problem

Mon May 14, 2018 1:21 pm

Thanks a lot!!! It works now!

Code: Select all

[email protected]:~ $ sudo hwclock -r
2018-05-14 15:19:27.916061+0200
however on I2C-0 I also get 'UU' instead of '68' but RTC module is working great anyway

Code: Select all

[email protected]:~ $ i2cdetect -y 0
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- UU -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7522
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: RTC module and I2C-0 problem

Mon May 14, 2018 1:29 pm

UU means in use, eg by a kernel driver.
If a kernel driver has registered to use a particular bus and address combination then userspace apps are normally given an EBUSY error to denote that. There is a way to override that, but that tends to lead to bad things as you're tweaking a device's state without the kernel's knowledge.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

dewille
Posts: 7
Joined: Fri May 11, 2018 2:32 pm

Re: RTC module and I2C-0 problem

Tue May 15, 2018 1:13 pm

OK another problem just pop up.... I'm not going to create new topic because this issue is related to current one.

RTC module is working perfect on I2C-0 till I run raspivid process....

Code: Select all

[email protected]:~ $ dmesg | grep rtc
[   30.338679] rtc-ds1307 0-0068: registered as rtc0

[email protected]:~ $ i2cdetect -y 0
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- UU -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

[email protected]:~ $ sudo hwclock -c
hw-time      system-time         freq-offset-ppm   tick
1526388857   1526388856.513660
1526388869   1526388868.514722                89      1
1526388880   1526388879.514817                50      1

When I call out a raspivid by

Code: Select all

[email protected]:~ $ raspivid -ih -vf -hf -t 0 -awb off -awbg 1.4,1.0 -fps 25 -pf baseline -qp 30 -b 10000000 -w 1920 -h 1080 -o /tmp/vidstr.h264 &
[1] 479

RTC module is not longer working...

Code: Select all

[email protected]:~ $ sudo hwclock
hwclock: ioctl(RTC_RD_TIME) to /dev/rtc to read the time failed: Remote I/O error

[email protected]:~ $ dmesg | grep rtc
[  482.358956] rtc-ds1307 0-0068: read error -121
[  482.359268] rtc-ds1307 0-0068: read error -121
[  482.359641] rtc-ds1307 0-0068: read error -121
[  482.478260] rtc-ds1307 0-0068: read error -121
[  482.485084] rtc-ds1307 0-0068: read error -121
[  482.485377] rtc-ds1307 0-0068: read error -121

/var/log/syslog

Code: Select all

May 15 14:54:14 raspberrypi systemd[1]: Time has been changed
May 15 14:54:14 raspberrypi systemd[1]: apt-daily-upgrade.timer: Adding 6min 50.680319s random time.
May 15 14:54:14 raspberrypi systemd[416]: Time has been changed
May 15 14:54:13 raspberrypi systemd[1]: apt-daily.timer: Adding 9h 50min 15.705302s random time.
May 15 14:54:13 raspberrypi systemd[416]: Time has been changed
May 15 14:54:13 raspberrypi systemd[1]: Time has been changed
May 15 14:54:13 raspberrypi systemd[1]: apt-daily-upgrade.timer: Adding 23min 52.330597s random time.
May 15 14:54:13 raspberrypi systemd[1]: apt-daily.timer: Adding 7h 4min 773.305ms random time.
May 15 14:57:17 raspberrypi kernel: [  482.358956] rtc-ds1307 0-0068: read error -121
May 15 14:57:17 raspberrypi kernel: [  482.359268] rtc-ds1307 0-0068: read error -121
May 15 14:57:17 raspberrypi kernel: [  482.359641] rtc-ds1307 0-0068: read error -121
May 15 14:57:17 raspberrypi kernel: [  482.478260] rtc-ds1307 0-0068: read error -121
May 15 14:57:17 raspberrypi kernel: [  482.485084] rtc-ds1307 0-0068: read error -121

On fresh raspbian image I got rtc module connected to I2C-1 working well with camera. The problem pop up when I gpio switching to I2C-0. I've also tested this on 3 different kernels and this problem appears on each.
Any idea on this ? It seems like raspivid makes I2C devices off or something....

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7522
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: RTC module and I2C-0 problem

Tue May 15, 2018 1:17 pm

dewille wrote:
Tue May 15, 2018 1:13 pm
Any idea on this ? It seems like raspivid makes I2C devices off or something....
This is why the device tree alias is called i2c_vc - it's nominally reserved for VideoCore (the GPU), and is used by VC to control the camera and display. If you wish to use either of those peripherals then it is off limits to the ARM. You hadn't mentioned wishing to use the camera previously which is why I hadn't flagged it up before.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

dewille
Posts: 7
Joined: Fri May 11, 2018 2:32 pm

Re: RTC module and I2C-0 problem

Tue May 15, 2018 1:45 pm

I did't mention cuz I didn't think it was relevant. OK, it's clear now. Thanks for your help!

h4med
Posts: 2
Joined: Mon Nov 19, 2018 7:25 am
Contact: Website

Re: RTC module and I2C-0 problem

Mon Nov 19, 2018 7:42 am

Hi everybody,
I have the same problem with RTC on I2C0, my RTC (DS3231) is connected to GPIO28,29 of a Compute Module 3 on I2C0. I've created i2c0_rtc.dtbo as instructed. But instead of UU I still get 68.
Did I do /boot/config.txt settings correctly?

Code: Select all

#-------i2c-------------
dtparam=i2c_arm=on
#dtparam=i2c1=off
dtparam=i2c0=on
i2c_arm_baudrate=100000
dtoverlay=i2c0-bcm2708,pins_28_29
dtoverlay=i2c0-rtc,ds3231

This is the i2cdetect output:

Code: Select all

[email protected]:~# i2cdetect -y 0
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- 68 -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

And:

h4med
Posts: 2
Joined: Mon Nov 19, 2018 7:25 am
Contact: Website

Re: RTC module and I2C-0 problem

Tue Nov 20, 2018 7:55 am

6by9 wrote:
Mon May 14, 2018 11:59 am
Hang on, have you only got "dtoverlay=i2c-rtc,ds3231" in config.txt, or have you edited that overlay first to point at i2c-0?
Note https://github.com/raspberrypi/linux/bl ... lay.dts#L9
target = <&i2c_arm>;
If you want to attach to i2c-0 then you need an overlay with "target = <&i2c_vc>;".
The fact you're still getting UU reported against 0x68 on i2c-1, and a device reporting on 0x68 of i2c-0 says you're pointing DT at the wrong place.

Code: Select all

wget https://raw.githubusercontent.com/raspberrypi/linux/rpi-4.14.y/arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts
<edit it to replace all instances of i2c_arm with i2c_vc>
dtc -I dts -O dtb -o i2c0_rtc.dtbo i2c-rtc-overlay.dts
sudo cp i2c0_rtc.dtbo /boot/overlays
<edit /boot/config.txt to load i2c0-rtc instead of i2c-rtc>

Found the problem! Name of the new overlay file was incorrect, it should be

Code: Select all

 i2c0-rtc.dtbo
instead of

Code: Select all

i2c0_rtc.dtbo <-- WRONG

PMic
Posts: 3
Joined: Sun Jul 21, 2019 9:16 pm

Re: RTC module and I2C-0 problem

Sun Jul 21, 2019 9:39 pm

Same problem, and already tried all of the above. I probably forgot something obvious but I hope someone here can point it out:
PiServer:~ $ dmesg | grep rtc
PiServer:~ $
In the /boot/overlays directory:
i2c-rtc-overlay-vc.dtbo
I changed out all the &i2c_arm to &i2c_vc from the github file mentioned earlier, and compiled it here (slight note, I did it from a dtb file instead of a dts file, but I can't believe that would be a difference?)

config.txt contains:

Code: Select all

#RTC
dtoverlay=i2c-rtc-overlay-vc,ds1307

Code: Select all

PiServer:/boot $ i2cdetect -y 0
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: 50 -- -- -- -- -- -- -- 58 -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- 68 -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
vcdbg log msg shows (amongst a lot of other information)

Code: Select all

017355.067: dtparam: i2c_vc=on
017369.809: brfs: File read: 2204 bytes
017376.579: brfs: File read: /mfs/sd/overlays/uart0.dtbo
017388.173: Loaded overlay 'uart0'
017388.229: dtparam: txd0_pin=32
017388.713: dtparam: rxd0_pin=33
017389.201: dtparam: pin_func=7
017423.765: brfs: File read: 988 bytes
017428.541: brfs: File read: /mfs/sd/overlays/i2c0-bcm2708.dtbo
017444.195: Loaded overlay 'i2c0-bcm2708'
017444.256: dtparam: pins_28_29=1
017465.771: brfs: File read: 1318 bytes
017473.575: brfs: File read: /mfs/sd/overlays/i2c-rtc-overlay-vc.dtbo
017492.289: Loaded overlay 'i2c-rtc-overlay-vc'
017492.347: dtparam: ds1307=true
019394.514: Device tree loaded to 0x2eff9800 (size 0x67c2)
Edit:
I sort of assumed my question would be obvious, but reading it over I'm not so sure.

I changed the overlay, compiled it, and put it in /boot/overlays.
I edited /boot/config.txt to point to the overlay.
I rebooted.
I used the grep command to register the thing, but it didn't do anything.
The i2cdetect command still says the unit is available.

What am I doing wrong, does anyone have any pointers where to look to get the unit properly registered?

PMic
Posts: 3
Joined: Sun Jul 21, 2019 9:16 pm

Re: RTC module and I2C-0 problem

Mon Jul 22, 2019 9:32 am

Figured it out!


Don't forget:

Code: Select all

sudo modprobe rtc-ds1307
As I said, something very simple.

I feel a bit stupid for having asked this question now, but instead of deleting it I hope somebody as silly as me will be helped by this someday.
Sorry, I was lying. The clock works, it keeps time, I can reach it when I modprobe it. Only thing not working is the automatic loading of the clock at boot. Basically what the /boot/config.txt is supposed to do right?

Any help would still be appreciated.

PMic
Posts: 3
Joined: Sun Jul 21, 2019 9:16 pm

Re: RTC module and I2C-0 problem

Mon Jul 22, 2019 11:23 am

Add the clock to the Kernel modules:-

Code: Select all


sudo nano /etc/modules
Add:-

Code: Select all

rtc-ds1307
Save


For now, it seems this did the trick, only thing is I got the assumption everywhere that this should be something automatic. Nowhere else have I seen anybody who had to do this manually?

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7522
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: RTC module and I2C-0 problem

Mon Jul 22, 2019 1:15 pm

What file EXACTLY did you download?

Code: Select all

wget https://raw.githubusercontent.com/raspberrypi/linux/rpi-4.14.y/arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts
would have got the 4.14 kernel version. which therefore won't have had the more recent fixes, including

Code: Select all

commit 18ec3066b9439c1811ab19f0e16c0b6a51fe4154
Author: Phil Elwell <[email protected]>
Date:   Mon Jun 17 14:36:12 2019 +0100

    overlays: Fix compatible string for ds1307 RTC
    
    Kernels since 4.19 have required the correct manufacture name in the
    compatible string for I2C devices, and unfortunately the one for the
    Dallas/Maxim DS1307 should have been "dallas,ds1307" and not
    "maxim,ds1307".
    
    See: https://github.com/raspberrypi/linux/issues/3013
    
    Signed-off-by: Phil Elwell <[email protected]>
Update your URL to download the rpi-4.19.y branch version and you may have better luck.
"modinfo rtc-ds1307" will tell you all the aliases that the driver is going to match against. If it doesn't match, then it won't get loaded.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

User avatar
DetlevSchm
Posts: 72
Joined: Tue Mar 12, 2013 8:43 am
Location: 3rd planet

Re: RTC module and I2C-0 problem

Thu Oct 24, 2019 5:33 pm

6by9 wrote:If you want to attach to i2c-0 then you need an overlay with "target = <&i2c_vc>;"
Where do I put this modified i2c-rtc-overlay.dts file?

There is a /boot/overlays/ folder, but it contains only .dtbo files, nowhere else do I have .dts files.

User avatar
DougieLawson
Posts: 36522
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: RTC module and I2C-0 problem

Thu Oct 24, 2019 7:58 pm

DetlevSchm wrote:
Thu Oct 24, 2019 5:33 pm
Where do I put this modified i2c-rtc-overlay.dts file?
You have to compile it to a dtb or dtbo with the dtc command.


dtc -O dtb -o foobar.dtb foobar.dts
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7522
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: RTC module and I2C-0 problem

Thu Oct 24, 2019 8:07 pm

https://www.raspberrypi.org/documentati ... ce-tree.md

Code: Select all

dtc [email protected] -I dts -O dtb -o 1st.dtbo 1st-overlay.dts
([email protected] is required for overlays)
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

User avatar
DetlevSchm
Posts: 72
Joined: Tue Mar 12, 2013 8:43 am
Location: 3rd planet

Re: RTC module and I2C-0 problem

Fri Oct 25, 2019 8:18 am

Thanks, it works now :D

Return to “Interfacing (DSI, CSI, I2C, etc.)”