USB Mass Storage Device

This forum is dedicated to feedback, discussions about ongoing or future developments, ideas and suggestions regarding the ChibiOS projects are welcome. This forum is NOT for support.
User avatar
DeusExMachina
Posts: 223
Joined: Tue Apr 03, 2012 5:08 am
Location: South Korea
Has thanked: 3 times
Been thanked: 3 times

Re: USB Mass Storage Device

Postby DeusExMachina » Thu Jun 15, 2017 1:02 am

Unfortunately I do not have any Windows 10 installations to check it.
I believe that the root cause of all MSD problems lays in poor USB MSD specification conformance.
I wish I had time to do that, but it seems to be a quite complex task.
To make this driver kind of "official" we need to pass all USB consortium tests.
Otherwise it will be just an amateur stuff, not suitable for a serious product.

geoffrey.brown
Posts: 87
Joined: Thu May 07, 2015 9:47 pm
Has thanked: 3 times
Been thanked: 15 times

Re: USB Mass Storage Device

Postby geoffrey.brown » Mon Jun 19, 2017 8:43 pm

Is there a mass storage driver that works with USBv1 on stm32 processors ? Much of the preceding thread is aimed at the OTGv1 devices and doesn't even compile correctly for USBv1. I've struggled to get it to work on an STM32L432, but something in the USB interrupt handler is unhappy.

Geoffrey

Ceco
Posts: 40
Joined: Tue Nov 27, 2012 12:16 pm
Been thanked: 3 times

Re: USB Mass Storage Device

Postby Ceco » Fri Dec 07, 2018 2:45 pm

Just a small report of my game with MSD.

STM32F437 with USB3220 PHY.
OTG_HS mode.
CPU clock 168Mhz.
SD_CLK = 48Mhz.

Chibios 18.2.0
MSD / SCSI drivers: https://github.com/ChibiOS/ChibiOS-Contrib
data endpoint size = 512 bytes
USB_HS RX FIFO size = 1536 bytes (3 * 512)
USB HS TX FIFO size = 2048 (4 * 512)
R/W cache buffer (no read/write ahead) 64 Kbyte
Slight changes in MSD/SCSI driver to implement R/W cache buffer.
Slight changes in USB low level driver to improve FIFO write performance, see: viewtopic.php?f=35&t=4924
Compiler optimization set to -O2 (this is important due to the current USB FIFO implementation).

SD card - Transcend 32GB, class 10, FAT32 with sector size 32K or 64K. Test with a single file with 501 Mbytes.

Read 14.3 MByte/sec
Write 10.4 MBbyte/sec

Future improvements for performance (no time to implement now):
- Implement read/write ahead cache buffers. Problem - both MSD and SDC drivers works only in synchronous mode. One must be changed to support asynchronous mode or both must be divided in different threads.


Return to “Development and Feedback”

Who is online

Users browsing this forum: No registered users and 21 guests