Tool/software: TI-RTOS
Hello All,
I want to reset my launchpad after certain event via software. How can I do this? Is it possible to use Watchdog timer?
How can i use this statement?
SysCtrlResetSourceGet( void );
Regards
Shubham
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.
Tool/software: TI-RTOS
Hello All,
I want to reset my launchpad after certain event via software. How can I do this? Is it possible to use Watchdog timer?
How can i use this statement?
SysCtrlResetSourceGet( void );
Regards
Shubham
Hi,
You can use the Watchdog time to reset your device. You just need to make sure that you don't reset the watchdog after you receive the event.
You can look at this thread for some help with the Watchdog.

Shubham Jindal said:How can i use this statement?
SysCtrlResetSourceGet( void );
Here are the possible return values of this function:
#define RSTSRC_PWR_ON (( AON_SYSCTL_RESETCTL_RESET_SRC_PWR_ON ) >> ( AON_SYSCTL_RESETCTL_RESET_SRC_S )) #define RSTSRC_PIN_RESET (( AON_SYSCTL_RESETCTL_RESET_SRC_PIN_RESET ) >> ( AON_SYSCTL_RESETCTL_RESET_SRC_S )) #define RSTSRC_VDDS_LOSS (( AON_SYSCTL_RESETCTL_RESET_SRC_VDDS_LOSS ) >> ( AON_SYSCTL_RESETCTL_RESET_SRC_S )) #define RSTSRC_VDD_LOSS (( AON_SYSCTL_RESETCTL_RESET_SRC_VDD_LOSS ) >> ( AON_SYSCTL_RESETCTL_RESET_SRC_S )) #define RSTSRC_VDDR_LOSS (( AON_SYSCTL_RESETCTL_RESET_SRC_VDDR_LOSS ) >> ( AON_SYSCTL_RESETCTL_RESET_SRC_S )) #define RSTSRC_CLK_LOSS (( AON_SYSCTL_RESETCTL_RESET_SRC_CLK_LOSS ) >> ( AON_SYSCTL_RESETCTL_RESET_SRC_S )) #define RSTSRC_SYSRESET (( AON_SYSCTL_RESETCTL_RESET_SRC_SYSRESET ) >> ( AON_SYSCTL_RESETCTL_RESET_SRC_S )) #define RSTSRC_WARMRESET (( AON_SYSCTL_RESETCTL_RESET_SRC_WARMRESET ) >> ( AON_SYSCTL_RESETCTL_RESET_SRC_S )) #define RSTSRC_WAKEUP_FROM_SHUTDOWN ((( AON_SYSCTL_RESETCTL_RESET_SRC_M ) >> ( AON_SYSCTL_RESETCTL_RESET_SRC_S )) + 1 )
Regards,
Michel
Hi Shubham,
Shubham Jindal said:According to this thread we cant use Watchdog_clear() in callback function. What should i do in this case?
Have you read the Doxygen documentation for the watchdog? (The link that Emmanuel gave you)
Here is a copy-paste of what you are supposed to do with the callback function:
In this function, the user may do whatever is appropriate for the application. Here are some suggestions:
- do nothing so that the timer will timeout again and trigger the reset,
- immediately reset the device,
- do self-test to check the integrity of the application,
- post a SWI or Task to do the self-test.
So you choose what you want to do. If you do not know what do, don't put any code in the watchdog callback function (leave it empty) and let your microcontroller restart automatically.
Regards,
Michel