Setup RTC DS1307/DS3231 on Odroid-C4

Post Reply
mbonamusa
Posts: 225
Joined: Mon Feb 25, 2013 9:08 pm
languages_spoken: catalan, spanish, english
ODROIDs: ODROID-X2, U2, U3, XU4, C1, C2
Has thanked: 0
Been thanked: 1 time
Contact:

Setup RTC DS1307/DS3231 on Odroid-C4

Post by mbonamusa »

Hi,
RTC_Shield is out of stsock, so I want to use an RTC DS1307/DS3221 based RTC on odroid C4. Is it possible?
How can I setup these RTC on Odroid-C4?

User avatar
joerg
Posts: 1343
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2, N1, N2, C4
Location: Germany
Has thanked: 86 times
Been thanked: 193 times
Contact:

Re: Setup RTC DS1307/DS3231 on Odroid-C4

Post by joerg »

What is the OS you are running? On Linux you must check if the kernel has rtc_ds1307 kernel module. If not you would need to compile your own kernel and add the rtc to the devicetree.
On @voodiks LineageOS I have managed it with an extra compiled kernel module and some devicetree commandos.

mbonamusa
Posts: 225
Joined: Mon Feb 25, 2013 9:08 pm
languages_spoken: catalan, spanish, english
ODROIDs: ODROID-X2, U2, U3, XU4, C1, C2
Has thanked: 0
Been thanked: 1 time
Contact:

Re: Setup RTC DS1307/DS3231 on Odroid-C4

Post by mbonamusa »

I'm using the original ubuntu 20.04 image from hardkernel.

User avatar
joerg
Posts: 1343
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2, N1, N2, C4
Location: Germany
Has thanked: 86 times
Been thanked: 193 times
Contact:

Re: Setup RTC DS1307/DS3231 on Odroid-C4

Post by joerg »

Try this commandos:

Code: Select all

sudo modprobe rtc_ds1307
lsmod
When you get this:

Code: Select all

Module                  Size  Used by
rtc_ds1307             40960  0
Then kernel driver is built for your kernel and you have chance to make it work with devicetree changes as this:

Code: Select all

	ds3231: rtc@68 {
		status = "okay";
		compatible = "maxim,ds3231";
		reg = <0x68>;
	};
If you can't do this, or if there is no kernel module, need to ask hardkernel devs, if they can make it for next release.

mbonamusa
Posts: 225
Joined: Mon Feb 25, 2013 9:08 pm
languages_spoken: catalan, spanish, english
ODROIDs: ODROID-X2, U2, U3, XU4, C1, C2
Has thanked: 0
Been thanked: 1 time
Contact:

Re: Setup RTC DS1307/DS3231 on Odroid-C4

Post by mbonamusa »

mbc@c4147B3:~$ sudo modprobe rtc_ds1307
modprobe: FATAL: Module rtc_ds1307 not found in directory /lib/modules/4.9.241-67

So, I suppose Harkernel has to make it for next release.

User avatar
odroid
Site Admin
Posts: 37286
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 1749 times
Been thanked: 1127 times
Contact:

Re: Setup RTC DS1307/DS3231 on Odroid-C4

Post by odroid »

We will add the driver to the next kernel update.

BTW, the RTC Shield will be available in few days.

mbonamusa
Posts: 225
Joined: Mon Feb 25, 2013 9:08 pm
languages_spoken: catalan, spanish, english
ODROIDs: ODROID-X2, U2, U3, XU4, C1, C2
Has thanked: 0
Been thanked: 1 time
Contact:

Re: Setup RTC DS1307/DS3231 on Odroid-C4

Post by mbonamusa »

Thank you @odroid!

User avatar
odroid
Site Admin
Posts: 37286
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 1749 times
Been thanked: 1127 times
Contact:

Re: Setup RTC DS1307/DS3231 on Odroid-C4

Post by odroid »

Several different RTC chipset drivers were added with 4.9.241-113 release.
https://github.com/hardkernel/linux/com ... 66004fe0ea
These users thanked the author odroid for the post:
joerg (Fri Mar 19, 2021 7:36 pm)

Post Reply

Return to “Hardware and peripherals”

Who is online

Users browsing this forum: No registered users and 1 guest