This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF52840 USB MSD Slow Write Speed

Hi, I have recently acquire a nRF52840 preview development board to prototype a USB MSD. With the example provided in the SDK V13, I tested the write speed and it was far from usable.

I am not sure if it is the problem of the NOR chip onboard but the problem shown to be a very slow write speed with only 177 KB/s, and the write is not consistant as well with the data transfer seemingly freezed half way and resume after quite a while.

I tested it with multiple PCs running Windows 10 but the problem appears to be the same.

Is the problem from the chip or it is inherent to the USB stack included in the SDK?

Thanks.

  • very slow write speed with only 177 KB/s

    That is not very slow. The maximum speed is around 1 MByte/sec for USB 2.0 full speed - but that would require quite some rather intelligent buffering with some more RAM, as you need to read from USB and write to memory at the same time.

    The 177 kB/s is about the expected speed when you are not doing this at the same time. This keeps the source code much simpler to understand - especially when there are abnormal conditions like write errors.

  • Could this also explain why I observed a freeze during data transfer? Is it because the read and write are not processed at the same time, therefore they take their turns which appear as a freeze?

  • Last time we was testing the MSC speed of the stack itself it was around 700 KB/s (using dd on EMPTY drive - 512MB of zeros).

    Do not say that 177KBps is unusable for 8MB drive - it can be totally written in less than a minute. This is quite obvious that for bigger drive faster FLASH and background write algorithm should be used. The example here just shows how to use MSC class and we tried to keep it simple.

    When it comes to the "halts" you have described, this may relate to PAN 104 and the library is resuming from "lost event" situation. This would be corrected in the final product.

  • Modern OS may do MB-sized transactions, which have little to none status infos on-the-fly available. This will look like a "hangup" of roughly 10 seconds to the user. Note that a single "write" transaction has no real limit in the underlying SCSI specs. GB-sized transactions are possible in theory - if the device has that many bytes available.

Related