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.

MSP432E401Y: ULPI example?

Part Number: MSP432E401Y
Other Parts Discussed in Thread: TUSB1210, TM4C129ENCPDT

I am trying to get a high-speed ULPI interface working with the MSP432E401Y Launchpad.

My application works great using the internal full-speed PHY.  I have purchased a TI TUSB1210 eval board and am trying to integrate it to get high-speed working.  After some hiccups (it wasn't documented in the "EVM Installation" section of the eval board manual that you need to provide an external 1.8V supply - you would think that the eval board would include that), the eval board seems to be up and running - it is emitting a 60 MHz 1.8V clock on CLOCKOUT.

I believe I've wired all 12 ULPI signals to the 432, and I've

  • Called GPIOPinConfigure for each pin to select its USB function
  • Called GPIOPinTypeUSBDigital for each pin
  • Called GPIOPadConfigSet for the 10 pins that are outputs, to set their drive strength to 12 mA
  • Called USBDCDFeatureSet(0,USBLIB_FEATURE_USBULPI, &ui32ULPI) with ui32ULPI = USBLIB_FEATURE_ULPI_HS
  • Called USBDCDFeatureSet(0, USBLIB_FEATURE_USBPLL, &ui32PllRate) with ui32PllRate = 0 in order to select External Clock (this is NOT documented, but I was able to suss it out by browsing the DriverLib code).

I can see the 60 MHz clock going to the 432.

But startup fails during USBDCompositeInit(), which calls USBDCDInit(), which calls ULPIConfigSet(), which calls USBULPIRegRead().  RegRead hangs waiting for the USB_ULPIREGCTL_REGCMPLT flag to come true.

When I investigate with my scope, I discovered that the USB0STP signal from the 432 is not behaving as I expected.

  • It is not going low to signal a ULPI transaction
  • It is pinned high at 3.3V, whereas I was expecting it to be a 1.8V-level signal to match the ULPI PHY.

I have spent at least two hours searching for examples.  The closest I have found is for the TM4C29x, but I haven't found actual code.  I did find a query from a guy on the forums who was struggling with a similar issue for the TM4C29x.  I have driven all of his stuff to ground and can't find anything he's doing that I wasn't.  Although I didn't find where he'd achieved success, either.

But I haven't found a whiff on a search for ULPI & MSP432E4.  Any pointers?  It would be great to have a single working example.

Thanks,

Brad

  • Hey Braden,

    Wanted to check-in.  If so, please share!  I did some searching, and I couldn't find any ULPI examples from our side.  It sounds like that TM4C post you found was probably the best resource on this topic.  

    Were you able to get this working?

    Thanks,

    JD

  • Actually, I did find this post from Amit about modifying an example to configure for a ULPI interface with external USB PHY.  https://e2e.ti.com/support/microcontrollers/msp430/f/166/t/652139?MSP432E401Y-Is-there-a-sample-program-that-supports-USB-high-speed-with-MSP432E4- 

    Thanks,

    JD

  • No luck.  More specifically, it barely worked once, for a minute, but was not repeatable.

    I have learned a heck of a lot, but apparently not quite enough.  For now we have given up on using the MSP432E for this, unless you have additional suggestions.

    • Briefly, in terms of the email from Amit that you found, I am pretty sure that the "once change required" corresponds to the call to USBDCDFeatureSet() that I mentioned doing in the fourth bullet of my original post.  (Turns out that one additional call - my fifth bullet - is needed if you want to use an external clock, which is the only option with the most common PHY solution.)
    • It turns out that the TI TUSB1210 part is not compatible with the 432 - it is intended for interfacing with a 1.8V microcontroller.  I had assumed that the 1.8V was part of the ULPI standard, but it's not.  There are 3.3V PHY parts.
    • So I tried a different part, the Microchip USB3300.  It appears to be a de facto standard.  You can buy USB3300 ULPI modules on ebay for <$20.
    • I learned that the USB3300's Reset pin is active high.  I was scratching my head for a while there.

    From there, things just get flaky. 

    • It turns out that I have to send a Reset pulse to the USB3300 prior to initializing the 432's USB, even though the module includes POR circuitry.  I was able to achieve reliable startup of the USBLib with that addition.
    • However, Windows never sees the device.  (My software all works fine, with Windows, using the built-in FS PHY.)
      • There is clearly a lot of traffic going over the "ULPI bus" between the 432 and the PHY chip, but none of it is documented in the 432 Tech Ref.  I poked at it a little bit with my scope and was able to see things like a ULPI Reset instruction.   But it is nearly pointless to try to debug since there's no reference as to what I *should* be seeing - the Tech Ref simply says to refer to the ULPI spec.  But that simply tells the capability of the PHY, not what the 432 is supposed to be doing with it.
      • In early testing, before I solved the USB3300 Reset problem, it would be typical to hear the USB "Boop-boop" from Windows, followed by "Unrecognized Device".
      • There was even a time where I got into an "endless boop-boop" loop where it was detecting the device but then not recognizing it, then repeating.

    But I'm pretty sure my code is correct.  It works with the built-in FS PHY.  And during all my many attempts (and surprisingly, during the phase before I figured out that I needed to provide a Reset pulse to the PHY), there was exactly one time that I saw the device fully initialized in Windows.  For example, in Device Manager, I could see the vendor ID string that I had programmed in my code.  That means that a whole lot of stuff worked correctly.

    But I got there by a weird path and could not reproduce it.  The thing that got me there was after I had rebooted the 432 but not yet fully initialized things on the 432 end.  So their was the "tail" of some previous run combined with the beginning of the new run and somehow the state was sufficient.  The device was not actually functional at that point - it simply appeared in Windows, and it went away once my second-run initialization finished.

    I spent another day or so on it after that, but I was in a position of having to debug an undocumented interface, so just gave up.  If TI has a hardware example that's known to work, I could try that.  I had chosen the TI TUSB1210 because it was a TI part and came with an eval module, but that turned out to be the wrong choice because of the voltage.  (BTW, the manual for that part is *terrible* - download it and just skim through it yourself.  There are places where the writing is so bad that there really are two equally valid interpretations.) 

    If there is a 3.3V TI part with an eval module (with the 20-pin ULPI connector), it's possible that we'd be willing to give that a quick try.  Much better would be an actual known-to-work example with the 432.

    Thanks,

    Brad

  • Not sure if this helps, but there is the USB High Speed Reference Design for ARM® Cortex®-M4F Based High Speed TM4C129x MCU which uses a USB3300 connected to a TM4C129ENCPDT and has a software example available.

    Since the MSP432E and TM4C129 series uses the same peripherals, the software for that reference design should serve as a reference for your MSP432E design.

  • Wow, nice find!

    I was very excited at first.  There is a schematic I can compare.  The PHY part looks pretty much identical to my Waveshare USB3300 module.  There is one noteworthy difference.  In my module, the ID pin of the USB connector is brought to the USB3300.  In the reference design, ID is pulled high, and ID from the connector is unconnected.  I don't know enough about USB at the moment to understand the implications of that.

    But the only software I see is a little diagnostic application.  I'm not seeing any source code.  And the User Guide for the board is pretty thin on detail, about the same as in the DriverLib guide or other docs.

    So the schematic is new information and is comforting, but I'm not seeing how to use it.

    I suspect that it has the same documentation "TivaWare USB Library" that I already have (SPMU297E).  

    Do you know where I could find source code examples of ULPI in action with this board?  The copy of USBLib I've been using for the 432 doesn't have any ULPI examples; hopefully they exist for this board.

    Thanks,

    Brad

  • Braden Hines said:
    I'm not seeing any source code. 

    I downloaded TIDM-TM4C129USBHS Software and ran the installer on a Windows 10 PC.

    There is source code and a CCS project, for which is a USB 2 Ethernet example application:

    C:\>dir "c:\Program Files (x86)\Texas Instruments\TM4C\TM4C129USBHS-1.0\tidm_tm4c129cusbhs2ethernet"
     Volume in drive C has no label.
     Volume Serial Number is D6FD-9E86
    
     Directory of c:\Program Files (x86)\Texas Instruments\TM4C\TM4C129USBHS-1.0\tidm_tm4c129cusbhs2ethernet
    
    24/02/2021  22:24    <DIR>          .
    24/02/2021  22:24    <DIR>          ..
    23/09/2016  18:54               485 .ccsproject
    23/09/2016  20:37            30,882 .cproject
    24/02/2021  22:24    <DIR>          .launches
    23/09/2016  18:54             1,853 .project
    24/02/2021  22:24    <DIR>          .settings
    24/02/2021  22:24    <DIR>          Debug
    19/09/2016  17:44            19,046 lwipopts.h
    21/01/2016  01:33                26 macros.ini_initial
    21/09/2016  00:19            13,483 startup_ccs.c
    26/09/2016  18:31             1,128 target_config.ccxml
    26/09/2016  18:38               872 target_config.uniflashsession
    23/09/2016  20:39            19,633 tidm_tm4c129cusbhs2ethernet.c
    05/04/2016  14:36             2,806 tidm_tm4c129cusbhs2ethernet.cmd
    05/04/2016  14:36             7,116 usb_bulk_structs.c
    23/09/2016  19:35             2,695 usb_bulk_structs.h
    24/02/2021  22:24    <DIR>          utils
                  12 File(s)        100,025 bytes
                   6 Dir(s)  990,359,031,808 bytes free

    Inside tidm_tm4c129cusbhs2ethernet.c there are calls to use ULPI for high speed. E.g.:

        //
        // If High Speed Mode is requested then set ULPI option for high speed.
        //
        if(bUSBBusMode)
        {
            ui32ULPI = USBLIB_FEATURE_ULPI_HS;
            USBDCDFeatureSet(0, USBLIB_FEATURE_USBULPI, &ui32ULPI);
        }

  • Ah!  Super helpful, thanks!  I thought the installer had only installed a little tool, did not realize it had installed a whole source tree.

    I do have the exact line you call out in my own source code, but I'm guessing there is something about the order of calls that is important.

    This doesn't necessarily ensure that my application will work now, but I would say you have answered my call for both hardware and software representative examples, so I'll go ahead and mark this resolved.

    Thank you so much for your help!

    Brad