[SAME5x] - Adafruit is using the SAMD51 chip in their latest range of Arduino-like boards. (The SAMe5 chips are similar to SAMd5 chips, except the E5 has ethernet and/or CAN?) They've got QSPI flash, the Arduino core up, as well as "circuitPython", and between Adafruit and their userbase, so they're collecting quite a bit of information. Watch their github SAMD-core repository (or not, if you have to avoid contamination.)
Is there a simple standard peripheral lib?
There is ASF - the Atmel Software Framework. I find it awful and bloated; about the same as the STM SPL. If you didn't mind SPL, you might not mind ASF. I don't have any experience with the higher-level functions.
Do you have to use their code generator HAL thing? Is it good?
Of course you don't HAVE to use it. I've only tried it a couple of times. It seems to be online-only, and I didn't like it very much. Parts of it aren't very intuitive (I'm not convinced that clock setup is any more obvious with the the GUI than with ASF, or that ASF is any better than figuring it out and doing it yourself.) It'll put together a .zip collection of the hundreds of files that your project might be dependent on for you to download and use offline. I guess that might make sense from a Source Code Version Control PoV, but I find it depressing.
Does anyone have STAY AWAY warning for the new SAM series? Or any other important comments on questions I might not know to ask?
Beware "per pin interrupts." While "any pin can generate an interrupt", the SAMD family at least as a limit on the total number of pin interrupts at 16, and for certain groups of pins, only one will actually generate an interrupt.
https://forums.adafruit.com/viewtopic.php?f=63&t=134385Any SERCOM can run I2C, but not all hardware pins support the I2C hardware requirements.
https://forums.adafruit.com/viewtopic.php?f=63&t=139056#p687412 Apparently Atmel Start declines to configure I2C on the pins that don't have the HW support, even though the differences in HW will seldom make a difference.
CM0 is a sucky CPU (ok, not an Atmel problem.) Simple RISXy expressions blow up into unexpectedly large bits of machine code because the M0 lacks some instruction encoding...
The SAMD51 errata has some pretty serious bugs in the A2D area, IIRC.
Don't forget to turn on the cache. And if you're going to benefit from the floating point hardware, you'll need to use single-precision math functions and convince the compiler not to promote all your floats to doubles in expressions...
Don't assume that a peripheral on one SAM chip behaves identically the similarly named peripheral on a different SAM chip. So far I've seen:
- "RTC" on SAMD10/etc can be clocked from a high-frequency GCLK. On most SAMs it can only be clocked from a 32kHz low-power clock.
- UART SERCOM pad multiplexing can be different. In particular, some chips support a pin configuration that can swap Rx and Tx by SW, and some don't.
- The SAMD5x chips (and perhaps others?) have multiple interrupts per SERCOM. Others have a single interrupt that needs to be decoded in the ISR.
- GCLK configuration is dramatically different between SAMD2x and SAMD5x, despite similar "philosophy"