Cover photo
Derek Groothuis
Lived in Chicago
120 followers|71,556 views


Question: strange/crashy behavior on SAMD chip (Adafruit Feather M0)

Hi all - I've been wrestling with an issue for a few weeks, and I'm curious if anyone else has suggestions/has seen something similar. I have a project that runs fine on a Feather 32u4 (AVR) but when I run it on a M0 (an SAMD chip like the Zero) it runs for a while but eventually crashes.

The particular area of problem seems to be around palettes - in particular, I have a set of gradient palettes that I am switching between periodically (created with DEFINE_GRADIENT_PALETTE, using the cool paletteknife code). It flies along switching happily for a while - and then finally crashes on some random palette change.

I should note - I had an even weirder palette-related bug previously, where the M0 would just lock up instantly on load. It turned out that RENAMING the variables for a couple of the palettes (just two, and always those two) fixed the problem. Which...well, I still haven't been able to even theorize intelligently around what was happening there. Presumably something memory related, but unclear to me why it runs fine for hours on the AVR chip but only lasts 2-3 mins on the SAMD (admittedly, I do not have deep understanding of the architectural differences).

Anyone seeing similar behaviors with a SAMD device, and/or have any suggestions? (Mostly want to use it as my program has slammed into the ceiling in terms of program size for the 32u4 feather - hoping to avoid ripping stuff out.)

Thanks, and thanks for the awesome library.
Jason Coon's profile photoDerek Groothuis's profile photo
FYI for those following this issue, I think I have a piece of code that replicates it, but ran out of time before my “deadline” (read: event in the desert in Nevada) so haven’t had a chance to clean it up, test it thoroughly, and submit it yet. Will try to do so this week.

If anyone else wants to try it, I’m pretty sure this code will crash consistently on a SAMD chip (at least on a Feather M0) - would be curious if others see same.
Add a comment...
I am Groot.
I am Groot.
Map of the places this user has livedMap of the places this user has livedMap of the places this user has lived
Chicago - Jakarta - Denver - Toledo - Nashville
I am Groot.
Basic Information