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.

IWR6843: I want to make Watchdog reboot after Watchdog log.

Part Number: IWR6843


Hello

I want to make Watchdog reboot after Watchdog log.

but it can't well,  check plz.

I think do that.

1. Watchdog_clear(watchdogHandle);

2. CLI_write ("Watchdog\n");

3. set resetMode = Watchdog_RESET_ON;

4. next  Watchdog -> reboot

but do not reboot..

int32_t init_watchdog(void)
{
    Watchdog_Params     watchdogParams;
    //int32_t             errCode = 0;
    //Watchdog_ResetMode  resetMode;
    //Watchdog_WindowSize windowSize;

    /* Initializa the Watchdog driver */
    Watchdog_Flag=1;
    Watchdog_init();

    /* Initialize the Watchdog driver default parameters */
    Watchdog_Params_init(&watchdogParams);

    

    watchdogParams.resetMode = Watchdog_RESET_OFF;
    watchdogParams.callbackFxn = watchdogCallback;


    watchdogParams.debugStallMode = Watchdog_DEBUG_STALL_ON;
    watchdogParams.windowSize = Watchdog_WINDOW_100_PERCENT;
    watchdogParams.preloadValue = 0xfff;// ( ( 4095+1 ) * 2^13 )/200,000,000=0.1677s
    watchdogParams.socHandle = gMmwMCB.socHandle;
    watchdogParams.esmHandle = esmHandle;

    watchdogHandle = Watchdog_open(0, &watchdogParams);

    if (watchdogHandle == NULL)
    {
        System_printf ("Error: Watchdog Driver Open failed\n");
        return -1;
    }

    return 0;
}

static void watchdogCallback(Watchdog_Handle handle)
{

    Watchdog_ResetMode  resetMode;
    int32_t             errCode = 0;

    Watchdog_clear(watchdogHandle);
    CLI_write ("Watchdog\n");
    System_printf ("Watchdog\n");


    resetMode = Watchdog_RESET_ON;
    errCode = Watchdog_control (watchdogHandle, WATCHDOG_CMD_RESETMODE, (void* )&resetMode);
    if (errCode < 0)
    {
        System_printf ("Error: Watchdog control Set Reset Mode failed [Error code %d]\n", errCode);
        return;
    }

    return;
}