Extending edgertronic capabilities - Hardware watchdog timer

From edgertronic high speed video camera
Jump to navigation Jump to search


Home

USB serial support



Background

The DM368 processor used in the edgertronic camera supports a hardware watchdog timer. The purpose of a hardware watchdog timer is to perform a hardware reset if the software crashes.

Watchdog timer support

Support to use the hardware watchdog timer is done using the user added URLs edgertronic SDK mechanism. Simple copy the app_ext_wdt.py and app_ext_wdt.html files from http://10.11.12.13/static/sdk/app_ext and save it in the root directory of an SD card, insert the SD card into the camera, and then power on the camera.

When using the app_ext_wdt.py code, the hardware watchdog timer is enabled by default. You can the /wdt_control URL to disable the watchdog timer.

Watchdog URLs

/wdt_control Enable or disable hardware watchdog timer and python logic to service the watchdog timer.
/wdt_get_status Returns a JSON encoded dictionary containing the watchdog timer counts values including how many times the camera's hardware watchdog timer has reset the processor since power on and how many times the camera's hardware watchdog timer has reset the processor since the last factory reset.
/wdt_force_reset Test feature which causes the processor to reset the camera in around 60 seconds.

Watchdog timer functional description

The DM368 hardware watchdog timer is made available to user space via the /dev/watchdog device file. Holding an open file handle to the /dev/watchdog device file enable the hardware watchdog timer. Writing a byte of data to the open file handle services the hardware watchdog timer. The DM368 hardware watchdog timer will reset the processor if more than 56 seconds goes by without the hardware watchdog timer being serviced.

When the user-added URL file app_ext_wdt.py is added to the camera, then when the camera boots the /dev/watchdog device file is opened and a periodic software timer is enabled to service the hardware watchdog timer every 10 seconds. If something causes the periodic software timer to fail to run, the hardware watchdog timer will cause the camera to reboot. The logic is implemented in the same user space python instance as the python code that responds to CAMAPI and also controls the video encoding, so if the python code stops responding, that should also cause the periodic software timer to fail, thus causing the camera to reboot.

Watchdog webUI status window

Web-ui-app-ext-wdt.png

Clicking on the wrench icon to open settings, then clicking on the Watchdog tab will cause the watchdog timers counts to be displayed. These values cannot be changed via the webUI.




Home

USB serial support