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.

TMS570LC4357: Errata SSWF021 clarification

Part Number: TMS570LC4357
Other Parts Discussed in Thread: HALCOGEN

We have a custom board using TMS570LC4357 with the following connections -- shown in the picture pasted at the end of this query.

In the configuration we are testing, R31 is absent and hence there is no OSCIN input to the MCU.

The clock comes into GIOA5/EXTCLKIN. HALCoGen generates a call to _errata_SSWF021_45_both_plls(PLL_RETRIES) from _c_int00 if the reset source is POWERON_RESET.

void _c_int00(void)
{
    register resetSource_t rstSrc;
/* USER CODE BEGIN (5) */
/* USER CODE END */

    /* Initialize Core Registers to avoid CCM Error */
    _coreInitRegisters_();
    
    /* Initialize Stack Pointers */
    _coreInitStackPointer_();

    /* Reset handler: the following instructions read from the system exception status register
     * to identify the cause of the CPU reset.
     */
    rstSrc = getResetSource();
    switch(rstSrc)
    {
        case POWERON_RESET:
        /* Initialize L2RAM to avoid ECC errors right after power on */
        _memInit_();

        /* Add condition to check whether PLL can be started successfully */
        if (_errata_SSWF021_45_both_plls(PLL_RETRIES) != 0U)
        {
            /* Put system in a safe state */
            handlePLLLockFail();
        }
        
/*SAFETYMCUSW 62 S MR:15.2, 15.5 <APPROVED> "Need to continue to handle POWERON Reset" */
        case DEBUG_RESET:
        case EXT_RESET:

.......

Now this _errata function seems to assume the presence of OSCIN.

uint32 _errata_SSWF021_45_both_plls(uint32 count)
{
    uint32 failCode,retries,clkCntlSav;

    /* save CLKCNTL */
    clkCntlSav = systemREG1->CLKCNTL;
    /* First set VCLK2 = HCLK */
    systemREG1->CLKCNTL = clkCntlSav & 0x000F0100U;
    /* Now set VCLK = HCLK and enable peripherals */
    systemREG1->CLKCNTL = SYS_CLKCNTRL_PENA;
    failCode = 0U;
    for(retries = 0U;(retries < count); retries++)
    {
        failCode = 0U;
        /* Disable PLL1 and PLL2 */
        failCode = disable_plls(SYS_CLKSRC_PLL1 | SYS_CLKSRC_PLL2);
        if(failCode != 0U)
        {
            break;
        }

        /* Clear Global Status Register */
        systemREG1->GBLSTAT = 0x00000301U;
        /* Clear the ESM PLL slip flags */
        esmREG->SR1[0U] = ESM_SR1_PLL1SLIP;
        esmREG->SR4[0U] = ESM_SR4_PLL2SLIP;
        /* set both PLLs to OSCIN/1*27/(2*1) */
        systemREG1->PLLCTL1 = 0x20001A00U;
        systemREG1->PLLCTL2 = 0x3FC0723DU;

........

So what happens in our configuration? Does this function fail, causing the MCU to go into a "safe" state?

The handlePLLLockFail() is just an infinite while loop .. while(1) {}

Are we supposed to just remove this check from HALCoGen generated code in our configuration?

All help in understanding this situation is much appreciated.

Thank you

Subu

  • Hello,
    The input for PLL is OSCIN. PLL can't be used with EXTCLKIN as input. This errata considers using PLL.

    Best regards,
    Miro
  • Miro:

    OK. What does that imply for my board hardware configuration with ONLY EXTCLK?

    a. The _errata code is generated by HALCoGen 4.7.1 regardless of the clock configuration.

    So will it always fail if there is no OSCIN?

    b. Should I be manually removing this piece of code in the generated code?

    c. Can OSCIN be a 40 MHz clock? It looks like it cannot be. That's why we had to go the EXTCLK route. There is no physical oscillator on the board either.

    Currently, I have a dead board and I am trying to figure out the cause and remedy.

    d. Is there a better hardware design given the constraints of only having an EXTCLK and other SWAP criteria?

    What are the various conditions in which it can fail?

    Please see e2e.ti.com/support/microcontrollers/hercules/f/312/p/788625/2923336#2923336

  • Hello Subu,

    a. If OSCIN and PLL are not used in your application, the PLL workaround is not applicable to you. You can comment out this function call:

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

    The CPU clock (GCLK1), the system clock (HCLK) and the peripheral clock (VCLKx) use the same clock source selected via the GHVSRC register.

    The default source for the GCLK1, HCLK, and VCLKx is the main oscillator. That is, after power up, the GCLK1 and HCLK are running at the OSCIN frequency, while the VCLKx frequency is the OSCIN frequency divided by 2. The oscillator can be disabled by setting the bit 0 in CSDIS register. The oscillator clock detect circuitry can also be disabled, please refer to 14.4.5.1 in TRM.

    You can choose the clock source for wake up via the GHVWAKE field.

    b. yes, you can

    c. No, the maximum OSC input frequency is 20MHz.

    d. You can use an external 3.3V clock signal which is connected to OSCIN. Please refer to the datasheet (6.6.1.1).