User Tools

Site Tools


snippets:watchdog

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
snippets:watchdog [2013/04/09 16:10] basnippets:watchdog [2017/11/07 22:26] (current) – external edit 127.0.0.1
Line 8: Line 8:
 Typically the "enable watchdog" is executed at program start and "toggle watchdog" is executed in the application main loop once on every iteration.\\ Typically the "enable watchdog" is executed at program start and "toggle watchdog" is executed in the application main loop once on every iteration.\\
  
- +| 
-{{:snippets:watchdog_init.png?direct |}}\\ +{{:snippets:watchdog_init.png?direct|}}\\ drag and drop this [[VI snippet]] into a LabVIEW block diagram.\\ 
-{{:snippets:watchdog_reset.png?direct |}}\\ +{{:snippets:watchdog_reset.png?direct|}}\\ drag and drop this [[VI snippet]] into a LabVIEW block diagram. \\
-drag and drop this [[VI snippet]] into a LabVIEW block diagram.\\ \\ \\ \\ \\ \\  \\  \\ \\ +
  
 **notes:** **notes:**
Line 18: Line 16:
   * Once the watchdog is enabled, debugging gets complicated. For this reason add the watchdog only at the very end of a development cycle   * Once the watchdog is enabled, debugging gets complicated. For this reason add the watchdog only at the very end of a development cycle
   * If you need to survey several parallel loops, insert the "watchdog_toggle" into one loop and survey the loop counters of the others   * If you need to survey several parallel loops, insert the "watchdog_toggle" into one loop and survey the loop counters of the others
-  * A reset during a file function can corrupt a file system\\+  * A reset during a file function can corrupt a file system 
 +  * When inserting the in line C-nodes the following warnings are generated.\\ This warning can be ignored, because it is about a disabled part of the block diagram. {{:snippets:errorsnwarnings:inline_c_node_not_supported.png?direct|}}  
 + 
 +====== check if a reset was caused by the watchdog ====== 
 +The following snippet can be used to check if the last reset was caused by the watchdog.\\ 
 +{{:snippets:watchdog_check.png?|}}\\ drag and drop this [[VI snippet]] into a LabVIEW block diagram.\\ 
 + 
 +The bit 14 of the reset regiter is 1, when a watchdog reset occured. 
 + 
 +The bit is 0 when the reset was caused by other reasons. 
 + 
 +The bit is 0 when it has been read. Hence it can only be read once per reset. 
 + 
 + 
 + 
 +====== save last programm state ====== 
 +With this snippet you can write and read a memory space that is not initialized at boot time:\\ 
 +{{:snippets:non_resetted_memory.png?|}}\\ drag and drop this [[VI snippet]] into a LabVIEW block diagram.\\ 
 + 
 +The value read is undefined, when there was a power loss.  
 + 
 +When a watchdog event occured or a reset signal was applied the value ramains the same as bevore the reset. 
 + 
 +  
 + 
 +The memory space is written and read by the following functions: 
 + 
 + - Mass storage device 
 + - Format file system 
 + - Firmware update 
 + 
 +  
 + 
 +The usable memory space is 16bytes long. With U32 an I32 Values 4 values can be written at the following locations: 
 + 
 +  0xFF800000 
 +  0xFF800004 
 +  0xFF800008 
 +  0xFF80000C 
 + 
 + 
 + 
snippets/watchdog.1365516616.txt.gz · Last modified: 2017/11/07 22:26 (external edit)