Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    Watchdog reset

    Scheduled Pinned Locked Moved MicroPython
    3 Posts 3 Posters 1.9k Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J Offline
      jonirons
      last edited by

      How does one feed or disable the watchdog.

      The documentation https://docs.pycom.io/wipy2/library/machine.WDT.html
      says:
      from machine import WDT
      wdt = WDT(timeout=2000) # enable it with a timeout of 2s
      wdt.feed()

      WDT is not available from machine
      I've never called WDT(timeout = anything) but it seems to be already operational at 4secs (as documented and experienced)
      Without WDT I can't call wdt.feed()

      Loops that run past the timeout (presumably 4secs?) HALT the CPU, not RESET.
      Can we rather do something better than: "I've got a bit tired so I'm just going to stop trying altogether."

      Its a bit like calling System.exit() in Java in response to an unexpected exception.

      Screen capture below:

      Task watchdog got triggered. The following tasks did not feed the watchdog in time:
      Tasks currently running:
      CPU 0: MicroPy
      Aborting.
      Guru Meditation Error: Core 0 panic'ed (Unhandled debug exception)
      Register dump:
      PC : 400e19df PS : 00060036 A0 : 800ec57f A1 : 3ffd4790
      A2 : 0000000a A3 : 0000000a A4 : 00000004 A5 : 00000000
      A6 : 00000000 A7 : fffffff8 A8 : 00000000 A9 : 3ffd4700
      A10 : 00000000 A11 : 3ffdcba3 A12 : 3ffd46cf A13 : 00000030
      A14 : 00000000 A15 : 00000000 SAR : 00000014 EXCCAUSE: 00000001
      EXCVADDR: 00000000 LBEG : 4000c46c LEND : 4000c477 LCOUNT : ffffffff
      CPU halted.

      1 Reply Last reply Reply Quote 0
      • L Offline
        LoneTech
        last edited by LoneTech

        While it's a crude workaround, it seems time.sleep_ms(1) feeds the watchdog. I'm guessing the watchdog is fed by a low priority thread, but didn't find a yield function in _thread.

        1 Reply Last reply Reply Quote 0
        • T Offline
          TravisT
          last edited by

          @LoneTech

          This suggestion saved me, feed() was not working and then I moved it just before my loop delay and it began to work.

          It was probably made worse because I had a gc.collect() after feed() originally.

          Thanks!

          1 Reply Last reply Reply Quote 0

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          • 1 / 1
          • First post
            Last post

          Pycom on Twitter

          Pycom