Hi
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:
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.
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:
Code:
bmAttributes = 0x1
wMaxPacketSize = 0x400
bInterval = 0x1
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.