Why usbd ReadReqEP can not get a USB_EVT_OUT event?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Why usbd ReadReqEP can not get a USB_EVT_OUT event?

1,156 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mengxp on Thu Jun 09 07:30:27 MST 2016
I want to create a multiple LUNs mass storage via ROM USBD API
But LPCOpen do not have this example because it use ROM USBD API
And USBD API do not support multiple LUNs
First I want to know how the ROMD MSC works and I can rewrite and improve it

I did a reverse engineering...
Dump the 64K rom from memory and save to rom.bin
And then work with IDA Pro. Got some source code for the ROM USBD MSC part...(see attachment rom_disasm.zip)

I rewrote the MSC code (see msc212_src.zip\usbd_msc.c)
It look very same with the rom part

But it is very strange with the SCSI_WRITE path
When Windows write a file to mass storage
It always loss some USB_EVT_OUT, It will hang the windows Write operation

NEED SOME HELP~~

Original Attachment has been moved to: rom_disasm.zip

Original Attachment has been moved to: msc212_src.zip

Labels (1)
0 Kudos
Reply
3 Replies

993 Views
lpcware
NXP Employee
NXP Employee
bump
0 Kudos
Reply

993 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mengxp on Thu Jun 09 08:36:20 MST 2016

    else if ( event == USB_EVT_OUT_NAK )
    {
        if (pMsc->BulkStage != MSC_BS_DATA_OUT)   <<<<<<<<<<<<<<<<<< It seems that add this line to solve above problem
            MSC_ReadReqEP(pMsc, pMsc->BulkBuf);
    }


But in the ROM ,the code does not have a "If", I think add the "if" is reasonable
Why ROM can work well ??!!
0 Kudos
Reply

993 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mengxp on Thu Jun 09 07:36:24 MST 2016
by the way.

To NXP support:

Can I get ROMD MSC part source code? (only msc part)

Thx!
0 Kudos
Reply