SAM3A8C: How to prevent watchdog reset during sleep?

Go To Last Post
5 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

 

I’m running a program on the SAM3A8C ARM Cortex CPU and have a problem with the watchdog

giving reset during sleep (via command pmc_sleep(SAM_PM_SMODE_WAIT)).

Shouldn’t all peripherals (including the watchdog) be automatically halted during sleep?

(AFAIK there is no way to manually suspend the watchdog after its initial configuration).

 

Thanks for any help!

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Engztrom wrote:
Shouldn’t ...  the watchdog be automatically halted during sleep?

I don't think that would be generally desirable - as it would leave the potential for you to get stuck in sleep!

 

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes, but it is even worse to always get a watchdog reset after a few seconds in sleep.

 

I might add that I have configured the watchdog with the flag WDT_IDLE_HALT set, but that seems to have no effect.

(Assuming "idle" refers to when the CPU is in sleep mode, even if that is not explicitly stated in the datasheet...)

 

Is the only solution to disable the reset function for the watchdog and instead let it trig the watchdog interrupt,

and then do a software reset from that interrupt when not flagged via a RAM variable to be in sleep mode?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Engztrom wrote:
Is the only solution to disable the reset function for the watchdog

I guess you could wake briefly from sleep to kick the dog ... ?

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

But why doesn't the WDT_IDLE_HALT setting work?

 

Currently the sleep mode is configured to wakeup on an IO-pin change (i.e. a pressed key).

Not sure how to configure it to wakeup on both a timer interrupt (to reset the watchdog) and the IO-pin change (the SAM3X-SAM3A datasheet is rather obscure...),

so if anyone has an example it would be greatly appreciated!