-
Notifications
You must be signed in to change notification settings - Fork 78
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
Freeze after Standby #33
Comments
I'm having a very similar issue. I built a bunch of ocean buoys with the SAMD21 chip on a Adafruit Feather M0. Each buoy will work fine for hrs then eventually hang after going into standby sleep mode. Oddly, some buoys with different hardware configurations (additional sensors) experience this much less often (need to run for weeks). Any ideas? ` //Put Feather M0 in Standby for 30 sec Alarm_Time += 30; |
I had similar periodic random issues and proposed this fix can you please try it? |
Ok. I'll see if I can.
I was able to prevent the problem by inserting a short delay (10 ms) into
the code right before the call for sleep. Not sure why it works, but it
solved the problem I was having. All buoys with that code have now worked
continuously without the hang I was seeing.
…--Wayne
On Wed, Jan 16, 2019 at 8:42 AM Marco Brianza ***@***.***> wrote:
I had similar periodic random issues and proposed this fix
#42 <#42>
can you please try it?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#33 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/Ae_slvtMuTZvFQSMiOqfd6jJz4hJ6Bowks5vDywxgaJpZM4Q2-25>
.
|
After waking from the RTCZero Standby the system freezes when I attempt to use interrupts. Is something not being reset after standby?
I am using a library called Retick that throttles the loop and utilizes TCC1 and it is getting stuck at the first instance of _WFI() after standby. Are the interrupts not being cleared?
#include <RTCZero.h>
#include "Arduino.h"
#include "retick.h"
#define RED 13 // Red LED on Pin #13
#define GREEN 8 // Green LED on Pin #8
#define VBATPIN A7 // Battery Voltage on Pin A7
// re-defines USB serial from M0 chip so it appears as regular serial
#if defined(ARDUINO_SAMD_ZERO) && defined(SERIAL_PORT_USBVIRTUAL)
// Required for Serial on Zero based boards
#define Serial SERIAL_PORT_USBVIRTUAL
#endif
/////////////// Key Settings ///////////////////
byte hours = 0;
byte minutes = 0;
byte seconds = 0;
byte day = 1;
byte month = 1;
byte year = 17;
byte Start = 0;
byte retickRate = 2000;
/////////////// Global Objects ////////////////////
RTCZero rtc; // Create RTC object
////////////// Setup ///////////////////
void setup() {
rtc.begin(); // initialize RTC
Serial.begin(9600);
while (!Serial);
Serial.println("Setup");
rtc.begin(); // initialize RTC
rtc.setTime(hours, minutes, seconds);
rtc.setDate(day, month, year);
rtc.setAlarmTime(hours, minutes, seconds + 20);
rtc.setAlarmDate(day, month, year);
rtc.enableAlarm(rtc.MATCH_YYMMDDHHMMSS);
Serial.println("Entering Standby");
rtc.standbyMode();
rtc.disableAlarm();
rtc.detachInterrupt();
rtc.updateAlarms();
delay(5000);
}
///////////////////// Loop //////////////////////
void loop() {
//Serial.begin(9600);
Serial.println("Entering Loop");
/* Each run-through of tick will be 20ms (50Hz)
*/
retick(retickRate);
}
///////////////////// ReTick //////////////////////
void tick() {
}
}
The text was updated successfully, but these errors were encountered: