cancel
Showing results for 
Search instead for 
Did you mean: 

Bug in USB Host Library? Isochronous data receive

dirk.frerichs
Associate II
Posted on May 08, 2017 at 12:40

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;
3 REPLIES 3
Imen.D
ST Employee
Posted on May 08, 2017 at 18:31

Hi

Frerichs.Dirk

,

Please note that this issue is reported internally and it is under review.

I will keep you informed about the taken actions/explanation if needed.

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
linh nguyen
Associate II
Posted on May 25, 2017 at 03:42

Please help me !

I am developing a uvc driver in kit stm32f4 Discovery .

I fixed source code ST USB Host library same you but I still don't receiver Isochronous data.

I sure webcam is streaming.

Please send your source and usb lib you used to my email

mailto:linhit1.2@gmail.com

Thanks you so much.

Posted on March 07, 2018 at 23:56

Imen,

We are also trying to use the STM32F4 as a host for a USB web cam.   I have been struggling to figure this out and it looks like the HAL doesn't support isochronous data as input.

Has there been any movement on this issue?

Is there any plan to implement this and provide an example?

Thanks,

Kevin