Debugging SAM R21 in Sleep Mode on a SAM-ICE

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

We have a problem that occurs occasionally on a SAM R21 when it comes out of sleep mode. We have it waking every 5 minutes and sending a packet. After some period of operation from hours, to weeks the SAM R21 will go into some strange state on wakeup. When it goes into this state, it does not send a packet and never goes back to sleep, just continues to run and burn power (until the battery dies).

 

We are using a SAM-ICE to flash it, but we can not use it to debug wakeup because the debugger exits as soon as the SAM R21 goes to sleep.

 

Is there some way that we can prevent the debugger from exiting when the SAM R21 sleeps so that we can catch what it is doing differently when it wakes?

+ Chris Brandson

Last Edited: Wed. Jun 1, 2016 - 08:58 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Pretty sure that the debugger on the R21 Xpro board could tolerate the MCU going to sleep, and see what happens when it wakes - so can you port your code to an R21 Xpro ?

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

Thanks for the suggestion! I had to stub out the hardware support for our boards and I now have it up and running. Alas, this doesn't seem to reproduce the problem. The

 

XPRO board has an EDBG chip which is not present on our board. Is there a EDBG break-out board available so I can wire it up to our board and see if I can debug sleep mode directly on our hardware?

 

+ Chris Brandson