I am using an industrial device based on a Compute Module Raspberry Pi 3 called Kunbus RevPi Core 3+.
The device is shipped with Raspbian and a pre compiled Image but I would like to install an Ubuntu Server 22.04 distro (much better for my pourpose). The Ubuntu started without a problem but I can't see the Real Time Clock.
Here is the wiring of the IC for providing the RTC and an another i2c IC.
The Kunbus guys mantain a Kernel patched with the Kernel Tree Overlay for the Hardware they have attacched to the board: revpi-core-overlay.dts
In the Overlay there's the specification of the RTC IC:
fragment@3 {
target = <&i2c1>;
__overlay__ {
pinctrl-names = "default";
pinctrl-0 = <&i2c1_pins>;
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
rtc@51 {
compatible = "nxp,pcf2129";
reg = <0x51>;
status = "okay";
};
crypto@60 {
compatible = "atmel,atecc508a";
reg = <0x60>;
status = "okay";
};
};
};
So, if I have understood here the IC nxp,pcf2129 is on the line 1 with an address 0x51
First try, load the module manually
With the info I found the the Overlay and in the datasheet I tried to load the kernel module manually.
I found the driver in the kernel tree rtc-pcf2127 and I have loaded the module:
sudo modprobe rtc-pcf2127
The modules was loaded:
ubuntu@ubuntu:~$ lsmod | grep rtc
rtc_pcf2127 24576 0
According to the documentation I found here: instantiating-devices I have tried to assign the driver an address:
echo pcf2129 0x51 /sys/class/i2c-adapter/i2c-1/new_device
But no /dev/rtc
has appeared:
ubuntu@ubuntu:~$ sudo ls -al /dev/rtc
ls: cannot access '/dev/rtc': No such file or directory
scanning the i2c bus has no answere too:
ubuntu@ubuntu:~$ sudo 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: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
How could properly use the rtc device?
Thanks,
S.
dtc
, the device tree compiler), then you can include it via/boot/config.txt
. – goldilocks Mar 08 '23 at 13:23#include <dt-bindings/gpio/gpio.h> #include <dt-bindings/pinctrl/bcm2835.h>
and I don't know where to find them. – Stefano Bossi Mar 08 '23 at 16:15root@ubuntu:~/linux# dtc -o dtb -o revpi-core-overlay.dtbo -@ ./arch/arm/boot/dts/overlays/revpi-core-overlay.dts Error: ./arch/arm/boot/dts/overlays/revpi-core-overlay.dts:9.1-9 syntax error FATAL ERROR: Unable to parse input tree
– Stefano Bossi Mar 08 '23 at 18:24device-tree
tag there with ~500 questions, nearly 10x what's here -- and dt in general seems intended to not be platform specific. – goldilocks Mar 08 '23 at 19:43