AnsweredAssumed Answered

BF54x usb driver hang when unplug USB stick

Question asked by chris@dw on May 24, 2013
Latest reply on May 26, 2013 by chris@dw
  • My project use custom board with BF542
  • the project use none OS, and use ADI usb drivers
  • BF542 is config as USB host

While BF542 is writing data to USB stick, the program will hang if the USB stick was unplugged.

The program will hang on a while loop as shown below.

Please help, thanks.

 

C:\Program Files\Analog Devices\VisualDSP 5.0\Blackfin\lib\src\drivers\usb\controller\otg\adi\hdrc\adi_usb_hdrc.c

 

TransmitDataBuffer()

{

................. line 3512

       /* check if FIFO is empty or not */

   if(*pUSB_TXCSR & (1 << 1))

   {

           /* only for the bulk endpoints we will wait */

             if(IS_BULK(pEpO->pEndpointDesc->bAttributes))

                  while(*pUSB_TXCSR & (1 << 1)) ; // <--- the program hang on this line if USB stick unplugged

             else

               *pUSB_TXCSR |= (1 << 3);

   }

 

.................

}

Outcomes