usbserial.ko

1,472 views
Skip to first unread message

Donna

unread,
Oct 11, 2011, 10:36:36 PM10/11/11
to linuxstamp
So I am trying to get a GSM modem to work on the linux stamp board. I
have used this modem on ubuntu using wvdial, but I had to put in a
modprobe usbserial command to get it to recognize the modem. once I
did that wvdial worked fine

On this board however, there was no usbserial.ko, I got that to
compile and when I do a dmesg I see this:
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
at91_ohci at91_ohci: AT91 OHCI
at91_ohci at91_ohci: new USB bus registered, assigned bus number 1
at91_ohci at91_ohci: irq 23, io mem 0x00300000
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
usbcore: registered new interface driver usblp
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
usbcore: registered new interface driver usbserial
usbserial: USB Serial Driver core
mice: PS/2 mouse device common for all mice


as well as a lot of other information of course. also it says this
usb 1-1: new full speed USB device using at91_ohci and address 2
usb 1-1: config 1 has an invalid interface number: 6 but max is 5
usb 1-1: config 1 has an invalid interface number: 7 but max is 5
usb 1-1: config 1 has an invalid interface number: 7 but max is 5
usb 1-1: config 1 has no interface number 3
usb 1-1: config 1 has no interface number 5
usb 1-1: configuration #1 chosen from 1 choice

That is all good, when I do a modprobe -l I see this:
sh-3.2# modprobe -l
/lib/modules/2.6.28.3/kernel/drivers/hid/hid-dummy.ko
/lib/modules/2.6.28.3/kernel/drivers/scsi/scsi_wait_scan.ko
/lib/modules/2.6.28.3/kernel/drivers/net/wireless/rt2x00/rt73usb.ko
/lib/modules/2.6.28.3/kernel/drivers/net/wireless/rt2x00/rt2x00usb.ko
/lib/modules/2.6.28.3/kernel/drivers/net/wireless/rt2x00/rt2x00lib.ko
/lib/modules/2.6.28.3/kernel/drivers/usb/serial/ftdi_sio.ko
/lib/modules/2.6.28.3/kernel/sound/core/snd-rawmidi.ko
/lib/modules/2.6.28.3/kernel/sound/core/snd-pcm.ko
/lib/modules/2.6.28.3/kernel/sound/core/snd-hwdep.ko
/lib/modules/2.6.28.3/kernel/sound/core/snd-page-alloc.ko
/lib/modules/2.6.28.3/kernel/sound/core/snd-timer.ko
/lib/modules/2.6.28.3/kernel/sound/core/snd.ko
/lib/modules/2.6.28.3/kernel/sound/usb/snd-usb-audio.ko
/lib/modules/2.6.28.3/kernel/sound/usb/snd-usb-lib.ko

usbserial no where to be found. hmmm. Also I see ftdi there, but when
I plug in an FTDI device, it does not recognize it.

Does anyone know if there are some other configuration files that need
to be tampered with to make it work? I put the modprobe command into /
etc/modules but that did not seem to work. Also, insmod usbserial does
not seem to work either,

I am stumped.





Paul Thomas

unread,
Oct 11, 2011, 11:11:41 PM10/11/11
to linux...@googlegroups.com
Normally with USB devices the modules should automatically be loaded.
However if you haven't done a 'make modules_install' this isn't the
case.

/lib/modules/linux-X is set up so that modprobe and udev know some
more info about the modules (specifically for modprobe
/lib/modules/linux-X/modules.dep).

So without that set up insmod is the only tool that will work. So if
you go to the directory where the .ko file is and do 'insmod
usbserial' what do you get?

Also when using /etc/modules you just list the module names there is
no need to add a modprobe before the name, but again that depends on
the modules_install.

To do kernel development I would suggest getting a proper NFS setup
with a tftpboot for the kernel.

thanks,
Paul

So I think that means you need to select some other option under
usbserial did you choose "generic serial driver"? If you want to load
the module manually you need to

> --
> You received this message because you are subscribed to the Google Groups "linuxstamp" group.
> To post to this group, send email to linux...@googlegroups.com.
> To unsubscribe from this group, send email to linuxstamp+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/linuxstamp?hl=en.
>
>

Donna

unread,
Oct 11, 2011, 11:43:26 PM10/11/11
to linuxstamp
hmmm, I may have to do the make modules_install, I saw that in the
instructions, but that would also recompile the vmlinux, yes ? No
problem there, just need to know to reflash that, eventually.

I have NFS and TFTboot going, that is no problem there. Also, I
checked and I just put in the same command in /etc/modules that worked
in Ubutu:
usbserial vendor=0x1410 product=0xB001
without the modprobe, you only do that if you are already up and
going.

I also tried the insmod usbserial.ko vendor=0x1410 product=0xB001
sh-3.2# insmod usbserial.ko vendor=0x1410 product=0xB001
usbserial: module is already loaded
insmod: error inserting 'usbserial.ko': -1 Invalid parameters

is says that it is already loaded, interesting because it does not
show up with the modprobe -l.

Not sure what to try next guess I will try the make modules_install
next.
> > For more options, visit this group athttp://groups.google.com/group/linuxstamp?hl=en.- Hide quoted text -
>
> - Show quoted text -

Paul Thomas

unread,
Oct 11, 2011, 11:51:18 PM10/11/11
to linux...@googlegroups.com
OK if you have the NFS going this is easy, you just need to point make
modules_install to your NFS root, something like:
'make ARCH=arm CROSS_COMPILE=arm-linux-
INSTALL_MOD_PATH=/path_to_nfs_root/ modules_install'

Then run a 'depmod' command on the linuxstamp to fix up the paths, and
it should load automatically through udev when you plug in the device.

thanks,
Paul

Donna

unread,
Oct 12, 2011, 12:13:18 AM10/12/11
to linuxstamp
I guess I can maybe try that as a test but my goal is for it to run
untethered, that is wireless, it's connectectivity will come from the
GSM modem, so it sort of needs to work straight away on boot up.

So for now, I did this
make ARCH=arm CROSS_COMPILE=arm-linux- modules_install
INSTALL_MOD_PATH='a place on host'/lib

it seemed to work and made all the files, I think what I do now is
just copy the files: modules.*
to /lib/modules/2.6/28.3/kernel as well as the .ko's farther down in
the directory tree
then run the
depmod

I am working on that now, just thought if you are on line, run the
plan by you. Will do the NFS if need be.

THANK YOU !!!!
> >> > For more options, visit this group athttp://groups.google.com/group/linuxstamp?hl=en.-Hide quoted text -

Paul Thomas

unread,
Oct 12, 2011, 12:18:09 AM10/12/11
to linux...@googlegroups.com
Yeah that should work. I normally just tar up the whole directory and
then untar in the linuxstamp (might help with the permissions).

The root nfs is just a test environment until you get things working.

thanks,
Paul

Мал Скрылёв

unread,
Oct 12, 2011, 1:40:59 AM10/12/11
to linux...@googlegroups.com
2011/10/12 Donna <donna....@gmail.com>:

> So for now, I did this
> make ARCH=arm CROSS_COMPILE=arm-linux- modules_install
> INSTALL_MOD_PATH='a place on host'/lib
>
> it seemed to work and made all the files, I think what I do now is
> just copy the files: modules.*
> to /lib/modules/2.6/28.3/kernel as well as the .ko's farther down in
> the directory tree
> then run the
> depmod
>
No depmod is needed for 2.6 kernel.
Try to compile the usbserial module into the kernel.

--
Малъ Зануда, Скрылёвъ сынъ

Donna

unread,
Oct 12, 2011, 2:09:12 AM10/12/11
to linuxstamp
It looks promising:

sh-3.2# modprobe -l
kernel/drivers/scsi/scsi_wait_scan.ko
kernel/drivers/usb/serial/usbserial.ko
kernel/drivers/usb/serial/cp2101.ko
kernel/drivers/usb/serial/ftdi_sio.ko
kernel/drivers/usb/serial/pl2303.ko
kernel/drivers/hid/hid-dummy.ko
sh-3.2#

sh-3.2# ls -l
total 168
-rwxr-xr-x 1 root root 18572 Oct 12 2011 cp2101.ko
-rw-r--r-- 1 root root 78306 Oct 12 2011 ftdi_sio.ko
-rwxr-xr-x 1 root root 24129 Oct 12 2011 pl2303.ko
-rw-r--r-- 1 root root 37167 Oct 12 2011 usbserial.ko
sh-3.2# pwd
/lib/modules/2.6.28.3/kernel/drivers/usb/serial
sh-3.2#

It does not seem like it is working though, it should make some
devices /dev/ttyUSB0, /dev/ttyUSB1, /dev/ttyUSB2, /dev/ttyUSB3,
I tried doing a mknod /dev/ttyUSB0 c 188 0, but nothing seems to
respond to that device

I am stumped.
> >> >> > For more options, visit this group athttp://groups.google.com/group/linuxstamp?hl=en.-Hidequoted text -

Donna

unread,
Oct 12, 2011, 2:10:08 AM10/12/11
to linuxstamp
hmm, might have to try that I guess. but it seems like something else
might be messed up. Not sure, it should work a s a module. but, I am
running out of things to look at. :(

On Oct 11, 10:40 pm, Мал Скрылёв <3ah...@gmail.com> wrote:
> 2011/10/12 Donna <donna.pol...@gmail.com>:> So for now, I did this

Paul Thomas

unread,
Oct 12, 2011, 2:40:22 AM10/12/11
to linux...@googlegroups.com
I bet you need another sub driver. Can you check on your working
system and see what other driver is using usbserial, for instance
(snippet from lsmod):
Module Size Used by
...
usbserial 34384 3 ftdi_sio
...

Where ftdi_sio is another kernel module. There's a ton of these under
usb serial converters; you can always choose all of them and let udev
sort it out.

Also unless you don't have udev installed you'll want and remove the
nodes you made yourself.

thanks,
Paul


2011/10/11 Donna <donna....@gmail.com>:

Donna

unread,
Oct 12, 2011, 3:18:13 AM10/12/11
to linuxstamp
sh-3.2# lsmod
Module Size Used by
sh-3.2#

Nothin there, hmmm

I did a rm -f /dev/ttyUSB0 to get rid of that previous hail mary

well, try again tomorrow....


On Oct 11, 11:40 pm, Paul Thomas <pthomas8...@gmail.com> wrote:
> I bet you need another sub driver. Can you check on your working
> system and see what other driver is using usbserial, for instance
> (snippet from lsmod):
> Module                  Size  Used by
> ...
> usbserial              34384  3 ftdi_sio
> ...
>
> Where ftdi_sio is another kernel module. There's a ton of these under
> usb serial converters; you can always choose all of them and let udev
> sort it out.
>
> Also unless you don't have udev installed you'll want and remove the
> nodes you made yourself.
>
> thanks,
> Paul
>
> 2011/10/11 Donna <donna.pol...@gmail.com>:
>
>
>
> > hmm, might have to try that I guess. but it seems like something else
> > might be messed up. Not sure, it should work a s a module. but, I am
> > running out of things to look at. :(
>
> > On Oct 11, 10:40špm, íÁÌ óËÒÙÌ£× <3ah...@gmail.com> wrote:
> >> 2011/10/12 Donna <donna.pol...@gmail.com>:> So for now, I did this
> >> > make ARCH=arm CROSS_COMPILE=arm-linux- modules_install
> >> > INSTALL_MOD_PATH='a place on host'/lib
>
> >> > it seemed to work and made all the files, I think what I do now is
> >> > just copy the files: modules.*
> >> > to /lib/modules/2.6/28.3/kernel as well as the .ko's farther down in
> >> > the directory tree
> >> > then run the
> >> > depmod
>
> >> No depmod is needed for 2.6 kernel.
> >> Try to compile the usbserial module into the kernel.
>
> >> --
> >> íÁÌß úÁÎÕÄÁ, óËÒÙÌ£×ß ÓÙÎß
>
> > --
> > You received this message because you are subscribed to the Google Groups "linuxstamp" group.
> > To post to this group, send email to linux...@googlegroups.com.
> > To unsubscribe from this group, send email to linuxstamp+...@googlegroups.com.

Мал Скрылёв

unread,
Oct 12, 2011, 5:59:46 AM10/12/11
to linux...@googlegroups.com
12 октября 2011 г. 10:10 пользователь Donna <donna....@gmail.com> написал:

> hmm, might have to try that I guess. but it seems like something else
> might be messed up. Not sure, it should work a s a module. but, I am
> running out of things to look at. :(
>

First, make sure that the use-to-serial functionality works correctly
as embedded. then you will investigate the problem.

Paul Thomas

unread,
Oct 12, 2011, 10:49:42 AM10/12/11
to linux...@googlegroups.com
Not on the linuxstamp, it works on your desktop or something right?
try that command there.

thanks,
Paul

Donna

unread,
Oct 12, 2011, 6:15:42 PM10/12/11
to linuxstamp
Yes, I use this same wireless GSM modem on Ubuntu all the time, works
like a champ. Basically it looks to Linux like a general purpose
serial device on ttyUSB0 (it actually has 4 total ttyUSB's, the others
do things like report signal strength, take GPS NEMA etc). Anyhoo,
you give it AT type commands, there are actually special ones for
wireless, once connected then pppd kicks in and you are off and
running. wvdial automates it, but actually you can do it with a script
too I think.

The same modem will show up as a COM port if you shove it into a
windows PC.

One thing I noticed, I was scanning the config file, I may have
something messed up in here,
#
# USB Serial Converter support
#
CONFIG_USB_SERIAL=m
CONFIG_USB_SERIAL_GENERIC=y
CONFIG_USB_SERIAL_PL2303=m
CONFIG_USB_SERIAL_CP2101=m
CONFIG_USB_SERIAL_FTDI_SIO=m

Maybe they should all be m ?


I was thinking of just putting my whole config file in here, I don't
see a way to attach a file. Anyway I am using the ebcat91_defconfig
file as recommended in the open circuits web site. I just modified
the USB serial part and left everything else as is.
> >> > For more options, visit this group athttp://groups.google.com/group/linuxstamp?hl=en.-Hide quoted text -

Donna

unread,
Oct 12, 2011, 6:17:26 PM10/12/11
to linuxstamp
Actually I am not sure the usbserial function is working on the board,
I also tried an FTDI usb and it did not respond either.

On Oct 12, 2:59 am, Мал Скрылёв <3ah...@gmail.com> wrote:
> 12 октября 2011 г. 10:10 пользователь Donna <donna.pol...@gmail.com> написал:

Paul Thomas

unread,
Oct 12, 2011, 6:21:09 PM10/12/11
to linux...@googlegroups.com
Yes the ftdi needs the ftdi_sio module as well. That's why you need to
do the lsmod on on your ubuntu machine so you can see the modules that
are using usbserial.

It's very dangerous to edit the .config file directly. I would use
xconfig or menuconfig to do that ('make ARCH=arm
CROSS_COMPILE=arm-linux- xconfig'). I think this will be much clearer
once you see the configuration from xconfig, it's a fairly nice
interface.

thanks,
Paul

2011/10/12 Donna <donna....@gmail.com>:

Donna

unread,
Oct 12, 2011, 6:29:24 PM10/12/11
to linuxstamp
Is there something simple that you have used on the USB host port
before that I could plug in to verify functioning? Keyboard ? If
enable the HID for keyboard can is shows up as something in /dev can I
just 'cat /dev/hibkbd' or something like that? Or maybe an FTDI USB
dongle or something. ???

On Oct 12, 7:49 am, Paul Thomas <pthomas8...@gmail.com> wrote:
> >> > For more options, visit this group athttp://groups.google.com/group/linuxstamp?hl=en.-Hide quoted text -

Paul Thomas

unread,
Oct 12, 2011, 6:33:22 PM10/12/11
to linux...@googlegroups.com
The mass storage is enabled, so a thumb drive will work. If you want
to test the FTDI chip just add the ftdi_sio module.

thanks,
Paul

Donna

unread,
Oct 12, 2011, 11:16:07 PM10/12/11
to linuxstamp
Interesting, below is what I got by trying both a usbstick and FTDI
dongle,
USB Stick seemed to work, although, I could not find /dev/sda1
FTDI stick did not work either, see below, Both work perfectly on
Ubuntu (of course)

It seems like something is missing ?


-------------------------------------------------------------------------------------------------
FTDI Dongle
-------------------------------------------------------------------------------------------------
sh-3.2# usb 1-1: new full speed USB device using at91_ohci and address
7
usb 1-1: configuration #1 chosen from 1 choice

sh-3.2# ls /dev
agpgart fd mem mixer3 ram12 ram9 sndstat tty7
audio full midi0 mpu401data ram13 random stderr tty8
audio1 initctl midi00 mpu401stat ram14 rmidi0 stdin tty9
audio2 kmem midi01 null ram15 rmidi1 stdout
ttyS0
audio3 loop0 midi02 port ram16 rmidi2 tty
urandom
audioctl loop1 midi03 ptmx ram2 rmidi3 tty0
xconsole
console loop2 midi1 pts ram3 sequencer tty1 zero
core loop3 midi2 ram ram4 shm tty2
dsp loop4 midi3 ram0 ram5 smpte0 tty3
dsp1 loop5 mixer ram1 ram6 smpte1 tty4
dsp2 loop6 mixer1 ram10 ram7 smpte2 tty5
dsp3 loop7 mixer2 ram11 ram8 smpte3 tty6
sh-3.2#
sh-3.2# lsmod
Module Size Used by
sh-3.2# modprobe -l
kernel/drivers/scsi/scsi_wait_scan.ko
kernel/drivers/usb/serial/usbserial.ko
kernel/drivers/usb/serial/cp2101.ko
kernel/drivers/usb/serial/ftdi_sio.ko
kernel/drivers/usb/serial/pl2303.ko
kernel/drivers/hid/hid-dummy.ko
sh-3.2# usb 1-1: USB disconnect, address 7

-------------------------------------------------------------------------------------------------





-------------------------------------------------------------------------------------------------
USBSTICK
-------------------------------------------------------------------------------------------------
usb 1-1: new full speed USB device using at91_ohci and address 6
usb 1-1: configuration #1 chosen from 1 choice
scsi2 : SCSI emulation for USB Mass Storage devices
scsi 2:0:0:0: Direct-Access USB DISK 2.0 PMAP PQ: 0
ANSI: 0 CCS
sd 2:0:0:0: [sda] 2015232 512-byte hardware sectors: (1.03 GB/984 MiB)
sd 2:0:0:0: [sda] Write Protect is off
sd 2:0:0:0: [sda] Assuming drive cache: write through
sd 2:0:0:0: [sda] 2015232 512-byte hardware sectors: (1.03 GB/984 MiB)
sd 2:0:0:0: [sda] Write Protect is off
sd 2:0:0:0: [sda] Assuming drive cache: write through
sda: sda1
sd 2:0:0:0: [sda] Attached SCSI removable disk
sd 2:0:0:0: Attached scsi generic sg0 type 0

sh-3.2# ls /dev
agpgart fd mem mixer3 ram12 ram9 sndstat tty7
audio full midi0 mpu401data ram13 random stderr tty8
audio1 initctl midi00 mpu401stat ram14 rmidi0 stdin tty9
audio2 kmem midi01 null ram15 rmidi1 stdout
ttyS0
audio3 loop0 midi02 port ram16 rmidi2 tty
urandom
audioctl loop1 midi03 ptmx ram2 rmidi3 tty0
xconsole
console loop2 midi1 pts ram3 sequencer tty1 zero
core loop3 midi2 ram ram4 shm tty2
dsp loop4 midi3 ram0 ram5 smpte0 tty3
dsp1 loop5 mixer ram1 ram6 smpte1 tty4
dsp2 loop6 mixer1 ram10 ram7 smpte2 tty5
dsp3 loop7 mixer2 ram11 ram8 smpte3 tty6
sh-3.2#
-------------------------------------------------------------------------------------------------
> >> >> > For more options, visit this group athttp://groups.google.com/group/linuxstamp?hl=en.-Hidequoted text -
>
> >> >> - Show quoted text -
>
> >> > --
> >> > You received this message because you are subscribed to the Google Groups "linuxstamp" group.
> >> > To post to this group, send email to linux...@googlegroups.com.
> >> > To unsubscribe from this group, send email to linuxstamp+...@googlegroups.com.
> >> > For more options, visit this group athttp://groups.google.com/group/linuxstamp?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups "linuxstamp" group.
> > To post to this group, send email to linux...@googlegroups.com.
> > To unsubscribe from this group, send email to linuxstamp+...@googlegroups.com.
> > For more options, visit this group athttp://groups.google.com/group/linuxstamp?hl=en.- Hide quoted text -

Paul Thomas

unread,
Oct 13, 2011, 1:14:33 AM10/13/11
to linux...@googlegroups.com
Here's what I get from dmesg when plugging in an FTDI cable with the
proper modules on the 9g20 board with 2.6.36 with the latest emdebian.

thanks,
Paul

usb 1-1: new full speed USB device using at91_ohci and address 2


usbcore: registered new interface driver usbserial

USB Serial support registered for generic
usbcore: registered new interface driver usbserial_generic


usbserial: USB Serial Driver core

USB Serial support registered for FTDI USB Serial Device
ftdi_sio 1-1:1.0: FTDI USB Serial Device converter detected
usb 1-1: Detected FT232RL
usb 1-1: Number of endpoints 2
usb 1-1: Endpoint 1 MaxPacketSize 64
usb 1-1: Endpoint 2 MaxPacketSize 64
usb 1-1: Setting MaxPacketSize 64
usb 1-1: FTDI USB Serial Device converter now attached to ttyUSB0
usbcore: registered new interface driver ftdi_sio
ftdi_sio: v1.6.0:USB FTDI Serial Converters Driver
usb 1-1: USB disconnect, address 2
ftdi_sio ttyUSB0: FTDI USB Serial Device converter now disconnected from ttyUSB0
ftdi_sio 1-1:1.0: device disconnected

Donna

unread,
Oct 13, 2011, 3:14:42 AM10/13/11
to linuxstamp
oh, thanks for that, ugh, I had applied the patches to take it up to
2.6.36, but I forgot, I am going to need to update the kernel and
well, everything i guess. hmm. I had gotten so side tracked with the
crosstool I forgot. I may try it on 2.6.28 since I have that on the
board or just go forward, either way, gotta line that up. Thank you.
Reply all
Reply to author
Forward
0 new messages