Skip to content

Arduino Due watchdog support 1.6.5 #3889

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
kaddigat opened this issue Sep 29, 2015 · 9 comments
Closed

Arduino Due watchdog support 1.6.5 #3889

kaddigat opened this issue Sep 29, 2015 · 9 comments
Assignees
Labels
Board: Arduino Due Applies only to the Due
Milestone

Comments

@kaddigat
Copy link

Watchdog does not work for arduino using IDE 1.6.5. However, according to the realease notes of 1.6.5 watchdog should already be implemented.

https://www.arduino.cc/en/Main/ReleaseNotes

@facchinm facchinm added Waiting for feedback More information must be provided before we can proceed Board: Arduino Due Applies only to the Due labels Sep 29, 2015
@facchinm facchinm self-assigned this Sep 29, 2015
@facchinm
Copy link
Member

Hi @kaddigat , what version of SAM core is reported in Board Manager?
Starting from IDE 1.6.2 non-AVR boards are handled externally so maybe you have an older version of the core while the IDE is updated.

The watchdog has been added in this commit #3111

@kaddigat
Copy link
Author

SAM core version is 1.6.4. But an update to 1.6.5 is not available. Is there a possibility to perform the update manually?

@facchinm
Copy link
Member

At the moment the only way to apply an almost master SAM core without manually patching the files is following these instructions (#3524 (comment)) while using a nightly version of the IDE.

I'm really sorry for the inconvenience and I'll push for a fast release of the updated core.

@kaddigat
Copy link
Author

I tried to get the watchdog running with Arduino IDE 1.6.6 Hourly Build 2015/09/28 06:26. I put the latest SAM core (downloaded from https://mega.nz/#!R5JzSaYb!oRss5QcoL1Jv6pvULNzdcNulSQrmnDhtPKPo2F4qve4) into the sketchbook and chose the Arduino Due board from 'ARM boards PR 3524'. Everything seems to work fine. Then tested the watchdog with this basic sketch:

int counter = 0;

void setup() 
{
  watchdogEnable(1000);
  Serial.begin(9600);
}

void loop() 
{
  delay(500);
  Serial.println(counter);
  if(counter >= 10)
  { 
    while(true)
    {
      Serial.println("loop");
      delay(100);
    }
  }
  counter++;
}

The compiler does not complain, but the Arduino does NOT restart und stays in the loop :(

@facchinm
Copy link
Member

Testing right now, I'll report the results here as soon as I can

@facchinm
Copy link
Member

Ok, found, there is a hole in the documentation about watchdog usage on DUE.
So, you need to define a non weak function

watchdogSetup(void) {
// do what you want here
}

in your sketch to get things working right.
Sorry for the inconvenience, I'll immediately start writing some docs about that!

@kaddigat
Copy link
Author

Thanks for the quick help! Everything is working fine now.
I described the solution in this post:
http://forum.arduino.cc/index.php?topic=350058.msg2416416#msg2416416

@facchinm
Copy link
Member

Glad it solved your issue!
IDE 1.6.6 is on its way with a lot of new features and it will bring the updated cores so stay tuned 😉

@ffissore ffissore modified the milestone: Release 1.6.6 Sep 30, 2015
@q2dg
Copy link

q2dg commented Oct 1, 2015

Is there any chance to generalize this API to other boards (328-based, 2560-based, 32U4-based, Zero...) in order to homegenize this feature?
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Board: Arduino Due Applies only to the Due
Projects
None yet
Development

No branches or pull requests

5 participants