Jump to content

How install RTC schield by Hardkernell in Odroid c2 with OMV Erasmus 3.0.92?


Recommended Posts

Posted

 

 

Hi Armbian people, this is my first time here and i feel like a child in a chemical laboratory... strange things, linux is a new world for me so i apologize for dumbs questions...

Im trying to install RTC Shield in my odroid c2 with Openmediavault Erasmus.

Someone can give me a hand?

I've start with the tutorial provided by Hardkernell.. is for Ubuntu, so i have an error (see first picture) since the second step.

After that, Odroid from HD suggest probe rtc with

sudo modprobe aml_i2c

sudo modprobe rtc_pcf8563..

.. it seems that the driver is not present or that is not the right thing to do (see second picture).

After that i"ve try with hwclock - - debug and... see the 3rd picture.

Im thinking to give up...

Or someone can help me?

My apologize for dumb questions and BAD english.

Marcello 99844925199df4293f15047affc66b32.jpgd25d8e961445b05ea0c98d3b8fe4b303.jpg28e5e687056bfb1bca6d4b72d6ba2b71.jpg

 

Posted

First part of the journey happened here: https://forum.openmediavault.org/index.php/Thread/20464-Problem-installing-Rtc-shield-Hardkernell-on-Openmediavault-Erasmus/?postID=159296#post159296

 

IMO it's just fdtput not doing what it should for reasons I haven't checked (since not using C2 anyway). To proceed it would help if @marcellom would put the result of 'dtc -I dtb -O dts -o meson64_odroidc2.dts meson64_odroidc2.dtb' to an online pasteboard service like pastebin.com. Just paste meson64_odroidc2.dts to it and post the link.

Posted

Looks like the i2c device is enabled in the DTS file

I'd use i2cdetect to see if the RTC is on the i2c bus and responding.

 

You will need to install the "i2c-tools" package if you don't have i2cdetect

root@cubie:~# i2cdetect -y 0
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- UU -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

It should look something like that, the UU on this one says that address 0x34 is being used by a driver

The "0" is the i2c bus number to check, you should have some /dev/i2c-* files

Posted
3 hours ago, marcellom said:

im really a noob so apologize for what i say...

 

Please don't get this wrong... but since I asked you already over at OMV forum and still miss the answer (or might have overlooked it): What do you need a RTC for on a NAS? The N in NAS is 'Network' just like in NTP (Network time protocol -- active by default on OMV and usually providing exactly the same correct time than RTC which is needed on systems w/o network connections)

Posted

Hi Tkaiser, yes, you are right...ntp update date and time.

 

I'm convinced myself that a nas MUST have a rtc to plan a week backup strategy since my odroid is not under UPS  and an accidental shutdown reset date to1970 for about half an hour.

Maybe I do not really need one RTC, my OMV Nas store just ripped music library for Volumio player.

But it is so frustrating to have something that does not work..

Posted

i quote myself

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

.. im really a noob so apologize for what i say... is possible that the directory /dev does not exist? 

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

was, obviously, a stupid question...

/dev directory does exist....i2c file... not!

 

a pastebin of my config-3.14.29-51 file....inside /boot

This can help?

https://pastebin.com/kgVznbPj

Posted

Since you're using a Legacy kernel, I2C port needs to be enabled in FEX file, meaning that you need to decompile /boot/script.bin into /boot/script.fex, edit it to enable I2C port, then recompile it into /boot/script.bin, assuming that you've created a backup first as /boot/script.bin-bak.

 

Posted
8 minutes ago, martinayotte said:

Since you're using a Legacy kernel, I2C port needs to be enabled in FEX file, meaning that you need to decompile /boot/script.bin into /boot/script.fex, edit it to enable I2C port, then recompile it into /boot/script.bin, assuming that you've created a backup first as /boot/script.bin-bak.

 

If that doesn't make the /dev/i2c* files show up

try "modprobe i2c-dev" and "modprobe aml_i2c"

If that works, add them to your /etc/modules file. Your config shows the i2c AML driver is enabled as a module, so might not be loaded "CONFIG_I2C_AML=m"

Have a read through https://www.abelectronics.co.uk/kb/article/1036/odroid-c2-running-ubuntu-i2c-setup

 

Posted
9 hours ago, martinayotte said:

Since you're using a Legacy kernel, I2C port needs to be enabled in FEX file, meaning that you need to decompile /boot/script.bin into /boot/script.fex, edit it to enable I2C port, then recompile it into /boot/script.bin, assuming that you've created a backup first as /boot/script.bin-bak.

Only AW 3.4.x kernel uses fex, this is Odroid C2 and it has DT from the start.

Posted

The good news is 0x51 is the i2c address for a PCF8563 RTC

Have you now tried to load the rtc driver with "modprobe rtc_pcf8563" ?

 

Posted
root@raspberrypi:~# modprobe i2c-dev
root@raspberrypi:~# modprobe rtc-pcf8563
root@raspberrypi:~# echo pcf8563 0x51 > /sys/class/i2c-adapter/i2c-0/new_device

the first command makes sure the i2c-dev driver is loaded

the second command loads the pcf8563 driver

the third one tells the kernel to use the pcf8563 driver for the device with addres 0x51 on i2c-0. You'll want to change i2c-0 to i2c-1 as that's the i2c port with your rtc device.

 

This is from http://www.susa.net/wordpress/2012/06/raspberry-pi-pcf8563-real-time-clock-rtc/

Posted

Great Chrisf...we have great news...

rtc is working...the last part is...how i can set the clock to work at boot?

Must follow Hard Kernell tutorial? (in the first post).

 

greatnews.png

Posted

You have a few options

1) create an init/systemd script to perform those actions on boot.

2) update your device tree to load the drivers

https://www.kernel.org/doc/Documentation/i2c/instantiating-devices

The sooner device tree overlays are supported for all SoC's the better I say...

 

Your device is referenced in https://www.kernel.org/doc/Documentation/devicetree/bindings/i2c/trivial-devices.txt it will only need a compatable = "nxp,pcf8563"; field and a reg = <0x51>; field

 

Posted

another "stupid" question...

Im not at home now but im thinking about what Chrisf says..

 

actually in my DT i have this

 

i2c@c1108500 {
        compatible = "amlogic, meson-i2c";
        dev_name = "i2c-A";
        status = "okay";
        reg = <0x0 0xc1108500 0x0 0x20>;
        device_id = <0x1>;
        pinctrl-names = "default";
        pinctrl-0 = <0x10>;
        #address-cells = <0x1>;
        #size-cells = <0x0>;
        use_pio = <0x0>;
        master_i2c_speed = <0x493e0>;
        clocks = <0xc 0xa>;
        clock-names = "clk_i2c";
        resets = <0xc 0x9>;
 

is enough change the bold parameters like this?

 

2c@c1108500 {
        compatible = "nxp,pcf8563";
        dev_name = "i2c-A";
        status = "okay";
        reg = <0x51>;
        device_id = <0x1>;
        pinctrl-names = "default";
        pinctrl-0 = <0x10>;
        #address-cells = <0x1>;
        #size-cells = <0x0>;
        use_pio = <0x0>;
        master_i2c_speed = <0x493e0>;
        clocks = <0xc 0xa>;
        clock-names = "clk_i2c";
        resets = <0xc 0x9>;

 

 

:D

Posted
3 hours ago, marcellom said:

is enough change the bold parameters like this?

No, you need to add a slave device to this node. Something like this

i2c@c1108500 {
        compatible = "amlogic, meson-i2c";
        dev_name = "i2c-A";
        status = "okay";
        reg = <0x0 0xc1108500 0x0 0x20>;
        device_id = <0x1>;
        pinctrl-names = "default";
        pinctrl-0 = <0x10>;
        #address-cells = <0x1>;
        #size-cells = <0x0>;
        use_pio = <0x0>;
        master_i2c_speed = <0x493e0>;
        clocks = <0xc 0xa>;
        clock-names = "clk_i2c";
        resets = <0xc 0x9>;
        
        rtc@51 {
            compatible = "nxp,pcf8563";
            reg = <0x51>;
        };
};

 

Posted

Ok Armbians... i tried with update of device tree and added the node as suggested...
After the mods and meson64_odroidc2.dtb recode from dts i have rebooted Odroid..
When the system time has updated and synch with ntp server time i havedone a hwclock - w to write the current time in hardware rtc.
After reboot the time and date was reset to 1970...
Grrrr...
So... i need to try with a different mode (script at start)...
Suggestions? :/
Ah, tnx for help boys... :)

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines