Skip to main content

RTC Connector

The Radxa ROCK 4D features an onboard RTC battery connector that allows you to connect an RTC battery. This provides continuous power to the Real-Time Clock (RTC) chip during power loss, ensuring the system clock continues to keep accurate time even when the board is powered off.

ROCK 4D RTC Connector Location

User Guide

To use the RTC connector, connect an RTC battery with the following specifications:

  • Connector Type: 2-Pin XH 1.25mm
  • Battery Type: CR2032
  • Battery Voltage: 3.0V
RTC Battery Installation

Checking RTC Status

To verify if the system recognizes the RTC battery, run the following command in the terminal:

radxa@radxa-4d$
sudo dmesg | grep rtc

If the RTC battery is properly recognized, you should see output similar to rtc information is valid:

[    8.145303] [drm] Esmart1-win0(possible_vp_mask = 0x00000006) has no possible crtcs
[ 8.145370] [drm] Esmart3-win0(possible_vp_mask = 0x00000006) has no possible crtcs
[ 8.153133] rockchip-drm display-subsystem: [drm] Cannot find any crtc or sizes
[ 8.154487] rockchip-drm display-subsystem: [drm] Cannot find any crtc or sizes
[ 8.700833] rtc-hym8563 2-0051: hym8563_init_device: error read i2c data -6
[ 8.716545] rtc-hym8563 2-0051: rtc information is valid
[ 8.724597] rtc-hym8563 2-0051: registered as rtc0
[ 8.725670] rtc-hym8563 2-0051: setting system clock to 2000-01-01T00:00:23 UTC (946684823)

Reading RTC Time

To read the current time from the RTC chip (/dev/rtc0), use the hwclock command:

radxa@radxa-4d$
sudo hwclock -r -f /dev/rtc0

Displaying System Time

To view the current system time, use the date command:

radxa@radxa-4d$
date

Setting RTC Time

If the RTC time doesn't match the system time, you can write the current system time to the RTC using:

radxa@radxa-4d$
sudo hwclock -w -f /dev/rtc0

Verifying RTC Functionality

To verify the RTC is working correctly:

  1. Note the current system time
  2. Disconnect power and network from the Radxa ROCK 4D
  3. Wait approximately 10 minutes
  4. Reconnect power and check if the system time has maintained accurate timekeeping

Interface Specifications

tip

For detailed interface specifications, please refer to the Hardware Design: Schematics in the download section.

Pin#NamePin#Name
1OSCI5I2C2_SDA_M0_CC_RTC
2OSCO6I2C2_SCL_M0_CC_RTC
3RTC_INT_L732KOUT_RTC
4GND8VCC_RTC