cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F730, STM32CubeIDE, OTG HS Device with DMA Possible?

upgrdman
Associate II

Hi,

I'm using OTG HS, in device mode, as a CDC VCP. It works when "Internal IP DMA" is disabled. If I enable DMA, the USB device enumerates but CDC_Transmit_HS() no longer works.

I saw the article on USB DMA with the STM32H7, and I tried similar things:

-Disabled the D-Cache globally.

-Edited my linker script to not use DTCM, by skipping past it like this:

"RAM  (xrw)  : ORIGIN = 0x20010000,  LENGTH = 192K"

-I have confirmed that the buffer I am trying to transmit is word aligned (memory address is a multiple of 4.)

-I am trying to transmit 20800 bytes, which is also a multiple of 4.

-I also put "__DSB();" immediately before each call to "CDC_Transmit_HS()"

Is there some other trick I need to use?

I would like to use OTG HS with DMA because I need to transfer a lot of data. With DMA disabled, and D-Cache enabled, I am only able to transfer about 16MBps (128Mbps). That is achieved with a loop in main() that non-stop calls CDC_Transmit_HS() to transmit packets that are 20800 bytes long. This is far below the theoretical 480Mbps. I know there is overhead, but this seems way off?

I have SYSCLK at 144MHz, because I need APB2 at 72MHz, because I need the ADCs to run at the highest possible clock of 36MHz. Looking at the clock tree, this seems to be the fastest I can run SYSCLK at if I want the ADCs running at 36MHz.

Thanks,

-Farrell

1 REPLY 1
TianZhang
Associate

Hello

I am writing this reply as I saw the same problem with STM32F746.

I also tried similar things with you, but the USB doesn't work properly.

If you solved this issue already, please let me know the solution.

Best regards,

Tian Zhang.