Skip to main content
Visitor II
August 30, 2021
Question

STM32 - USB HS device with DMA and Isonchronous Transmission to stm32

  • August 30, 2021
  • 2 replies
  • 1188 views

As part of my thesis, trying to get as much data transfer from PC to STM32 as possible. As I am going to transfer a video stream, isonchronous transmission seems to be a good choice, but I don't know how to do it properly.

I use STM32H743 microcontroller with USB3300 as external PHY.

What I have done so far is to rewrite the USBD_CDC library to use endpoint out as isoc instead of bulk.

I changed in the endpoint descriptor as follows:

bmAttributes = 0x1
wMaxPacketSize = 0x400
bInterval = 0x1

In addition, in the USBD_LL_OpenEP function, I changed the endpoint type and the packet size similarly to the descriptor.

I'm testing this with pyusb, sending a 1024byte packet 1000 times and it's works bad.

On STM32 I can see incoming packets, but only 20% are arriving

I don't know if this is working as it should. From what I observe, after each packet comes an interrupt USB_OTG_GINTSTS_OEPINT,

in which I have to move the pointer for DMA anyway (by calling USBD_LL_PrepareReceive with recive_buff + new offset)

- that's not how DMA should work, is it?

Additionally I keep getting (I don't know how often but probably every few ms) USB_OTG_GINTSTS_PXFR_INCOMPISOOUT interrupts which I don't know what to do with.

I can see that my previous approach is wrong. How to do it properly? Do you know any cool examples?

I need all your advice.

    This topic has been closed for replies.

    2 replies

    Visitor II
    September 21, 2021

    Hello @Piotr Piórkowski​ ,

    Your issue has been raised internally. I will keep you informed.

    Thank you for your contribution.

    BeST regards,

    Walid

    Visitor II
    September 21, 2021

    Hello @Piotr Piórkowski​ 

    Actually we provide an audio example for isochronous OUT transfer to stream audio from PC to STM32.

    Check the following example and try to adapt it to your use case :

    • Path: Projects\STM32H743I-EVAL\Applications\USB_Device\Audio_Standalone

    This could help you.

    BeST Regards,

    Walid

    Visitor II
    October 5, 2021

    Hello @Piotr Piórkowski​ ,

    Please click on Select as Best if my post fully answered your question. This will help other customers with the same issue to find the solution faster

    BeST Regards,

    Walid