LPC43xx - LPCUSBlib - MassStorageHost performance

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

LPC43xx - LPCUSBlib - MassStorageHost performance

837 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by AntonioL on Tue Mar 19 04:59:15 MST 2013
Hello to everybody

I am testing the performances of a LPC4357 (on a MCB4357 Keil dev board), USB port 0 HS as Mass Storage Host, using the LPCopen platform - LPCUSBlib dedicated example.

Does anybody know how much can I expect? I bet not the theoretical 480Mbit/s, but I'd like to know how far one can go.

At the moment I tried with different MSD flash disks and choose the fastest, then I tried to tune the buffer size (in MassStorageHost.c, static uint8_t buffer[8*1024];) also increasing its size (placing  it to the second portion of the ram through an explicit __attribute__((at(0x20000000))) ).

I discovered that to read a 10MBytes file from the MSD, it takes about 1010ms with 8kB buffer, it increases significantly if I lower the size (2094ms with 2kB buffer), while rising it to 16-32 or even 64 kB doesn't improve very much (at minimun I get 994ms).. i.e I get approx 70-80Mbit/s rate at most.

Is it normal/the maximum I can achieve?

I have a look also at the LPCUSBlib and found in the LPCUSBlibConfig.h the USBRAM_BUFFER_SIZE define (default 4kB), but cannot increase it otherwise the linker won't find enough space.. is it related to the bandwidth limitation I am experiencing or is there something else to optimize?

Thank you in advance,
regards,
Antonio
Labels (1)
0 Kudos
3 Replies

641 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by alexandermas on Sun Apr 20 00:53:15 MST 2014
To lift productivity it is necessary to increase the size of the buffer (PIPE_MAX_SIZE), to increase the FRAMELIST_SIZE_BITS size, to optimize the functions Pipe_Read_Stream_LE, Pipe_Write_Stream_LE at me in the project with freertos and lwip reading speed 10mb/s in a mode without wasps speed to 15-18mb/s at me PIPE_MAX_SIZE = 16кб, with double buffering, FRAMELIST_SIZE_BITS =5, the standard manager of memory is removed, instead of it another is used, by heap in sdram. cpu lpc4357 at 204mhz
0 Kudos

641 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by AntonioL on Fri Mar 22 07:15:17 MST 2013
Hi,

thank you for your comments.

I was aware that the payload data is wrapped with protocol data and divided in many packets, but really I didn' imagine how much.

I tried with a USB analyzer and effectively I found out that:
- with same USB flash key, just formatted and with the same single file (10MB payload) saved onto it
- with a PC it reports an actual bandwidth usage of 128-130Mbps
- with the MPC board it reports 115Mbps (and it takes 1.07s to tranfer the file - measured with an oscilloscope on a signalling pin)

Therefore the BW is almost the same.. I couldn't imagine the traffic was about 50% more than the payload transfer rate (115Mbps Vs 75Mbps).

Best regards,
Antonio
0 Kudos

641 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by tuong on Wed Mar 20 03:31:25 MST 2013
Hi,

Have you compared with your PC or other platforms? What is the result? Please try in following conditions:
   - Same USB thumb drive
   - Same read/write location (read/write on the begining of the drive always faster than on the end of the drive)

FYI, 480Mbit/s is the USB high speed bit speed, you cannot calculate your expected time for 10MBytes file transfer from 480Mbits/s, as your file will not be transmitted continuously, it will be devided to many packets, each packet is wrapped by USB protocol data (SYNC,PID,ADD,your valid data,CRC) then transfered on USB bus.

With best regards,
0 Kudos