WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: rtc with ds1339  (Read 4389 times)

Offline ml

  • Newbie
  • *
  • Posts: 14
rtc with ds1339
« on: June 28, 2011, 06:25:34 AM »
Hello,
i need a kernel module or an extension for changing the time in ds 1339 (I2C) chip. I found some source:
http://www.daum-electronic.de/de/download/GPL/GPL/modules
I have problems to compile them for my micro core.
Please help

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11619
Re: rtc with ds1339
« Reply #1 on: June 29, 2011, 04:48:39 AM »
Hi ml

In the Makefile there is a compiler directive for an ARM processor. Try removing arm-9dtmi-linux-gnu-gcc
and -O5 from the file and  add  -march=i486 -mtune=i686 -Os  in their place.

Offline ml

  • Newbie
  • *
  • Posts: 14
Re: rtc with ds1339
« Reply #2 on: June 30, 2011, 06:52:45 AM »
Hi,
i tried the changes in Make file, but i am still not able to compile.
(Intel® Atom™ processor Z5xx)

Any suggestions?

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11619
Re: rtc with ds1339
« Reply #3 on: June 30, 2011, 02:12:18 PM »
Hi ml
Quote
Any suggestions?
Yes, ignore my last post, it was incorrect.

The original Makefile looks like this:
Code: [Select]
all: clean rtc_ds1339.o

rtc_ds1339.o: rtc_ds1339.c
arm-9dtmi-linux-gnu-gcc -O5 -ffast-math -fexpensive-optimizations -Wall -DLINUX -D__KERNEL__ -DMODULE -I. -c rtc_ds1339.c

clean:
@echo 'Removing all objects !'
-rm -f *.o
but should probably look more like this:
Code: [Select]
all: clean rtc_ds1339.o

rtc_ds1339.o: rtc_ds1339.c
i686-pc-linux-gnu-gcc -O5 -ffast-math -fexpensive-optimizations -Wall -DLINUX -D__KERNEL__ -DMODULE -I. -c rtc_ds1339.c

clean:
@echo 'Removing all objects !'
-rm -f *.o
Unfortunately the result is a lot of errors. The files not found cause many more errors and warnings.
Code: [Select]
i686-pc-linux-gnu-gcc -O5 -ffast-math -fexpensive-optimizations -Wall -DLINUX -D__KERNEL__ -DMODULE -I. -c rtc_ds1339.c
rtc_ds1339.c:54:26: error: linux/config.h: No such file or directory
rtc_ds1339.c:55:26: error: linux/module.h: No such file or directory
rtc_ds1339.c:59:30: error: linux/miscdevice.h: No such file or directory
rtc_ds1339.c:60:26: error: linux/ioport.h: No such file or directory
In file included from /usr/include/asm/fcntl.h:1,
                 from /usr/include/linux/fcntl.h:4,
                 from rtc_ds1339.c:61:
/usr/include/asm-generic/fcntl.h:113: error: expected specifier-qualifier-list before 'pid_t'
rtc_ds1339.c:62:31: error: linux/mc146818rtc.h: No such file or directory
rtc_ds1339.c:63:24: error: linux/init.h: No such file or directory
rtc_ds1339.c:65:27: error: linux/proc_fs.h: No such file or directory
rtc_ds1339.c:66:28: error: linux/spinlock.h: No such file or directory
In file included from rtc_ds1339.c:67:
/usr/include/linux/sysctl.h:40: error: expected specifier-qualifier-list before 'size_t'
rtc_ds1339.c:69:75: error: linux/slab.h: No such file or directory
rtc_ds1339.c:70:75: error: linux/mm.h: No such file or directory
rtc_ds1339.c:76:75: error: linux/delay.h: No such file or directory
rtc_ds1339.c:77:75: error: asm/io.h: No such file or directory
The files are from 2004 and I think there were some changes made to the kernel tree that are causing
some of these errors. I know config.h was removed. I think it was replaced with autoconfig.h. The others
may be because they were moved in the kernel or because of a missing or incorrect include directive
in the makefile. The -O5 also doesn't look correct, I don't think it goes up to 5. Since this is a module
there are some directives used that I'm not familiar with.

Bottom line is I'm in over my head at this point. Maybe someone more capable in this area can provide
a few pointers and set me straight.