Topic: Installing Scratchbox difficulties

Hello,

I having difficulty installing scratchbox on an Ubuntu 10.4 system, x86_64.  I am using the instructions found in the wiki.  I could not install scratchbox-devkit-cputransp -- it doesn't seem to be part of the current 'stable' environment.  I checked around, and it seems that the the current stable is 'hathor' while the older 'apophis' has the cputransp devkit, and 'hathor' doesn't.  HOWEVER -- apophis only seems to have i386 binaries, as shown in the following message from apt-get:

W: Failed to fetch http://scratchbox.org/debian/dists/apop … ackages.gz  404  Not Found

So: am I correct that I cannot use scratchbox on my development machine?  someone has to first make scratchbox-devkit-cputransp available?

What other choices would I have to do development with libusb and libhid?  Is there a public available server I can get onto to do development, for instance?

Thanks!

wayn3w

Re: Installing Scratchbox difficulties

I ran into the same problem. I ended up running Virtualbox and installing Ubuntu 9.04 in 32-bit mode in a VM. Installed scratchbox apophis instead of stable(hathor).

An easier option is to install the GNU Toolchain, cross-compile libusb, then cross-compile the usb driver.

Get and unpack the latest libusb source code (libusb-1.0.8). Cross-compile to ARM code. Note do not copy libusb shared object to the chumby since it is already there. It is needed only to link with in the next step.

wget ..
tar xf ...
cd libusb-1.0.8
./configure --host=arm-linux --prefix=/home/me/libusb-1.0.8/install
make
make install

Cross-compile my usb driver, linking with the shared library from the previous step.

cd ~/mydvr
arm-linux-gcc -O2 -Wall mydvr.c -I ~/libusb-1.0.8/install/include -o mydvr -L ~/libusb-1.0.8/install/lib -lusb-1.0
arm-linux-strip mydvr
scp mydvr root@chumby1:/mnt/storage/usr/local/bin

If there is an easier way to do this, please let me know.

mmauka

3 (edited by wayn3w 2010-07-24 14:26:04)

Re: Installing Scratchbox difficulties

Thank you mmauka; if I run into dead ends, I'll go down your route.

I got it working by using the instructions in the Chumby wiki but instead of using cputransp I used qemu; I found a hint in the Scratchbox wiki for Hathor r1:

* Use scratchbox-qemu-devkit for the latest qemu instead of scratchbox-cputransp-devkit.

I also had to use a different ARM emulator since qemu-arm-cvs-m wasn't available; I think I chose qemu-arm-sb.

With these, I was able to compile and install libusb-0.1.12 and libhid-0.2.16, and compile test_libhid.  In scratchbox on my laptop I was able to get it to work, and somewhat work on the Chumby when I copied the executable and the libraries and set up the LD_LIBRARY_PATH.  "Hello World" works as well as test_libhid, with the latter, I have questions I'll post about separately.

Re: Installing Scratchbox difficulties

Running ./test_libhid to find my USB device, I get the following:

chumby:/mnt/usb# export USB_DEBUG=10
chumby:/mnt/usb# ./test_libhid 
 NOTICE: hid_init(): libhid 0.2.16.0.0 is being initialized.
  TRACE: hid_init(): initialising USB subsystem...
usb_set_debug: Setting debugging level to 10 (on)
usb_os_init: No USB VFS found, is it mounted?
  TRACE: hid_init(): scanning for USB busses...
USB error: couldn't opendir(): No such file or directory
  ERROR: hid_init(): failed to scan for USB busses
hid_init failed with return code 4
chumby:/mnt/usb#

This happens with the installed libusb and the one I compile above.  Looking into the USB code I see the issue is that it is looking for the USB VFS directory structure, such /dev/bus/usb or /proc/bus/usb, neither of which is found on the Chumby (well, /proc/bus/usb is there, but is empty).

I feel like I missing something if the installed libusb is producing messages saying it can't find the USB filesystem.  What must be done to make libusb work?  Were there any Chumby software that was build with libusb so I can use it as an example?

Thanks,

Wayne

Re: Installing Scratchbox difficulties

Try:

mount none /proc/bus/usb -tusbfs

Re: Installing Scratchbox difficulties

Thanks ChumbyLurker!  That did it.

Was there some documentation about USB hacking I missed?  I couldn't find this on the wiki.

Thanks!

wayn3w