2017-06-12 08:14 AM
I'm working on the audio example and I've made it work with Audio Class 2.0. Device enumerates and ISO packets are received.
However when I decided to enable DMA for better performance the TX line is not working. Device receives Setup packets, but cannot transmit.
In the generated from CubeMX code I saw the following:
// Be aware that enabling DMA mode will result in data being sent only by multiple of 4 packet sizes. This is due to the fact
// that USB DMA does not allow sending data from non word-aligned addresses.
Does somebody knows how 'large' is one packet or where that is defined?
Anyone bumped into that problem?
Using:
- System Workbench for STM32
- STM32Cube_FW_F7_V1.7.0
#stm32-usb-dma #stm32-usb #stm32 #stm32f72018-05-03 08:22 PM
I have the same problem here with STM32H743, when USB DMA is disabled, both transmit and receive isochronous transfers are working fine, but with DMA enabled, receive still works, but isochronous transmit doesn't, resulting in empty packets being sent to PC. The transmit and receive buffers are defined back-to-back in the same structure, which is placed in SRAM1 with 4-byte alignment.
Control transfers through endpoint 0 apparently works as the device enumerates properly, but isochronous transmit simply fails, as if the DMA was not active.
Is there any special procedure to initialize the DMA transmit for isochronous end points, that the driver did not implement properly?
The HAL drivers are version 1.1.0 for STM32H7.
2018-05-24 01:08 AM
Hi
I cannot enumerate, it returns error if UAC2 descriptor is inserted. Do you have a valid device descriptor? or is there something to change other than device qualifier and device descriptor?
2018-05-24 07:32 AM
You can find some examples of UAC2 descriptors online, such as from one NXP document:
https://www.nxp.com/docs/en/user-guide/USBUG.pdf
Alternatively, if you have access to a device that implements UAC 2.0, such as XMOS based USB devices, you can copy their descriptor using some USB descriptor viewers and use as a reference.
If you have enumeration problems, you can also use a descriptor viewer to check for mistakes.
Although, the USB DMA problem remains unsolved...
2018-05-24 12:39 PM
Hi Chen
thanks for the reply
I started from a cube project and it works in UAC1, then I replaced the descriptors. The board is recognized but with errors.
Here the project
I don't understand where is the error
2018-05-26 08:48 PM
Just making sure, does your board include a USB HS physical layer? Neither STM32F7 nor STM32H7 provide an integrated USB high speed PHY, so you will need an external IC to use USB high speed mode. Typically UAC 2.0 is implemented in USB high speed mode.
2018-05-27 12:48 AM
I'm using STM32F769I-DISC1 with integrated PHY. However the USB audio class 2 is indipendent from the USB speed. In fact the UAC2 (as well as UAC1) can be used both with high speed USB (480Mbps) and full speed (12Mbps) with the obvious speed limitations. I started from the CUBE project with UAC1 high speed but when I change the descriptors there's something that goes wrong.
2018-10-09 09:14 AM
Any chance this has been solved?
I'm using the STM32H743I-Eval board, and I've got the USB external PHY working at HighSpeed however I need to get it working with DMA, I've switched .dma_enable to true, however now it fails at the device descriptor stage.
Any ideas how I can fix (or atleast debug) this?
2018-12-18 06:58 PM
ST now has a number of discovery and other boards with USB HS OTG/Device (either with external or internal PHY) and all examples seem to be the now very old USB Audio Class 1.0. Hopefully UAC 2 will be forthcoming, and since at least two boards now have 4 microphones on-board, hopefully those examples will support 4 channel audio capture! And please with DMA, and 24-bit samples and at least 48 kHz or more! Thanks for the great drivers and examples, keep them coming!
2019-12-05 07:00 AM
hi,did you solve the problem of transimting with dma mode?