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.

CCS/TMS320F280049M: Always get error status when call ASSERT(SysCtl_getClock(DEVICE_OSCSRC_FREQ) == DEVICE_SYSCLK_FREQ);

Part Number: TMS320F280049M

Tool/software: Code Composer Studio

Hi Champs,

when I ran F280049M example code, I found out that when I ran device_init(), there are 2 function which check clock frequency. When I ran ASSERT(SysCtl_getClock(DEVICE_OSCSRC_FREQ) == DEVICE_SYSCLK_FREQ); and it will jump to error loop. I check other examples are all the same status. My c2000ware version is C2000Ware_1_00_01_00.

Could anyone tell how to fix this ? Right now I just comment those ASSERT in each example. Is there other method to solve it ? thanks.

  • Hello,
    I am writing to let you know that a C2000 team member has been assigned to this post and should be answering shortly.

    Regards
    Baskaran
  • Hi Lisa,

    I saw this issue myself just now when I ran an example, but the issue went away before I could track down the cause and I'm not sure why.

    Can step through Device_init() and check out the return values of some of the clock functions? Can you make sure SysCtl_setClock() returns "true"? And can you tell me what SysCtl_getClock() is returning? It should return 100MHz, but that's apparently not happening.

    Does power cycling the board help at all?

    Edit: I assume you didn't make any changes to any of the files, correct? Like you didn't try to change the code to run from a different clock source or anything?

    Thanks,
    Whitney

  • Hi Whitney,

    thanks for your reply. I didn't change source file. I just import the example code. i will try to load code and check return value. Will update to you

    You mentioned that you face this issue before and it is gone. Did you change any hardware setting on controlCARD? i just wonder that is there any hardware setting we should change.  thanks!

  • Hi Lisa,

    I didn't change any hardware settings. The only thing I recall changing was that I rebuilt driverlib.lib.

    Whitney
  • Hi Whitney,

    Please see attach pic. I step into code and found the clockOut is 100Mhz and DEVICE_SYSCLK_FREQ is also 100Mhz. It shouldn't generate fault... Could you please check this ? thanks!

  • Lisa,

    Thanks for the update. Doesn't that say 10MHz? And if clockOut is 0, that means it's reading the the CLKSRCCTL1.OSCCLKSRCSEL and finding that the clock is configured to run off of INTOSC2. However, the DEVICE_SETCLOCK_CFG value that is being passed to SysCtl_setClock() is supposed to be configuring it to the external oscillator.

    Is SysCtl_setClock() returning false? If so, can you step through the function and see if it it's a missing clock failure or a DCC issue that is causing 'status' to be set to false?

    Thanks,

    Whitney

  • Hi Whitney ,
    You are right! Yes. After check the SysCtl_setClock() is returning false. The reason is that SysCtl_isMCDClockFailureDetected() return true. However, I didn't change any PLL setting. Could you please tell me how to solve this ? thanks !
  • Hi Lisa,

    If you clear the MCDSTS bit (call SysCtl_resetMCD()), before calling SysCtl_setClock() does it succeed? Does it stay cleared (for example, if you load a different example or power cycle the board) or do you eventually get another MCD error?

    Thanks,
    Whitney
  • Hi Whitney,

    I tried to write "1" to MCDCR.MCLKCLR but i fail. I use  ClkCfgRegs.MCDCR.bit.MCLKCLR = 1; and HWREG(CLKCFG_BASE + SYSCTL_O_MCDCR) |= (SYSCTL_MCDCR_MCLKCLR); Both method can't work. Also i enter debug mode and try to write value in Register window but i also failed. I wrote EALLOW; beforw code already... Could you please try to clean MCDSTS? thanks 

    Also MCDSTS will be set after power up device. Please see attachment. That mean code always detect MCDSTS and jump to error loop..

  • Hi Lisa,

    I forced MCLKSTS high using OSCOFF and then cleared it using HWREGH(CLKCFG_BASE + SYSCTL_O_MCDCR) |= SYSCTL_MCDCR_MCLKCLR; without any issues.

    I'm going to ask around for some help on this from someone who knows more about MCD, and get back to you.

    Whitney
  • What happens if you use MCLKOFF to turn off the MCD, set MCLKCLR, switch the oscillator source (CLKSRCCTL1.OSCCLKSRCSEL) to something else, and turn the MCD back on again?

    Thanks,
    Whitney
  • Hi Whitney ,
    I tried to switch another oscillator resource which still generate missing clock detection. Could you please help to check why MCD always be 1 after power on the board ? Because there is another FAE also got the same question as me. thanks!
  • The default clock source on power up is INTOSC2, so perhaps there's something wrong with INTOSC2 on your device. Do you happen to have another F28004x board that you are able to use without this issue?

    Even if that is the case, you should be able to power up another clock source and switch to it, and then be able to clear the MCD flag. Is that not working?

    Whitney
  • Hi Whitney,

    I also borrowed another board from FAE. In first time, there is no MCD condition. After a day, another board also got MCD. I didn't change HW and SW.... It is really weird... Which condition will impact INTOSC2 ? thanks.
  • Weird indeed. Do both boards have the MCD error immediately after power cycling them or does power cycling clear one or both of them?

    I was thinking you might have a bad board, but the fact that you're having issues with a second makes that seem unlikely.

    Whitney

  • Hi Whitney,
    both board have MCD error immediately after power board....
  • Are you using the same docking station for both boards? How are you powering them? USB or the 5V supply?

    Whitney