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.

IWR6843ISK-ODS: Watchdog problem

Part Number: IWR6843ISK-ODS

Hi,

 In 3D People Counting, a watchdog is added, but the callback function of the watchdog is not included.  The following is the initialization function of the watchdog, please help me to have a look.  thank you

void mbRadar_watchdogInit(void)
{
    Watchdog_Params     watchdogParams;

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

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

    gWatchdogInt = 0;

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

    watchdogParams.debugStallMode = Watchdog_DEBUG_STALL_ON;
    watchdogParams.windowSize = Watchdog_WINDOW_100_PERCENT;

    /* texp = (DWDPRLD + 1) x 8192 / RTICLK. if RTICLK = 200MHz then 255 means 10.5ms .*/
    watchdogParams.preloadValue = 255;
    watchdogParams.socHandle = gMmwMssMCB.socHandle;
    watchdogParams.esmHandle = gMmwMssMCB.esmHandle;
    /* Open the Watchdog driver */
    watchdogHandle = Watchdog_open(0, &watchdogParams);
    return;
}

  • Hello,

    Can you please confirm which version of the toolbox you are using and which lab and files you are looking at?

    Thanks,

    Jackson

  • HI,

    The 3D people counting project in version 4.6 is used。

  • I'm not sure I understand what your question is. This is a function you have implemented in the people counting demo?

    Please make sure you have seen the test code implementation of the watchdog in 6843 at the below path.

    "C:\ti\mmwave_sdk_03_05_00_04\packages\ti\drivers\watchdog\test\xwr68xx"

    Regards,

    Jackson

  • HI,

    My watchdog initializes as described above and basically runs as a routine. I added a summation variable to the watchdog callback function, then printed the value through a serial port in another task, and found that the value did not change, indicating that the watchdog was invalid.

  • Hello,

    Are you able to run the test code and verify the callback interrupt is triggering. I don't see anything different, other than maybe it isn't linking the callback function correctly. Can you debug and verify that the watchdogCallback pointer is pointing to the correct function?

    Regards,

    Jackson

  • HI、

    As for how to run the test code as you mentioned, I initialized it according to the test code.

  • Hello,

    What does your watchdog callback function look like?

    Regards,

    Jackson

  • Hi,

    This is the watchdog callback function.The main reason is that no callback function is fired.

    void mbRadar_watchdogInit(void)
    {
        Watchdog_Params     watchdogParams;
    
        /* Initializa the Watchdog driver */
        Watchdog_init();
    
        /* Initialize the Watchdog driver default parameters */
        Watchdog_Params_init(&watchdogParams);
    
        gWatchdogInt = 0;
    
        watchdogParams.resetMode = Watchdog_RESET_OFF;
        watchdogParams.callbackFxn = watchdogCallback;
    
        watchdogParams.debugStallMode = Watchdog_DEBUG_STALL_ON;
        watchdogParams.windowSize = Watchdog_WINDOW_100_PERCENT;
    
        /* texp = (DWDPRLD + 1) x 8192 / RTICLK. if RTICLK = 200MHz then 255 means 10.5ms .*/
        watchdogParams.preloadValue = 255;
        watchdogParams.socHandle = gMmwMssMCB.socHandle;
        watchdogParams.esmHandle = gMmwMssMCB.esmHandle;
        /* Open the Watchdog driver */
        watchdogHandle = Watchdog_open(0, &watchdogParams);
        return;
    }
    static void watchdogCallback(Watchdog_Handle handle)
    {
        Watchdog_ResetMode  resetMode;
    
        if(gsensorState != sensorStop)
        {
            gWatchdogInt++;
        }
    
       Watchdog_clear(watchdogHandle);
        if (gWatchdogInt >= 30)
        {
            resetMode = Watchdog_RESET_ON;
            Watchdog_control (watchdogHandle, WATCHDOG_CMD_RESETMODE, (void* )&resetMode);
        }
    
        return;
    }

  • Have you tried including the debug statement from the test program to make sure the watchdog opens correctly? And have you made sure that the initialization is being called correctly and getting all the way through init?

    Thanks,

    Jackson

  • Hi.

    Please help me to check whether the initialization function and the callback function are correct. First, I add a log print to the initialization function. Once the program runs, I can see the log output through the serial port. This indicates that the initialization function has been executed. I don't quite understand what you mean by your last sentence. The initialization function is placed at the end of the initTask.

  • Hello,

    I just copied the functions from the test code into the OOB demo to run this myself. I was able to get it working but had to modify a few more lines. Please try the following and let me know if it is working.

    The test code uses global variables to pass the SOC and ESM handles to the watchdog, please make sure you have declared these variables at the top of the main file as in the test code.

    Watchdog_Handle watchdogHandle;
    SOC_Handle socHandle;
    ESM_Handle esmHandle;

    Also, make sure you are setting both the ESM and SOC handles to these variables in the main() function. The demo code only sets the SOC y default. You will need to initialize these modules and use the return handle with the global vars above.

    esmHandle = ESM_init(0U);
    socHandle = SOC_init (&socCfg, &errCode);

    By setting these variables properly I was able to get the callback function to fire. Let me know if this works for you.

    Regards,

    Jackson