Working on port to SODAQ Autonomo (SAMD21)

Hey,

Soc and mcu family relations and naming schemes should be respected as well.

Well, there's always the tradeoff between consistency within RIOT and consistency with whatever a vendor does to sort it's MCU variants.

I must say that I prefer the RIOT naming scheme, which is more or less unified over all the vendors. If not because we as RIOT developers have it easier to navigate in quite a large code base, then because a large part of RIOT's appeal is the abstraction of actual hardware it offers, across a wide range of platforms.

The relationships do not need to be elaborately reflected in build automation as just following the naming schemes is enough to tell the reader how they are related.

Well, we do have a build matrix with ~5k entries. Build automation goes a long way, and the more we can declare using conventions, the less we have to maintain.

I'm personally more familiar with ST and their Nucleo64 family of boards and STM32 family of MCU, so I cannot suggest anything specific detail for this particular discussion.

I think that state reflects that of many RIOTers: there's a lot of experience with one (or some) MCU families, and less to none with others.

When bringing up a new MCU family, I usually do my first steps with the platform, so the vendor's family relations are not clear yet. It is usually only when adding the second member of a family that I can assess how similar they are.

Add to that the complication that sometimes we add support for a specific MCU before other family members are available or even announced.

So I think the way we currently do it is sound, which is incrementally adding common folders as soon as it makes sense (saves duplicate code, ...), using a scheme similar (if not consistent) across supported boards/MCUs.

But as I'm probably biased, do others feel that the folder scheme should more reflect a vendor's scheme?

Kaspar

Hi Kees,

if you volunteer you could start with moving code to samd21_common and open PR(s) for that :-).

Well, OK. I'll give it a try.

Seems like a step in the right direction. I personally won't find time for that unfortunately. On our side we could test your PR(s) with the samr21-xpro board and AFAIK Kaspar has a saml21-xpro board.

Do you have a "build farm" of some sorts? Or do you run tests manually?

Regarding the UART issue, could you give some more insights about the pad you want to add to uart_conf_t? I just gave it a quick look into the reference manual

http://www.atmel.com/images/atmel-42181-sam-d21_datasheet.pdf

but on the first sight I didn't see a difference to

http://www.atmel.com/Images/Atmel-42223–SAM-R21_Datasheet.pdf

My UART changes have nothing to do with samd21 versus samr21. It's about selecting a pin for RX, TX. For example, on Autonomo use pin PA10 for TX. PA10 is PAD2 of SERCOM0, with MUX C. The samr21_xpro has PA4 as TX, PA4 is PAD0 of SERCOM0 (ALT) with MUX D.

Hi Kees,

Hi Kees,

if you volunteer you could start with moving code to samd21_common and open PR(s) for that :-).

Well, OK. I'll give it a try.

Seems like a step in the right direction. I personally won't find time for that unfortunately. On our side we could test your PR(s) with the samr21-xpro board and AFAIK Kaspar has a saml21-xpro board.

Do you have a "build farm" of some sorts? Or do you run tests manually?

We have static build tests (tool named "Murdock") which can be enabled by maintainers in a PR. The rest is done manually with review and local testing.

Regarding the UART issue, could you give some more insights about the pad you want to add to uart_conf_t? I just gave it a quick look into the reference manual

http://www.atmel.com/images/atmel-42181-sam-d21_datasheet.pdf

but on the first sight I didn't see a difference to

http://www.atmel.com/Images/Atmel-42223–SAM-R21_Datasheet.pdf

My UART changes have nothing to do with samd21 versus samr21. It's about selecting a pin for RX, TX. For example, on Autonomo use pin PA10 for TX. PA10 is PAD2 of SERCOM0, with MUX C. The samr21_xpro has PA4 as TX, PA4 is PAD0 of SERCOM0 (ALT) with MUX D.

Ok I got it. Agree that it makes sense to expand the configuration type.

But as I'm probably biased, do others feel that the folder scheme should more reflect a vendor's scheme?

I'd like to have the most generic abstraction (e.g. samd21, saml21 and probably samr21) and better no separate folders for each CPU variant. However, I can't estimate the feasibility of that in order to allow support for all these variants. Let's move this discussion to your PR.

Best Peter

Sorry to revive this thread. But I don't agree. I don't think there is such a thing as a samd21 MCU. (Perhaps you can point me to Atmel documentation to prove otherwise.)

The samd21 and the samr21 are very much alike, but so is the saml21, and the saml22, and quite a few more.

On Atmel's website the samr21 is described as "Single-chip ARM® Cortex®-M0+ based 32-bit Microcontroller ...".