2025-05-07 11:06 AM - edited 2025-05-07 4:32 PM
Hello,
I am trying to enable the USB IP DMA mode on an STM32U5A5. Without DMA, I have it working as a USB device and it transmits and receives data without apparent issues. To start using DMA, my understanding is that all I need to do, in CubeMX, is change the "Enable IP DMA" setting for the USB OTG HS peripheral to ENABLED. From there I expect the USB peripheral to take care of itself.
Unfortunately, in DMA mode, the device transmits exactly three 512-byte packets and then hangs.In my short test, I request four packets. The fourth one never moves. The PC host receiver never gets the fourth packet. The first three arrive intact. I tried tests where the buffer containing the transmit data is set to either 512 bytes long, 1024 bytes long or 2048 bytes long. Each test moves 3*512 bytes and stops.
[After posting the above, I did some additional tests by breaking the data into small chunks, as small as 4 bytes at time. The magic limit of the number of bytes is about 1700. Every permutation stopped somewhere near 1700 bytes sent. Data always arrives at the receiver in perfect condition. (The last test made 425 sends at 4 bytes at a time.) What is special about that number?]
What am I missing in my configuration?
Thanks, Erik
2025-05-08 3:48 AM