Hello,
NCS2.0.2, nRF5340, VScode, watchdog
i want to uninstall watch dog before sys_reboot(0) for DFU;
but as follow no use. it will Restart twice.
Hello,
NCS2.0.2, nRF5340, VScode, watchdog
i want to uninstall watch dog before sys_reboot(0) for DFU;
but as follow no use. it will Restart twice.
Hi, Sigurd Hellesvik
wdt_disable return value: -1
Best regards
Hi,
-1 is EPERM.
From wdt_disable():
"-EPERM – If watchdog can not be disabled directly by application code. "
Maybe an easier way to achieve what you need is to save a Non-Volatile variable keeping track of the watchdog status.
Then enable the watchdog if the variables says so.
Did that make sense?
Regards,
Sigurd Hellesvik
Hi
i've no idea.
Best regards
Hi,
You can not call wdt_disable from you application.
I suggest you do something like this in your code instead:
#define WDT_TMP_DISABLE_ID 1 int wdt_tmp_disabled[1]; nvs_read(fs,WDT_TMP_DISABLE_ID,wdt_tmp_disabled,sizeof(wdt_tmp_disabled)); if(wdt_tmp_disabled){ wdt_tmp_disabled = 0; nvs_write(fs,WDT_TMP_DISABLE_ID,wdt_tmp_disabled,sizeof(wdt_tmp_disabled)); } else{ wdt_install_timeout(...) wdt_setup(...) } // ... // ... //If you want to restart temporary withour watchdog: wdt_tmp_disabled = 1 nvs_write(fs,WDT_TMP_DISABLE_ID,wdt_tmp_disabled,sizeof(wdt_tmp_disabled)); sys_reboot(0)
Did the code example help your understanding?
Regards,
Sigurd Hellesvik