Atmel website | ARM Community | AVR freaks | Technical Support
Banner
 FAQ •  Search •  Register •  Login 

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: webcam test on AT91rm9200dk USB interface
PostPosted: Fri Jan 14, 2005 4:34 pm 
Offline

Joined: Tue Dec 28, 2004 5:50 pm
Posts: 11
i want use a webcam to test AT91RM9200DK USB interface to grab image,
to do so i can familiar with arm linux platform programing.

the usb camera chip is zc301b with a HV7131b sensor,
the driver could be found at zc0302.sourceforge.net and test program use videodog,but they both only for x86,so must port to ARM and recompile.

i want to compile driver standalone but not build in kernel,
the develop environment setup follow this step:

1,download cross toolchain (cross-2.95.3.tar.bz2) packaged in AT91CDROM from 81.80.104.162(at91 technology support ftp site)
2,cd /usr/local/arm
3,tar jxvf cross-2.95.3.tar.bz2
4,cd ~/linux-2.4.27-vrs1-ATMEL
5,cp -rf include/asm-arm /usr/local/arm/2.95.3/arm-linux/include/asm
6,cp -rf include/linux /usr/local/arm/2.95.3/arm-linux/include

then modify Makefile of zc030x driver and videodog for ARM(attached below),the test result as below:

use this option to compile driver can not find correct kernel head files:
-I/usr/local/arm/2.95.3/arm-linux/include
-L/usr/local/arm/2.95.3/arm-linux/lib

but this will work:
-I/root/linux-2.4.27-vrs1-ATMEL/include
-I/root/linux-2.4.27-vrs1-ATMEL/include/linux

why this happen?
the cross toolchain should have correct head files seted by step 5,6.

then compile videodog but always fail.
CFLAGS option use:

-I/usr/local/arm/2.95.3/arm-linux/include
-L/usr/local/arm/2.95.3/arm-linux/lib

the error message complain glibc not linked ok.
like this:

utils.o(.text+0x34c): undefined reference to `memcpy'
utils.o(.text+0x360): undefined reference to `memset'
utils.o(.text+0x39c): undefined reference to `sprintf'
utils.o(.text+0x3a8): undefined reference to `strcpy'
utils.o(.text+0x3c4): undefined reference to `time'
utils.o(.text+0x3d0): undefined reference to `time'
utils.o(.text+0x424): undefined reference to `sprintf'
utils.o(.text+0x444): undefined reference to `memset'
utils.o(.text+0x450): undefined reference to `strlen'
utils.o(.text+0x460): undefined reference to `strncpy'

who have successful compiled user application for 2.4.27-vrs1 kernel with 2.95.3 toolchain?
or compiled a standalone driver successful?
if you have done same work ,Could you give some idea,Thanks!

Makefile for videodog attached:
-------------------------------------------------------------------------------------
# videodog
# general config
NAME = videodog
VERSION =0.23
CONFIG_FILE=/etc/vd.conf

CROSSGCC=/usr/local/arm/2.95.3
CROSSINCLUDE=$(CROSSGCC)/arm-linux/include
CROSSLIB=$(CROSSGCC)/arm-linux/lib

# comment if you want to change it
SPECIAL= -DBENCH # enables benchmark ( frame count / sec count )
JPEG = -DHASJPEG
JPEG_LIB=-ljpeg

#ASM_SWAP = -DBGR2RGB # enables a faster swap routine (bgr24 -> rgb24)

CC = arm-linux-gcc
LD = arm-linux-ld
AR = arm-linux-ar
RANLIB=arm-linux-ranlib
STRIP=arm-linux-strip

CFLAGS = -Wall -O3 $(SPECIAL) -DSTAMP -DCONFIG_FILE=\"$(CONFIG_FILE)\" -DVERSION=\"$(VERSION)\" # -DDEBUG -g3
CFLAGS += -I$(CROSSINCLUDE) -L$(CROSSLIB)
#CFLAGS += -fomit-frame-pointer -Wno-trigraphs -fno-strict-aliasing -fno-common -Wstrict-prototypes
#CFLAGS += -march=armv4 -mtune=arm9tdmi -mshort-load-bytes

LDFLAGS = -L/usr/local/arm/2.95.3/lib/lib.a -L$(CROSSLIB)

TARGETBIN =$(NAME)
# files
OBJS = utils.o \
loadset.o \
effects.o \
video.o \
stamp.o \
main.o

all: $(TARGETBIN)

$(TARGETBIN):$(OBJS)
@echo Linking $(TARGETBIN)
@$(LD) $(LDFLAGS) -o $(TARGETBIN) $(OBJS)

.c.o: Makefile $*.c
@echo Compiling $*.c
@$(CC) -static -s $(CFLAGS) -c $*.c -o $*.o

clean:
rm -rf *.o $(NAME)

------------------------------------------------------------------------------

any suggestion will great appreciation!


Top
 Profile  
 
 Post subject: work toolchain for at91rm9200 board and glibc(uClibc)?
PostPosted: Sat Jan 15, 2005 12:28 pm 
Offline

Joined: Tue Dec 28, 2004 5:50 pm
Posts: 11
as the topic say,
the cross toolchain should with build in glibc(uClibc),
but how to link the c run time library when cross complie a user application?
where the library files locate?
/usr/local/arm/2.95.3/arm-linux/lib
or /usr/local/arm/2.95.3/lib/gcc-lib/arm-linux/2.95.3 ?

i have linked these two directory to try compile videodog and both fail.

if the glibc(uClibc)does not build in cross toolchain 2.95.3,
then how to cross compile glibc in it,what version can work?

sorry,i am a newbie for this ,could somebody give some suggestion?
Best Regards


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 20, 2005 2:40 pm 
Offline
User avatar

Joined: Fri Feb 13, 2004 7:53 pm
Posts: 329
Hi deseaf,

That's best to post your questions on the official ARM Linux forum. IMHO, you will get more chances to have an answer.

This AT91 Linux forum, is for very basic questions related to distributions for AT91 boards i.e. availibility etc....

Rgds


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: Google [Bot] and 9 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: