cancel
Showing results for 
Search instead for 
Did you mean: 

Use USB CDC with DMA?

Leonelf
Associate II
Posted on October 23, 2015 at 17:49

Is there a way to use the USB stack of the F4Disco with DMA? I'd like to transfer some 100 bytes and then trigger an interrupt... At the moment I'm using UART with a USB-UART bridge for that.

1 REPLY 1
qwer.asdf
Senior
Posted on October 26, 2015 at 10:43

It is straightforward to use the STM32F4Discovery's USB as CDC device in FS mode without DMA.

If you want to use the DMA you must use USB HS (not FS), but STM32F4Discovery's USB HS is not connected to the USB port, so you'll need some soldering skills.

Also be warned that enabling DMA may not be a good idea. The UM1734 document states a limitation:

''When using this driver with the OTG HS core, enabling DMA mode (define USB_OTG_HS_INTERNAL_DMA_ENABLED in usb_conf.h file) results in data being sent only by multiple of 4 bytes. This is due to the fact that USB DMA does not allow sending data from non word-aligned addresses. For this specific application, it is advised not to enable this option unless required.''