Anyone had issues getting the samd21 to wake from sleep via UART? What I am experiencing is that the wake is a little buggy and results in strange print output or the board hangs. What is really interesting is that after trying to wake from sleep I can no longer program the board (using openocd or edbg). I asked Atmel (Microchip) and they gave me a tool that erases the board continuously as you reset the samd21. I created my own version by putting this command in a loop:
./edbg/edbg -t atmel_cm0p -be
Which works to reprogram the boards.
I can wakeup from an external input on a pin, but in that case I use the 32768 HZ external oscillator or the low power internal one. The problem appears to be trying to put the system clock (GEN0) into standby/ondemand mode and then trying to wake that using the USART interrupt. I don't see this issue if you put sleep in one of the idles modes and it is interesting that application note AT11626 which demonstrates how to wake from sleep using USART actually puts the code in IDLE 2 rather than standby sleep in the final version.
Anyone experience anything similar?