IMX RTC: Difference between revisions

From Variscite Wiki
m (Eran moved page VAR-SOM-MX6 RTC to IMX RTC)
No edit summary
Line 1: Line 1:
{{PageHeader|RTC}} {{DocImage|category1=Yocto|category2=VAR-SOM-MX6}}[[Category:DART-6UL]][[Category:VAR-SOM-MX7]] __toc__
{{PageHeader|RTC}} {{DocImage|category1=Yocto|category2=VAR-SOM-MX6}}[[Category:DART-6UL]][[Category:VAR-SOM-MX7]] __toc__
= Setting the RTC =
To set the RTC first set the date from Linux shell, type:<br>  
To set the RTC first set the date from Linux shell, type:<br>  
<pre>$ date --set="20150225 09:04"
<pre>$ date --set="20150225 09:04"
Line 7: Line 8:
</pre>  
</pre>  
Power down your board wait 5 minutes and power up. Check your system with date and the time should be up to date.<br>
Power down your board wait 5 minutes and power up. Check your system with date and the time should be up to date.<br>
= Wakeup using the RTC =
Wakeup using the RTC requires hardware connection of ISL12057 IRQ2# pin to a SoC GPIO (in this example GPIO1_01).<br>
Configure your kernel and add Intersil ISL12057 driver. Device Drivers -> Real Time Clock  -> <*> Intersil ISL12057.<br>
For VAR-SOM-MX6, edit arch/arm/boot/dts/imx6qdl-var-som.dtsi<br>
For DART-MX6, edit arch/arm/boot/dts/imx6qdl-var-dart.dtsi<br>
<pre>
rtc@0x68 {
              compatible = "isil,isl12057";
              reg = <0x68>;
              interrupt-parent = <&gpio1>;
              interrupts = <1 IRQ_TYPE_EDGE_FALLING>;
};</pre>
follow the Build Linux from source code guide to build the kernel and device trees and to copy them to your SD card.Don't forget to also build and install the kernel modules.<br>
To set the RTC to wakeup after 10 seconds type:<br>
<pre>$ rtcwake -m mem -d rtc0 -s 10
</pre>

Revision as of 13:55, 12 December 2016

RTC

Setting the RTC

To set the RTC first set the date from Linux shell, type:

$ date --set="20150225 09:04"

Then set the real time clock from Linux shell, type:

$ hwclock --systohc --utc

Power down your board wait 5 minutes and power up. Check your system with date and the time should be up to date.

Wakeup using the RTC

Wakeup using the RTC requires hardware connection of ISL12057 IRQ2# pin to a SoC GPIO (in this example GPIO1_01).
Configure your kernel and add Intersil ISL12057 driver. Device Drivers -> Real Time Clock -> <*> Intersil ISL12057.
For VAR-SOM-MX6, edit arch/arm/boot/dts/imx6qdl-var-som.dtsi
For DART-MX6, edit arch/arm/boot/dts/imx6qdl-var-dart.dtsi

rtc@0x68 {
               compatible = "isil,isl12057";
               reg = <0x68>;
               interrupt-parent = <&gpio1>;
               interrupts = <1 IRQ_TYPE_EDGE_FALLING>;
};

follow the Build Linux from source code guide to build the kernel and device trees and to copy them to your SD card.Don't forget to also build and install the kernel modules.
To set the RTC to wakeup after 10 seconds type:

$ rtcwake -m mem -d rtc0 -s 10