Page 10 of 12
Re: USB Mass Storage Device
Posted: Tue Jan 03, 2017 6:16 pm
by barthess
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.
Re: USB Mass Storage Device
Posted: Tue Jan 03, 2017 7:10 pm
by Giovanni
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
Re: USB Mass Storage Device
Posted: Tue Jan 03, 2017 8:48 pm
by barthess
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.
Re: USB Mass Storage Device
Posted: Thu Jan 05, 2017 5:56 pm
by barthess
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.
Re: USB Mass Storage Device
Posted: Fri Jan 06, 2017 2:49 am
by DeusExMachina
Hey guys, please mention about your hardware when you give these fancy numbers... barthess, is it for F4 series?
Re: USB Mass Storage Device
Posted: Fri Jan 06, 2017 8:06 am
by barthess
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.
Re: USB Mass Storage Device
Posted: Fri Jan 06, 2017 5:59 pm
by barthess
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.
Re: USB Mass Storage Device
Posted: Fri Jan 06, 2017 6:14 pm
by Koen
What about MSC tests ?
Re: USB Mass Storage Device
Posted: Fri Jan 06, 2017 7:12 pm
by barthess
Koen wrote:What about MSC tests ?
Most of them failed. Sad.
Re: USB Mass Storage Device
Posted: Sat Jan 07, 2017 2:27 am
by Koen
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/v63jJY9eIt 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.