Lockup initializing WatchDogTimer

I would like to have a WDT working on my BF700 project. Currently the code to initialize it (borrowed from ADI) locks the board up on the line with the lock up comment).

static void initWdt (void)
{
    /* SEC configuration for WDOG to issue FAULT */
    *pREG_RCU0_BCODE = 0x0;

    *pREG_RCU0_CTL |= BITM_RCU_CTL_SRSTREQEN;

    *pREG_SEC0_GCTL  = ENUM_SEC_GCTL_EN;
    *pREG_SEC0_SCTL3 = (BITM_SEC_SCTL_FEN | BITM_SEC_SCTL_SEN); // Fault Enable | Source (signal) Enable
    *pREG_SEC0_FCTL  = (BITM_SEC_FCTL_EN | BITM_SEC_FCTL_SREN); // WDOG Enable | System Reset Enable
    *pREG_WDOG0_CNT  = FIVE_SECONDS; // Defined as '500'
    *pREG_WDOG0_CTL  = 0x01;         // Start the WDOG - THIS LINE CRASHES THE BOARD!!!!
}

#pragma section ("L2_sram")
void serviceWdt (void)
{
    *pREG_WDOG0_STAT = 1; // this action resets the current counter in the WDOG_STAT register to the
                          // programmed WDOG_CNT value
}

Any clue what I am doing wrong?

Alan

Parents Reply Children