I am working on porting the UVC driver to another STM32 device that supports hi speed USB to increase the frame rate. I am able to transmit video over USB HS, but not at the max transfer rate. I can transfer at 1 packet per microframe but not the max 3 packets per microframe. In the UVC driver, video data is transmitted one packet at a time, so I think that is part of the problem. Before sending each packet the USB interrupts are disabled and then reenabled afterwords. I tried keeping the IRQs enabled all the time, but it breaks the video stream. Why is this?
uint8_t UVC_Transmit_FS(uint8_t* Buf, uint16_t Len)
{
uint8_t result = USBD_OK;
HAL_NVIC_DisableIRQ(OTG_FS_IRQn);
USBD_UVC_SetTxBuffer(hUsbDevice_0, Buf, Len);
result = USBD_UVC_TransmitPacket(hUsbDevice_0);
HAL_NVIC_EnableIRQ(OTG_FS_IRQn);
return result;
}
I tried increasing the amount of data loaded into the TX fifo to more than one packet, but it didn’t work even though the low level driver seems to be designed for it. The device does not transmit any video data.
Any ideas why this might be?
Are there any plans to try to get this driver working at a faster frame rate over HS USB?