Profile cover photo
Profile photo
Derek Groothuis
I am Groot.
I am Groot.


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.
Wait while more posts are being loaded