Watchdog on Feather Express M4

Please tell us which board you are using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
baxtertidwell
 
Posts: 49
Joined: Mon Jan 07, 2013 6:16 pm

Watchdog on Feather Express M4

Post by baxtertidwell »

Apparently, the wdt library is not supported by the SAMD processors. I need a watchdog and came across SleepyDog. I'm not interested in the sleep part, just the watchdog.

I'm not having much luck. No matter what value I use for

Code: Select all

int countdownMS = Watchdog.enable(6000);
Serial.print(countdownMS, DEC);
countdownMS always comes back as something else. Here are some random values:
400 sets to 250
1500 sets to 1000
2200 sets to 2000
2500 sets to 2000
6000 sets to 4000
16000 sets to 16000 but 15000 sets to 8000.

But the biggest problem is, when it is not reset in time, there's an exception that seems to have something to do with Serial. I would have expected a watchdog timeout to restart the code.

Are my assumptions wrong? Or is there a better tool I should be using for a watchdog timer?

Here's the error FWIW:

Code: Select all

Exception in thread rx:
Traceback (most recent call last):
  File "C:\Users\Baxter\.platformio\python3\lib\threading.py", line 926, in _bootstrap_inner
    self.run()
  File "C:\Users\Baxter\.platformio\python3\lib\threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "c:\users\Baxter\.platformio\penv\lib\site-packages\serial\tools\miniterm.py", line 445, in reader
    data = self.serial.read(self.serial.in_waiting or 1)
  File "c:\users\Baxter\.platformio\penv\lib\site-packages\serial\serialwin32.py", line 257, in in_waiting
    raise SerialException("ClearCommError failed ({!r})".format(ctypes.WinError()))
serial.serialutil.SerialException: ClearCommError failed (PermissionError(13, 'The device does not recognize the command.', None, 22))


User avatar
baxtertidwell
 
Posts: 49
Joined: Mon Jan 07, 2013 6:16 pm

Re: Watchdog on Feather Express M4

Post by baxtertidwell »

Thanks, User_UM...

That is a nice, simple approach that does only one thing. And works on the SAMD51.

User avatar
User_UMjT7KxnxP8YN8
 
Posts: 323
Joined: Tue Jul 17, 2018 1:28 pm

Re: Watchdog on Feather Express M4

Post by User_UMjT7KxnxP8YN8 »

I grew up during the Dragnet "Just the facts, ma'am" era.

User avatar
akki0075
 
Posts: 53
Joined: Fri Jan 17, 2020 6:51 pm

Re: Watchdog on Feather Express M4

Post by akki0075 »

Hi,

Does anyone know what is the minimum power requirement to trigger the Watchdog.sleep(timeout)?? Is it 3.1V, 3.2V or 3.3?

Thanks,
Akshay

Locked
Please be positive and constructive with your questions and comments.

Return to “Itsy Bitsy Boards”