Skip to content
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/saml21: add compatibily headers for vendor files migration #20850

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dylad
Copy link
Member

@dylad dylad commented Sep 4, 2024

Contribution description

This PR introduces new compatibility headers for SAML21 MCUs.

New vendor files introduces a small syntax changes in the name of single bit bitfield. There are all now all suffixed with _Msk

For instance, using the old vendor files, a single bit bitfield would look like:
register = FOO_BAR_1 | FOO_BAR_2;
With the new headers, it should now look like:
register = FOO_BAR_1_Msk | FOO_BAR_2_Msk;

Thus, the idea is to introduce compatibility headers alongside the current (old) headers that RIOT have. Then, to update boards and peripherals driver to match the new syntax.
These files will be deleted as well as old headers at the end of the migration phase.

These files were created using this script

SAML21-based boards configuration using old syntax were convert while at it.

Testing procedure

CI should be enough. This doesn't have any impact on the code or binary size.

Issues/PRs references

Second step of the ongoing Microchip vendor files migration (see #20457)

@github-actions github-actions bot added Platform: ARM Platform: This PR/issue effects ARM-based platforms Area: boards Area: Board ports Area: cpu Area: CPU/MCU ports labels Sep 4, 2024
@benpicco benpicco added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Sep 13, 2024
@riot-ci
Copy link

riot-ci commented Sep 13, 2024

Murdock results

✔️ PASSED

fd34483 boards/saml21*: convert bitfields to new masks names

Success Failures Total Runtime
10215 0 10215 19m:37s

Artifacts

Copy link
Contributor

@mguetschow mguetschow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From a quick glance at the generating script and the changes, looks good to me. The CI doesn't complain and using the new defines in the periph_config.h shows that they are available as expected.

Let's get this merged then - thanks for your work! :)

@mguetschow mguetschow added this pull request to the merge queue Oct 29, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 29, 2024
@mguetschow mguetschow added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR CI: full build disable CI build filter and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR CI: full build disable CI build filter labels Oct 30, 2024
@mguetschow
Copy link
Contributor

@dylad Looks like CI did find some issue with BOARD=bastwan with saml21 CPU:

-- running on worker breeze thread 1, build number 128043.
make: Entering directory '/tmp/dwq.0.6332435015575191/0a6a2fc4f3b80dc9cf8ff15e2552cf2e/examples/gnrc_border_router'
rm -rf /tmp/dwq.0.6332435015575191/0a6a2fc4f3b80dc9cf8ff15e2552cf2e/build/pkg-build/cmsis
make: Leaving directory '/tmp/dwq.0.6332435015575191/0a6a2fc4f3b80dc9cf8ff15e2552cf2e/examples/gnrc_border_router'
make: Entering directory '/tmp/dwq.0.6332435015575191/0a6a2fc4f3b80dc9cf8ff15e2552cf2e/examples/gnrc_border_router'
Building application "gnrc_border_router" for "bastwan" with CPU "saml21".

Cloning into '/tmp/dwq.0.6332435015575191/0a6a2fc4f3b80dc9cf8ff15e2552cf2e/build/pkg/cmsis'...
done.
HEAD is now at 2b7495b85 Merge branch 'develop'
In file included from ../../drivers/include/periph/gpio.h:82,
                 from include/board.h:28,
                 from board.c:24:
include/periph_conf.h:49:22: error: 'MCLK_APBCMASK_TC0_Msk' undeclared here (not in a function); did you mean 'MCLK_APBCMASK_TC0_Pos'?
   49 |         .mclk_mask = MCLK_APBCMASK_TC0_Msk | MCLK_APBCMASK_TC1_Msk,
      |                      ^~~~~~~~~~~~~~~~~~~~~
      |                      MCLK_APBCMASK_TC0_Pos
include/periph_conf.h:49:46: error: 'MCLK_APBCMASK_TC1_Msk' undeclared here (not in a function); did you mean 'MCLK_APBCMASK_TC1_Pos'?
   49 |         .mclk_mask = MCLK_APBCMASK_TC0_Msk | MCLK_APBCMASK_TC1_Msk,
      |                                              ^~~~~~~~~~~~~~~~~~~~~
      |                                              MCLK_APBCMASK_TC1_Pos
make[2]: *** [/tmp/dwq.0.6332435015575191/0a6a2fc4f3b80dc9cf8ff15e2552cf2e/Makefile.base:139: /tmp/dwq.0.6332435015575191/0a6a2fc4f3b80dc9cf8ff15e2552cf2e/build/board/board.o] Error 1
make[1]: *** [/tmp/dwq.0.6332435015575191/0a6a2fc4f3b80dc9cf8ff15e2552cf2e/Makefile.base:31: ALL--/tmp/dwq.0.6332435015575191/0a6a2fc4f3b80dc9cf8ff15e2552cf2e/boards/bastwan] Error 2
make[1]: *** Waiting for unfinished jobs....
In file included from ../../../drivers/include/periph/gpio.h:82,
                 from ../../bastwan/include/board.h:28,
                 from board_common.c:20:
../../bastwan/include/periph_conf.h:49:22: error: 'MCLK_APBCMASK_TC0_Msk' undeclared here (not in a function); did you mean 'MCLK_APBCMASK_TC0_Pos'?
   49 |         .mclk_mask = MCLK_APBCMASK_TC0_Msk | MCLK_APBCMASK_TC1_Msk,
      |                      ^~~~~~~~~~~~~~~~~~~~~
      |                      MCLK_APBCMASK_TC0_Pos
../../bastwan/include/periph_conf.h:49:46: error: 'MCLK_APBCMASK_TC1_Msk' undeclared here (not in a function); did you mean 'MCLK_APBCMASK_TC1_Pos'?
   49 |         .mclk_mask = MCLK_APBCMASK_TC0_Msk | MCLK_APBCMASK_TC1_Msk,
      |                                              ^~~~~~~~~~~~~~~~~~~~~
      |                                              MCLK_APBCMASK_TC1_Pos
make[2]: *** [/tmp/dwq.0.6332435015575191/0a6a2fc4f3b80dc9cf8ff15e2552cf2e/Makefile.base:139: /tmp/dwq.0.6332435015575191/0a6a2fc4f3b80dc9cf8ff15e2552cf2e/build/board_common_init/board_common.o] Error 1
make[1]: *** [/tmp/dwq.0.6332435015575191/0a6a2fc4f3b80dc9cf8ff15e2552cf2e/Makefile.base:31: ALL--/tmp/dwq.0.6332435015575191/0a6a2fc4f3b80dc9cf8ff15e2552cf2e/boards/common/init] Error 2
In file included from hwrng.c:23:
../../../boards/bastwan/include/periph_conf.h:49:22: error: 'MCLK_APBCMASK_TC0_Msk' undeclared here (not in a function); did you mean 'MCLK_APBCMASK_TC0_Pos'?
   49 |         .mclk_mask = MCLK_APBCMASK_TC0_Msk | MCLK_APBCMASK_TC1_Msk,
      |                      ^~~~~~~~~~~~~~~~~~~~~
      |                      MCLK_APBCMASK_TC0_Pos
../../../boards/bastwan/include/periph_conf.h:49:46: error: 'MCLK_APBCMASK_TC1_Msk' undeclared here (not in a function); did you mean 'MCLK_APBCMASK_TC1_Pos'?
   49 |         .mclk_mask = MCLK_APBCMASK_TC0_Msk | MCLK_APBCMASK_TC1_Msk,
      |                                              ^~~~~~~~~~~~~~~~~~~~~
      |                                              MCLK_APBCMASK_TC1_Pos
make[4]: *** [/tmp/dwq.0.6332435015575191/0a6a2fc4f3b80dc9cf8ff15e2552cf2e/Makefile.base:139: /tmp/dwq.0.6332435015575191/0a6a2fc4f3b80dc9cf8ff15e2552cf2e/build/sam0_common_periph/hwrng.o] Error 1
make[4]: *** Waiting for unfinished jobs....
In file included from ../../../drivers/include/periph/gpio.h:82,
                 from gpio.c:54:
../../../boards/bastwan/include/periph_conf.h:49:22: error: 'MCLK_APBCMASK_TC0_Msk' undeclared here (not in a function); did you mean 'MCLK_APBCMASK_TC0_Pos'?
   49 |         .mclk_mask = MCLK_APBCMASK_TC0_Msk | MCLK_APBCMASK_TC1_Msk,
      |                      ^~~~~~~~~~~~~~~~~~~~~
      |                      MCLK_APBCMASK_TC0_Pos
../../../boards/bastwan/include/periph_conf.h:49:46: error: 'MCLK_APBCMASK_TC1_Msk' undeclared here (not in a function); did you mean 'MCLK_APBCMASK_TC1_Pos'?
   49 |         .mclk_mask = MCLK_APBCMASK_TC0_Msk | MCLK_APBCMASK_TC1_Msk,
      |                                              ^~~~~~~~~~~~~~~~~~~~~
      |                                              MCLK_APBCMASK_TC1_Pos
make[4]: *** [/tmp/dwq.0.6332435015575191/0a6a2fc4f3b80dc9cf8ff15e2552cf2e/Makefile.base:139: /tmp/dwq.0.6332435015575191/0a6a2fc4f3b80dc9cf8ff15e2552cf2e/build/sam0_common_periph/gpio.o] Error 1
In file included from ../../../drivers/include/periph/rtc.h:44,
                 from rtc_rtt.c:34:
../../../boards/bastwan/include/periph_conf.h:49:22: error: 'MCLK_APBCMASK_TC0_Msk' undeclared here (not in a function); did you mean 'MCLK_APBCMASK_TC0_Pos'?
   49 |         .mclk_mask = MCLK_APBCMASK_TC0_Msk | MCLK_APBCMASK_TC1_Msk,
      |                      ^~~~~~~~~~~~~~~~~~~~~
      |                      MCLK_APBCMASK_TC0_Pos
../../../boards/bastwan/include/periph_conf.h:49:46: error: 'MCLK_APBCMASK_TC1_Msk' undeclared here (not in a function); did you mean 'MCLK_APBCMASK_TC1_Pos'?
   49 |         .mclk_mask = MCLK_APBCMASK_TC0_Msk | MCLK_APBCMASK_TC1_Msk,
      |                                              ^~~~~~~~~~~~~~~~~~~~~
      |                                              MCLK_APBCMASK_TC1_Pos
make[4]: *** [/tmp/dwq.0.6332435015575191/0a6a2fc4f3b80dc9cf8ff15e2552cf2e/Makefile.base:139: /tmp/dwq.0.6332435015575191/0a6a2fc4f3b80dc9cf8ff15e2552cf2e/build/sam0_common_periph/rtc_rtt.o] Error 1
make[3]: *** [/tmp/dwq.0.6332435015575191/0a6a2fc4f3b80dc9cf8ff15e2552cf2e/Makefile.base:31: ALL--/tmp/dwq.0.6332435015575191/0a6a2fc4f3b80dc9cf8ff15e2552cf2e/cpu/sam0_common/periph] Error 2
make[2]: *** [/tmp/dwq.0.6332435015575191/0a6a2fc4f3b80dc9cf8ff15e2552cf2e/Makefile.base:31: ALL--/tmp/dwq.0.6332435015575191/0a6a2fc4f3b80dc9cf8ff15e2552cf2e/cpu/sam0_common] Error 2
make[2]: *** Waiting for unfinished jobs....
In file included from ../../drivers/include/periph/gpio.h:82,
                 from ../../boards/bastwan/include/board.h:28,
                 from vectors_cortexm.c:32:
../../boards/bastwan/include/periph_conf.h:49:22: error: 'MCLK_APBCMASK_TC0_Msk' undeclared here (not in a function); did you mean 'MCLK_APBCMASK_TC0_Pos'?
   49 |         .mclk_mask = MCLK_APBCMASK_TC0_Msk | MCLK_APBCMASK_TC1_Msk,
      |                      ^~~~~~~~~~~~~~~~~~~~~
      |                      MCLK_APBCMASK_TC0_Pos
../../boards/bastwan/include/periph_conf.h:49:46: error: 'MCLK_APBCMASK_TC1_Msk' undeclared here (not in a function); did you mean 'MCLK_APBCMASK_TC1_Pos'?
   49 |         .mclk_mask = MCLK_APBCMASK_TC0_Msk | MCLK_APBCMASK_TC1_Msk,
      |                                              ^~~~~~~~~~~~~~~~~~~~~
      |                                              MCLK_APBCMASK_TC1_Pos
make[3]: *** [/tmp/dwq.0.6332435015575191/0a6a2fc4f3b80dc9cf8ff15e2552cf2e/Makefile.base:139: /tmp/dwq.0.6332435015575191/0a6a2fc4f3b80dc9cf8ff15e2552cf2e/build/cortexm_common/vectors_cortexm.o] Error 1
make[2]: *** [/tmp/dwq.0.6332435015575191/0a6a2fc4f3b80dc9cf8ff15e2552cf2e/Makefile.base:31: ALL--/tmp/dwq.0.6332435015575191/0a6a2fc4f3b80dc9cf8ff15e2552cf2e/cpu/cortexm_common] Error 2
In file included from cpu.c:26:
../../boards/bastwan/include/periph_conf.h:49:22: error: 'MCLK_APBCMASK_TC0_Msk' undeclared here (not in a function); did you mean 'MCLK_APBCMASK_TC0_Pos'?
   49 |         .mclk_mask = MCLK_APBCMASK_TC0_Msk | MCLK_APBCMASK_TC1_Msk,
      |                      ^~~~~~~~~~~~~~~~~~~~~
      |                      MCLK_APBCMASK_TC0_Pos
../../boards/bastwan/include/periph_conf.h:49:46: error: 'MCLK_APBCMASK_TC1_Msk' undeclared here (not in a function); did you mean 'MCLK_APBCMASK_TC1_Pos'?
   49 |         .mclk_mask = MCLK_APBCMASK_TC0_Msk | MCLK_APBCMASK_TC1_Msk,
      |                                              ^~~~~~~~~~~~~~~~~~~~~
      |                                              MCLK_APBCMASK_TC1_Pos
make[2]: *** [/tmp/dwq.0.6332435015575191/0a6a2fc4f3b80dc9cf8ff15e2552cf2e/Makefile.base:139: /tmp/dwq.0.6332435015575191/0a6a2fc4f3b80dc9cf8ff15e2552cf2e/build/cpu/cpu.o] Error 1
make[1]: *** [/tmp/dwq.0.6332435015575191/0a6a2fc4f3b80dc9cf8ff15e2552cf2e/Makefile.base:31: ALL--/tmp/dwq.0.6332435015575191/0a6a2fc4f3b80dc9cf8ff15e2552cf2e/cpu/saml21] Error 2
make: *** [/tmp/dwq.0.6332435015575191/0a6a2fc4f3b80dc9cf8ff15e2552cf2e/examples/gnrc_border_router/../../Makefile.include:746: application_gnrc_border_router.module] Error 2
make: Leaving directory '/tmp/dwq.0.6332435015575191/0a6a2fc4f3b80dc9cf8ff15e2552cf2e/examples/gnrc_border_router'
cat: /tmp/dwq.0.6332435015575191/0a6a2fc4f3b80dc9cf8ff15e2552cf2e/build/test-input-hash.sha1: No such file or directory
{"build/": 4964}

@dylad
Copy link
Member Author

dylad commented Oct 30, 2024

Yup,
I'm AFK this week. I will take care of this next week.
Thanks for the review !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: boards Area: Board ports Area: cpu Area: CPU/MCU ports CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Platform: ARM Platform: This PR/issue effects ARM-based platforms
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants