Mass Storage transfer speed

Discussion created by lpcware Employee on Jun 15, 2016
Content originally posted in LPCWare by Muis on Wed Feb 12 06:32:44 MST 2014
Using the new LPCOpen library / LPC11U3xx ROM drivers I'm not able to get transfer speeds above 512 kb/s, even though I was able to get 1 MB/s using the previous nxpUSBlib (LUFA based) which is a pure software implementation.

What I did in the previous library is that when the host (Windows) request 8 sectors, I starting reading them using the SPI multi-sector read command, and flushing the sectors back to the USB endpoint on the fly. This made the whole operation kind of asynchronous, because when the USB driver was busy clearing the endpoint, I was already reading the data from the card which I knew would be requested next.

Now with the new USB rom drivers, the driver always requests 64 bytes, which is kind of unhandy but no big problem, since I can predict the next 64 bytes it will request (since the host will always read full 512 byte sectors). But there is no way to predict wether it will request just a single sector or also the following 8 sectors behind it, making any kind of 'smart buffering' impossible. And even if the driver did notify me it will need multiple sectors, I still see no easy way to do the same kind of asynchronous transfer I was doing before, because the USB interrupts requesting the data will block the SPI code.

The end-result is that there seems to be no way to use the ROM drivers and get a decent transfer speed.

Am I overlooking something? Because I'd rather not migrate back to the LUFA drivers, however I can't seem to figure out how to work around these limitations in LPCOpen?