Skip to main content
dirk.frerichs
Associate II
May 8, 2017
Question

Bug in USB Host Library? Isochronous data receive

  • May 8, 2017
  • 2 replies
  • 1611 views
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;
    This topic has been closed for replies.

    2 replies

    ST Technical Moderator
    May 8, 2017
    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

    In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
    Kevin Carney
    Associate
    March 7, 2018
    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

    linh nguyen
    Associate
    May 25, 2017
    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.