UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Adventurer
Adventurer
428 Views
Registered: ‎04-23-2014

Can't close system watchdog on Zynq UltraScale+

I'm using the system watchdog (/dev/watchdog) to ensure that my system will not freeze. Following the kernel API documentation, I open the device, configure the timeout, keep on writing to the device and then perform a "Magic Close" when I want to stop monitoring. The code looks something like this:

 

// Open watchdog device
int watchdogFd = open("/dev/watchdog0", O_WRONLY);

// Configure timeout
int timeout = WATCHDOG_DEV_TIMEOUT;
ioctl(watchdogFd, WDIOC_SETTIMEOUT, &timeout);

// Kick watchdog
while(keepMonitoring) {
    write(watchdogFd, "\0", 1);
sleep(1); } // Perform "magic close" to stop monitoring write(watchdogFd, "V", 1); close(watchdogFd);

This code actually worked well with ZU3EG ES1 silicon. Now I switched to the production version ZU3EG, and the magic close doesn't work anymore. After the close, the watchdog device cannot be opened again by another process and the system reboots after the timeout.

 

I am basically running the same Linux images on both systems (except of different FSBL and bitfiles of course). Is a magic close no longer possible with the production version Zynq UltaScales?

 

Edit: Actually the kernel parameter CONFIG_WATCHDOG_NOWAYOUT is set to no. So a magic close shouldn't even be necessary here, but a simple call to close() should be sufficient.

0 Kudos