The Real-Time Clock (RTC) is a hardware component that tracks wall clock time and is battery backed so it works even with system power off. Such clocks will normally not track the local time zone or daylight saving time but will instead be set to Coordinated Universal Time.

On the ConnectCore 95 SMT SOM:

  • The i.MX95 SoC provides one RTC

On the ConnectCore 95 SMARC SOM:

  • The Micro Controller Assist (MCA) implements an RTC on its firmware

  • The SMARC SOM has a footprint for an external RTC (not assembled by default)

This topic is about the NXP i.MX95 RTC, which is disabled by default in favor of the MCA RTC on the SMARC SOM.

For information on the MCA RTC, see MCA Real-Time Clock (RTC).

Kernel configuration

You can manage the real-time clock driver support through the following kernel configuration options:

  • i.MX SCMI BBM control driver (CONFIG_IMX_SCMI_BBM_CONTROL)

These options are enabled as built-in on the default ConnectCore 95 Development Kit kernel configuration file.

Kernel driver

File Description

drivers/firmware/arm_scmi/imx-sm-bbm.c

SCMI protocol implementation for NXP BBM protocol

drivers/firmware/imx/sm-bbm.c

Driver for the NXP SCMI BBM control

Device tree bindings and customization

Internal RTC

The i.MX95 RTC is managed by the System Manager (SM) and is accessed through SCMI via the Battery-Backed Module (BBM) driver.

i.MX95 device tree
	firmware {
		scmi {

			[...]

			scmi_bbm: protocol@81 {
				reg = <0x81>;
			};
		};
	};

The i.MX95 RTC is disabled on the SMARC SOM device tree include file ccimx95-smarc.dtsi in favor of the MCA RTC. To enable the i.MX95 RTC, do one of these:

  • Do not include the ccimx95-smarc.dtsi on your platform device tree, if not doing a design based on the SMARC SOM, or

  • Specifically enable the internal RTC by adding the following to your platform device tree:

    &scmi_bbm {
    	status = "okay";
    };

The Battery-Backed Module (BBM) driver communicates via SCMI with the System Manager (SM) to control not only the internal RTC but also the ON_OFF line events and other power events that conflict with the operation of the MCA.

Digi only recommends that you enable the BBM driver if:

  • your custom hardware is not based on the SMARC SOM, or

  • your custom hardware is based on the SMARC SOM, but you plan to work in MCA-bypass mode.

RTC user space usage

The different RTCs are accessible via the following file descriptors:

  • /dev/rtc0 (for the i.MX95 RTC)

The /dev/rtc device is a symbolic link to /dev/rtc0.

This assumes a design not based on the SMARC SOM, or working on MCA-bypass mode (no MCA RTC).

For more information, refer to the Linux kernel documentation at Documentation/devicetree/bindings/rtc/rtc.yaml.

Initializing the RTC

When connected to the Internet, Digi Embedded Yocto uses an NTP (Network Time Protocol) daemon to set the RTC time and keep the system time up to date. You must initialize the RTC the first time you power the board after unpacking the kit and whenever power is completely lost (including RTC backup battery). When not initialized, or if the date is set to a value before the year 1970, the Linux system reports the following error message:

system time... hwclock: settimeofday() failed: Invalid
Linux cannot handle dates before the year 1970.

To initialize the RTC from the Linux shell, set a correct system time using the date command and then issue hwclock -w to write the system time into the RTC. For instance to set June, 3rd 2025 at 15:30:

# date -s "2025-06-03 15:30"
Tue Jun  3 15:30:00 UTC 2025
# hwclock -w -f /dev/rtcX

where X is the index of the RTC device you want to initialize.

RTC test application

Digi Embedded Yocto provides a basic RTC test application. Build the package dey-examples-rtc in your Yocto project to install the test application rtc_test.

The RTC test application allows you to read the current time from the RTC; set it using the system time; and read, set, and test the alarm interrupt.

Syntax

To display the application syntax, run:

# rtc_test -h

Examples

Test the alarm interrupt with the specified seconds:

# rtc_test -e -s 20

In this case, the test sets the RTC alarm to 20 seconds from the current time and then waits for the alarm interrupt to occur.