EasyManua.ls Logo

Phytec i.MX 93 - Rtc

Default Icon
85 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
i.MX 93 BSP Manual PD24.1.1 Documentation Rev.: imx8mp-pd22.1.2-51-ga548be7d
Warning
Data in the rst 265 bytes of the normal EEPROM area (bus: I2C-2 addr: 0x50) shouldn’t be erased
or corrupted! This might inuence the behavior of the bootloader. The board might not boot correctly
anymore.
7.9.3 Rescue EEPROM Data
The hardware introspection data is pre-written on the EEPROM data spaces. If you have accidentally
deleted or overwritten the HW data, you could contact our support!
DT representation, e.g. in phyCORE-i.MX 93 le can be found in our PHYTEC git: https://git.phytec.de/
linux-imx/tree/arch/arm64/boot/dts/freescale/imx93-phycore-som.dtsi?h=v6.1.55_2.2.0-phy3#n172
7.10 RTC
RTCs can be accessed via /dev/rtc*. Because PHYTEC boards have often more than one RTC, there might
be more than one RTC device le.
To nd the name of the RTC device, you can read its sysfs entry with:
target:~$ cat /sys/class/rtc/rtc*/name
You will get, for example:
rtc-rv3028 0-0052
snvs_rtc 30370000.snvs:snvs-rtc-lp
Tip
This will list all RTCs including the non-I²C RTCs. Linux assigns RTC device IDs based on the device
tree/aliases entries if present.
Date and time can be manipulated with the hwclock tool and the date command. To show the current date
and time set on the target:
target:~$ date
Thu Jan 1 00:01:26 UTC 1970
Change the date and time with the date command. The date command sets the time with the following
syntax “YYYY-MM-DD hh:mm:ss (+|-)hh:mm”:
target:~$ date -s "2022-03-02 11:15:00 +0100"
Wed Mar 2 10:15:00 UTC 2022
Note
Your timezone (in this example +0100) may vary.
Using the date command does not change the time and date of the RTC, so if we were to restart the target
those changes would be discarded. To write to the RTC we need to use the hwclock command. Write the
Accessing Peripherals 61