You are reading a single comment by @AkosLukacs and its replies. Click here to read the full conversation.
  • Quick question: wanted to use E.enableWatchdog, because it's pretty hard to reset the watch if something goes wrong.
    Officially it's for official boards, but afaik fanoush's firmware (I'm using v.2v03.11 on a DS-D6) is pretty close to the MDBT firmware.
    My observations:
    E.enableWatchdog(1) - if no code running, and I don't do anything, the watch disconnects. Feels like 1-2 seconds, but that could be the BT driver in my laptop, or my internal watch is not accurate enough...
    If I type something + hit enter at less than 1 second intervals, it keeps running.
    If I set a for example 0.5 sec interval, it keeps running.
    On a train ATM, so can't check with other boards. Did these tests after reset, no other code running.

  • wanted to use E.enableWatchdog, because it's pretty hard to reset the watch if something goes wrong.

    Just a big warning related to watchdog. I just managed to brick HX03W while doing upload from Espruino WebIDE. The default is calling reset() before upload, which is normally sane thing to do but it interacts with watchdog in unfortunate way. reset() clears your watchdog pinging routine but not the watchdog itself as it is not real CPU reset and then starts upload. If upload does not finish in time you get watchdog reboot in the middle of upload. For me this causes my HX03W to not start properly now.

    I see nothing in serial console and bluetooth device can be seen but cannot be connected to UART service. So now I need to open it or wait until battery dies and then try to hold the button while powering on. Hopefully it will skip loading the partially saved code.

    So just beware it is not that easy with the watchdog. One safe way to upload is first clear code via require("Storage").erase(".bootcde") and then call reset() manually, then wait for watchdog reboot and only then upload new code. Or run everything in RAM until code is finished and stable.

About

Avatar for AkosLukacs @AkosLukacs started