cpu/samd21 is currently filled with SAMR21 files, not SAMD21


The files in cpu/samd21 are not really for SAMD21 but for SAMR21. The two cpu variants are very similar but not quite the same.

The files in cpu/samd21 have been added because of the addition of the samr21-xpro board.

I'm trying to figure out if I can add my board in RIOT. It is the SODAQ Autonomo which is derived from Arduino Zero. It has an Atmel SAMD21J18A (Cortex M0). Plus we have a new board, the LoRaONE which is a SAMD21G18A.

As said, the files currently in cpu/samd21 tree are meant for the SAMR21. Now, if I wanted to add my SAMD21 boards, how should I proceed?

The SAMR21 is just a SAMD21 with several of the GPIOs and one of the SPI buses internally connected to the at86rf233. The CPU support would be exactly the same.

Well, then why does Atmel supply different trees for SAMR21 and SAMD21? And why are the include files different? Not a whole lot, but still.

The CPU may be the same but there is (much) more than that.

Furthermore, the SAMD21 has several variants and so does the SAMR21. Each have small difference in their specific include files. It feels very uncomfortable to have just one "samd21" in RIOT.

So, if it was up to me, I would like to see that * all files in cpu/samd21 are moved to cpu/samr21 (to make room for the real samd21 tree) * some document is written explaining where these files came from (version, URL, etc) * write up some procedure that describes what to do when the CMSIS source is updated (bug fixes, new release, etc) * preferably no CMSIS files are changed, unless properly documented

BTW. Where are these CMSIS files coming from anyway? I see them in the Arduino Zero distribution too, but I couldn't find them anywhere else on the web. They are from Atmel, but nothing on Atmel's website gives a clue.