EmbeddedRelated.com
Forums
Memfault Beyond the Launch

LPC2148 LPCUSB mass storage errors

Started by "den...@rocketmail.com" April 23, 2012
Hello, we are trying to implement usb mass storage on a lpc2148 ARM development board.

We use this version of the lpcusb library: https://github.com/promovicz/lpcusb

and we try to get the example of mass storage working that is delivered with this library.

Windows continually says that the sdcard needs to be formatted. The output of the dmesg command under linux says that the partition table is beyond EOD. We tried to partition the sdcard with fdisk under linux, but still no result.

In a debugging console we see the following messages:

TEST UNIT READY
CSW: status=0, residue=0
CBW: lenQ2, flags, cmd(, cmdlen
READ10, LBA=0, len=1
RCMD_READ_SINGLE_BLOCK failed (0xFF)!
CSW: status=0, residue=0
CBW: len=8, flags, cmd%, cmdlen
READ CAPACITY
CMD_SEND_CSD failed (0xFF)!
CSW: status=0, residue=0
CBW: len=8, flags, cmd%, cmdlen
READ CAPACITY
CMD_SEND_CSD failed (0xFF)!
CSW: status=0, residue=0
CBW: lenQ2, flags, cmd(, cmdlen
READ10, LBA=0, len=1
RCMD_READ_SINGLE_BLOCK failed (0xFF)!
CSW: status=0, residue=0
CBW: len=0, flags=0, cmd, cmdlen=6
Unhandled SCSI: 1E 00 00 00 00 00
CSW: status=1, residue=0
S1CBW: len, flags, cmd=3, cmdlen
REQUEST SENSE (052000)
CSW: status=0, residue=0
CBW: len=8, flags, cmd%, cmdlen
READ CAPACITY
CMD_SEND_CSD failed (0xFF)!
CSW: status=0, residue=0
CBW: len=8, flags, cmd%, cmdlen
READ CAPACITY
CMD_SEND_CSD failed (0xFF)!
CSW: status=0, residue=0
CBW: len=0, flags=0, cmd=0, cmdlen=6

This sequence of messages is continually repeated.

In the debugging message above we noticed the lines:
CMD_SEND_CSD failed (0xFF)! and RCMD_READ_SINGLE_BLOCK failed (0xFF)!

This messages are printed in the sdcard.c file in the functions SDReadCSD and SDReadBlock.

At the top of the debugging window it also says: CMD_GO_IDLE_STATE failed (0xFF)! once. This message comes from the function SDInit that can also be found at the file sdcard.c

Can somebody explain what this messages mean and a way to resolve this problem?

Thanks in advance

Glenn & Dennis

An Engineer's Guide to the LPC2100 Series

--- In l..., "dennis.koole@..." wrote:

> Can somebody explain what this messages mean and a way to resolve this problem?
>
> Thanks in advance
>
> Glenn & Dennis
>

You can figure what they mean for yourself. A command was issued and the response was wrong. In fact, it doesn't look like ANY command worked so there is something hosed in your setup. Perhaps the device is miswired? It appears like all of the responses are 0xff and this would imply that the card is not driving the bus (look at the MISO signals).

You can also look at the excellent demo code here:
http://www.jcwren.com/arm/

There is a full FatFS and sd/mmc implementation and if the makefile is edited, the LPC2148 will appear as a mass storage device. By default, the LPC2148 will appear as a COM device for the console.

Richard

One working example is also here
http://sourceforge.net/projects/fat12ctrlface/

On Mon, 2012-04-23 at 13:33 +0000, d...@rocketmail.com wrote:

>
>
> Hello, we are trying to implement usb mass storage on a lpc2148 ARM
> development board.
>
> We use this version of the lpcusb library:
> https://github.com/promovicz/lpcusb
>
> and we try to get the example of mass storage working that is
> delivered with this library.
>
> Windows continually says that the sdcard needs to be formatted. The
> output of the dmesg command under linux says that the partition table
> is beyond EOD. We tried to partition the sdcard with fdisk under
> linux, but still no result.
>
> In a debugging console we see the following messages:
>
> TEST UNIT READY
> CSW: status=0, residue=0
> CBW: lenQ2, flags, cmd(, cmdlen
> READ10, LBA=0, len=1
> RCMD_READ_SINGLE_BLOCK failed (0xFF)!
> CSW: status=0, residue=0
> CBW: len=8, flags, cmd%, cmdlen
> READ CAPACITY
> CMD_SEND_CSD failed (0xFF)!
> CSW: status=0, residue=0
> CBW: len=8, flags, cmd%, cmdlen
> READ CAPACITY
> CMD_SEND_CSD failed (0xFF)!
> CSW: status=0, residue=0
> CBW: lenQ2, flags, cmd(, cmdlen
> READ10, LBA=0, len=1
> RCMD_READ_SINGLE_BLOCK failed (0xFF)!
> CSW: status=0, residue=0
> CBW: len=0, flags=0, cmd, cmdlen=6
> Unhandled SCSI: 1E 00 00 00 00 00
> CSW: status=1, residue=0
> S1CBW: len, flags, cmd=3, cmdlen
> REQUEST SENSE (052000)
> CSW: status=0, residue=0
> CBW: len=8, flags, cmd%, cmdlen
> READ CAPACITY
> CMD_SEND_CSD failed (0xFF)!
> CSW: status=0, residue=0
> CBW: len=8, flags, cmd%, cmdlen
> READ CAPACITY
> CMD_SEND_CSD failed (0xFF)!
> CSW: status=0, residue=0
> CBW: len=0, flags=0, cmd=0, cmdlen=6
>
> This sequence of messages is continually repeated.
>
> In the debugging message above we noticed the lines:
> CMD_SEND_CSD failed (0xFF)! and RCMD_READ_SINGLE_BLOCK failed (0xFF)!
>
> This messages are printed in the sdcard.c file in the functions
> SDReadCSD and SDReadBlock.
>
> At the top of the debugging window it also says: CMD_GO_IDLE_STATE
> failed (0xFF)! once. This message comes from the function SDInit that
> can also be found at the file sdcard.c
>
> Can somebody explain what this messages mean and a way to resolve this
> problem?
>
> Thanks in advance
>
> Glenn & Dennis
>

--



--- In l..., Primoz Beltram wrote:
>
> One working example is also here
> http://sourceforge.net/projects/fat12ctrlface/

There are lots of examples on the web:

http://www.sparkfun.com/products/10216

>
> On Mon, 2012-04-23 at 13:33 +0000, dennis.koole@... wrote:
>
> >
> >
> > Hello, we are trying to implement usb mass storage on a lpc2148 ARM
> > development board.
> >
> > We use this version of the lpcusb library:
> > https://github.com/promovicz/lpcusb
> >
> > and we try to get the example of mass storage working that is
> > delivered with this library.
> >
> > Windows continually says that the sdcard needs to be formatted. The
> > output of the dmesg command under linux says that the partition table
> > is beyond EOD. We tried to partition the sdcard with fdisk under
> > linux, but still no result.
> >
> > In a debugging console we see the following messages:
> >
> > TEST UNIT READY
> > CSW: status=0, residue=0
> > CBW: lenQ2, flags, cmd(, cmdlen
> > READ10, LBA=0, len=1
> > RCMD_READ_SINGLE_BLOCK failed (0xFF)!
> > CSW: status=0, residue=0
> > CBW: len=8, flags, cmd%, cmdlen
> > READ CAPACITY
> > CMD_SEND_CSD failed (0xFF)!
> > CSW: status=0, residue=0
> > CBW: len=8, flags, cmd%, cmdlen
> > READ CAPACITY
> > CMD_SEND_CSD failed (0xFF)!
> > CSW: status=0, residue=0
> > CBW: lenQ2, flags, cmd(, cmdlen
> > READ10, LBA=0, len=1
> > RCMD_READ_SINGLE_BLOCK failed (0xFF)!
> > CSW: status=0, residue=0
> > CBW: len=0, flags=0, cmd, cmdlen=6
> > Unhandled SCSI: 1E 00 00 00 00 00
> > CSW: status=1, residue=0
> > S1CBW: len, flags, cmd=3, cmdlen
> > REQUEST SENSE (052000)
> > CSW: status=0, residue=0
> > CBW: len=8, flags, cmd%, cmdlen
> > READ CAPACITY
> > CMD_SEND_CSD failed (0xFF)!
> > CSW: status=0, residue=0
> > CBW: len=8, flags, cmd%, cmdlen
> > READ CAPACITY
> > CMD_SEND_CSD failed (0xFF)!
> > CSW: status=0, residue=0
> > CBW: len=0, flags=0, cmd=0, cmdlen=6
> >
> > This sequence of messages is continually repeated.
> >
> > In the debugging message above we noticed the lines:
> > CMD_SEND_CSD failed (0xFF)! and RCMD_READ_SINGLE_BLOCK failed (0xFF)!
> >
> > This messages are printed in the sdcard.c file in the functions
> > SDReadCSD and SDReadBlock.
> >
> > At the top of the debugging window it also says: CMD_GO_IDLE_STATE
> > failed (0xFF)! once. This message comes from the function SDInit that
> > can also be found at the file sdcard.c
> >
> > Can somebody explain what this messages mean and a way to resolve this
> > problem?
> >
> > Thanks in advance
> >
> > Glenn & Dennis
> >
> >
> >
> >
> > --
>
>
>


Memfault Beyond the Launch