Is DMA possible with USB FS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-02-07 5:13 AM
I'm working on a STM32H750XB with USB. It works fine with the USB2_OTG_FS instance, but the speed is not reaching the maximum (only 875kB/s). I'm using the USB with diskio, FatFS and FreeRTOS.
I'd like to enable DMA to make it faster, so I set
hhcd.Init.dma_enable = 1;
and I also disable DCache.
But when it's set like this, the device crashes when the USB is getting enumerated.
Is it really possible to enable DMA on USB FS ?
Thanks !
- Labels:
-
DMA
-
FatFS
-
FreeRTOS
-
STM32H7 Series
-
USB
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-02-07 5:59 AM
What do you think the maximum speed for a USB FS MSC should be?​
​
The interface is going to be most efficient doing high block count aligned transfers. FatFS doesn't have any inherent block caching or lazy-write algorithm. f_read / f_write need to be used with an awareness of underlying media expectation. doing many small transaction will be particularly slow.​
​
T​he USB FIFO should be able to use DMA
​
T​he H750 should be able to uses it's D-Cache, expect to have to manage coherency, either directly or by using specific memory areas you've set to be non-cacheable.
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-02-07 6:03 AM
The max speed for USB FS is 1.5MB/s in the most ideal case, according to the specification, so I wanted to be the closest as possible to this value.
I'm doing "big" transactions, an f_read of ~65kB.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-02-07 6:03 AM
Clock speed != max data transfer speed.
yes, DMA can be used, provided you manage cache appropriately.
Sending more data per transfer is going to more efficient.
Should be able to get around 1 MBps transfer rate if you are quick to reinitiate transfer after the last one succeeds.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-02-07 6:06 AM
What needs to be changed to move from non-DMA to DMA USB ?
I did the
hhcd.Init.dma_enable = 1;
and also changed usb_diskio to usb_diskio_dma.
