cancel
Showing results for 
Search instead for 
Did you mean: 

How DMA works for USB HS

PPiór.1
Associate III

I am wondering how DMA works for USB HS. As far as I know it is a "machine" to copy memory to another place. And how is it implemented for USB ? We have there a FIFO queue and from what I observed in the driver, the data from the FIFO are copied by the CPU. So what is the point of DMA here ? Maybe I understand something wrong.

In case of USB device library, is it enough to enable DMA during configuration by setting ENABLE value for USB hpcd_USB_OTG_HS.Init.dma_enable ?

1 REPLY 1

Which STM32?

> from what I observed in the driver, the data from the FIFO are copied by the CPU

What driver? Where does it copy data from FIFO? How do you know the portions which copy data are actually used when DMA is used?

The Host programming model/Device programming model subchapters in RM contain walkthrough of procedures to get things going with and without DMA for the various scenarios (CTRL/INTR/BULK/ISO x In, Out); comparing "with DMA" and "without DMA" for the same scenario helps understanding what differences in handling DMA introduces. I don't say the documentation is stellar, far from it, but there is at least some; and if you are interested you should have a look at it.

JW