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.

C66x - Failed reboot after hard reset triggered by a watchdog

I am using 6678 silicon rev 2;

I am using a 6678 connected to a host processor via a SRIO switch. The 6678 is also connected to an EEPROM over I2C. The boot mode is I2C. The RBL loads instructions from EEPROM, configures the reconfigures the PLL & SRIO and then waits for the host processor to download code into 6678's internal RAM. After host downloads the code, a doorbell wakes up the DSP to start executing the code in the IRAM. This scheme works well on power up (POR).

6678 SRIO is explicitly removed from reset isolation after bootup.

After bootup, in some error conditions, I hard reset the DSP using software instructions to write to RSTCTRL register on PLL module. This always successfully hard resets the DSP following which the boot process works - i.e boot ROM code runs, and waits for host to sync SRIO port and download code.  

In another use case, I cannot hard reset the DSP in software using RSTCRTL register. In that case, I use the watchdog to hard reset the whole chip.  For some reason, 8/10 times the 6678 does not reboot in this case. I know that watchdog times out, and the hard reset is triggered because I can see some traffic on the I2C bus that is supposed to happen when the internal boot ROM's code starts executing. But for some reason, the SRIO switch port of the 6678 does not come up.

The question I have is what is the difference between a hard reset triggered by a watchdog, and a hard reset triggered by using RSTCTRL? I cannot see why one works and not the other. Both are described in section 7.4.2 of 6678 data sheet.

  • For some reason, for cases where reboot fails after the watchdog triggers a hard reset I also cannot connect the emulator to the 6678 over JTAG.
  • I know that watchdog times out, and the hard reset is triggered because I can see some traffic on the I2C bus that is supposed to happen when the internal boot ROM's code starts executing. But for some reason, the SRIO switch port of the 6678 does not come up.


    Is the i2c bus activity happens 10/10 watchdog hard reset?

    Thank you.
  • I am using 6678 silicon rev 2;

    I hope you are using custom board. As per my understanding, rev2.0 SOC doesn't requires IBL workaround to be programmed in EEPROM. Have you tried ROM SRIO boot for your case?

    Thank you.
  • 1. Yes, I always see some activity on the I2C bus every time the watchdog times out. For some reason, it is seems that not all traffic mataches the traffic I2C has on POR.

    2. We use I2C because we do have some boards that have silicon version 1.0. In any case, the hardware team did try SRIO boot directly for rev 2 boards, but the board did not boot. Probably missing some SRIO configuration.

    Anyhow, we need to continue to support board in the field with rev 1 of silicon. 

    So, we are not sure what could be difference between the two methods of hard reset - RSTCRRL and watchdog triggered.

    Thanks

  • Can you please share the code that you are using to setup the watchdog timer and also let us know if you checked RESETSTAT signal and checked if it shows the same behavior as described in the datasheet. Have you set the OMODE field in the RESETMUX correctly.

    Please check this post for the correct configuration while using watchdog timer :
    e2e.ti.com/.../252870

    Regards,
    Rahul
  • Hi Rahul,

    Yes, I used that post to figure out the watchdog configuration successfully to reset the chip. I then use the CSL API instead. I know it works because I tested the watchdog stand alone; and I also see the PC go to boot ROM address 020B00*.

    Here is the code in any case:

    // Enable emulator reset isolation.

    CSL_PSC_enableModuleResetIsolation(5);

    // reset isolate everything. See what happens

    CSL_TmrObj TmrObj;

    // CSL_IntcParam vectId;

    // CSL_IntcEventHandlerRecord EventRecord;

    Uint16 loadVal;

    CSL_TmrHwSetup hwSetup = CSL_TMR_HWSETUP_DEFAULTS;

    CSL_TmrEnamode TimeCountMode = CSL_TMR_ENAMODE_CONT;

    CSL_Status Status;

    CSL_tmrInit(NULL);

    /* Clear local data structures */

    memset(&TmrObj, 0, sizeof(CSL_TmrObj));

    printf("Debug: Testing Watch Dog Timer...\n");

    /* Open the timer 0. */

    hTmr = CSL_tmrOpen(&TmrObj, 0, NULL, &Status);

     

    /* Validate opened handle */

    if ( (hTmr == NULL) || (Status != CSL_SOK) )

    while(1);

     

    Uint8 CoreId=0;

    /* Prepare config registers to perform HARD reset when WATCHDOG expires */

    /* Unlock kicker */

    CSL_BootCfgUnlockKicker ();

    /* Configure RESET MUX register RSTMUXx for CORE x to reset COREPAC on watchdog timeout */

    U8 resetMuxLockStatus = 0;

    CSL_BootCfgGetResetMuxLockStatus(CoreId, &resetMuxLockStatus);

    printf ("Core %u RSTMUX lock status %u\n", CoreId, resetMuxLockStatus);

    if (0 != resetMuxLockStatus)

    CSL_BootCfgSetResetMuxLockStatus (CoreId, 0);

    // The value needed to reset the chip based on OMODE field of RSTMUX register of 6678 data sheet.

    static const U8 sCHIP_RESET_VALUE = 5;

    CSL_BootCfgSetResetMuxOutputMode(CoreId, sCHIP_RESET_VALUE);

    /* RSTCTRL - unlock RSTCFG register */

    //*((volatile unsigned int *)(0x023100E8)) = 0x00015a69;

    /* RSTCFG - Generate HARD reset when watchdog expires. 0 for hard reset is the default. */

    //*((volatile unsigned int *)(0x023100EC)) = 0x1;

    CSL_BootCfgLockKicker();

    /* Prepare timer to act as a Watchdog timer */

    /* Set the timer mode to WATCHDOG mode */

    hwSetup.tmrTimerMode = CSL_TMR_TIMMODE_WDT;

    hwSetup.tmrPulseWidthLo = CSL_TMR_PWID_FOURCLKS; // CSL_TMR_PWID_FOURCLKS

    hwSetup.tmrClksrcLo = CSL_TMR_CLKSRC_INTERNAL;

    hwSetup.tmrClockPulseLo = CSL_TMR_CP_PULSE;

    hwSetup.tmrClockPulseHi = CSL_TMR_CP_PULSE;

    hwSetup.tmrIpGateLo = CSL_TMR_CLOCK_INP_NOGATE;

    /* load the PRDLO */

    hwSetup.tmrTimerPeriodLo = 0x0;

    /* load the PRDHI */

    hwSetup.tmrTimerPeriodHi = 0x8; // H = 1, L = 0 => 25 seconds approx?

    /* Configure the timer. */

    CSL_tmrHwSetup(hTmr, &hwSetup);

    /* Reset the Timer */

    CSL_tmrHwControl(hTmr, CSL_TMR_CMD_RESET64, NULL);

    /* Start the timer in CONTINUOUS Mode. */

    CSL_tmrHwControl(hTmr, CSL_TMR_CMD_START_WDT, (void *)&TimeCountMode);

    hTmr->regs->EMUMGT_CLKSPD = hTmr->regs->EMUMGT_CLKSPD | (0x000F0000 & 0x10000);

    //hTmr->regs->EMUMGT_CLKSPD = hTmr->regs->EMUMGT_CLKSPD | 0x80000;

    /* Watchdog timer service key1 */

    loadVal = CSL_TMR_WDTCR_WDKEY_CMD1;

    CSL_tmrHwControl(hTmr, CSL_TMR_CMD_LOAD_WDKEY, (Uint16 *)&loadVal);

    /* Watchdog timer service key2 */

    loadVal = CSL_TMR_WDTCR_WDKEY_CMD2;

    CSL_tmrHwControl(hTmr, CSL_TMR_CMD_LOAD_WDKEY, (Uint16 *)&loadVal);

    /* Close opened handle */

    CSL_tmrClose( hTmr );

  • I has this part of code commented out because the default was 0 for hard reset which is what I needed:

    /* RSTCTRL - unlock RSTCFG register */

    //*((volatile unsigned int *)(0x023100E8)) = 0x00015a69;

    /* RSTCFG - Generate HARD reset when watchdog expires. 0 for hard reset is the default. */

    //*((volatile unsigned int *)(0x023100EC)) = 0x1;

    With this code, the CPU did go to RootROM, but the behaviour of I2C and SRIO on bootup were not the same as in the case of POR. 

    So, I explicitly wrote 0 for hard reset, and now the chip boots reliably every time.

    /* RSTCTRL - unlock RSTCFG register */

    *((volatile unsigned int *)(0x023100E8)) = 0x00015a69;

    /* RSTCFG - Generate HARD reset when watchdog expires. 0 for hard reset is the default. */

    *((volatile unsigned int *)(0x023100EC)) = 0x0;

    I dont understand why it behaves this way. If I try soft reset by writing 1 to 0x023100EC, I get the same problem of bootup like I have when I dont write to these two registers at all. Is it possible the default value of this bit 1 for soft reset and its a documentation bug?

    Another question: please elaborate what the SWRST bit of RSTCTRL register (0x023100E8) does. It is set to 1 in the same operation in which the key is written to the register to unlock it:

    *((volatile unsigned int *)(0x023100E8)) = 0x00015a69;

    Thanks