ts-7000
[Top] [All Lists]

Re: [ts-7000] libusb

To:
Subject: Re: [ts-7000] libusb
From: Dino Sbrocca <>
Date: Mon, 17 Jul 2006 13:31:37 -0400 (EDT)
Anand,

I don't have any experience developing drivers.  I haven't gotten to that point in my project yet.

Dino

Anand S Madhusoodanan <> wrote:
Hi,

I tried it and it worked great. Do you have any experience in working with libusb to develop drivers? I have connected an HP Printer to the board but then i use the bulk write function (the end point on the printer is a bulk end point). The return value of the write function indicates success (the no. of characters it wrote) but then I do not see a page being printed out. Could you tell me what I am doing wrong?

I do it as follows


usb_claim_interface();
usb_bulk_write()
usb_release_interface();

Looking forward to your replies.

Regards
Anand S Madhusoodanan

Dino Sbrocca <> wrote:
Anand,

Ftp the libusb-0.1.so.4 binary instead of the libusb-0.1.so.4.4.4 binary.   I put it in the /lib directory on the TS7260.

Dino

Anand S Madhusoodanan <> wrote:
Dino,

I have the following files in my .libs directory.

descriptors.o
error.o
 libusb-0.1.so.4.4.4
libusb-0.1.so.4.4.4
libusb.a
libusb.la -> ../libusb.la
libusb.lai
libusbpp-0.1.so.4 -> libusbpp-0.1.so.4.4.4
libusbpp-0.1.so.4.4.4
libusbpp-0.1.so.4.4.4T
libusbpp.a
libusbpp.la -> ../libusbpp.la
libusbpp.lai
 libusbpp-0.1.so.4.4.4
 libusb-0.1.so.4.4.4
linux.o
usb.o
usbpp.o


I did things the same way you had done but once I ftp the file ( libusb-0.1.so.4.4.4). when I try to execute my program on the board it says

"error while loading shared libraries: libusb-0.1.so.4: cannot open shared object file: No such file or directory". The libusb-0.1.so.4.4.4 file and the program are in the same directory.

Is there something that I am doing wrong??

Please do let me know

Regards
Anand S Madhusoodanan

Dino Sbrocca <> wrote:
Anand,

I have achieved some level of success. 

1. I re-installed my cross toolchain from the TS web site    (ftp://ftp.embeddedarm.com/ts-arm-linux-cd/cross-toolchains/crosstool-linux-gcc-3.3.4-glibc-2.3.2-0.28rc39.tar.bz2)
2. I downloaded and unpacked the latest source for libusb (http://prdownloads.sourceforge.net/libusb/libusb-0.1.12.tar.gz)
3. I ran the following configure command.  The problem with the command that I sent to you previously was that it wasn't overriding the c++ compiler which is now required by version 0.1.12.  The old command caused the make utility to use the native c++ compiler.  ( CC=arm-linux-gcc CXX=arm-linux-gcc ./configure --prefix=/usr/local/opt/crosstool/arm-linux/gcc-3.3.4-glibc-2.3.2/arm-linux --program-prefix=arm-linux- --host=arm-pc-linux-gnu)
4. I ran the make command (make).  This command will successfully compile all of the libusb core code and fail when it tries to compile the libusb test programs.  I ignored the test programs.
5. I adopted root authority (su)
6. I added the cross compiler to my path.  The new install process performs a compile.   (PATH=$PATH:/usr/local/opt/crosstool/arm-linux/gcc-3.3.4-glibc-2.3.2/bin)
7. I ran the install (make install).  This command will successfully install all core libusb objects and fail when it tries to install the libusb test programs.  I ignored the test programs.
8.  I ftp'ed the libusb-0.1.so.4 file over to the /lib directory on the TS7260.
9. I cross compiled my test program and tested it on the TS7260.  It worked.

I will continue to investigate the failure of the libusb test programs.

Dino Sbrocca <> wrote:
Anand,

I downloaded the libusb source and tried to cross compile it from scratch on my SUSE linux host.  It failed.

The .so binary that I have installed in my cross compile environment and on my TS7260 is libusb-0.1.4.4.0.  This is an older version of libusb than the one I downloaded.  I do not have the original source that I used.  I will never make that mistake again.

I'll start over from scratch now and contact the libusb mailing list for help.  I'll keep detailed notes and send them to you when it works.

Dino

Anand S Madhusoodanan <> wrote:
Hi Dino,

I tried out the things you had mentioned in your previoue email. They worked until I typed in the make command.

At the make command it gave me an error saying it could not read the
.so file.

"libusb.so: could not read symbols: File in wrong format"

The exact mesage is pasted above.

Is there is a problem with the version of software that I am using? I had downloaded the Linux Crosstool gcc-3.3.4-glibc-2.3.2 -- 0.28rc39 (11-3-2004) from the website.

I look forward to your comments.

Regards
Anand S Madhusoodanan





Dino Sbrocca <> wrote:
I use libusb to communicate with a USB interface chip to a 1-Wire network.  I'm certainly not a linux expert but, the following may help.

To install libusb on the TS7260 I downloaded the source to libusb to a host linux machine and cross compiled it using the following commands:

CC=arm-linux-gcc ./configure --prefix=/usr/local/opt/crosstool/arm-linux/gcc-3.3.4-glibc-2.3.2/arm-linux --program-prefix=arm-linux- --host=arm-pc-linux-gnu
make
make install

I then ftp'ed the .so file to the TS7260 and set the proper authorities.

To run a test program, I first load the USB modules on the TS7260 with TS's /usr/bin/loadUSBModules.sh script and then mount the USB file system with the following command:

mount -t usbdevfs none /proc/bus/usb

The test program was cross compiled on the host and then ftp'ed to the TS7260.  The test program just reads through the buses and devices recognized by the kernal and dumps them to the console.  It's a reasonably good test that you've loaded all the software properly.  Send me an e-mail if you want the source.

Dino





  

Anand S Madhusoodanan <> wrote:
Hi,

Has anyone used libusb on the TS7260? Any comments on how to go about using that package on the board would be greatly appreciated.

Regards
Anand S Madhusoodanan
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com



Yahoo! Music Unlimited - Access over 1 million songs. Try it free.




Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+ countries) for 2�/min or less.



Yahoo! Music Unlimited - Access over 1 million songs. Try it free.

__._,_.___


SPONSORED LINKS
Linux os Hardware Arms
Computer internet Computer security Computer hardware security


YAHOO! GROUPS LINKS

  •  Visit your group "ts-7000" on the web.
     
  •  To unsubscribe from this group, send an email to:
     =Unsubscribe
     
  •  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



__,_._,___
<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU