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.

CCS/AWR1642BOOST: AWR1642 watchdog function to achieve

Part Number: AWR1642BOOST
Other Parts Discussed in Thread: SYSBIOS

Tool/software: Code Composer Studio

I'd like to add a watchdog to my project.

I have tried to add functions and content of watchdog directly to implement, compilation did not pass.

Then I tried to directly delete all the original project files, directly to drive (SDK2.0) watchdog driven test program, compiled or have common problems.

Question: how can I add watchdog functionality to my projects, or how can I change how I compile projects,

The error message displayed is as shown in the figure:

  • Hi,

    Here is the code sample to implement watchdog in mmw demo based on SDK 2.1 version.

    mss_main.c--->
    
    
    Watchdog_Handle         watchdogHandle = NULL;
    
    void MmwDemo_setupWatchdog()
    {
    	Watchdog_Params     watchdogParams;
    	
    	/* Initializa the Watchdog driver */
    	Watchdog_init();
    
        /* Initialize the Watchdog driver default parameters */
        Watchdog_Params_init(&watchdogParams);
    	
    watchdogParams.resetMode = Watchdog_RESET_ON;
    	//watchdogParams.callbackFxn = watchdogCallback;
        watchdogParams.debugStallMode = Watchdog_DEBUG_STALL_ON;
        watchdogParams.windowSize = Watchdog_WINDOW_100_PERCENT;
    	/* T-expire = (preloadValue+1) x 2 ^ 13 / RTICLK1 ; RTICLK1=20MHz */
        watchdogParams.preloadValue = 1954; /* 80.03 mSec */
        watchdogParams.socHandle = gMmwMssMCB.socHandle;
        //watchdogParams.esmHandle = esmHandle; /* required in callback mode only */
    
        /* Open the Watchdog driver */
        watchdogHandle = Watchdog_open(0, &watchdogParams);
    }
    
    void MmwDemo_TimerCallBack(void)
    {
    	/* Clear the watchdog (100% window) at every 80msec timer to avoid reset */
    	if(watchdogHandle != NULL)
    	{
    		Watchdog_clear(watchdogHandle);
    	}
    }
    
    /*** Call MmwDemo_setupWatchdog(); before MmwDemo_CLIInit function */
    
    
    mss_mmw.mak --->
    Add watchdog library-- 
    MSS_MMW_DEMO_STD_LIBS = -llibwatchdog_$(MMWAVE_SDK_DEVICE_TYPE).$(R4F_LIB_EXT)
    
    Add watchdog path --
    MSS_MMW_DEMO_LOC_LIBS = -i$(MMWAVE_SDK_INSTALL_PATH)/ti/drivers/watchdog/lib
    
    
    mss_mmw.cfg -->
    /* add timer to the application */
    var Timer = xdc.useModule('ti.sysbios.hal.Timer');
    
    Timer.create(1, '&MmwDemo_TimerCallBack', {period:80000, periodType: Timer.PeriodType_MICROSECS});
    

    Please refer this source code and other change to embed watchdog feature in other application.

    Based on application requirement you can decide when and how you need to clear the watchdog under pre-defined window. Here I have used 100% window and using sysBios Timer (80msec: watchdog preload value) to clear the watchdog.

    For further read on watchdog with mmwave sensor, please refer this app-note

    Regards,

    Jitendra