Hi,
I am going to be deploying a number of recorders for extended periods of time (months) between being checked. I have built in as much reliability in to the PCB design using your guidance, but still remain a little nervous.
Would you know a way to reset the device as part of an error handler that I could incorporate to just ensure that I am still collecting data.
Kind Regards
Rob
Programatically reset device with C
Re: Programatically reset device with C
How about watchdog?
You can set the timer quite long with WDOG_CF register and then you need to write the WDOG_KEY register before it expires and if it expires, reset happens.
You can set the timer quite long with WDOG_CF register and then you need to write the WDOG_KEY register before it expires and if it expires, reset happens.
Code: Select all
void WatchdogReset(void) {
PERIP(WDOG_CF) = 1;
PERIP(WDOG_KEY) = 0x4ea9;
while (1)
;
}
Re: Programatically reset device with C
Watchdog is a new one on me, but looking at it this could be a workaround. for future PCBs I think I will incorporate a transistor so i can pull xreset down, but it's a little late in the day for that.
Thanks very much
Rob
Thanks very much
Rob
Re: Programatically reset device with C
Watchdog is the number one way for me to restart the system from scratch in products, e.g. after a firmware update or waking up from standby (when standby has turned off so many things that turning them back on is just unnecessarily duplicated code).
In the case of vs1005 / vs1010 keeping PWRBTN high for 4-5 seconds also causes a reset (unless reset by power-button is disabled).
In the case of vs1005 / vs1010 keeping PWRBTN high for 4-5 seconds also causes a reset (unless reset by power-button is disabled).
Visit https://www.facebook.com/VLSISolution VLSI Solution on Facebook
Re: Programatically reset device with C
VSOS actively disables power button reset in VS1005g. Just for reference, in VS1010 it can be enabled.
Re: Programatically reset device with C
Thanks for all this information. Watchdog implementation was really easy and seems to have worked really well when deployed
Re: Programatically reset device with C
Nice to hear that the solution worked. And you can use this as watchdog too.
If you start watchdog and enter to while(1); you'll get a reset. On normal cases, you have to feed it before timeout or it bites you. The length of the timeout is something to think about.
However, if you are doing a recorder there is a one nasty thing. Files open to write get finalized on fclose() call. And if fclose() never comes, you'll get file system corruption.
If you start watchdog and enter to while(1); you'll get a reset. On normal cases, you have to feed it before timeout or it bites you. The length of the timeout is something to think about.
However, if you are doing a recorder there is a one nasty thing. Files open to write get finalized on fclose() call. And if fclose() never comes, you'll get file system corruption.
Re: Programatically reset device with C
That's fine, As the devices are to be deployed for so long I have set it to greater than the length of the file i am recording. If I miss a 10 minute slot here or there it isn't too problematic. Hopefully it will not be needed though.
Thanks
Rob
Thanks
Rob