-
Notifications
You must be signed in to change notification settings - Fork 2.1k
cpu/sam0: structural clean-up for sam[dlr]21 CPUs #6223
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cpu/sam0: structural clean-up for sam[dlr]21 CPUs #6223
Conversation
I've been skimming through Atmel xdk-asf files (see http://asf.atmel.com/docs/latest/download.html). The includes under cpu/saml21/include/atmel/ seem to come from an old ASF package, partially reviewed and modified. Code for various boards in RIOT use these includes. The directory at cpu/sam21_common/include/cmsis/saml21/, instead, is a complete copy of ASF I've been thinking over the changes you propone in this PR: I do not feel easy in moving single includes from cpu/saml21/include/atmel/ to cpu/sam21_common/include/cmsis/saml21/. I'd rather remove cpu/saml21/include/atmel/ entirely (since it is contains files coming from an older version of ASF) and then try to fix things that break. What do you think? |
I didn't check any version of the saml21 vendor header, I simply copied the existing ones from the saml21 folder into the sam0_common include dir. I propose the following: we should merge this PR first, as i think the re-structuring makes much much sense. And second, you add a commit to your PR, updating the vendor headers under |
Great. I like this approach. Small steps, but with a goal in mind to unify the common code for the sam0 variants (samd21, saml21, etc) Let's add the README for saml21 and start documenting it like I did for the other parts. |
This PR makes sense. I think it is a better approach in order to add support for the whole cortex M0 Atmel portfolio. the sam21_common folder was confusing, I mean if we want to add support for SAMDxx or SAML22 it is better to have a sam0_common rather than sam21_common. |
FYI |
Nice, seems we get to a consensus here. About the README.md file: I have obviously no idea about the versioning/modifications to the Atmel ASF packages. So how about: I will not add a README.md for the |
Well, OK. |
I'm fine with checking in this PR and then updating what is needed. |
Cool, then all we need is an ACK... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sam0 it is finally... ;) ACK!
I've created #6240 , which only adds the correct README file (as @keestux suggested). Now, to further you work I would like to update the CMSIS includes. The first ASF XDK including CMSIS definitions for SAML21 version B (the CPU I use is a SAML21E18b) is 3.26.0:
My problem is that a simple substitution of the include / include_b directories breaks quite a few of the drivers. I've published a version here (a branch on my fork but not a PR, since it does not compile): https://github.com/ant9000/RIOT/tree/saml21_update_to_xdk3.33 When you try to compile examples/default for BOARD=saml21-xpro, the result is: Any hints on how to proceed from here? Antonio |
Found my way around the drivers, now my branch compiles: I'll do a few tests on real hw, will submit a PR soon. |
AFAIKT, things do work correctly - so I've created #6242 . |
I've noticed these compiler errors too when I was trying to update the SAML21 files. It is because of Anyway, I'd be interested to know what you did to achieve "Found my way around the drivers, now my branch compiles". |
Trying to match ASF driver code was not immediate - it's very far from RIOT sources. Anyway, what seems to work is this: As you can see, it was no big deal once I got a hang on it. |
the
sam21_common
was not utilized fully for both thesamd21
and thesaml21
implementations, leading to confusion and code duplication. With this PR both implementations use the shared code in the same manner.I also renamed the shared folder to
sam0_common
, as the old name was somehow misleading and this seems to be the more precise naming scheme used also by Atmel for that family of devices.For the future, we might even think about merging all the samd/saml code into the sam0 tree?! But another day...