Failed to load BB-I2C1-RTC-PCF8563 with kernel 5.10.131

Thank you for providing information.

Hope the kernel 5.10.x-bone-rt-rx is stable one. Please let me know in case there is more stable version is available, would like to test the same…

Can I use this dtb?

Appreciate your valuable input.

Regards

Any ‘ubuntu’ image from that repo is not tested or validated, it’s just available to compare with Debian 10.x and Debian 11.x… Any issue you see, feel free to add a github issue, but note, the ubuntu configs are not tested on a daily, weekly, or monthly basis…

Regards,

all development is done on the v5.10.x-ti branch:

and any changes/fixes are merged back into older branches, including the 5.10.x-bone-rt-rx…

Regards,

Please share you full script, this is working with no changes…

uname -r

5.10.131-ti-r49
config-pin P9.17 i2c
config-pin P9.18 i2c
sudo sh -c "echo 'pcf8563 0x51' > /sys/class/i2c-adapter/i2c-1/new_device"

dmesg | grep pcf

[ 3471.208461] rtc-pcf8563 1-0051: registered as rtc1
[ 3471.223203] i2c i2c-1: new_device: Instantiated device pcf8563 at 0x51

sudo hwclock -f /dev/rtc1 --verbose

hwclock from util-linux 2.36.1
System Time: 1663696102.419664
Using the rtc interface to the clock.
Assuming hardware clock is kept in UTC time.
Waiting for clock tick...
ioctl(4, RTC_UIE_ON, 0): Invalid argument
Waiting in loop for time from /dev/rtc1 to change
...got clock tick
Time read from Hardware Clock: 2022/09/20 17:48:29
Hw clock time : 2022/09/20 17:48:29 = 1663696109 seconds since 1969
Time since last adjustment is 1663696109 seconds
Calculated Hardware Clock drift is 0.000000 seconds
2022-09-20 17:48:28.056263+00:00

Regards,

Alright, Thanks for the info.

Appreciate your help and valuable suggestions.

Regards,

Kernel version - 5.10.131-bone-rt-r64
Here is the complete rtc initialization script

sh -c “echo ‘pcf8563 0x51’ > /sys/class/i2c-adapter/i2c-1/new_device”
sleep 2
hwclock -f /dev/rtc1 -s

Thanks & Regards

debian@BeagleBone:/opt/source/dtb-5.10-ti$ sudo hwclock -f /dev/rtc1 -s
[sudo] password for debian: 
debian@BeagleBone:/opt/source/dtb-5.10-ti$ dmesg | grep rtc
[    9.913773] omap_rtc 44e3e000.rtc: registered as rtc0
[    9.919640] omap_rtc 44e3e000.rtc: setting system clock to 2000-01-01T00:00:00 UTC (946684800)
[   53.777076] PM: bootloader does not support rtc-only!
[ 3471.208461] rtc-pcf8563 1-0051: registered as rtc1
debian@BeagleBone:/opt/source/dtb-5.10-ti$ dmesg | grep pcf
[ 3471.208461] rtc-pcf8563 1-0051: registered as rtc1
[ 3471.223203] i2c i2c-1: new_device: Instantiated device pcf8563 at 0x51

seems to be working fine…

Regards,

It is working with kernel 5.10.87 and not with kernel 131.

Without loading rtc dtbs i have below errors
[ 2.291869] omap_rtc 44e3e000.rtc: registered as rtc0
[ 2.291921] omap_rtc 44e3e000.rtc: setting system clock to 2000-01-01T00:00:00 UTC (946684800)
[ 59.931211] rtc-pcf8563 1-0051: pcf8563_write_block_data: err=-16 addr=0e, data=03
[ 59.931228] rtc-pcf8563 1-0051: pcf8563_probe: write error
[ 59.931450] rtc-pcf8563: probe of 1-0051 failed with error -5

Observations after loading dtbs
Here is the log where we can see dtbs getting loaded.

uboot_overlays: loading /boot/dtbs/5.10.131-bone-rt-r64/overlays/BB-I2C1-00A0.dtbo …
1047 bytes read in 9 ms (113.3 KiB/s)
uboot_overlays: loading /boot/dtbs/5.10.131-bone-rt-r64/overlays/BB-I2C1-RTC-PCF8563.dtb …
1480 bytes read in 9 ms (160.2 KiB/s)

dmesg | grep rtc
[ 2.292166] omap_rtc 44e3e000.rtc: registered as rtc1
[ 2.425052] rtc-pcf8563 1-0051: registered as rtc0
[ 2.426326] rtc-pcf8563 1-0051: setting system clock to 2022-09-20T11:58:58 UTC (1663675138)

dmesg | grep pcf
[ 2.425052] rtc-pcf8563 1-0051: registered as rtc0
[ 2.426326] rtc-pcf8563 1-0051: setting system clock to 2022-09-20T11:58:58 UTC (1663675138)
[ 60.189916] i2c i2c-1: Failed to register i2c client pcf8563 at 0x51 (-16)

I have generated dtb file from dts and copied to /boot/dtbs/5.10.131-bone-rt-r64/overlays and loading during bootup. Still not working with kernel 5.10.131…

Thanks & Regards

No idea, works here…

debian@BeagleBone:~$ sudo apt install linux-image-5.10.131-bone65 
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
  linux-image-5.10.131-bone65
0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
Need to get 33.4 MB of archives.
After this operation, 50.2 MB of additional disk space will be used.
Get:1 http://repos.rcn-ee.com/debian bullseye/main armhf linux-image-5.10.131-bone65 armhf 1bullseye [33.4 MB]
Fetched 33.4 MB in 15s (2,249 kB/s)
Selecting previously unselected package linux-image-5.10.131-bone65.
(Reading database ... 61687 files and directories currently installed.)
Preparing to unpack .../linux-image-5.10.131-bone65_1bullseye_armhf.deb ...
Unpacking linux-image-5.10.131-bone65 (1bullseye) ...
Setting up linux-image-5.10.131-bone65 (1bullseye) ...
update-initramfs: Generating /boot/initrd.img-5.10.131-bone65
zz-uenv_txt: Updating /boot/uEnv.txt [uname_r=5.10.131-bone65]
debian@BeagleBone:~$ sudo reboot
debian@BeagleBone:~$ uname -r ; config-pin P9.17 i2c ; config-pin P9.18 i2c
5.10.131-bone65
Current mode for P9_17 is:     i2c
Current mode for P9_18 is:     i2c
debian@BeagleBone:~$ sudo sh -c "echo 'pcf8563 0x51' > /sys/class/i2c-adapter/i2c-1/new_device"
debian@BeagleBone:~$ dmesg | grep pcf
[  150.700734] rtc-pcf8563 1-0051: registered as rtc1
[  150.711766] i2c i2c-1: new_device: Instantiated device pcf8563 at 0x51
debian@BeagleBone:~$ dmesg | grep rtc
[    2.652912] omap_rtc 44e3e000.rtc: already running
[    2.654210] omap_rtc 44e3e000.rtc: registered as rtc0
[    2.654275] omap_rtc 44e3e000.rtc: setting system clock to 2022-09-20T18:36:56 UTC (1663699016)
[  150.700734] rtc-pcf8563 1-0051: registered as rtc1
debian@BeagleBone:~$ sudo hwclock -f /dev/rtc1 --verbose
hwclock from util-linux 2.36.1
System Time: 1663699206.944033
Using the rtc interface to the clock.
Assuming hardware clock is kept in UTC time.
Waiting for clock tick...
ioctl(4, RTC_UIE_ON, 0): Invalid argument
Waiting in loop for time from /dev/rtc1 to change
...got clock tick
Time read from Hardware Clock: 2022/09/20 18:40:13
Hw clock time : 2022/09/20 18:40:13 = 1663699213 seconds since 1969
Time since last adjustment is 1663699213 seconds
Calculated Hardware Clock drift is 0.000000 seconds
2022-09-20 18:40:12.773918+00:00
debian@BeagleBone:~$ sudo hwclock -f /dev/rtc1 -s
debian@BeagleBone:~$ dmesg | grep pcf
[  150.700734] rtc-pcf8563 1-0051: registered as rtc1
[  150.711766] i2c i2c-1: new_device: Instantiated device pcf8563 at 0x51
debian@BeagleBone:~$ dmesg | grep rtc
[    2.652912] omap_rtc 44e3e000.rtc: already running
[    2.654210] omap_rtc 44e3e000.rtc: registered as rtc0
[    2.654275] omap_rtc 44e3e000.rtc: setting system clock to 2022-09-20T18:36:56 UTC (1663699016)
[  150.700734] rtc-pcf8563 1-0051: registered as rtc1

Regards,

strange… I’m not sure what steps I’m missing… It’s fun to debug…

sudo config-pin P9.18 i2c
P9_18 pinmux file not found!
bash: /sys/devices/platform/ocp/ocpP9_18_pinmux/state: No such file or directory
Cannot write pinmux file: /sys/devices/platform/ocp/ocp
P9_18_pinmux/state

I would like to test once with your working dtb/dtbo… Could you please share dtb/ dtbo which you have been using?

Thanks & Regards

so… Failed to load BB-I2C1-RTC-PCF8563 with kernel 5.10.131 - #2 by RobertCNelson

so please report:

sudo beagle-version

or the older…

sudo /opt/scripts/tools/version.sh 

I pushed the overlays…

debian@BeagleBone:~$ git clone -b v5.10.x https://github.com/beagleboard/BeagleBoard-DeviceTrees.git
debian@BeagleBone:~$ cd BeagleBoard-DeviceTrees/
debian@BeagleBone:~/BeagleBoard-DeviceTrees$ make
debian@BeagleBone:~/BeagleBoard-DeviceTrees$ sudo make install
debian@BeagleBone:~$ dmesg | grep rtc
[    2.626442] omap_rtc 44e3e000.rtc: already running
[    2.627829] omap_rtc 44e3e000.rtc: registered as rtc1
[    2.760694] rtc-pcf8563 1-0051: registered as rtc0
[    2.761984] rtc-pcf8563 1-0051: setting system clock to 2022-09-20T19:16:51 UTC (1663701411)
debian@BeagleBone:~$ dmesg | grep pcf
[    2.760694] rtc-pcf8563 1-0051: registered as rtc0
[    2.761984] rtc-pcf8563 1-0051: setting system clock to 2022-09-20T19:16:51 UTC (166370141

But without sudo beagle-version i can’t verify your setup…

Regards,

Hi

I could not find beagle-version or /opt/scripts/tools/version.sh commands…
What data does it give?

Here is dmesg log for board details -
Linux version 5.10.131-bone-rt-r64 (mrudula@mrudula-Latitude-5400) (arm-linux-gnueabi-gcc (GCC) 10.3.0, GNU ld (GNU Binutils) 2.36.1) #9 SMP PREEMPT_RT Sun Aug 28 00:33:36 IST 2022
[ 0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=50c5387d
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[ 0.000000] OF: fdt: Machine model: TI AM335x BeagleBone Green

Thanks & Regards

sudo apt update
sudo apt install bb-beagle-version
sudo beagle-version

Everything required to match your u-boot/kernel/boot settings and reproduce issues…

Regards,

Here is the required information

ubuntu@arm:~$ sudo beagle-version 
eeprom:[A335BNLTBBG1BBG216114003]
model:[TI_AM335x_BeagleBone_Green]
bootloader:[microSD-(push-button)]:[/dev/mmcblk0]:[U-Boot SPL 2021.10-00011-g6988a046 (Mar 08 2022 - 00:19:27 +0530)]:[location: dd MBR]
UBOOT: Booted Device-Tree:[am335x-boneblack-uboot-univ.dts]
UBOOT: Loaded Overlay:[BB-AAIM-LCD10-00A1.bb.org-overlays]
UBOOT: Loaded Overlay:[BB-I2C1-00A0.bb.org-overlays]
UBOOT: Loaded Overlay:[BB-I2C1-RTC-PCF8563.kernel]
UBOOT: Loaded Overlay:[BB-UART1-00A0.bb.org-overlays]
UBOOT: Loaded Overlay:[BB-UART2-00A0.bb.org-overlays]
UBOOT: Loaded Overlay:[BB-UART4-00A0.bb.org-overlays]
UBOOT: Loaded Overlay:[M-BB-BBG-00A0.kernel]
kernel:[5.10.131-bone-rt-r64]
pkg check: to individually upgrade run: [sudo apt install --only-upgrade <pkg>]
WARNING:pkg:[bb-cape-overlays]:[NOT_INSTALLED]
WARNING:pkg:[bb-customizations]:[NOT_INSTALLED]
WARNING:pkg:[bb-usb-gadgets]:[NOT_INSTALLED]
WARNING:pkg:[bb-wl18xx-firmware]:[NOT_INSTALLED]
pkg:[kmod]:[27-1ubuntu2]
WARNING:pkg:[librobotcontrol]:[NOT_INSTALLED]
groups:[ubuntu : ubuntu adm kmem dialout cdrom floppy audio dip video plugdev users systemd-journal input netdev i2c admin tisdk weston-launch bluetooth cloud9ide gpio]
cmdline:[console=ttyS0,115200n8 bone_capemgr.uboot_capemgr_enabled=1 root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait coherent_pool=1M quiet]
dmesg | grep remote
dmesg | grep pru
dmesg | grep pinctrl-single
[    2.045882] pinctrl-single 44e10800.pinmux: 142 pins, size 568
dmesg | grep gpio-of-helper
[    3.287498] gpio-of-helper ocp:cape-universal: Allocated GPIO id=0 name='P8_03'
[    3.287732] gpio-of-helper ocp:cape-universal: Allocated GPIO id=1 name='P8_04'
[    3.287935] gpio-of-helper ocp:cape-universal: Allocated GPIO id=2 name='P8_05'
[    3.288128] gpio-of-helper ocp:cape-universal: Allocated GPIO id=3 name='P8_06'
[    3.288584] gpio-of-helper ocp:cape-universal: Allocated GPIO id=4 name='P8_07'
[    3.288797] gpio-of-helper ocp:cape-universal: Allocated GPIO id=5 name='P8_08'
[    3.288995] gpio-of-helper ocp:cape-universal: Allocated GPIO id=6 name='P8_09'
[    3.289190] gpio-of-helper ocp:cape-universal: Allocated GPIO id=7 name='P8_10'
[    3.289377] gpio-of-helper ocp:cape-universal: Allocated GPIO id=8 name='P8_11'
[    3.289571] gpio-of-helper ocp:cape-universal: Allocated GPIO id=9 name='P8_12'
[    3.289632] gpio-of-helper ocp:cape-universal: Failed to get gpio property of 'P8_13'
[    3.289641] gpio-of-helper ocp:cape-universal: Failed to create gpio entry
[    3.611379] gpio-of-helper ocp:cape-universal: Allocated GPIO id=0 name='P8_03'
[    3.611540] gpio-of-helper ocp:cape-universal: Allocated GPIO id=1 name='P8_04'
[    3.611704] gpio-of-helper ocp:cape-universal: Allocated GPIO id=2 name='P8_05'
[    3.611853] gpio-of-helper ocp:cape-universal: Allocated GPIO id=3 name='P8_06'
[    3.612088] gpio-of-helper ocp:cape-universal: Allocated GPIO id=4 name='P8_07'
[    3.612237] gpio-of-helper ocp:cape-universal: Allocated GPIO id=5 name='P8_08'
[    3.612384] gpio-of-helper ocp:cape-universal: Allocated GPIO id=6 name='P8_09'
[    3.612540] gpio-of-helper ocp:cape-universal: Allocated GPIO id=7 name='P8_10'
[    3.612678] gpio-of-helper ocp:cape-universal: Allocated GPIO id=8 name='P8_11'
[    3.612829] gpio-of-helper ocp:cape-universal: Allocated GPIO id=9 name='P8_12'
[    3.613085] gpio-of-helper ocp:cape-universal: Allocated GPIO id=10 name='P8_13'
[    3.613291] gpio-of-helper ocp:cape-universal: Allocated GPIO id=11 name='P8_14'
[    3.613494] gpio-of-helper ocp:cape-universal: Allocated GPIO id=12 name='P8_15'
[    3.613682] gpio-of-helper ocp:cape-universal: Allocated GPIO id=13 name='P8_16'
[    3.613890] gpio-of-helper ocp:cape-universal: Allocated GPIO id=14 name='P8_17'
[    3.614093] gpio-of-helper ocp:cape-universal: Allocated GPIO id=15 name='P8_18'
[    3.614288] gpio-of-helper ocp:cape-universal: Allocated GPIO id=16 name='P8_19'
[    3.614501] gpio-of-helper ocp:cape-universal: Allocated GPIO id=17 name='P8_20'
[    3.614687] gpio-of-helper ocp:cape-universal: Allocated GPIO id=18 name='P8_21'
[    3.623432] gpio-of-helper ocp:cape-universal: Allocated GPIO id=19 name='P8_22'
[    3.623703] gpio-of-helper ocp:cape-universal: Allocated GPIO id=20 name='P8_23'
[    3.623911] gpio-of-helper ocp:cape-universal: Allocated GPIO id=21 name='P8_24'
[    3.624135] gpio-of-helper ocp:cape-universal: Allocated GPIO id=22 name='P8_25'
[    3.624321] gpio-of-helper ocp:cape-universal: Allocated GPIO id=23 name='P8_26'
[    3.624531] gpio-of-helper ocp:cape-universal: Allocated GPIO id=24 name='P8_27'
[    3.624728] gpio-of-helper ocp:cape-universal: Allocated GPIO id=25 name='P8_28'
[    3.624927] gpio-of-helper ocp:cape-universal: Allocated GPIO id=26 name='P8_29'
[    3.625122] gpio-of-helper ocp:cape-universal: Allocated GPIO id=27 name='P8_30'
[    3.625327] gpio-of-helper ocp:cape-universal: Allocated GPIO id=28 name='P8_31'
[    3.625526] gpio-of-helper ocp:cape-universal: Allocated GPIO id=29 name='P8_32'
[    3.625719] gpio-of-helper ocp:cape-universal: Allocated GPIO id=30 name='P8_33'
[    3.625922] gpio-of-helper ocp:cape-universal: Allocated GPIO id=31 name='P8_34'
[    3.626127] gpio-of-helper ocp:cape-universal: Allocated GPIO id=32 name='P8_35'
[    3.626317] gpio-of-helper ocp:cape-universal: Allocated GPIO id=33 name='P8_36'
[    3.626528] gpio-of-helper ocp:cape-universal: Allocated GPIO id=34 name='P8_37'
[    3.626723] gpio-of-helper ocp:cape-universal: Allocated GPIO id=35 name='P8_38'
[    3.626916] gpio-of-helper ocp:cape-universal: Allocated GPIO id=36 name='P8_39'
[    3.631706] gpio-of-helper ocp:cape-universal: Allocated GPIO id=37 name='P8_40'
[    3.631935] gpio-of-helper ocp:cape-universal: Allocated GPIO id=38 name='P8_41'
[    3.632127] gpio-of-helper ocp:cape-universal: Allocated GPIO id=39 name='P8_42'
[    3.632440] gpio-of-helper ocp:cape-universal: Allocated GPIO id=40 name='P8_43'
[    3.632680] gpio-of-helper ocp:cape-universal: Allocated GPIO id=41 name='P8_44'
[    3.632891] gpio-of-helper ocp:cape-universal: Allocated GPIO id=42 name='P8_45'
[    3.633096] gpio-of-helper ocp:cape-universal: Allocated GPIO id=43 name='P8_46'
[    3.633300] gpio-of-helper ocp:cape-universal: Allocated GPIO id=44 name='P9_11'
[    3.633506] gpio-of-helper ocp:cape-universal: Allocated GPIO id=45 name='P9_12'
[    3.633715] gpio-of-helper ocp:cape-universal: Allocated GPIO id=46 name='P9_13'
[    3.633905] gpio-of-helper ocp:cape-universal: Allocated GPIO id=47 name='P9_14'
[    3.634107] gpio-of-helper ocp:cape-universal: Allocated GPIO id=48 name='P9_15'
[    3.634292] gpio-of-helper ocp:cape-universal: Allocated GPIO id=49 name='P9_16'
[    3.634516] gpio-of-helper ocp:cape-universal: Allocated GPIO id=50 name='P9_17'
[    3.634715] gpio-of-helper ocp:cape-universal: Allocated GPIO id=51 name='P9_18'
[    3.634911] gpio-of-helper ocp:cape-universal: Allocated GPIO id=52 name='P9_19'
[    3.635206] gpio-of-helper ocp:cape-universal: Allocated GPIO id=53 name='P9_20'
[    3.635418] gpio-of-helper ocp:cape-universal: Allocated GPIO id=54 name='P9_21'
[    3.635610] gpio-of-helper ocp:cape-universal: Allocated GPIO id=55 name='P9_22'
[    3.635808] gpio-of-helper ocp:cape-universal: Allocated GPIO id=56 name='P9_23'
[    3.636000] gpio-of-helper ocp:cape-universal: Allocated GPIO id=57 name='P9_24'
[    3.636637] gpio-of-helper ocp:cape-universal: Allocated GPIO id=58 name='P9_25'
[    3.636878] gpio-of-helper ocp:cape-universal: Allocated GPIO id=59 name='P9_26'
[    3.637083] gpio-of-helper ocp:cape-universal: Allocated GPIO id=60 name='P9_27'
[    3.637285] gpio-of-helper ocp:cape-universal: Allocated GPIO id=61 name='P9_28'
[    3.637477] gpio-of-helper ocp:cape-universal: Allocated GPIO id=62 name='P9_29'
[    3.637677] gpio-of-helper ocp:cape-universal: Allocated GPIO id=63 name='P9_30'
[    3.637893] gpio-of-helper ocp:cape-universal: Allocated GPIO id=64 name='P9_31'
[    3.638085] gpio-of-helper ocp:cape-universal: Allocated GPIO id=65 name='P9_41'
[    3.638298] gpio-of-helper ocp:cape-universal: Allocated GPIO id=66 name='P9_91'
[    3.638485] gpio-of-helper ocp:cape-universal: Allocated GPIO id=67 name='P9_42'
[    3.638706] gpio-of-helper ocp:cape-universal: Allocated GPIO id=68 name='P9_92'
[    3.638716] gpio-of-helper ocp:cape-universal: ready
lsusb
Bus 001 Device 002: ID 413c:301a Dell Computer Corp. Dell MS116 USB Optical Mouse
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
END
ubuntu@arm:~$ 

Log for rtc

ubuntu@arm:~$ dmesg | grep rtc
[    2.288400] omap_rtc 44e3e000.rtc: registered as rtc1
[    2.421048] rtc-pcf8563 1-0051: registered as rtc0
[    2.422321] rtc-pcf8563 1-0051: setting system clock to 2022-09-22T12:23:49 UTC (1663849429)
ubuntu@arm:~$ dmesg | grep pcf
[    2.421048] rtc-pcf8563 1-0051: registered as rtc0
[    2.422321] rtc-pcf8563 1-0051: setting system clock to 2022-09-22T12:23:49 UTC (1663849429)
[   99.540968] i2c i2c-1: Failed to register i2c client pcf8563 at 0x51 (-16)
[  164.747902] i2c i2c-1: Failed to register i2c client pcf8563 at 0x51 (-16)
ubuntu@arm:~$ sudo sh -c "echo 'pcf8563 0x51' > /sys/class/i2c-adapter/i2c-1/new_device"
sh: 1: echo: echo: I/O error
[  197.977520] i2c i2c-1: Failed to register i2c client pcf8563 at 0x51 (-16)
ubuntu@arm:~$ 

Please let me know in case you need other information.

Appreciate your input.

Thanks & Regards,

Please remove this overlay from /boot/uEnv.txt , as you already have… BB-I2C1-RTC-PCF8563 added…

I’ve also cleaned up BB-UART1-00A0, BB-UART2-00A0, and BB-UART4-00A0

debian@BeagleBone:~$ git clone -b v5.10.x https://github.com/beagleboard/BeagleBoard-DeviceTrees.git
debian@BeagleBone:~$ cd BeagleBoard-DeviceTrees/
debian@BeagleBone:~/BeagleBoard-DeviceTrees$ make
debian@BeagleBone:~/BeagleBoard-DeviceTrees$ sudo make install

Regards,