Automatic Activation, Hotplug and UDEV, Configuration
Post Reply
mrDrosera
Posts: 2
Joined: 24 Jan 2012, 18:34

usb modeswitch integration in an ARM embedded device

Post by mrDrosera » 24 Jan 2012, 18:42

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

Josh
Site Admin
Posts: 6593
Joined: 03 Nov 2007, 00:30

Post by Josh » 25 Jan 2012, 09:26

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


mrDrosera
Posts: 2
Joined: 24 Jan 2012, 18:34

Post by mrDrosera » 25 Jan 2012, 10:45

Hi Josh,

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

Josh
Site Admin
Posts: 6593
Joined: 03 Nov 2007, 00:30

Post by Josh » 25 Jan 2012, 19:41

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.


axle
Posts: 1
Joined: 07 Feb 2012, 14:23
Location: sweden

Re: usb modeswitch integration in an ARM embedded device

Post by axle » 07 Feb 2012, 14:27

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?

Josh
Site Admin
Posts: 6593
Joined: 03 Nov 2007, 00:30

Post by Josh » 07 Feb 2012, 21:04

Hmm, are you absolutely sure that your platform is ARM compatible? The error you are getting points to the processor command set.

ever_so
Posts: 1
Joined: 23 Feb 2012, 00:11

Post by ever_so » 23 Feb 2012, 00:37

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.

Josh
Site Admin
Posts: 6593
Joined: 03 Nov 2007, 00:30

Post by Josh » 25 Feb 2012, 00:56

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.


Post Reply