Bug in USB Host Library? Isochronous data receive
Hi
I think it is a bug...
Problem:
Isochronous data Receive from USB Device with ST USB Host library.
- > no example or projects in internet
So i tried to get data from USB Webcam.
But i didn't get an USBH_URB_DONE event or other flag
i added following lines in function:
static void HCD_HC_IN_IRQHandler (HCD_HandleTypeDef *hhcd, uint8_t chnum)
if ((hhcd->hc[chnum].ep_type == EP_TYPE_CTRL)|| (hhcd->hc[chnum].ep_type == EP_TYPE_BULK)) { __HAL_HCD_UNMASK_HALT_HC_INT(chnum); USB_HC_Halt(hhcd->Instance, chnum); __HAL_HCD_CLEAR_HC_INT(chnum, USB_OTG_HCINT_NAK); } else if((hhcd->hc[chnum].ep_type == EP_TYPE_INTR)|| (hhcd->hc[chnum].ep_type == EP_TYPE_ISOC )) { USBx_HC(chnum)->HCCHAR |= USB_OTG_HCCHAR_ODDFRM; hhcd->hc[chnum].urb_state = URB_DONE; HAL_HCD_HC_NotifyURBChange_Callback(hhcd, chnum, hhcd->hc[chnum].urb_state); } hhcd->hc[chnum].toggle_in ^= 1; }
line (hhcd->hc[chnum].ep_type == EP_TYPE_ISOC )) added to catch URB EVENT
example for receive isochronous data :
case VIDEO_STREAM_START:
USBH_IsocReceiveData( phost , framebuffer , pVideo->EpVideoStream.wMaxPacketSize, pVideo->EpVideoStream.bPipe ); pVideo->StreamState = VIDEO_STREAM_PLAY; osMessagePut ( phost->os_event, USBH_URB_EVENT , 0); break;case VIDEO_STREAM_PLAY:
if((USBH_LL_GetURBState(phost , pVideo->EpVideoStream.bPipe) == USBH_URB_DONE)&& ((phost->Timer-pVideo->EpVideoStream.wTimer) >= pVideo->EpVideoStream.bInterval)){pVideo->EpVideoStream.wTimer = phost->Timer;
uint32_t rxlen = USBH_LL_GetLastXferSize (phost, pVideo->EpVideoStream.bPipe ) ;
if( rxlen ){} USBH_IsocReceiveData( phost , framebuffer , pVideo->EpVideoStream.wMaxPacketSize, pVideo->EpVideoStream.bPipe );
}
osMessagePut ( phost->os_event, USBH_URB_EVENT , 0); break;