lpcware

Problems with USB MSC examples for LPC1343 and LPC176x

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by SOTA on Mon Mar 26 08:56:09 MST 2012
I've been experimenting with USB demo code that implements a tiny mass storage class , either alone or in combination with CDC or HID class - thie idea being to use the MSC class on initial connect to provide the CDC .inf driver setup file. and possibly access to proprietary config and trace log files.
The custom board this is intended for uses a LPC1343 with USB soft connect working - ive gotten all other USB demos to work on it, including the bootlader MSC firmware update, which is pretty brilliant i must say :)

The LPC1343 MSC examples (with LPCxpresso) seem to work fine with Win XP, but with Win7 after enumeration windows insists the drive needs to be formatted, and of course that can't work so it never mounts the filesystem.  Its the same with either the ROM or Flash based versions.  These create a fat12 filesystem in RAM (~6k)
The same thing happens with the more recent example for combined CDC+MSC.

I also tried the LPC1769 example here:
http://ics.nxp.com/support/documents/microcontrollers/zip/mcb1700.code.bundle.lpc1769.lpcxpresso.zip
It similarly provides a tiny  fat12 filesystem in RAM (16k?)

Here the error is different  - It seems to enumerate correctly but hangs just before mounting the fs, after about 1 minute windows declares the drive defective with generic error #10 "the device failed to start".
the same is true under XP or Win7 , with or without debugger connected, bus powered or not.

I then installed several USB trace tools to try and see whats going on - i see that windows is repeatedly sending the cmd scsi_inquire (first transactions to endpoint 82), and the LPC17xx replies "Status pending" immediately, and about 20 sec. later replies "Status Cancelled"

windows then resets the device and tries again 3 times, after that it disconnects the device.

My board uses a LPC1758 and has soft-connect working properly , and i've tried this both bus-powered and independently powered. This is using a known good custom board i designed a couple years ago, though USB hardware was initially tested ok, i had little use for it till now. I am very confident there is nothing wrong with the hardware.

I made sure to uninstall previous drivers and change the product ID codes / strings in the device descriptors too as a precaution against confusing windows with older non-MSC class drivers from previous tests.

Questions:
- Has anyone experienced the same problem with the LPC1343 MSC examples in Win 7? is there a fix or workaround for that ?
- can  anyone can confirm the behavior i'm seeing with the LPC176x example ?  is there a subtle difference between the LPC175x and LPC176x USB peripherals or DMA system that might explain this? i dont have a 176x eval board with USB on it but that would be the next logical thing to try.

Unfortunately i'm not familiar enough with USB  internals general or the  USB driver code to attempt to debug it except in the most superficial  way, but if there's an expert here who can guide me, i can do any tests  with the lpcxpresso debugger that you may suggest.

Thanks in advance for any help or suggestions!

Outcomes