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.

Program hanging when trying to set AUX Clock for USB

Other Parts Discussed in Thread: CONTROLSUITE

Hello,

I am trying to set the AUX clock using the following function, SysCtlAuxClockSet().  Once in the function it hangs on the following, 

//Wait for the SYSPLL lock
while(ClkCfgRegs.AUXPLLSTS.bit.LOCKS != 1)
{
// Uncomment to service the watchdog
// ServiceDog();
}

I had this working in bare metal configuration, but once I merged this to our development project that uses SYS/BIOS, this happened.  I read somewhere that it has something to do with InitSysCtrl();, but I am not sure.  Our program starts by doing initial board setup (including InitSysCtrl();) and then runs the BIOS.  Once started, I try to setup the USB, and that is where it gets trapped in that loop.  

PS.  Using F28377D

  • Michael,

    Are you running the whole system off of an external oscillator? If so, InitSysCtrl() is probably disabling INTOSC2 when it configures the system PLL. To change the aux PLL clock source from INTOSC2 to XTAL, both clock sources must be active. Check the state of ClkCfgRegs.CLKSRCCTL1.bit.INTOSC2OFF before the call of SysCtlAuxClockSet(). If it's 1, that's your problem.

  • I actually don't have a way to test it at the moment because my board broke and we need to order more, but suppose this is the case.  What is the method to fix it?  Is there functions to turn it back on, or can I just change the bit in that register?

  • For debug purposes, you can write directly to that register before switching the aux clock source:

    EALLOW;
    ClkCfgRegs.CLKSRCCTL1.bit.INTOSC2OFF = 0;
    EDIS;

    If you need to make that a permanent fix, add a 40 us delay afterwards to be sure INTOSC2 finishes its power-up. A better solution is to change your system clock setup code to leave INTOSC2 running. Look for a line like:

    ClkCfgRegs.CLKSRCCTL1.bit.INTOSC2OFF = 1;

    and remove it.

    INTOSC2 needs to be active because the clock source select is a glitch-free mux that requires both the old and new clock to be running. I'll make sure this is clarified in the next release of the F2837xD documentation. The AUXPLLSTS.LOCKS bit is controlled by a counter that runs off of AUXOSCCLK. The only thing that can keep it from locking is if AUXOSCCLK is missing.

    Aside from that, the other main concern with the PLL is that the frequency after the multiplier (known as the VCO frequency) has to be between 110 and 550 MHz.

    Please let me know if you need any further assistance.

  • Adam,

    Thanks!  Inside InitSysCtrl(), InitSysPll() is called which in turn calls SysXtalOscSel().  This turns off INTOSC2 as you mentioned.  I will comment out the line that disables it.  

    Thanks,
    Michael

  • Michael,

    It sounds like you're using version 100 of the controlSUITE package for F2837xD. There's a new version (110) available that fixes that problem. You can update your controlSUITE to get it. I probably should've suggested that first. :-)

  • Are there change-logs that we have access to for these different versions?  I see v120 just got pushed to me today.  

  • Yes. Look in the device_support\F2837xD\v120\doc directory for a file named F2837xD-FRM-EX-UG.pdf. There's a detailed revision history in section 1.1.