cpu/saml21: add compatibily headers for vendor files migration
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)
Murdock results
:heavy_check_mark: PASSED
a9cb19dcc5577ee28d4835f386f762402a35a9cf cpu/samr30: create compatibility headers for vendor files migration
| Success | Failures | Total | Runtime |
|---|---|---|---|
| 10215 | 0 | 10215 | 15m:01s |
Artifacts
@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}
Yup, I'm AFK this week. I will take care of this next week. Thanks for the review !
I forgot to add compatibility headers for SAMR34/SAMR30 (which are SAML21-based in fact) Let's see if Murdock is happy now.
Looks like the Murdock failure is unrelated (board native). Retry.
Thanks!