Page 1 of 1

Implementing RTC on red pitaya

Posted: Tue Mar 16, 2021 5:05 pm
by radiationman
Hi all,

My application requires time keeping without connection to the internet. I have successfully connected a DS3231 RTC module via I2C and can confirm it is working using

Code: Select all

$ ~# i2cdetect -y -r 0
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: UU -- -- -- -- -- -- 57 -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- 68 -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
Also, I can read the time using

Code: Select all

 i2cdump -r 0x0-6 0 0x68
No size specified (using byte-data access)
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f    0123456789abcdef
00: 30 19 19 01 01 01 00                               0?????.
Now I would like to have the RedPitaya set its system time via this RTC module. Is this possible?
My current version is

Code: Select all

##############################################################################
# Red Pitaya GNU/Linux Ecosystem
# Version: 1.04
# Build: 7
# Branch:
# Commit: 9fad00447133657b314d42d4c42ad306009faae9
# U-Boot: "redpitaya-v2016.4"
# Linux Kernel: "branch-redpitaya-v2017.2"
# Pro Applications: ""
##############################################################################
I've noticed that commands such as

Code: Select all

$ hwclock -r
return errors, because I do not have a

Code: Select all

/dev/rtc
directory.

From the searching I've done, I think I need to install a module specific to the ds3231. I've tried this using modprobe

Code: Select all

~# modprobe rtc-ds3231
modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/4.9.0-xilinx/modules.dep.bin'
modprobe: FATAL: Module rtc-ds3231 not found in directory /lib/modules/4.9.0-xilinx
As you can probably tell, I am new to Linux in general. Any suggestions on where to go from here would be much appreciated.