Page 1 of 1

usb modeswitch integration in an ARM embedded device

Posted: 24 Jan 2012, 18:42
by mrDrosera
Dear all,

I'm trying to integrate the usb_modeswitch package in an embedded ARM device.
I've downloaded the precompiled static ARM binary from the homepage...it works.

Now I've added the udev rules taken from my ubuntu 11.04, this is also ok...when I plug my Vodafone Mobile device it's identified from udev that tries to launch the usb_modeswitch script...this is also ok.

usb_modeswitch script then tries to launch usb_modeswitch_dispatcher...this is what I'm missing.
I've tried to cross-compile it but at the moment I'm not able to do it...what do you suggest me?

Thank you very much!!!
Best regards.

mrD

Posted: 25 Jan 2012, 09:26
by Josh
If you are referring to the Ubuntu version of the dispatcher: this is a C port from the original source version which is a Tcl script. It is probably easier to use the script together with the ARM binary of the Tcl mini shell also available here.

http://www.draisberghof.de/usb_modeswit ... static.bz2

Either rename it to /usr/bin/tclsh or adapt the "usb_modeswitch" bash script that lies in /lib/udev and let it call "jimsh" instead of "tclsh".

There should be no problem with cross compiling jimsh yourself (e.g. for a non-static version). A quick search returned this from the developer's mailing list:

http://sqlite.org:8080/pipermail/jim-de ... 00597.html


Posted: 25 Jan 2012, 10:45
by mrDrosera
Hi Josh,

Thank you very much for your answer! I will try this static binary :-)

Posted: 25 Jan 2012, 19:41
by Josh
Using a script for the dispatcher is probably more flexible, if you need to do any adaptations for your target platform. And Tcl code is a lot easier to read than Bash code, IMHO.


Re: usb modeswitch integration in an ARM embedded device

Posted: 07 Feb 2012, 14:27
by axle
mrDrosera wrote:Dear all,

I'm trying to integrate the usb_modeswitch package in an embedded ARM device.
I've downloaded the precompiled static ARM binary from the homepage...it works.

Now I've added the udev rules taken from my ubuntu 11.04, this is also ok...when I plug my Vodafone Mobile device it's identified from udev that tries to launch the usb_modeswitch script...this is also ok.

usb_modeswitch script then tries to launch usb_modeswitch_dispatcher...this is what I'm missing.
I've tried to cross-compile it but at the moment I'm not able to do it...what do you suggest me?

Thank you very much!!!
Best regards.

mrD
I am also trying to do something similar except when I try to run the usb_modeswitch statis arm binary I get an error message "Illegal command"

I first install the usb_modeswitch data package on my board and then copy the arm binary file to the install folder. I then run chmod to make the file executable and try to run the file. Any ideas what I could be doing wrong?

Posted: 07 Feb 2012, 21:04
by Josh
Hmm, are you absolutely sure that your platform is ARM compatible? The error you are getting points to the processor command set.

Posted: 23 Feb 2012, 00:37
by ever_so
I'm trying to integrate usb_modeswitch into an ARM9 (armv4t architecture) device.

I have installed the Static Binary from the Download section, (wondering which arm architectures are 100% compatible with it). Also tried to install usb_modeswitch from the packages available at angstrom-distribution.org/repo, but they are a mix of libraries and binaries for different arm architectures (4t, 5, 6, even 7)...

All in all, when I run usb_switchmode, in either way, it only replies "Illegal Instruction"...

Please provide some more details on the compatibility issues for ARM. In case it is made for a higher architecture, is it possible that it is provided another static binary for lower ones?

Thank you so much.

Best Regards.

Posted: 25 Feb 2012, 00:56
by Josh
The cross compiler I used was part of a "scratchbox" installation, set to an ARMEL target. I did some developing for the (obsolete) Nokia N8x0 platform with it; these device use an OMAP ARM chip (from TI).

The binary offered here is reportedly working on Android devices. It's certainly not targeted at higher-end ARM CPUs.

If you have any SDK for your platform, it should not be too hard to compile libusb and usb_modeswitch yourself.