Supercapacitor shows 0V even when powered on

Hello,

I am using JetPack 4.6.3 (L4T 32.7.3 ) on Jetson AGX Xavier device.

Surprisingly, the voltage across the supercapacitor (C512) is always 0 V (whether turned on or off). It was suggested here to enable the “backup-battery” by the device tree. I did it but had no success. The “backup-battery” status can be seen as “okay”:

$ dtc -qqq -I fs -O dts /sys/firmware/devicetree/base | grep -A 1 backup-battery
			backup-battery {
				backup-battery-output-resister = <0x64>;
				status = "okay";
				backup-battery-charging-current = <0x64>;
				backup-battery-charging-voltage = <0x2dc6c0>;
			};

The /proc/device-tree shows the same output as above. Next, the extlinux.conf file looks like the following:

$ cat /boot/extlinux/extlinux.conf | head -n 12
TIMEOUT 30
DEFAULT primary

MENU TITLE L4T boot options

LABEL primary
      MENU LABEL primary kernel
      LINUX /boot/Image
      INITRD /boot/initrd
      APPEND ${cbootargs} quiet root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4 console=ttyTCU0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0 rootfstype=ext4 nv-auto-config
      FDT /boot/tegra194-p2888-0001-p2822-0000.dtb

Furthermore, the /boot/tegra194-p2888-0001-p2822-0000.dtb file is looking alright, as shown below:

$ dtc -qqq -O dts /boot/tegra194-p2888-0001-p2822-0000.dtb | grep -A 1 backup-battery
			backup-battery {
				backup-battery-charging-current = <0x64>;
				backup-battery-charging-voltage = <0x2dc6c0>;
				backup-battery-output-resister = <0x64>;
				status = "okay";

I kept the device powered on for more than an hour to measure the voltage again but found it 0 V. Please see the attached picture showing voltage measurements as suggested here:

What is wrong here?

Thank you very much.

Hi, did you test by removing the backup battery?

Hi, I guess you are referring to the supercapacitor when you use the term backup battery.

If so, I haven’t done it.

Yes, it is. Please remove it and try.

Thanks a lot. I will update you once done!

@Trumany

Thank you for waiting. I received the Rechargeable Lithium CMOS Battery (ML1220 3V). So I am going to solder on the terminals as shown here

Do I need to remove/de-solder the super capacitor or let it be there as it is?

Yes, please remove the super capacitor first.

@Trumany

I removed the super cap and soldered the battery. I measured 2.7V across the battery’s terminal. Later on, I powered on the device and plugged LAN cable to get the correct time, as shown below:

$ timedatectl
                      Local time: Tue 2023-05-09 19:51:35 JST
                  Universal time: Tue 2023-05-09 10:51:35 UTC
                        RTC time: Tue 2023-05-09 10:51:36
                       Time zone: Asia/Tokyo (JST, +0900)
       System clock synchronized: yes
systemd-timesyncd.service active: yes
                 RTC in local TZ: no

Finally, I turned off the device for approximately 5 minutes and then started it again to check if the RTC clock was up! Unfortunately, it wasn’t. Please see below:

$ timedatectl
                      Local time: Tue 2023-05-09 19:54:04 JST
                  Universal time: Tue 2023-05-09 10:54:04 UTC
                        RTC time: Sat 2000-01-01 01:01:07
                       Time zone: Asia/Tokyo (JST, +0900)
       System clock synchronized: no
systemd-timesyncd.service active: yes
                 RTC in local TZ: no

The battery-status is okay, as shown by dtc below:

$ dtc -qqq -I fs -O dts /proc/device-tree | grep -A 1 backup-battery
			backup-battery {
				backup-battery-output-resister = <0x64>;
				status = "okay";
				backup-battery-charging-current = <0x64>;
				backup-battery-charging-voltage = <0x2dc6c0>;
			};

What’s battery voltage level when you turned off the device?

2.587V

Could you disable tegra RTC to confirm.

	rtc@c2a0000 {
 		status = "disable";
 	};

Thanks a lot but how to do that?

Modify the “rtc@c2a0000” to disable in device tree.

@ShaneCCC @Trumany

Yes, I did it. But the problem persists.

Please see below for additional details.

  1. device-tree showing battery status
    $ dtc -qqq -I fs -O dts /proc/device-tree | grep -A 1 backup-battery
    			backup-battery {
    				backup-battery-output-resister = <0x64>;
    				status = "okay";
    				backup-battery-charging-current = <0x64>;
    				backup-battery-charging-voltage = <0x2dc6c0>;
    			};
    
  2. device-tree showing rtc status
    $ dtc -qqq -I fs -O dts /proc/device-tree | grep -A 3 rtc@c2a0000
    	rtc@c2a0000 {
    		compatible = "nvidia,tegra18-rtc";
    		status = "disable";
    		interrupt-parent = <0x3e>;
    --
    		tegra_rtc = "/rtc@c2a0000";
    		eqos_txrx_tri_state_idle = "/pinmux@2430000/eqos_idle";
    		tegra_dspk2 = "/aconnect@2a41000/ahub/dspk@2905100";
    		e3333_csi_in0 = "/host1x/nvcsi@15a00000/channel@0/ports/port@0/endpoint@0";
    --
    		rtc1 = "/rtc@c2a0000";
    		i2c5 = "/i2c@31b0000";
    		tegra-camera-rtcpu = "/rtcpu@bc00000";
    		serial0 = "/serial@3100000";
    
  3. Before turning off the device. Actual time is 18:24.
    $ timedatectl 
                          Local time: Wed 2023-05-10 18:24:25 JST
                      Universal time: Wed 2023-05-10 09:24:25 UTC
                            RTC time: Wed 2023-05-10 09:24:52
                           Time zone: Asia/Tokyo (JST, +0900)
           System clock synchronized: no
    systemd-timesyncd.service active: yes
                     RTC in local TZ: no
    
  4. Power off the device for after 20 minutes. Remove LAN cable to disable internet access and then turn on. Actual time is 18:44.
    $ timedatectl 
                          Local time: Wed 2023-05-10 18:21:52 JST
                      Universal time: Wed 2023-05-10 09:21:52 UTC
                            RTC time: Sat 2000-01-01 01:01:20
                           Time zone: Asia/Tokyo (JST, +0900)
           System clock synchronized: no
    systemd-timesyncd.service active: yes
                     RTC in local TZ: no
    

As you can see, RTC clock is reset to 2000-01-01 01:01:20.

Did you sync the time to RTC?

sudo hwclock -r -f /dev/rtc0

No. How to do it?

nvidia@nvidia-desktop:~$ sudo timedatectl set-ntp off
nvidia@nvidia-desktop:~$ sudo timedatectl
Local time: 三 2022-10-26 12:41:11 CST
Universal time: 三 2022-10-26 04:41:11 UTC
RTC time: 三 2022-10-26 04:41:12
Time zone: Asia/Taipei (CST, +0800)
System clock synchronized: yes
NTP service: inactive
RTC in local TZ: no
nvidia@nvidia-desktop:~$ sudo hwclock -r -f /dev/rtc1
2022-10-26 12:43:57.897850+08:00
nvidia@nvidia-desktop:~$ sudo shutdown now

@ShaneCCC

Here is the update. I tried as you suggested but had no success. Below are the details:

In the commands above, you used /dev/rtc0 and rtc1. So, I checked which one to use.

$ dmesg | grep rtc
[    0.814461] iommu: Adding device bc00000.rtcpu to group 23
[    1.000406] vdd-rtc: at 800 mV 
[    1.076839] camchar: rtcpu character device driver loaded
[    2.057154] max77686-rtc max77620-rtc: rtc core: registered max77620-rtc as rtc0
[    2.244970] tegra186-cam-rtcpu bc00000.rtcpu: deferring, 14800000.isp is not probed
[    6.264629] tegra186-cam-rtcpu bc00000.rtcpu: Trace buffer configured at IOVA=0xbff00000
[    6.337734] tegra-ivc ivc-bc00000.rtcpu: region 0: iova=0xbfee0000-0xbfefffff size=131072
[    6.338096] tegra-ivc ivc-bc00000.rtcpu:echo@0: echo: ver=0 grp=1 RX[16x64]=0x1000-0x1480 TX[16x64]=0x1480-0x1900
[    6.338263] tegra-ivc ivc-bc00000.rtcpu:dbg@1: dbg: ver=0 grp=1 RX[1x384]=0x1900-0x1b00 TX[1x384]=0x1b00-0x1d00
[    6.338386] tegra-ivc ivc-bc00000.rtcpu:dbg@2: dbg: ver=0 grp=1 RX[1x8192]=0x1d00-0x3d80 TX[1x8192]=0x3d80-0x5e00
[    6.338748] tegra-ivc ivc-bc00000.rtcpu:ivccontrol@3: ivccontrol: ver=0 grp=1 RX[64x320]=0x5e00-0xae80 TX[64x320]=0xae80-0xff00
[    6.338799] tegra-capture-ivc ivc-bc00000.rtcpu:ivccontrol@3: no priority specified, using 99 as default
[    6.338877] tegra-ivc ivc-bc00000.rtcpu:ivccapture@4: ivccapture: ver=0 grp=1 RX[512x64]=0xff00-0x17f80 TX[512x64]=0x17f80-0x20000
[    6.338922] tegra-capture-ivc ivc-bc00000.rtcpu:ivccapture@4: no priority specified, using 99 as default
[    6.339130] tegra186-cam-rtcpu bc00000.rtcpu: using cam RTCPU IRQ (71)
[    6.339133] tegra186-cam-rtcpu bc00000.rtcpu: tegra_camrtc_mon_create is successful
[    6.340174] tegra186-cam-rtcpu bc00000.rtcpu: firmware version cpu=rce cmd=5 sha1=8966ca7b0e527ed98649649b043322724401969c
[    6.341182] hctosys: unable to open rtc device (rtc1)

$ ll /dev/rtc*
lrwxrwxrwx 1 root root      4 May 10 18:20 /dev/rtc -> rtc0
crw------- 1 root root 252, 0 May 10 18:20 /dev/rtc0

It is confirmed that rtc0 shoud be used. Before setting the hwclock, I connected internet to get the correct time and followed your steps:

$ timedatectl
                      Local time: Thu 2023-05-11 10:44:19 JST
                  Universal time: Thu 2023-05-11 01:44:19 UTC
                        RTC time: Thu 2023-05-11 01:44:19
                       Time zone: Asia/Tokyo (JST, +0900)
       System clock synchronized: yes
systemd-timesyncd.service active: yes
                 RTC in local TZ: no

$ sudo timedatectl set-ntp off

$ sudo timedatectl
                      Local time: Thu 2023-05-11 10:46:32 JST
                  Universal time: Thu 2023-05-11 01:46:32 UTC
                        RTC time: Thu 2023-05-11 01:46:33
                       Time zone: Asia/Tokyo (JST, +0900)
       System clock synchronized: yes
systemd-timesyncd.service active: no
                 RTC in local TZ: no

$ sudo hwclock -r -f /dev/rtc0
2023-05-11 10:47:24.458603+0900

$ sudo shutdown now

I waited approximately 20 minutes and then turned on the device to check the time.

$ timedatectl
                      Local time: Tue 2022-09-06 12:20:14 JST
                  Universal time: Tue 2022-09-06 03:20:14 UTC
                        RTC time: Sat 2000-01-01 01:02:31
                       Time zone: Asia/Tokyo (JST, +0900)
       System clock synchronized: no
systemd-timesyncd.service active: no
                 RTC in local TZ: no

As you can see, the time is incorrect. Furthermore, the command dmesg | grep rtc still says unable to open rtc device (rtc1) as shown below. It is probably the old log.

$ dmesg | grep rtc
[    0.828527] iommu: Adding device bc00000.rtcpu to group 23
[    1.001829] vdd-rtc: at 800 mV 
[    1.065482] camchar: rtcpu character device driver loaded
[    2.006431] max77686-rtc max77620-rtc: rtc core: registered max77620-rtc as rtc0
[    2.059157] tegra186-cam-rtcpu bc00000.rtcpu: deferring, 14800000.isp is not probed
[    6.067238] tegra186-cam-rtcpu bc00000.rtcpu: Trace buffer configured at IOVA=0xbff00000
[    6.140194] tegra-ivc ivc-bc00000.rtcpu: region 0: iova=0xbfee0000-0xbfefffff size=131072
[    6.140544] tegra-ivc ivc-bc00000.rtcpu:echo@0: echo: ver=0 grp=1 RX[16x64]=0x1000-0x1480 TX[16x64]=0x1480-0x1900
[    6.140832] tegra-ivc ivc-bc00000.rtcpu:dbg@1: dbg: ver=0 grp=1 RX[1x384]=0x1900-0x1b00 TX[1x384]=0x1b00-0x1d00
[    6.141058] tegra-ivc ivc-bc00000.rtcpu:dbg@2: dbg: ver=0 grp=1 RX[1x8192]=0x1d00-0x3d80 TX[1x8192]=0x3d80-0x5e00
[    6.141409] tegra-ivc ivc-bc00000.rtcpu:ivccontrol@3: ivccontrol: ver=0 grp=1 RX[64x320]=0x5e00-0xae80 TX[64x320]=0xae80-0xff00
[    6.141471] tegra-capture-ivc ivc-bc00000.rtcpu:ivccontrol@3: no priority specified, using 99 as default
[    6.141574] tegra-ivc ivc-bc00000.rtcpu:ivccapture@4: ivccapture: ver=0 grp=1 RX[512x64]=0xff00-0x17f80 TX[512x64]=0x17f80-0x20000
[    6.141631] tegra-capture-ivc ivc-bc00000.rtcpu:ivccapture@4: no priority specified, using 99 as default
[    6.141892] tegra186-cam-rtcpu bc00000.rtcpu: using cam RTCPU IRQ (71)
[    6.141897] tegra186-cam-rtcpu bc00000.rtcpu: tegra_camrtc_mon_create is successful
[    6.142883] tegra186-cam-rtcpu bc00000.rtcpu: firmware version cpu=rce cmd=5 sha1=8966ca7b0e527ed98649649b043322724401969c
[    6.143992] hctosys: unable to open rtc device (rtc1)

After disable tegra RTC you should only have rtc0.
Does any kernel message to load the time from rtc0?

Modify “rtc@c2a0000” back and reference to below topic to verify.