marcellom Posted November 13, 2017 Posted November 13, 2017 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
tkaiser Posted November 13, 2017 Posted November 13, 2017 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. 1
marcellom Posted November 13, 2017 Author Posted November 13, 2017 Tkaiser, you are precious Yes, i'll. do tonight... tnx for patience!
marcellom Posted November 13, 2017 Author Posted November 13, 2017 Hi people.. here my meson64_odroidc2.dtb..... https://pastebin.com/dxFP56f1 I hope someone can give me a help... Im the first with this problem, but if we solve, i can write a tutorial for the next..and share informations.. Thanks..
chrisf Posted November 13, 2017 Posted November 13, 2017 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
marcellom Posted November 13, 2017 Author Posted November 13, 2017 tnx for the answer Chrisf.... look at the picture.... crazy.. no? What i wrong?
chrisf Posted November 13, 2017 Posted November 13, 2017 Maybe your i2c devices are named differently, they had names like "i2c-A" in the DTS try ls -l /dev/i2c*
marcellom Posted November 14, 2017 Author Posted November 14, 2017 .. im really a noob so apologize for what i say... is possible that the directory /dev does not exist?
tkaiser Posted November 14, 2017 Posted November 14, 2017 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)
marcellom Posted November 14, 2017 Author Posted November 14, 2017 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..
marcellom Posted November 14, 2017 Author Posted November 14, 2017 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
martinayotte Posted November 14, 2017 Posted November 14, 2017 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.
chrisf Posted November 14, 2017 Posted November 14, 2017 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
zador.blood.stained Posted November 15, 2017 Posted November 15, 2017 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.
marcellom Posted November 15, 2017 Author Posted November 15, 2017 Tnx Armbians, this evening ill test with modprobe and ill report my experience...
marcellom Posted November 15, 2017 Author Posted November 15, 2017 Good news...following this https://www.abelectronics.co.uk/kb/article/1036/odroid-c2-running-ubuntu-i2c-setup i have this as the attached picture.. Is a good news i think.. So...whats my next step?
marcellom Posted November 15, 2017 Author Posted November 15, 2017 ...and in /dev ....see the following picture But with modprobe i2c-dev i have not answers...
chrisf Posted November 15, 2017 Posted November 15, 2017 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" ?
marcellom Posted November 16, 2017 Author Posted November 16, 2017 Maybe with a different name will works? I must serch in config file RTC name?
chrisf Posted November 16, 2017 Posted November 16, 2017 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/ 1
marcellom Posted November 16, 2017 Author Posted November 16, 2017 Wow Chrisf...i cant wait go home after work... This evening ill try and..i hope to have good news again!! I Thank you very much
marcellom Posted November 16, 2017 Author Posted November 16, 2017 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).
chrisf Posted November 16, 2017 Posted November 16, 2017 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
marcellom Posted November 17, 2017 Author Posted November 17, 2017 this step will be a little bit more difficult... This w.e. i try and...report here. Tnx Chrisf
marcellom Posted November 17, 2017 Author Posted November 17, 2017 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>;
zador.blood.stained Posted November 17, 2017 Posted November 17, 2017 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>; }; }; 1
marcellom Posted November 17, 2017 Author Posted November 17, 2017 Yeeeeeh.. i thank you very very much
marcellom Posted November 17, 2017 Author Posted November 17, 2017 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...
zador.blood.stained Posted November 18, 2017 Posted November 18, 2017 10 hours ago, marcellom said: Suggestions? :/ There can be more than 1 hardware RTC. What does output of "ls /dev/rtc*" look like?
marcellom Posted November 18, 2017 Author Posted November 18, 2017 Good morning Zador this is the output /dev/rtc /dev/rtc0
Recommended Posts