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.

IWR6443: external watchdog implementation in iwr6443

Part Number: IWR6443

Hello,

i am implementing APIs for external watchdog in iwr 6443.the iwr 6443 will keep on sending 150ms low and 50ms high signal to Power management IC(PMIC). if iwr 6443 fails and stop responding, then 150ms low and 50ms high signal will not be sent to PMIC. So PMIC will monitor this and start sending 10ms low signal in each 5 sec interval to WARM_RESET pin of iwr 6443. So iwr 6443 will reset. So i can get 10ms low signal in each 5 sec interval to WARM_RESET pin of iwr6443 which perform warm rest the processor. Using watchdog_open(),watchdog_control() etc ...APIs, I am trying to implement watchdog .But due to some issue warm reset is not occurring.

Below find the APIs i implemented. Please let me know,  What are the changes should i do , to detect 10ms low signal in WARM_REST pin and cause processor warm reset.

int32_t ROA_watchdog_Test()
{
    Watchdog_Params     watchdogParams;
    int32_t             errCode = 0;
    Watchdog_ResetMode  resetMode;
    Watchdog_WindowSize windowSize;

    /* Initializa the Watchdog driver */
    Watchdog_init();

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

    if (testSelection == (uint32_t)WATCHDOG_APP_TEST_RESET)
    {
        watchdogParams.resetMode = Watchdog_RESET_ON;
        CLI_write("resetMode = Watchdog_RESET_ON\n");
    }
    if (testSelection == (uint32_t)WATCHDOG_APP_TEST_INTERRUPT)
    {
        watchdogParams.resetMode = Watchdog_RESET_OFF;
        watchdogParams.callbackFxn = watchdogCallback;
        CLI_write("resetMode =WATCHDOG_APP_TEST_INTERRUPT\n");
    }
    watchdogParams.debugStallMode = Watchdog_DEBUG_STALL_ON;
    watchdogParams.windowSize = Watchdog_WINDOW_100_PERCENT;
    watchdogParams.preloadValue = 20;
    watchdogParams.socHandle = socHandle;
    watchdogParams.esmHandle = esmHandle;

    /* Open the Watchdog driver */
    watchdogHandle = Watchdog_open(0U, &watchdogParams);
    if (watchdogHandle == NULL)
    {
        CLI_write("Error: Watchdog Driver Open failed\n");
        return -1;
    }
    else
    {
        CLI_write("Watchdog Driver Open success\n");
    }

       
    if (testSelection == (uint32_t)WATCHDOG_APP_TEST_RESET)
    {
        /* Wait for the watchdog to expire and trigger a warm reset */
        CLI_write("Wait for the watchdog to expire and trigger a warm reset \n");
         while (1);
    }
    else if (testSelection == (uint32_t)WATCHDOG_APP_TEST_INTERRUPT)
    {
        while (gWatchdogInt == (uint32_t)0U)
        {
            //Do nothing
        }
        CLI_write ("Debug: Watchdog Driver NMI received\n");
    }
    else
    {
        //Do nothing
    }
    
    /* Configure the Watchdog reset mode ON */
    resetMode = Watchdog_RESET_ON;
    errCode = Watchdog_control (watchdogHandle, WATCHDOG_CMD_RESETMODE, (void* )&resetMode);
    if (errCode < 0)
    {
        CLI_write ("Error: Watchdog control Set Reset Mode failed [Error code %d]\n", errCode);
        return -1;
    }
    else
    {
       CLI_write ("Watchdog control Set Reset Mode success \n");
    }

    /* Configure the Watchdog reset mode OFF */
    resetMode = Watchdog_RESET_OFF;
    errCode = Watchdog_control (watchdogHandle, WATCHDOG_CMD_RESETMODE, (void* )&resetMode);
    if (errCode < 0)
    {
        CLI_write ("Error: Watchdog control Set Reset Mode failed [Error code %d]\n", errCode);
        return -1;
    }
    else
    {
       CLI_write ("Watchdog control Reset off Mode success \n");
    }

    /* Configure the Watchdog Window size 50% */
    windowSize = Watchdog_WINDOW_50_PERCENT;
    errCode = Watchdog_control (watchdogHandle, WATCHDOG_CMD_WINDOWSIZE, (void* )&windowSize);
    if (errCode < 0)
    {
        CLI_write ("Error: Watchdog control Set Window size failed [Error code %d]\n", errCode);
        return -1;
    }
    else
    {
        CLI_write ("Watchdog control Set Window size success \n");
    }


    /* Configure the Watchdog Window size 25% */
    windowSize = Watchdog_WINDOW_25_PERCENT;
    errCode = Watchdog_control (watchdogHandle, WATCHDOG_CMD_WINDOWSIZE, (void* )&windowSize);
    if (errCode < 0)
    {
        CLI_write ("Error: Watchdog control Set Window size failed [Error code %d]\n", errCode);
        return -1;
    }

    /* Configure the Watchdog Window size 12.5% */
    windowSize = Watchdog_WINDOW_12_5_PERCENT;
    errCode = Watchdog_control (watchdogHandle, WATCHDOG_CMD_WINDOWSIZE, (void* )&windowSize);
    if (errCode < 0)
    {
        CLI_write ("Error: Watchdog control Set Window size failed [Error code %d]\n", errCode);
        return -1;
    }

    /* Configure the Watchdog Window size 6.25% */
    windowSize = Watchdog_WINDOW_6_25_PERCENT;
    errCode = Watchdog_control (watchdogHandle, WATCHDOG_CMD_WINDOWSIZE, (void* )&windowSize);
    if (errCode < 0)
    {
        CLI_write ("Error: Watchdog control Set Window size failed [Error code %d]\n", errCode);
        return -1;
    }

    /* Configure the Watchdog Window size 3.125% */
    windowSize = Watchdog_WINDOW_3_125_PERCENT;
    errCode = Watchdog_control (watchdogHandle, WATCHDOG_CMD_WINDOWSIZE, (void* )&windowSize);
    if (errCode < 0)
    {
        CLI_write ("Error: Watchdog control Set Window size failed [Error code %d]\n", errCode);
        return -1;
    }

    return 0;
}