How to Enable RTC in LS1046A NXP Board

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to Enable RTC in LS1046A NXP Board

Jump to solution
2,748 Views
sheikfaaruk
Contributor III

I am working with LS1046ARDB Evaluation Board to develop a network based application. I have started my project with Flex-builder(flexbuild_lsdk2108), Flex-installer(version: 1.13.2108) and Codewarrior IDE.

I have followed the steps in this document https://www.nxp.com/docs/en/user-guide/LSDKUG_Rev21.08.pdf -> 7.2.12 Real Time Clock (RTC). But i can't enable the RTC time . I have posted my work below.

I have download the images from https://lsdk.github.io/components.html

boot_LS -> wget https://www.nxp.com/lgfiles/sdk/lsdk2108/boot_LS_arm64_lts_5.10.tgz

firmware image -> wget https://www.nxp.com/lgfiles/sdk/lsdk2108/firmware_ls1046ardb_sdboot.img

Rootfs -> wget https://www.nxp.com/lgfiles/sdk/lsdk2108/rootfs_lsdk2108_ubuntu_main_arm64.tgz

I have depolyed the image's in SD card through flex-installer:

$ flex-installer -i pf -d /dev/sdx (partition and format the target storage device)

$ sudo flex-installer -b boot_LS_arm64_lts_5.10.tgz -r rootfs_lsdk2108_ubuntu_main_arm64.tgz -f firmware_ls1046ardb_sdboot.img -d /dev/sdx

I have booted the board using SD card, by default rtc not enabled

Then i followed the LSDK document 7.2.12 Real Time Clock (RTC) and enabled all mentioned options in document . 

I add the images how i enable the rtc in linux:custom and boot log with it

1 Custom the linux build

1.Custom_linux.png

2. Select Device Driver -> RTC (Real Time Clock)

2.Device_Drivers.png

3 . Enable the following options as mention in Document

[*] Set system time from RTC on
startup and resume (new)
(rtc0) RTC used to set the system
time (new)
<[*] /sys/class/rtc/rtcN (sysfs)
<[*] /proc/driver/rtc (procfs for
rtc0)
<[*] /dev/rtcN (character devices)

3.Real_time_clock.png

4. Save the Config file 

4.save_config.png

5. complie and build the boot file with custom config file 

5.Build_custom_linux.png

But i can't enable rtc time in custom build also .

In our NXP board [LS1046ARDB] console log :

user@localhost:~$ timedatectl
Local time: Wed 2021-07-21 19:00:51 UTC
Universal time: Wed 2021-07-21 19:00:51 UTC
RTC time: n/a
Time zone: Etc/UTC (UTC, +0000)
System clock synchronized: no
NTP service: active
RTC in local TZ: no

root@localhost:/home/user# hwclock
hwclock: Cannot access the Hardware Clock via any known method.
hwclock: Use the --verbose option to see the details of our search for an access method.

root@localhost:/home/user# hwclock --verbose
hwclock from util-linux 2.34
System Time: 1626894132.588974
Trying to open: /dev/rtc0
Trying to open: /dev/rtc
Trying to open: /dev/misc/rtc
No usable clock interface found.
hwclock: Cannot access the Hardware Clock via any known method.

root@localhost:/home/user# ls /dev/r
ram0 ram10 ram12 ram14 ram2 ram4 ram6 ram8 random
ram1 ram11 ram13 ram15 ram3 ram5 ram7 ram9 rtc1

root@localhost:/home/user# ls /dev/rtc1 -l
crw------- 1 root root 251, 1 Jul 21 19:00 /dev/rtc1

In document mention  as "please refer to DTS file to enble the RTC driver before build ":

NOTE: Please refer to the related DTS file to enable the RTC driver before building.
For example, LS2080AQDS board, should enable the below option:
<*> Dallas/Maxim DS3232

My question is which DTS file should used for LS1046ARDB Board to enable the RTC driver before build  and how to do that ?     

0 Kudos
Reply
1 Solution
2,728 Views
yipingwang
NXP TechSupport
NXP TechSupport

In Linux Kernel, please configure the following option

CONFIG_RTC_DRV_PCF2127=y

View solution in original post

0 Kudos
Reply
1 Reply
2,729 Views
yipingwang
NXP TechSupport
NXP TechSupport

In Linux Kernel, please configure the following option

CONFIG_RTC_DRV_PCF2127=y
0 Kudos
Reply