Re: g_mass_storage emulation of flash drive - difficulties with passing vendor/product ID

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jun 6, 2017 at 3:33 PM, Alan Robertson <clinicalitltd@xxxxxxxxx> wrote:
> On Tue, Jun 6, 2017 at 3:03 PM, Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> wrote:
>> On Mon, 5 Jun 2017, Alan Robertson wrote:
>>> > Try changing bcdDevice to a valid number, and change the serial number
>>> > string to something different from what you were using before.
>>>
>>> Have changed both and also cleared Windows USB cache with DriveCleanup
>>> from www.uwe-sieber.de (which forces redetection).  Eject removable
>>> media is showing as Cruzer Switch, but it is still showing as "Linux
>>> File-Stor Gadget USB Device" in device manager (and as File-Stor on
>>> other non-Windows devices I tried).
>>>
>>> I'm guessing we've now changed all that's changeable with
>>> g_mass_storage but happy to take any further suggestions! - something
>>> is still making it appear subtly different to systems cf a native USB
>>> flash drive :(
>>
>> It's hard to say what that could be.  From your description, the gadget
>> does not send any information to the host that could identify it as a
>> Linux-based gadget.
>
> Agree in lsusb -v there's nothing obvious, but the way File-Stor is
> coming up on router & KDE and Windows is also identifying as that
> (even after clearing devices and changing SN) make me think there must
> be something that is still 'giving the game away'!  Sadly I've got no
> control of the devices I'm trying to use this in, I just know that
> they're not recognising this as a valid memory stick when they will
> happily recognise any other actual sticks that I try to use in them.
>

Sorry to return to this topic & appreciate it might be either specific
to either the Pi or the system(s) I'm connecting it to, but have now
had time to try a few more combinations out and would appreciate any
thoughts from the experts here.

To give some extra background - I've got the Pi configured to
automatically overwrite the mass storage device filestore upon boot,
so it is always presenting a fresh filesystem.  Each system below is
made by a different manufacturer and is a closed system, so I have no
ability to perform any diagnostics at that end.

System 1 - Always works
System 2 - Shows no USB stick connected
System 3 - Gives error when trying to save (memory error)
System 4 - Says unidentified USB
(Windows PC - Always works)
(Linux PC - Always works)

At first I thought this was due to minor subtleties of how the
g_mass_storage device was being presented as a standard Sandisk USB
memory stick works fine in all systems.

However I then started to notice some unusual behaviour, if rather
than doing a reboot (and wiping it fresh), I kept the power running
and moved it between machines.

If I started with System 1 first, then systems 2, 3, 4 would all
recognise/write to it OK.

I then copied a backup of the filesystem after it had been in System 1
- however that still didn't seem to solve the problem after a reboot.
What I did then notice though was that if I powered the Pi up and then
first connected it to a Windows system it then worked fine when
plugged in to the others.  To be clear I didn't read/write any files
to the device, just started it up, then plugged it into Windows, saw
the home directory on the USB open, then unplugged it and plugged it
into one of the other systems - they all now recognised it.

I tried starting/stopping g_mass_storage but that in itself didn't
seem to do it.

To be honest I'm now a bit flummoxed!  It is clearly able to work with
all 4 systems (I've been able to save files from them), but it seems
to want to be plugged into either a PC or System 1 first before then
working with the others.  Can anyone think of anything that is
happening when I do this?  Unfortunately the idea of doing it this way
is just not workable for what I'm wanting to do.  Ideally I would have
1 Pi for each system, plugged into it just by the one USB data/power
cable such that when the system powered on the Pi booted and then the
USB was available to it to read/write.

Thanks in advance for any thoughts.

Alan
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux