LPC1343 MSC USB question

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

LPC1343 MSC USB question

954件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by madid87 on Thu Feb 21 13:26:37 MST 2013
Hello.
I have written an USB application which uses SD Card as memory for MSC device.
Currently when a PC want to write a file I store eight 64 byte packets in a buffer which is then written to the SD Card.

As this is single sector operation my transfer rate is only 150kB/s and I would like to implement multi-sector write, e.q. store 4kB in a buffer and then write 8 sectors at once.

My problem is that I don't know how many bytes or sectors will a host send me in total.

If someone could provide me with a link or information which will clarify it.

How can I access CBW (command block wrapper)which has dCBWDataTransferLength variable?

Thank you.
0 件の賞賛
返信
4 返答(返信)

929件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by madid87 on Tue Feb 26 07:31:06 MST 2013

Quote: Tsuneo
The answer is obvious ;-)
You can't change the code in the ROM driver.
You have two requirements, both couldn't stand together.
Take just one, customized source code without the ROM driver, or ROM driver without customization.

Anyway, I don't recommend the USB ROM driver on LPC1343, because it has of limited use. Maybe, the coder of this routine shouldn't have so much experience on USB coding. (S)he can't imagine there would be so many implementation variations other than (s)he knows, like your requirement.

In this post, I criticized HID implementation of LPC1343 ROM driver.
http://tech.dir.groups.yahoo.com/group/lpc2000/message/49888

The second generation of the USB ROM driver on LPC1347 and LPC11Uxx has improved so much.

Tsuneo



OK, thank you once again.
I'm very unhappy with the driver since it cannot give me the exact file size.
At least now I know when to use the non-ROM drivers :)

Best regards,
Ivan
0 件の賞賛
返信

929件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Tsuneo on Tue Feb 26 07:24:47 MST 2013
The answer is obvious ;-)
You can't change the code in the ROM driver.
You have two requirements, both couldn't stand together.
Take just one, customized source code without the ROM driver, or ROM driver without customization.

Anyway, I don't recommend the USB ROM driver on LPC1343, because it has of limited use. Maybe, the coder of this routine shouldn't have so much experience on USB coding. (S)he can't imagine there would be so many implementation variations other than (s)he knows, like your requirement.

In this post, I criticized HID implementation of LPC1343 ROM driver.
http://tech.dir.groups.yahoo.com/group/lpc2000/message/49888

The second generation of the USB ROM driver on LPC1347 and LPC11Uxx has improved so much.

Tsuneo
0 件の賞賛
返信

929件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by madid87 on Sun Feb 24 12:56:04 MST 2013

Quote: Tsuneo
READ10/WRITE10 SCSI commands, which are carried by CBW, specify the size of transport with the (logical) start address on the media. The format of these commands are defined in the SCSI Block Commands-2 (SBC-2) spec. You may download a draft of this spec on T10.org, after free registration.

http://www.t10.org/drafts.htm#sbc2


Which example, exactly, are you working on?

Tsuneo



Thank you for the help.
LPC1343 has two examples regarding USB Mass Storage devices. One is called [B]usbmsd [/B]and uses standard MSC driver.
The other one is called [B]usbmsd_rom[/B] and uses MSC ROM drivers.

usbmsd example uses CBW and it's easy to see what is the file length. On the other hand, ROM example has CBW hidden (or at least I cannot find it).

I would like to use the ROM MSC driver but I don't know how to get the total file length? This is needed in order for me to optimize SD Card performance.
All I get is 64 byte packets and I [B]don't know how much data is there in total.[/B]

I appreciate any help.

Thanks once more.
0 件の賞賛
返信

929件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Tsuneo on Sat Feb 23 07:14:26 MST 2013

Quote:
My problem is that I don't know how many bytes or sectors will a host send me in total.


READ10/WRITE10 SCSI commands, which are carried by CBW, specify the size of transport with the (logical) start address on the media. The format of these commands are defined in the SCSI Block Commands-2 (SBC-2) spec. You may download a draft of this spec on T10.org, after free registration.

http://www.t10.org/drafts.htm#sbc2


Quote:
How can I access CBW (command block wrapper)which has dCBWDataTransferLength variable?


Which example, exactly, are you working on?

Tsuneo
0 件の賞賛
返信