AnsweredAssumed Answered

Analog Devices USB driver for Blackfin 527 hangs

Question asked by LechLorens on Oct 26, 2012
Latest reply on Nov 5, 2012 by CraigG

The USB driver provided by Analog Devices with Visual DSP++ hangs on my Blackfin 527 while waiting for a packet to be transmitted. The hang occurs inside DevDmaInterruptHandler() in the following context (I've substituted macros for the magic numbers used in the original source code for clarity):

 

/* if there is a  short packet at the end, we have to manually set TxPktRdy bit */
if(IS_BULK(pEpO->pEndpointDesc->bAttributes) && dwBytesRemaining)
{
    /* this condition may happen rarely */
    if(*pUSB_TXCSR & FIFO_NOT_EMPTY_T)
    {
        while(*pUSB_TXCSR & FIFO_NOT_EMPTY_T) ; // <-- The driver hangs here
    }

    LoadShortPacket(pBuffer,dwProcessedBytes,dwEpNum);
    /* set the Tx Ready bit for the short packet to go */
    *pUSB_TXCSR = TXPKTRDY_T;

 

This happens for a bulk endpoint with maximum packet size of 64 bytes when a packet of 86 bytes is being transferred. I've tried making the driver use DMA mode 0 only so as to make sure that it is not related to the anomaly 05-00-0460 but to no avail.

 

Please, read on for some probably relevant background on my experience with the driver.

 

I am developing an RNDIS driver to work using the BF527 USB interface. I couldn't get libusb527.dlb I got with Visual DSP++ to work with my

setup due to timing problems and the library hanging inside UsbOtgInterruptHandler() since it incorrectly determined that it operated the A end of the USB.

 

I took the available sources of the library and recompiled them. The compilation failed inside adi_usb_otg_SetInterface() as the call to SetInterface() was made with an insufficient number of arguments.

 

This makes me think that perhaps libusb527.dlb might be compiled from a different version of source code than is distributed along with Visual DSP++. If this should be the case, is it possible to get an updated version?

 

Thank you in advance for any help!

Outcomes