LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-20-2009, 01:31 PM   #1
DEF.
Member
 
Registered: Apr 2009
Posts: 96

Rep: Reputation: 23
Unhappy usb serial driver failing when calling "usb_submit_urb" - why?


I have a Sierra Wireless Compass 888 USB modem running on Linux: host is a Ubuntu 8.04 and Target is an embedded target (ARM variant). Both the host and target are running kernel 2.6.24.23.

Now, at this time I am not in a position to get a) vendor support for the embedded target and b_ support for the vendor support for the modem. So I am hoping someone can help point me in the right direction on how to debug this problem.

So... the modem works fine on the host. I cross-compile the same driver code for the target and all compiles well (using the target supplied environment/tool-chain). At this stage the only noted differences are that my target as default has it's usb-serial driver 'built-in' and is thus not a kernel module (other than the host is x86 and the target is ARM (+any other platform difference) ). So after compiling I have a sierra.ko (this is the modem driver - it is dependent on the usbserial and the usbcore modules.

On bootup I can see the correct modem driver version is loaded.

When plugging in the modem I see all the expected USB/serial port and identified.

So I decide to send the modem a command (signal strength) as follows:

echo 'AT+CSQ' > dev/ttyUSB3

and the following error is displayed at the terminal

"write error: Cannot allocate memory"

and the system is hung until I unplug the modem.

The debug output is as follows:

"sierra ttyUSB2: sierra_open: submit urb 1 failed (-12) 4096
sierra ttyUSB2: sierra_open: submit urb 2 failed (-12) 4096
sierra ttyUSB2: sierra_open: submit urb 3 failed (-12) 4096
sierra ttyUSB2: sierra_open: submit urb 4 failed (-12) 4096
sierra ttyUSB2: sierra_open: submit urb 5 failed (-12) 4096
sierra ttyUSB2: sierra_open: submit urb 6 failed (-12) 4096
sierra ttyUSB2: sierra_open: submit urb 7 failed (-12) 4096
sierra ttyUSB2: sierra_write - usb_submit_urb(write bulk) failed with status = -12"



Any one any ideas how I can begin to debug this? I know the usb_submit_urb() function in the sierra driver is failing. I know it because it can't allocate memory, but I don't know why?

Is it maybe a cross compile problem? I don't know if this driver has been built for ARM yet?

Any help appreciated.....................
 
Old 04-22-2009, 04:17 AM   #2
greplinux
Member
 
Registered: Jun 2007
Posts: 118

Rep: Reputation: 17
Quote:
So I decide to send the modem a command (signal strength) as follows:

echo 'AT+CSQ' > dev/ttyUSB3
Quote:

sierra ttyUSB2: sierra_open: submit urb 7 failed (-12) 4096
I see that you are issuing AT command to "/dev/ttyUSB3" and getting error for "ttyUSB2". That seems odd to me. Could you please recheck the connection procedures.

URB- stands for USB request Blocks which is the basic data structure used for communication in USB protocol. So for any USB communication this is needed, without this USB transaction is impossible.

usb_submit_urb - This function actually submits the URB to the kernel for using it in USB communication. Since it is failing, it is not possible for communicate using USB protocol.

Hope this helps

Thanks,
 
Old 04-28-2009, 07:38 AM   #3
DEF.
Member
 
Registered: Apr 2009
Posts: 96

Original Poster
Rep: Reputation: 23
Oh I am really sorry for taking so long to reply and also the original email contains a mistake as the port used is /dev/ttyUSB3 and the message should read as follows:

"sierra ttyUSB3: sierra_open: submit urb 1 failed (-12) 4096
sierra ttyUSB3: sierra_open: submit urb 2 failed (-12) 4096
sierra ttyUSB3: sierra_open: submit urb 3 failed (-12) 4096
sierra ttyUSB3: sierra_open: submit urb 4 failed (-12) 4096
sierra ttyUSB3: sierra_open: submit urb 5 failed (-12) 4096
sierra ttyUSB3: sierra_open: submit urb 6 failed (-12) 4096
sierra ttyUSB3: sierra_open: submit urb 7 failed (-12) 4096
sierra ttyUSB3: sierra_write - usb_submit_urb(write bulk) failed with status = -12"

Now error (-12) is 'out of memory' but the device has plenty of free memory. Does it require the memory to be configured in a specific way?
 
Old 05-28-2009, 10:25 AM   #4
DEF.
Member
 
Registered: Apr 2009
Posts: 96

Original Poster
Rep: Reputation: 23
Hmm, it looks like a problem with my USB host driver ox... and bulk transfers.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ns:"error when calling class OldSim"&tclsh:"invalid command+child process exits abn." shojaru Linux - Newbie 0 03-05-2009 04:23 AM
I can't connect serial-usb adaptor because it is "busy" michalodstrcil Linux - Hardware 1 01-02-2009 09:41 PM
pl2303 attached to ttyUSB0 but driver attached to device is "serial" sheeluh Linux - Software 4 03-12-2007 04:27 AM
odd recursion: calling "by hand" vs calling by cronscript... prx Programming 4 02-12-2005 04:59 PM
Writing to "/dev/usb/hiddev*" and to "/proc/bus/usb/00B/00S" throw an arror EI stpg Programming 0 07-14-2004 05:44 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:25 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration