s3c2440camera-r5 compile problem

majid
hi

I'm newbi to linux, sorry. what should I do?

root@dab-desktop:/opt/FriendlyARM/s3c2440camera-r5# make
make -C ../linux-2.6.32.2 M=/opt/FriendlyARM/s3c2440camera-r5 ARCH=arm
modules
make[1]: Entering directory `/opt/FriendlyARM/linux-2.6.32.2'

  WARNING: Symbol version dump
/opt/FriendlyARM/linux-2.6.32.2/Module.symvers
           is missing; modules will have no dependencies and modversions.

  Building modules, stage 2.
  MODPOST 1 modules
make[1]: Leaving directory `/opt/FriendlyARM/linux-2.6.32.2'
root@dab-desktop:/opt/FriendlyARM/s3c2440camera-r5#

open-nandra
Well Makefile looks little bit strange. Before running make run in your
mini2440 kernel dir following:
make mini2440_defconfig ARCH=arm; make prepare ARCH=arm
CROSS_COMPILE=arm-linux-<depends what's the prefix for your compiler); make
ARCH=arm CROSS_COMPILE=arm-linux-<same as before>

Then in camera directory:
KERNEL_DIR=<path to mini2440 kernel> CROSS_COMPILE=<same as upper> make

majid
tanx

majid
still there are some strange things. I set PATH to linux-2.6.32.2 kernel in
.profile and has restarted but:  

root@dab-desktop:~/Project/mini2440/s3c2440camera-r5# bash
./ARM-Linux-GCC-4.3.2.sh
CC: arm-linux-gcc
CXX: arm-linux-gxx
CPP: arm-linux-cpp
AR: arm-linux-ar
AS: arm-linux-as
LD: arm-linux-ld
NM: arm-linux-nm
RANLIB: arm-linux-ranlib
STRIP: arm-linux-strip
SIZE: arm-linux-size
root@dab-desktop:~/Project/mini2440/s3c2440camera-r5# make test_capture
cc -Wall -std=gnu99  -O3 test_capture.c -o test_capture 
In file included from /usr/include/string.h:640,
                 from test_capture.c:10:
In function ‘memset’,
    inlined from ‘main’ at test_capture.c:43:
/usr/include/bits/string3.h:83: warning: call to ‘__warn_memset_zero_len’
declared with attribute warning: memset used with constant zero length
parameter; this could be due to transposed parameters
/tmp/ccPFfrW9.o: In function `main':
test_capture.c:(.text+0x4a): warning: memset used with constant zero length
parameter; this could be due to transposed parameters
root@dab-desktop:~/Project/mini2440/s3c2440camera-r5# 



why it has referred to "/usr/include/string.h" instead of my defined PATH ?

majid
.profile is

# mini2440
PATH=$PATH:/usr/local/arm/4.3.2/bin/
PATH=$PATH:/opt/FriendlyArm/mini2440/linux-2.6.32.2

(also, I have used correct char case for "FriendlyArm". Forget about first
post with "FriendlyARM".)

open-nandra
Well it build fine here. but I'm not using FriendlyARM cross compiler.
Anyway try to add -I<path to include> to Makefile.

majid
kindly, what cross compiler do you use?

open-nandra
I build one using buildroot tool and use across all projects.

majid
#in makefile
EXTRA_CFLAGS += -I/opt/FriendlyArm/mini2440/linux-2.6.32.2

but still there is problem!

open-nandra
OK lemme check with friendlyarm cross-compiler.

open-nandra
Well I can't compile with current frienldyarm toolchain. I get:
arm-none-linux-gnueabi-gcc: Internal error: Segmentation fault (program
cc1)
Please submit a full bug report.
See <https://support.codesourcery.com/GNUToolchain/>; for instructions.

Anyway test_capture is build or not on your side? Warnings could be omitted
;).

marek

majid
thanks for your time

here has created a 11.8KB test_capture file

I'm new to Linux, is it sufficient ?

open-nandra
If it's created should be sufficient ;). Load it to board and run it.

majid
again, for review

////////////////////////////////////////////////////////////////////
root@dab-desktop:/# cd /home/dab/project/mini2440/s3c2440camera-r5/

root@dab-desktop:/home/dab/project/mini2440/s3c2440camera-r5# make clean
rm -f s3c2440camera.mod.o  s3c2440camera.o  s3c2440camif.o 
s3c2440_ov9650.o  sccb.o  s3c2440camera.ko s3c2440camera.mod.c 
test_capture tiff_capture 

root@dab-desktop:/home/dab/project/mini2440/s3c2440camera-r5# make
bash ./ARM-Linux-GCC-4.3.2.sh
CC: arm-linux-gcc
CXX: arm-linux-gxx
CPP: arm-linux-cpp
AR: arm-linux-ar
AS: arm-linux-as
LD: arm-linux-ld
NM: arm-linux-nm
RANLIB: arm-linux-ranlib
STRIP: arm-linux-strip
SIZE: arm-linux-size
make -C /opt/FriendlyArm/mini2440/linux-2.6.32.2
M=/home/dab/project/mini2440/s3c2440camera-r5 ARCH=arm modules
make[1]: Entering directory `/opt/FriendlyArm/mini2440/linux-2.6.32.2'
  CC [M]  /home/dab/project/mini2440/s3c2440camera-r5/s3c2440_ov9650.o
/home/dab/project/mini2440/s3c2440camera-r5/ov9650_qcif.h:1: warning:
'ov9650_qcif' defined but not used
/home/dab/project/mini2440/s3c2440camera-r5/s3c2440_ov9650.c:36: warning:
'ov9650_invert' defined but not used
/home/dab/project/mini2440/s3c2440camera-r5/s3c2440_ov9650.c:39: warning:
'ov9650_restore' defined but not used
/home/dab/project/mini2440/s3c2440camera-r5/s3c2440_ov9650.c:117: warning:
'ov9650_exp' defined but not used
/home/dab/project/mini2440/s3c2440camera-r5/s3c2440_ov9650.c:118: warning:
'ov9650_gain' defined but not used
  CC [M]  /home/dab/project/mini2440/s3c2440camera-r5/sccb.o
  CC [M]  /home/dab/project/mini2440/s3c2440camera-r5/s3c2440camif.o
/home/dab/project/mini2440/s3c2440camera-r5/s3c2440camif.c: In function
'update_target_fmt_regs':
/home/dab/project/mini2440/s3c2440camera-r5/s3c2440camif.c:414: warning:
unused variable 'cicoscctrl'
/home/dab/project/mini2440/s3c2440camera-r5/s3c2440camif.c:413: warning:
unused variable 'cicrscctrl'
/home/dab/project/mini2440/s3c2440camera-r5/s3c2440camif.c:412: warning:
unused variable 'cicrctrl'
/home/dab/project/mini2440/s3c2440camera-r5/s3c2440camif.c:409: warning:
unused variable 'ciprscctrl'
/home/dab/project/mini2440/s3c2440camera-r5/s3c2440camif.c:408: warning:
unused variable 'ciprctrl'
/home/dab/project/mini2440/s3c2440camera-r5/s3c2440camif.c:407: warning:
unused variable 'ciprtrgfmt'
/home/dab/project/mini2440/s3c2440camera-r5/s3c2440camif.c: In function
'update_target_zoom_regs':
/home/dab/project/mini2440/s3c2440camera-r5/s3c2440camif.c:580: warning:
unused variable 'cicoscpreratio'
/home/dab/project/mini2440/s3c2440camera-r5/s3c2440camif.c:578: warning:
unused variable 'ciprscctrl'
/home/dab/project/mini2440/s3c2440camera-r5/s3c2440camif.c:577: warning:
unused variable 'ciprscpredst'
/home/dab/project/mini2440/s3c2440camera-r5/s3c2440camif.c:571: warning:
unused variable 'preDstHeight'
/home/dab/project/mini2440/s3c2440camera-r5/s3c2440camif.c:571: warning:
unused variable 'preDstWidth'
/home/dab/project/mini2440/s3c2440camera-r5/s3c2440camif.c:566: warning:
unused variable 'preVratio'
/home/dab/project/mini2440/s3c2440camera-r5/s3c2440camif.c:566: warning:
unused variable 'preHratio'
/home/dab/project/mini2440/s3c2440camera-r5/s3c2440camif.c: In function
'start_capture':
/home/dab/project/mini2440/s3c2440camera-r5/s3c2440camif.c:704: warning:
unused variable 'ciimgcpt'
/home/dab/project/mini2440/s3c2440camera-r5/s3c2440camif.c:703: warning:
unused variable 'ciprscctrl'
/home/dab/project/mini2440/s3c2440camera-r5/s3c2440camif.c: In function
's3c2410camif_querycap':
/home/dab/project/mini2440/s3c2440camera-r5/s3c2440camif.c:1229: warning:
unused variable 'pcam'
/home/dab/project/mini2440/s3c2440camera-r5/s3c2440camif.c: In function
's3c2410camif_enum_fmt_vid_cap':
/home/dab/project/mini2440/s3c2440camera-r5/s3c2440camif.c:1269: warning:
unused variable 'dev'
/home/dab/project/mini2440/s3c2440camera-r5/s3c2440camif.c: At top level:
/home/dab/project/mini2440/s3c2440camera-r5/s3c2440camif.c:152: warning:
's3c2440camif_free_frame_buf' defined but not used
/home/dab/project/mini2440/s3c2440camera-r5/s3c2440camif.c:257: warning:
's3c2440camif_reg_dump' defined but not used
  LD [M]  /home/dab/project/mini2440/s3c2440camera-r5/s3c2440camera.o
  Building modules, stage 2.
  MODPOST 1 modules
WARNING: "video_device_release"
[/home/dab/project/mini2440/s3c2440camera-r5/s3c2440camera.ko] undefined!
WARNING: "video_register_device"
[/home/dab/project/mini2440/s3c2440camera-r5/s3c2440camera.ko] undefined!
WARNING: "video_device_alloc"
[/home/dab/project/mini2440/s3c2440camera-r5/s3c2440camera.ko] undefined!
WARNING: "video_unregister_device"
[/home/dab/project/mini2440/s3c2440camera-r5/s3c2440camera.ko] undefined!
WARNING: "video_devdata"
[/home/dab/project/mini2440/s3c2440camera-r5/s3c2440camera.ko] undefined!
WARNING: "video_ioctl2"
[/home/dab/project/mini2440/s3c2440camera-r5/s3c2440camera.ko] undefined!
  CC      /home/dab/project/mini2440/s3c2440camera-r5/s3c2440camera.mod.o
  LD [M]  /home/dab/project/mini2440/s3c2440camera-r5/s3c2440camera.ko
make[1]: Leaving directory `/opt/FriendlyArm/mini2440/linux-2.6.32.2'

root@dab-desktop:/home/dab/project/mini2440/s3c2440camera-r5# make
test_capture
bash ./ARM-Linux-GCC-4.3.2.sh
CC: arm-linux-gcc
CXX: arm-linux-gxx
CPP: arm-linux-cpp
AR: arm-linux-ar
AS: arm-linux-as
LD: arm-linux-ld
NM: arm-linux-nm
RANLIB: arm-linux-ranlib
STRIP: arm-linux-strip
SIZE: arm-linux-size
cc -Wall -std=gnu99  -O3 test_capture.c -o test_capture 
In file included from /usr/include/string.h:640,
                 from test_capture.c:10:
In function ‘memset’,
    inlined from ‘main’ at test_capture.c:43:
/usr/include/bits/string3.h:83: warning: call to ‘__warn_memset_zero_len’
declared with attribute warning: memset used with constant zero length
parameter; this could be due to transposed parameters
/tmp/cc5dMyo6.o: In function `main':
test_capture.c:(.text+0x4a): warning: memset used with constant zero length
parameter; this could be due to transposed parameters

root@dab-desktop:/home/dab/project/mini2440/s3c2440camera-r5# 
////////////////////////////////////////////////////////////////////

finally
there is .o files, a .ko file and test_capture file

open-nandra
Well as I said. Load it try it. If it works it's good. This is just
warnings not errors.

majid
yes, I will do it.

I know, [warning: unused variable 'x']. Absolutely, it is not important
here.
But, what about [WARNING: "X"
[/home/dab/project/mini2440/s3c2440camera-r5/s3c2440camera.ko] undefined!]
?

While, I see s3c2440camera.ko file in the proposed directory!