Raspberry PI CM4 and RTC

dtoverlay=i2c0
dtoverlay=i2c1
dtoverlay=i2c2
dtoverlay=i2c3
dtoverlay=i2c4
dtoverlay=i2c5
dtoverlay=i2c6
I actually think an approach like this is good. Just substitute your i2c1 settings from above. That way you are activating all the buses.
At minimum activate i2c0 and i2c1.
Skipping a device (i2c0) could be having weird effect.
 
Nope.
Code:
% sysctl dev.gpio.0.pin.44
dev.gpio.0.pin.44.function: input
% sysctl dev.gpio.0.pin.45
dev.gpio.0.pin.45.function: input

Tried changing that with sysctl, but i2c scan still doesn't find anything.
If you add 3 lines only for rtc,
Code:
dtparm=i2c_arm=on
dtparam=i2c_vc=on
dtoverlay=i2c-rtc,pcf85063,i2c_csi_dsi
will anything change? "i2c_vc=on" enables i2c defined on video core and I guess that would be i2c10.
 
Indeed, alt2 seems to do the trick!
Code:
# sysctl dev.gpio.0.pin.44.function=alt2
dev.gpio.0.pin.44.function: input -> alt2
# sysctl dev.gpio.0.pin.45.function=alt2
dev.gpio.0.pin.45.function: input -> alt2
# i2c -f /dev/iic0 -s -v
dev: /dev/iic0, addr: 0x4b2e9c68, r/w: r, offset: 0x00, width: 8, count: 1
Hardware may not support START/STOP scanning; trying less-reliable read method.
Scanning I2C devices on /dev/iic0:
18 51

But how to get the pins into this mode before kernel tries to talk to RTC ?
I tried to put those sysctls to loader.conf, but it doesn't seem to work.
 
Got it working. The correct stuff in config.txt is:
Code:
dtoverlay=i2c1,pins_44_45=on
dtoverlay=i2c-rtc,pcf85063=on
gpio=44=a2
gpio=45=a2

Thanks for everyone for helping with this!
 
I tried to put those sysctls to loader.conf, but it doesn't seem to work.
The first place to try would be /etc/sysctl.conf.

Since config.txt is unique to RPi I wonder if the "alt" muxing of pins works on other platforms like Rockchip. Is this just a Raspberry Pi thing? Referencing mux modes as "alt" ?
 
The first place to try would be /etc/sysctl.conf.

Since config.txt is unique to RPi I wonder if the "alt" muxing of pins works on other platforms like Rockchip. Is this just a Raspberry Pi thing? Referencing mux modes as "alt" ?
sysctl.conf won't work because it is loaded after kernel. But for my purposes, having gpio=44=a2 in config.txt is ok.
 
Back
Top