openslab-osu / featherfault Goto Github PK
View Code? Open in Web Editor NEW🔬FeatherFault tells you why your Arduino program is crashing
License: GNU General Public License v3.0
🔬FeatherFault tells you why your Arduino program is crashing
License: GNU General Public License v3.0
FeatherTrace saves registers pushed onto the stack to a register dump and takes a stacktrace, printing this information on reboot. While a full stacktrace as found in FeatherTrace requires changing compiler flags, saving the pushed registers would only require an inline assembly interrupt handler similar to the one found here. As a result, integrating this feature into FeatherFault would be a useful way to get around being unable to MARK
some areas of code while still allowing FeatherFault to be Arduino IDE compatible (unlike FeatherTrace). An external program and the elf from the current build (hopefully compiled with -g3
?) would be required to translate the saved address into a line number, but this would be useful information if the line was not MARK
ed.
The implementation of this ISR would be based on the link above, and would rely on the exception handling behavior in the Cortex-M0+.
I have a board with a new bootloader from Adafruit.
VID is 0x239a
PID is 0x0015
Please update the recover_fault.py script to support the new bootloader.
Normal operation, VID is 0x800b
FeatherFault fails to compile when being used with the Adafruit SleepyDog Library. This issue is caused by both FeatherFault and SleepyDog defining WDT_Handler
function, causing a multiple definition error during link time:
C:\Users\User\AppData\Local\Temp\arduino_build_638914\libraries\Adafruit_SleepyDog_Library\utility\WatchdogSAMD.cpp.o: In function `WDT_Handler':
C:\Users\User\Documents\Arduino\libraries\Adafruit_SleepyDog_Library\utility/WatchdogSAMD.cpp:167: multiple definition of `WDT_Handler'
C:\Users\User\AppData\Local\Temp\arduino_build_638914\libraries\FeatherFault\FeatherFault.cpp.o:C:\Users\zackp\OneDrive\Documents\Arduino\libraries\FeatherFault\src/FeatherFault.cpp:148: first defined here
collect2.exe: error: ld returned 1 exit status
FeatherFault needs to be able to respond to the watchdog timer, so removing WDT_Handler
is out of the question. The only idea I have to resolve this issue is to implement the FeatherFault watchdog code in terms of the SleepyDog library--resulting in less-than-ideal reliability and another dependency.
For the moment I will mark this as wontfix
, though I am open to other solutions.
Currently the the MARK macro takes nearly 5 milliseconds, which can add up quickly if used 20 times in a loop. I think most of this is in the string processing - extracting the filename from the FILE constant. If we move this step into the interrupt handler, we could reduce the time to copying and int and a pointer, plus the time to actually feed the watchdog. I expect this to take around 2 microseconds if the peripheral clock runs at 1MHz.
Here's my test code:
#include "FeatherFault.h"
void setup() {
digitalWrite(13, LOW);
delay(100);
digitalWrite(13, HIGH);
Serial.begin(115200);
while(!Serial);
FeatherFault::StartWDT(FeatherFault::WDTTimeout::WDT_8S); MARK;
FeatherFault::PrintFault(Serial); MARK;
Serial.flush(); MARK;
}
void loop() {
long tic = micros();
MARK;
long toc = micros();
Serial.println(toc-tic);
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.