-
Notifications
You must be signed in to change notification settings - Fork 79
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
Library does not work with Feather M4 Express and Adafruit_SleepyDog-master #37
Comments
Adding OSCCTRL->DFLLVAL.reg = OSCCTRL->DFLLVAL.reg; after sleeping seems to fix the problem. Basically, some of the configuration done in startup.c is apparently lost when the SAMD51 goes to standby. The only reason I thought to look at this is because I noticed that sleeping also changed the pitch of a physical oscillator (a change of about 230 cents) I have connected to the device ... so I assumed it was changing the timers' configuration. Looking at wiring.c and startup.c, I localized an area of code that appeared to re-configure it properly after sleep. In all honesty, I have no idea what it does, but it seems to fix both problems. Any clues as to why this works? |
I was having trouble localizing a problem before with the SPIFlash library and finally pinned it down to its interaction with the SleepyDog library. I created a minimal example which basically causes SPIFlash writes to corrupt the file system (see attached). This example works when you comment out the Watchdog.sleep(1000); ... to reproduce the error, follow these steps, first with that line commented out:
Then repeat that with the Watchdog.sleep(1000); line and watch the file system become corrupted. Any ideas what in the SleepyDog library is causing this?
Flash_Memory_Problem_Minimal_Example.txt
Update: this same crash happens when using CircuitPython to create the file system and see what is written.
The text was updated successfully, but these errors were encountered: