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.

TMS570LS1227: How to notify user when going into infinite loop in _c_int00() ?

Part Number: TMS570LS1227

Hello! I was checking the _c_int00 function generated by HCG. I noticed that the MCU might go inside infinite loops like these:


if(_errata_SSWF021_45_both_plls(PLL_RETRIES) != 0U)
{
handlePLLLockFail();//Infinite wait inside
}


if ((esmREG->SR1[2]) != 0U)
{
for(;;)
{
}
}


if( pbistIsTestPassed() != TRUE)
{
pbistFail();//Infinite wait inside
}

When MCU goes inside the infinite loop, I need to notify the user, maybe by pulling down the nError pin. How can I do this? esmInit() is called after all the infinite loops in the _c_int00 so does it work if I change the esm config? Or can I pull down the nError pin programatically?

  • Hi,

    1. you can toggle one LED on your board, or you can print a message in console.

    2. For PLL1 slip, the ESM 1.10 and ESM 1.42 are set. You can enable the nERROR for ESM 1.10 and ESM 1.42

    3. When any bit of ESM group 3 is set, the nERROR led will be lit on:

        if ((esmREG->SR1[2]) != 0U)           ---> Group 3 error
        {
            for(;;)
            {
            }
        }

  • Thanks for the reply! The problem is, the infinite loops come before esmInit() and main() in the generated code.

    I found that changes of esm config in HCG resulted in changes of esmInit(). Since esmInit() will not be called before the loops, will esm work as configured?

    Same for the gioInit() for toggling LED. It's called in main(), after all the loops in _c_int00().

    Should I just move esmInit() and gioInit() before the first loop?

  • Hello,

    Yes, you can call gioInit() in _c_int00(). If you toggle GIO pin before the system is initialized (by calling systemInit()), the toggling speed is pretty slow since the OSC is used as the system clock.