This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

USB Host driver stops other interrupts while device attaches.

Other Parts Discussed in Thread: TM4C129ENCPDT

I am writing a USB Host interface for the UBLOX Lisa U2 GSM modem.

I have done host interfaces for Sierra Wireless, Cinterion, UBLOX Toby with no issues but the UBLOX Lisa U2 has a funny start up.

It first presents itself as VID=0x058B  and PID=0x0041when it first boots, then some 2 -4 seconds later represents as a different VID = 0x1546 and PID = 0x1102.

I am only trying to handle the connection from the final VID/PID so haven't registered a driver for the initial VID/PID

For some reason the USB drivers seem to block the interrupts from my UART and SPI for 30 to 40 seconds after the module connects.

If I stop the debugger whilst the code is hung it is always in interrupt.c "IntDisable" or "IntEnable"

The interrupt being disabled/enabled varies - I have seen disable for general interrupt 58, enable for general interrupt 42

When I restart the debugger it will resume operation as expected, no longer being frozen.

If I leave the code running after a reset either under debugger or without, the application will freeze for 20 to 30 seconds before starting normal operation.

This freezing is always associated with the USB device first trying to connect.

It seems like the USB driver is rapidly disabling interrupts or something and blocking all other interrupts from working, once it stops doing this other tasks and interrupts resume normal operation. The second enumeration of the final VID/PID never seems to occur.

  • I should add that I am using TM4C129ENCPDT processor with tirtos_tivac_2_12_01_33 library under CCS V6
  • Seems to be this code in usbhostenum.c which is causing everything else to be frozen out for some time

    //

       // Block until endpoint 0 returns to the IDLE state.

       //

       while(g_sUSBHEP0State.iState != eEP0StateIdle)

       {

           OS_INT_DISABLE(g_sUSBHCD.ui32IntNum);

           if((g_sUSBHCD.ui32IntEvents & (INT_EVENT_ENUM | INT_EVENT_SOF)) ==

              (INT_EVENT_ENUM | INT_EVENT_SOF))

           {

               g_sUSBHCD.ui32IntEvents &= ~(INT_EVENT_ENUM | INT_EVENT_SOF);

               USBHCDEnumHandler();

           }

           OS_INT_ENABLE(g_sUSBHCD.ui32IntNum);

           if(g_sUSBHEP0State.iState == eEP0StateError)

           {

               return(0xffffffff);

           }

           //

           // If we aborted the transfer due to an error, tell the caller

           // that no bytes were transferred.

           //

           if(g_sUSBHCD.ui32IntEvents & (INT_EVENT_VBUS_ERR |

                                         INT_EVENT_DISCONNECT))

           {

               return(0xffffffff);

           }

       }

  • Barry,

    It appears that you are using the TivaWare's USB library to create your own USB host driver and not using the TI-RTOS services directly. So I went ahead and moved this thread over to the device forum in hopes you can get a faster answer there.