I use the last version from Dolittle (ntpclient-2007-365) and all work 
quite correct,
I have a little problem on start, that it accumulate a big error on 
first 20 minutes
after a reebot, then if I resync with ntp server all work ok from there.
So I'm really interested to know if someone else has this problem.

Any way, to compile I use a vmware sdk on winXp.
It's not the last version but I think that this shouldn't do the difference.
This is the step by step operation I do.

cd /home/fox/devboard-R2_01  
. init_env
cd apps
tar xvf ntpclient_2007_365.tar
cd ntpclient_2007
then I use this Makefile

*******************************************************************+ 
AXIS_USABLE_LIBS = UCLIBC GLIBC
include $(AXIS_TOP_DIR)/tools/build/Rules.axis


INSTDIR = $(prefix)/usr/bin


CC:=cris-gcc -mlinux
CFLAGS += -Wall -Wpointer-arith -Wcast-align -Wcast-qual -Wshadow \
 -Waggregate-return -Wnested-externs -Winline -Wwrite-strings \
 -Wstrict-prototypes

CFLAGS += -Os
LDFLAGS= -s
#all: ntpclient
all: ntpclient adjtimex delay

ntpclient: ntpclient.o phaselock.o

adjtimex: adjtimex.o

delay: delay.o

install: ntpclient
        $(INSTALL) -p -o root -g root -m 0777  ntpclient $(INSTDIR)

clean:
        $(RM) ntpclient adjtimex *.o adjtimex delay


********************************************************************

then do:

make cris-axis-linux-gnu

compiling code without modification set this link error:

ntpclient.o: In function `set_time':
/home/fox/devboard-R2_01/apps/ntpclient-2007/ntpclient.c:185: undefined 
reference to `clock_settime'
ntpclient.o: In function `ntpc_gettime':
/home/fox/devboard-R2_01/apps/ntpclient-2007/ntpclient.c:216: undefined 
reference to `clock_gettime'
collect2: ld returned 1 exit status
make: *** [ntpclient] Error 1

So to avoid this I modified ntpclient.c inserting this lines  at begin 
of file
#define USE_OBSOLETE_GETTIMEOFDAY

then compile should be ok.
Take care to transfer executable to fox as binary.

Let me know if all is ok, or if you require the executable,
I can send it to you ny email.

Once  program work , let me know  if  you have the same  problem as I have.

To start at reboot time I  have inserted this commands at the end of 
/etc/init.d/rc

/mnt/1/fox/adjtimex -f 1524916
/mnt/1/fox/ntpclient -s -h  ip_number_of_my_ntp_server
/mnt/1/fox/ntpclient -l -i 30 - ip_number_of_my_ntp_server  
 >/var/log/ntpclient.log&

The first one set clock frequency according to last parameters before 
reboot, see file
Howto included into ntpclient distribution to compute it the first time.

Andrea Maccaferri









Reply via email to