javos65 / WDTZero

Allows to use the WatchDog functionality for Arduino Zero, MKRZero and MKR1000 only
15 stars 12 forks source link

MKR GSM #1

Closed alanoatwork closed 3 years ago

alanoatwork commented 5 years ago

John,

Does your library support the MKR GSM 1400? I also noticed that the zip file doesn't load into the Arduino IDE correctly . I get the message, "Specified folder/zip file does not contain a valid library". Any ideas?

alanoatwork commented 5 years ago

I manually installed the library and tried it out. It doesn't seem to work with the MKR GSM 1400. Any ideas on why it doesn't work?

javos65 commented 4 years ago

Does it not function, or does it not compile?

salvq commented 4 years ago

I am using Arduino MKR 1400 with MKRGSM and latest WDTZero library and compilation is OK, no issue so far...

CptHolzschnauz commented 3 years ago

Hello Thx for your work. My only problem is to intialise a hardstop WDTZero MyWatchDoggy(WDT_HARDCYCLE4S); Follows to a no matching function for that call. In you example is just a SoftStop. Is it possible to add a example with a correct HardStop? Thx a bunch

javos65 commented 3 years ago

Hi CptHolz, Let me dig into this, been more than a year since I tested this. What is your goal precisely with the watchdog function? J

CptHolzschnauz commented 3 years ago

Hey, glad to read you, it's a honor for me!

Yesterday i checked your lib and answered my first question to myself..RTFC...;=) But i have more questions...

I have a big (maybe 2 big?) project startet on a Arduino MKR 1400. This device has a hardware design error (When switching the modem to 2G there's a spike in the current consumption which halts the cpu. The "official" solution is to attach a battery and change the hardware a bit). With solder a bridge over a too weak electronic fuse and avoiding the 2G mode it works even without the battery. Sometimes :(.

Because of the flaky behaviour, it's not easy to find out what's the cause of the cpu halts. It runs for hours and days until the error occurs.

(With the MKR1500 there is a bug with the modem firmware that avoid receiving sms on some networks over a long time, so i'am stuck with the 1400...I can't replace the form factor...)

Ergo: I try to keep everything running and since a reboot is not such a problem i added your lib. I think it's a very handy and good idea to add a hardware WD, strange to me that it's not more popular. My questions are:

  1. I call MyWatchDoggy.setup(WDT_HARDCYCLE16S); You wrote in your code # define WDT_HARDCYCLE16S 0x04B0 // WDT HARD cycle 16 Seconds. When i count in my head i would say it's about max 8 to 10 sec until reset. I think this is because the cpu on the mkr1400 is faster than the one you used for the lib?

  2. MyWatchDoggy.attachShutdown(myshutdown); won't work with a hard, i guess. Is there a way to log the reset with the hardstop?

  3. When the CPU crashes, it crashes realy hard, the reset button is not responding power off/on is the only cure. Do you think the hard WD will work? Any comments, hints, something?

  4. Last i found out that the crash is at the some point, while drawing a graphic with the GFX lib, eg coping data from a progmem to the memory that is displayed. There is no other operation at this time, i can't explain the crash at this particular moment, it works thousend of thousend times before a crash what makes inline debugging sensless (?), nothing conspicuous...no more idea expt hardware troubles which makes it even more dif..

Anyway, thanks a lot for your time and your lib, maybe it's a remedy for my project.. R

javos65 commented 3 years ago

ad 1.: time for Hard WDT should be ok, however I'v not loked intor the clock-tree of a MKR1400, might be it runs twice the speed. ad2. Hard WDT's does not use the early warning IRQ (EW), therefor it cant have a callback. Reason - in my oppinion- is that a HW watchdog should not be dependend on the processor :) ad3. yes, Watchdog timer is completely independend from the processor. However if your external conditions are screwed( ie power problem), there is no power-up. ad4. cant say, these are the most hard problems... ie my mkr1000 in my domotics crashes once a month... cant get this fixed for now.