A20 Micro & Externel RTC DS1307 insted of inbuilt RTC ie SUN4I ?

Started by mandar.khire, March 21, 2016, 03:42:22 PM

Previous topic - Next topic

mandar.khire

Hi,
This is my first topic in Olimex forum.
Basic Question:-
1. Allwinner A20 processor has inbuilt RTC, but if I want to use external RTC by connecting it on UEXT connector (I2C 1 or 2). At time of kernel expansion how can board use this external RTC for keep time update?

Background:-
I follow few steps before start working on RTC.
1. I download Pre-compiled dabian SD card image & dumped it into blank sd card. So I got RFS, UBoot, uImage.
2. It work fine.
3. I download kernel source & compiled it on pc (Ubuntu 14.04 LTS [3.19.0-56-generic] 64bit).
4.copy paste UImage & full module tree in SD card respected location.
5. It also work fine.
Then I start looking about RTC.
I understood by reading various links & pdf that Allwinner A20 processor has inbuilt RTC & not have any separate battery connection for it.
I have DS1307 Serial Real-Time Clock.
I try to follow https://www.olimex.com/forum/index.php?topic=3003.0, which explained how to use external RTC.

Questions:-
1. I follow https://linux-sunxi.org/Linux_Kernel#Compilation for kernel compilation, but from git I got 'linux-sunxi-sunxi-3.4' folder in that I cant find core.c to edit as per https://www.olimex.com/forum/index.php?topic=3003.0.

2. I used https://github.com/OLIMEX/OLINUXINO/tree/master/SOFTWARE/A20/A20-OLinuXino-Micro%20with%20MOD-RTC instead of https://github.com/OLIMEX/OLINUXINO/tree/master/SOFTWARE/A13/MOD-RTC which given in forum previous topic. Is this MOD-RTC working properly because even removing RTC module from board, it giving output, it should give error? It might be due to I connecting my external RTC at I2C 1 & somehow internal RTC also using I2C1 so I got proper output when I remove external RTC & run MOD_RTC example.

Can someone guide me?


mandar.khire

Thanks gvi70000,
I use following link for Compiling Linux_kernel
https://linux-sunxi.org/Linux_Kernel#Compilation
In that sunxi-3.4 (stable version) https://github.com/linux-sunxi/linux-sunxi/tree/sunxi-3.4
I used but I cant find any core.c at lichee/linux-3.4/arch/arm/mach-sun7i/ ?
Does I am using wrong path from github for kernel?

gvi70000

You can copy the missing files and then from Daves sources. You can also try Armbian if you need only Linux