You are not logged in.

#1 2011-07-04 19:40:46

Sinn006
Member
Registered: 2011-07-04
Posts: 4

Problems compiling at91 driver for samutils-0.2.1

Hello All!

I'm having problems compiling the usb driver for sam7 tools. I am receiving the following errors:

make -C /lib/modules/2.6.39-ARCH/build SUBDIRS=/home/bailey/Source/sam7utils-0.2.1/driver modules
make[1]: Entering directory `/usr/src/linux-2.6.39-ARCH'
  CC [M]  /home/bailey/Source/sam7utils-0.2.1/driver/at91.o
/home/bailey/Source/sam7utils-0.2.1/driver/at91.c: In function âat91_write_bulk_callbackâ:
/home/bailey/Source/sam7utils-0.2.1/driver/at91.c:154:2: error: implicit declaration of function âusb_buffer_freeâ [-Werror=implicit-function-declaration]
/home/bailey/Source/sam7utils-0.2.1/driver/at91.c:140:19: warning: variable âdevâ set but not used [-Wunused-but-set-variable]
/home/bailey/Source/sam7utils-0.2.1/driver/at91.c: In function âat91_writeâ:
/home/bailey/Source/sam7utils-0.2.1/driver/at91.c:178:2: error: implicit declaration of function âusb_buffer_allocâ [-Werror=implicit-function-declaration]
/home/bailey/Source/sam7utils-0.2.1/driver/at91.c:178:6: warning: assignment makes pointer from integer without a cast [enabled by default]
/home/bailey/Source/sam7utils-0.2.1/driver/at91.c:192:6: warning: passing argument 6 of âusb_fill_bulk_urbâ from incompatible pointer type [enabled by default]
include/linux/usb.h:1266:20: note: expected âusb_complete_tâ but argument is of type âvoid (*)(struct urb *, struct pt_regs *)â
/home/bailey/Source/sam7utils-0.2.1/driver/at91.c: In function âat91_probeâ:
/home/bailey/Source/sam7utils-0.2.1/driver/at91.c:305:2: error: implicit declaration of function âinfoâ [-Werror=implicit-function-declaration]
/home/bailey/Source/sam7utils-0.2.1/driver/at91.c: In function âat91_disconnectâ:
/home/bailey/Source/sam7utils-0.2.1/driver/at91.c:320:2: error: implicit declaration of function âlock_kernelâ [-Werror=implicit-function-declaration]
/home/bailey/Source/sam7utils-0.2.1/driver/at91.c:328:2: error: implicit declaration of function âunlock_kernelâ [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors

make[2]: *** [/home/bailey/Source/sam7utils-0.2.1/driver/at91.o] Error 1
make[1]: *** [_module_/home/bailey/Source/sam7utils-0.2.1/driver] Error 2
make[1]: Leaving directory `/usr/src/linux-2.6.39-ARCH'
make: *** [default] Error 2

output of uname -a

2.6.39-ARCH #1 SMP PREEMPT Mon Jun 27 22:01:13 CEST 2011 i686 Intel(R) Pentium(R) 4 CPU 1.50GHz GenuineIntel GNU/Linux

I am running gcc 4.6.1-1 and have installed kernel26headers. If there is any info I'm missing plz let me know.
Thanks for your help in advance

Offline

#2 2011-07-06 17:32:39

calef13
Member
Registered: 2007-06-10
Posts: 142

Re: Problems compiling at91 driver for samutils-0.2.1

Most likely, the code you are trying to compile has not been written to be compatible with GCC 4.6.x. The "-Wunused-but-set-variable" were only introduced in the 4.6.x series. Arch linux is a lot more bleeding edge that other distros and this can be problematic sometimes when the developer of some code works with earlier versions of tools.
The easiest solution is probably adding "-Wno-implicit-function-declaration" to the CFLAGS variable in the makefile. This will stop the errors you are seeing above from causing the compile to fail.
Another solution is to compile an earlier version of GCC and modify your PATH variable to use that instead.

If the compile still fails after modifying the CFLAGS as above, then disable treating warnings as errors. To do this there should be something like "-W -Wall" which you can remove, or adding "-Wno-error" to CFLAGS _i think_ will disable the treating of warnings as errors explicitly.

If you are compiling this code as part of building the PKGBUILD from the AUR here: http://aur.archlinux.org/packages.php?ID=31596 then you should notify the dev responsible for that package. Then they can release a fix. Otherwise, you should try the one from the AUR, it will probably be fixed to compile on arch.

Good luck

Offline

#3 2011-07-06 23:23:21

Sinn006
Member
Registered: 2011-07-04
Posts: 4

Re: Problems compiling at91 driver for samutils-0.2.1

Thank you for the reply, I noticed that the post below (its for Ubuntu) shows the gcc version to be 4.0.3
[link]http://www.makingthings.com/documentati … -sam7utils[/link]

I poked around the Makefile in /usr/src/linux-2.6.39 and got rid of "-Wall" and "-Wno-implicit-function-declaration"
it compiled with the following warnings:

make[1]: Entering directory `/usr/src/linux-2.6.39-ARCH'
  Building modules, stage 2.
  MODPOST 1 modules
WARNING: "info" [/home/bailey/Source/sam7utils-0.2.1/driver/at91.ko] undefined!
WARNING: "unlock_kernel" [/home/bailey/Source/sam7utils-0.2.1/driver/at91.ko] undefined!
WARNING: "lock_kernel" [/home/bailey/Source/sam7utils-0.2.1/driver/at91.ko] undefined!
WARNING: "usb_buffer_alloc" [/home/bailey/Source/sam7utils-0.2.1/driver/at91.ko] undefined!
WARNING: "usb_buffer_free" [/home/bailey/Source/sam7utils-0.2.1/driver/at91.ko] undefined!
  CC      /home/bailey/Source/sam7utils-0.2.1/driver/at91.mod.o
  LD [M]  /home/bailey/Source/sam7utils-0.2.1/driver/at91.ko
make[1]: Leaving directory `/usr/src/linux-2.6.39-ARCH'

but when I tried to install, the output was

insmod: error inserting 'at91.ko': -1 Unknown symbol in module

Unfortunately, I tried grabbing the package from the AUR, but I ran into the same issues. Seems the only common factor in this process is gcc.

Thanks for the help

Offline

#4 2011-07-06 23:57:13

Sinn006
Member
Registered: 2011-07-04
Posts: 4

Re: Problems compiling at91 driver for samutils-0.2.1

I'm attempting to build GCC 4.0.3 and try to compile the at91 driver with it-
Built GCC 4.0.3 - The same error exists...........

I did however notice this on my dmesg:

[424584.196740] at91: Unknown symbol usb_buffer_free (err 0)
[424584.197129] at91: Unknown symbol usb_buffer_alloc (err 0)
[428853.201593] conftest[23110]: segfault at 40 ip b7642068 sp bfec20c8 error 4 in libc-2.14.so[b761c000+162000]
[435876.147181] usb 2-2.1: usbfs: interface 0 claimed by cdc_acm while 'sam7' sets config #1
[435917.510802] conftest[24305]: segfault at 40 ip b75b3068 sp bf9fa7c8 error 4 in libc-2.14.so[b758d000+162000]
[440767.795587] at91: Unknown symbol info (err 0)
[440767.798380] at91: Unknown symbol unlock_kernel (err 0)
[440767.798894] at91: Unknown symbol lock_kernel (err 0)
[440767.800183] at91: Unknown symbol usb_buffer_free (err 0)
[440767.800582] at91: Unknown symbol usb_buffer_alloc (err 0)

I wonder if I missed a lib/package somewhere

Last edited by Sinn006 (2011-07-07 04:27:44)

Offline

#5 2011-07-07 23:03:46

Sinn006
Member
Registered: 2011-07-04
Posts: 4

Re: Problems compiling at91 driver for samutils-0.2.1

Well....... I googled this line from my dmesg

interface 0 claimed by cdc_acm while 'sam7' sets config #1

and found this little link here: http://lists.osmocom.org/pipermail/base … 00959.html
which says:

> usb 4-1: usbfs: interface 0 claimed by cdc_acm while 'sam7' sets config  
> #1

sam7 can talk to the device either by using libusb, or by utilizing the  
emulated
serial port of the Linux kernel.

You have compiled sam7 to use usb directly, so you have to rmmod usbserial  
and/or cdc_acm,
because they will block your attempts to talk to the device via libusb.  
This
is the error message you've seen in your kernel log.

(check io_libusb.c (usb) and io_posix.c (emulated serial port) in the  
sam7utils source code,
  it unfortunately provides very little feedback if things don't work out  
well)

so I decided to

sudo rmmod sam_ba
sudo rmmod cdc_acm

Turns out the whole time i was trying to compile the module (that never did compile) wasn't my problem at all.
either way, my board works. hmm

Offline

Board footer

Powered by FluxBB