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.

A question for the TI StarterWare USB team

Other Parts Discussed in Thread: OMAP-L138

I'm doing some debugging, trying to get my USB code to work, (I'm having a problem with the tick timer not working...).  When I came across an apparent contradiction in the TI code.  Perhaps it may help the TI USB team (and might eventually help me debug my code).

The contradiction became visible in the function USBDHIDCompositeInit(), which says:

// Register our tick handler (this must be done after USBDCDInit).
InternalUSBRegisterTickHandler(...);

However, USBDHIDCompositeInit() is called before USBDCDInit(), not after, hence the contradiction. The TI comment is warning us of something, but the TI code itself does not obey the warning.  

So I looked further. It appears the timer TickHandler gets registered, and then immediately zero'd out. 

I here document the collision with pseudo-code snippets all from the Starterware package: 

USBDHIDInit(...)
{
  .
  .
  .     
  USBDHIDCompositeInit(...);
  USBDCDInit(...);
}

Notice the sequence of those function calls. Next I'll expand those in the same sequence.

USBDHIDCompositeInit(...)
{
 .
 .
 .
    // Register our tick handler (this must be done after USBDCDInit).    
    InternalUSBRegisterTickHandler(...);
}

 

USBDCDInit(...)
{
    .
    .
    .
    // Initialize the USB tick module.
    InternalUSBTickInit();
    .
    .
    .
}

In other words, the following two functions get called in this sequence:

InternalUSBRegisterTickHandler(...)
{    
    g_pfTickHandlers[ulHandler] = pfHandler;    
    g_pvTickInstance[ulHandler] = pvInstance;
}

InternalUSBTickInit()
{    
    g_pfTickHandlers[ulLoop] = 0;    
    g_pvTickInstance[ulLoop] = 0;
}

The first function registers the tick handler, and the second undoes it (by zeroing it out), so the tick handler is no longer registered and can no longer function.

Only a little further in this same routine, it disconnects the USB device, then waits 100 milliSeconds (using the tick handler), and then reconnects the USB device. In my case, it never returns from the 100 milliSecond wait because the tick handler is not working.  At least, that is my understanding of it.

Am I mistaken here?

 

  • Hi Walter Snafu,

    Your understanding with the tick handler being reset is correct.

    This issue has already been noted and will be taken care in the next release. The existing examples are working as the tick handler is triggered not through tick timer but called by some other direct means, say, from "usbdbulk.c: HandleEndpoints" function in case of Bulk device class.

    Regards
    Sirish

  • Naga Sirish Kumar Sannala said:
    Your understanding with the tick handler being reset is correct. This issue has already been noted and will be taken care in the next release. The existing examples are working ....

    Thanks for getting back to me.  In most respects I love TI DSP, and their support forum.

    Though I have to lament how terribly long it is taking to get the USB port working.  I've been at this for TWO YEARS! Trying to get answers from TI about their USB.  Remember the Jungo/BIOSUSB package that turned out to be useless?  Then StarterWare v1.  Then v2.  Then v3.  Then it was discovered the TI ARM compiler couldn't handle packed structures (necessary for USB communication).  And now a whole bunch of bugs and poor-documentation still lingering in the StarterWare package. Despite the fact that I (and many others) attended the TI seminar one year ago, titled "USB: From Introduction to Rapid Development." (I'll discuss this chronology more in a separate thread.)

    At each of these stages there were further months of delay and further promises from TI that a solution would soon be forthcoming "in the next release."  Plus TI employees implicitly acknowledging they knew about the problems, but didn't tell us. We users were left twisting-in-the-wind, to dig through the TI USB software and discover/debug the problems on our own.....

    I've been up and down this rollercoaster ride too many times.  I'm despondant about it.  My bosses CAN'T BELIEVE it takes so long to develop a USB port.  They're looking at me in cross-eyed disbelief.  It's just a freaking USB port!  Everyone else has had USB working for decades!!!

    Today I took a peek at my part's silicon errata sheet (OMAP-L138).  Unlike most errata sheets, this time it's a long document. You wouldn't believe how many times USB is mentioned in the errata, with arcane "work-arounds" -- each with its own peculiar impact on software development. This adds yet further complexity to the existing bugs and insufficient Starterware documentation. This is a confounding maze that only TI can sort out.

    To all this TI proudly points out, "The existing USB examples are working!" That's great if you're using your super-complex TI DSP system to monitor a keyboard or mouse clicks, or as a file server. But if we want to communicate real DSP data, then we're out of luck.

    At this point I need real reassurances from TI about their USB, and a serious time-table.