1

I tried the example provided by atmel's ASF on USB mass storage host to send/read a file to a USB flash storage device. When reading a file, i'm getting 1.7 MB/s speed, I tried a lot of solutions, which include :

  • Made sure its running on High speed mode, and the board is running on 300 mhz
  • Tried increasing the buffer size for the F_read function, and I managed to increase it to 2.2 MB/s
  • I tested the file system it self, which is FAT32 on a virtual memory example, and got 30MB/s on read operations ( not sure if thats helpful for speed debugging purposes)
  • I tried using the same program, except reading from an SD card, which gave me an output of 1 MB/s
  • I also tested it on full speed mode and it gave me an output of 0.66 MB/s.
  • one extreme idea i tested was running two boards, one in host mode, and the other in device mode then I tested the transfer speed of the USB, it gave me an output of 1.66 MB/s on Bulk Mode. (running on HS)
  • tried the Keil examples which gave me worst results than Atmel's.

    can someone please suggest solutions? I've read all documentation regarding USB communication provided by Atmel and Keil.

  • How is it actually getting the data off the host controller? DMA? FIFO Interrupts? Polling? That would be the first thing I'd look into. – Notlikethat Apr 06 '16 at 20:02

1 Answers1

1

Atmel's mass storage USB stack lacks multi-sector read and write, though the SCSI layer indeed implements the proper command to get many sectors in a row (see uhi_msc_scsi_read_10). The abstraction layer reading data above the SCSI commands (uhi_msc_mem_read_10_ram and uhi_msc_mem_write_10_ram for instance) only read sector by sector, yielding in very poor performance.

In order to achieve USB High Speed performance (~35 MB/s) you will have to hack these functions (and all the layers above) to use multi-sectors read/write.

R.B.
  • 11
  • 1