A Theory On Usb Problems


judge0

Member
Joined
Oct 3, 2005
Messages
172
Location
Sault Ste Marie, Ontario, Canada
Website
Visit site
A quick summary of what we know so far:

USB 2.0 doesn't work with provided USB cable.

Drivers exist in /lib/modules/2.4.25/drivers/usb/gadget/
- g_zero.o
- g_file_storage.o
- gadgetfs.o
- net2272.o
Utility modprobe can load 'net2272', can load after net2272, gadgetfs and g_zero.
Cannot load g_file_storage ever, (it's loaded as required by 'net2272').

MMSP2 has USB chip built-in to SOC, possibly accessible through EXT port.

GPH has added their own (net2272) USB, accessible through USB port on right hand side by Power Connection.

No combination of the above drivers allows system to work with either WinXP or Linux.

Some scattered, unconfirmed reports of stable USB 1.1 working through hub ( I tried this, did not work for me).

Information that is not available to me:
Drivers that shipped with the dev board???

I have a feeling that the builtin MMSP2 USB has priority on the system, but has no pathway to the cable. (ie. The connection is being established, but during handshaking protocol, a request is made by the host PC that the builtin USB-MMSP2 is trying to respond to). Alternatively, a base driver for the USB is missing and needs to be loaded on system before 'net2272'. Also, the above drivers might be applied to the MMSP2 hardware because of conflict priority etc.

Is there a kind soul with a dev board that could post a listing of system drivers, and possibly post them on ED's site? Would certainly be appreciated :)

EDIT: typo
 
I got mine working, but I still use my card reader, it is better.

I only have USB 2.0 on my PC (nForce2 mobo) and no hubs.

It won't work on the crap front ports, I had to plug it into the back ports.

It is possible that the netchip pushes the GP2X over the edge for power draw on some lesser batteries, or units with the coating still on the terminals.

I shined up my battery terminals with 1800 grit sandpaper before I ever used it.

Edit: I am using the supplied cable.
 
devboard's didn't have the usb chip or connector soldered to the board, as GPH had other more pressing things to fix, like the SD driver (and still do, to some extent).

If you can't load 'g_file_storage' then you must be loading it incorrectly - I assume you did provide the path to the backing storage?

The output I get when running under a 2.0 hub is as follows:

Code:
Using /lib/modules/2.4.25/kernel/drivers/usb/gadget/net2272.o
net2272: PLX NET2272 USB Peripheral Controller
net2272: irq 222, mapped mem c287d000, chip rev 0011
net2272: running in 16-bit, byte normal bus mode
net2272: version: 2005 Sept 08

Using /lib/modules/2.4.25/kernel/drivers/usb/gadget/g_file_storage.o
fsg_bind
check_para
mod_data.protocol_type:0x6,mod_data.protocol_name:Transparent SCSI
ooooooooooooooo
ooooooooooooooo
g_file_storage net2272: File-backed Storage Gadget, version: 05 June 2004
g_file_storage net2272: Number of LUNs=1
g_file_storage net2272-lun0: ro=0, file: /dev/mmcsd/disc0/part1
dosetconfig
disc connect
dosetconfig
enable_reset config
wMaxpacketSize:0x200
wMaxpacketSize:0x200
high speed config #1
g_file_storage net2272: high speed config #1

compared to the following when attached to a 1.1 hub:

Code:
Using /lib/modules/2.4.25/kernel/drivers/usb/gadget/net2272.o
net2272: PLX NET2272 USB Peripheral Controller
net2272: irq 222, mapped mem c287d000, chip rev 0011
net2272: running in 16-bit, byte normal bus mode
net2272: version: 2005 Sept 08
Using /lib/modules/2.4.25/kernel/drivers/usb/gadget/g_file_storage.o
fsg_bind
check_para
mod_data.protocol_type:0x6,mod_data.protocol_name:Transparent SCSI
ooooooooooooooo
ooooooooooooooo
g_file_storage net2272: File-backed Storage Gadget, version: 05 June 2004
g_file_storage net2272: Number of LUNs=1
g_file_storage net2272-lun0: ro=0, file: /dev/mmcsd/disc0/part1
dosetconfig
disc connect
dosetconfig
enable_reset config
wMaxpacketSize:0x40
wMaxpacketSize:0x40
full speed config #1
g_file_storage net2272: full speed config #1
class_setup_reg

The only difference seems to be that windows sends a mass storage class reset on the 1.1, but not on the 2.0. This probably means that the control pipe (endpoint 0) is working fine, but the bulk endpoints are not working. Maybe it's because of the max packet size being different under 2.0 highspeed, compared to 1.1 ?

I've wrote my own USB driver (doesn't use any modules and runs entirely in kernel space), but at the moment it forces 1.1 mode. No hub required, but no 2.0 speed either. I really should try it at 2.0 speeds.
 
@Squidge: yes I provided the path, g_file_storage.o appears to be loaded by net2272.

All attempts to load 'g_file_storage' end up with "Invalid Argument"

Some inconsistencies: drivers(modular) should be lodable from /etc/modules.
However, adding the line 'net2272' does nothing, manually doing 'modprobe net2272' or 'insmod net2272' does load the module.

On a clean reboot, if you rum 'lsmod', it comes up blank. Adding 'net2272' to /etc/modules does not load 'net2272' on reboot, it should.

Also, Busybox doesn't support the 'source' command to run scripts after edit.

Appears that some of the scripts are referencing oddball directories. There are a couple of references to /opt (which doesn't exist). Some scripts reference /etc/init.d while the path that exists on the system is /etc/rc.d/init.d.

It looks like GPH had two teams working on the U-Boot & Kernel images and the directory structures they used do not match up.
 
My gp2x works perfectly under linux for me. I actually use it all the time now to transfer files so I really have no reason to buy a card reader.
 
I know little about linux but would a 2.6 kernel make a difference in this case?
 
Squidge posted on Dec 19 2005 at 04:32 AM said:
judge0: what command line are you actually using to load the file storage?

'modprobe g_file_storage /mnt/sd' or 'insmod g_file_storage /mnt/sd'

have also tried 'modprobe g_file_storage /dev/sda' etc - same results "Invalid Argument"
 
Last edited by a moderator:
judge0 posted on Dec 19 2005 at 11:19 AM said:
Squidge posted on Dec 19 2005 at 04:32 AM said:
judge0: what command line are you actually using to load the file storage?

'modprobe g_file_storage /mnt/sd' or 'insmod g_file_storage /mnt/sd'

have also tried 'modprobe g_file_storage /dev/sda' etc - same results "Invalid Argument"

Yup, completely wrong, hence the "Invalid Argument". What you need is something like:

insmod g_file_storage.o file=/dev/mmcsd/disc0/part1

BTW: Having the module loaded at boot time is a bad idea - if both linux and g_file_storage modify the file system, then you just end up with a corrupt SD card. That's why GPH enable it only when you enter that menu, and remove it after you exit from the menu. I think this is due to the fact that g_file_storage also has a cache, so Linux updates the file system, and then g_file_storage overwrites it, thinking it has exclusive access.
 
Last edited by a moderator:
@Squidge: Thank you

Had tried with paramater /dev/mmcsd/disc0/part1
but never saw any indication of needing to use syntax 'file='

Are you saying those *.o driver modules are dynamically loaded as required?

I am starting to get the idea that embedded linux is a far cry from linux

BTW, did the dev unit, aside from not having a USB port, ship with any drivers in /lib/modules? :)
 
Back
Top