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
barthess
Posts: 861
Joined: Wed Dec 08, 2010 7:55 pm
Location: Minsk, Belarus
Been thanked: 7 times

Re: USB Mass Storage Device

Postby barthess » Tue Jan 03, 2017 6:16 pm

I thought about DMA too and I know how it works in (other drivers). But I totally have no ideas how to use it in STM's OTG core. Reference manual has almost nothing about it. Any way, would it worth the work? "Raw" high speed data transfer measured by me is ~24MBytes read and ~12MBytes write on USB3318 phy. I still do not know how much I will acquire from NAND flash in real life application.

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: USB Mass Storage Device

Postby Giovanni » Tue Jan 03, 2017 7:10 pm

Some extra documentation regarding the OTG DMA is present in the original Synopsis document, the STM32 RM only contains part of it. It should be useful mainly to offload the CPU during transfers and have one less thread, the current "pump", that is used like a soft-DMA.

Giovanni

User avatar
barthess
Posts: 861
Joined: Wed Dec 08, 2010 7:55 pm
Location: Minsk, Belarus
Been thanked: 7 times

Re: USB Mass Storage Device

Postby barthess » Tue Jan 03, 2017 8:48 pm

Is this document available somewhere except Synopsis site? I hate that privacy racket.
http://xinu.mscs.mu.edu/Synopsys_Design ... Controller Hm... I am not along with my hate.

User avatar
barthess
Posts: 861
Joined: Wed Dec 08, 2010 7:55 pm
Location: Minsk, Belarus
Been thanked: 7 times

Re: USB Mass Storage Device

Postby barthess » Thu Jan 05, 2017 5:56 pm

I have first measurements for combined NAND and USB HS. Read ~10MB/s via USB and ~15MB/s direct, write ~8MB/s via USB and the same speed during direct write. I use my USB MSD driver as is, i.e. no double buffering, no huge blocks. The only difference from "conventional" mass storage device is block size 2048 bytes (it is NAND page size). It is faster than I supposed before.

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 » Fri Jan 06, 2017 2:49 am

Hey guys, please mention about your hardware when you give these fancy numbers... barthess, is it for F4 series?

User avatar
barthess
Posts: 861
Joined: Wed Dec 08, 2010 7:55 pm
Location: Minsk, Belarus
Been thanked: 7 times

Re: USB Mass Storage Device

Postby barthess » Fri Jan 06, 2017 8:06 am

It is custom board with STM32F767, USB3318 phy, MT29F4G08 NAND on FSMC bus. I suppose NAND will be bottle neck on both F4 and F7, but I have no hardware to proof this.

User avatar
barthess
Posts: 861
Joined: Wed Dec 08, 2010 7:55 pm
Location: Minsk, Belarus
Been thanked: 7 times

Re: USB Mass Storage Device

Postby barthess » Fri Jan 06, 2017 5:59 pm

My device with my driver is able to pass USB2CV tests. All I need to do is to comment out chibios's debug checks about already ongoing transaction and to add empty (with bNumConfigurations == 0) device qualifier descriptor. Only except is suspend/resume test, may be it is virtual machine problem because my flash drives produce the same test fail.
Attachments
usb2cv_report.rtf.zip
(2.39 KiB) Downloaded 217 times
Untitled.png

Koen
Posts: 35
Joined: Mon Dec 21, 2015 12:15 am
Been thanked: 5 times

Re: USB Mass Storage Device

Postby Koen » Fri Jan 06, 2017 6:14 pm

What about MSC tests ?

User avatar
barthess
Posts: 861
Joined: Wed Dec 08, 2010 7:55 pm
Location: Minsk, Belarus
Been thanked: 7 times

Re: USB Mass Storage Device

Postby barthess » Fri Jan 06, 2017 7:12 pm

Koen wrote:What about MSC tests ?

Most of them failed. Sad.

Koen
Posts: 35
Joined: Mon Dec 21, 2015 12:15 am
Been thanked: 5 times

Re: USB Mass Storage Device

Postby Koen » Sat Jan 07, 2017 2:27 am

I've been mixing the different versions, fixing issues and adding quite some code to achieve both Chapter 9 and MSC compliance these past few days. Here is the interesting bit :

Code: Select all

**
Device is considered compliant with the Bootability specification.
**
Summary Log Counts [ Fails (0); Aborts (0); Warnings (2) ]

Here is the full log of the MSC compliance : http://pastebin.com/v63jJY9e

It took more time than expected and there's still a bit to verify and clear up. Sadly I have to work on something else for the next few days.


Return to “Development and Feedback”

Who is online

Users browsing this forum: No registered users and 8 guests