Skip to content

Buildsystem: Automatically add Common Board Definitions when USEMODULE is set #21299

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

Closed
wants to merge 5 commits into from

Conversation

crasbe
Copy link
Contributor

@crasbe crasbe commented Mar 14, 2025

Contribution description

Many boards in RIOT (such as the feather-nrf52840, feather-m0, ...) use common board definitions for things like the bootloader. Back when this was implemented in #8058, the approach was to include the directory by adding the path to the DIRS variable and setting the USEMODULE in one of the common folders.

This is not really elegant and the Makefile in the boards/common/... subfolder didn't even get executed.
You can find more information about this in #21298.

The PR is based on #21281 and since it is not currently merged, I added the changes in squashed-form. That is obviously to be deleted once #21281 is merged. This is meant as a Request for Comments.

If this is valid solution, it would be possible to adapt it to the CPU common folders as well, but probably not in this PR.

Testing procedure

Make sure the boards still compile and the common folder is still included.

The only adapted boards are currently the two feather-nrf52840* and the seeedstudio-xiao-nrf52840.

`tests/sys/shell` on `feather-nrf52840` with #21281:
~/RIOTstuff/riot-ada-bootloader/RIOT$ BOARD=feather-nrf52840 make -C tests/sys/shell
make: Entering directory '/home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/tests/sys/shell'
Building application "tests_shell" for "feather-nrf52840" with CPU "nrf52".

"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/pkg/cmsis/
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/boards/common/init
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/boards/feather-nrf52840
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/boards/common/adafruit-nrf52-bootloader
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/core
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/core/lib
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/cpu/nrf52
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/cpu/cortexm_common
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/cpu/cortexm_common/periph
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/cpu/nrf52/periph
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/cpu/nrf52/vectors
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/cpu/nrf5x_common
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/cpu/nrf5x_common/periph
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/drivers
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/drivers/periph_common
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/app_metadata
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/auto_init
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/auto_init/usb
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/div
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/event
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/fmt
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/frac
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/isrpipe
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/libc
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/luid
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/malloc_thread_safe
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/newlib_syscalls_default
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/preprocessor
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/ps
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/shell
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/shell/cmds
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/stdio
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/test_utils/interactive_sync
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/test_utils/print_stack_usage
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/tsrb
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/usb/usbus
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/usb/usbus/cdc/acm
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/usb_board_reset
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/ztimer
   text    data     bss     dec     hex filename
  23692     128    4696   28516    6f64 /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/tests/sys/shell/bin/feather-nrf52840/tests_shell.elf
make: Leaving directory '/home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/tests/sys/shell'
`tests/sys/shell` on `feather-nrf52840` with this PR:
~/RIOTstuff/riot-ada-bootloader/RIOT$ BOARD=feather-nrf52840 make -C tests/sys/shell
make: Entering directory '/home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/tests/sys/shell'
Building application "tests_shell" for "feather-nrf52840" with CPU "nrf52".

"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/pkg/cmsis/
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/boards/common/adafruit-nrf52-bootloader
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/boards/common/init
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/boards/feather-nrf52840
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/core
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/core/lib
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/cpu/nrf52
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/cpu/cortexm_common
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/cpu/cortexm_common/periph
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/cpu/nrf52/periph
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/cpu/nrf52/vectors
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/cpu/nrf5x_common
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/cpu/nrf5x_common/periph
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/drivers
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/drivers/periph_common
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/app_metadata
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/auto_init
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/auto_init/usb
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/div
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/event
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/fmt
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/frac
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/isrpipe
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/libc
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/luid
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/malloc_thread_safe
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/newlib_syscalls_default
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/preprocessor
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/ps
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/shell
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/shell/cmds
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/stdio
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/test_utils/interactive_sync
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/test_utils/print_stack_usage
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/tsrb
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/usb/usbus
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/usb/usbus/cdc/acm
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/usb_board_reset
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/ztimer
   text    data     bss     dec     hex filename
  23676     128    4696   28500    6f54 /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/tests/sys/shell/bin/feather-nrf52840/tests_shell.elf
make: Leaving directory '/home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/tests/sys/shell'

Boards that are not yet adapted, such as the feather-m0, will include the common files twice. I don't think that that would have any adverse effects, but it's obviously not desireable.

`tests/sys/shell` on `feather-m0` with master
~/RIOTstuff/riot-ada-bootloader/RIOT$ BOARD=feather-m0 make -C tests/sys/shell
make: Entering directory '/home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/tests/sys/shell'
Building application "tests_shell" for "feather-m0" with CPU "samd21".

"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/pkg/cmsis/
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/boards/common/init
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/boards/feather-m0
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/boards/common/samdx1-arduino-bootloader
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/core
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/core/lib
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/cpu/samd21
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/cpu/cortexm_common
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/cpu/cortexm_common/periph
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/cpu/sam0_common
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/cpu/sam0_common/periph
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/cpu/samd21/periph
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/cpu/samd21/vectors
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/drivers
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/drivers/periph_common
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/app_metadata
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/auto_init
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/auto_init/usb
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/div
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/event
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/fmt
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/frac
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/isrpipe
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/libc
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/luid
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/malloc_thread_safe
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/newlib_syscalls_default
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/pm_layered
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/preprocessor
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/ps
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/shell
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/shell/cmds
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/stdio
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/test_utils/interactive_sync
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/test_utils/print_stack_usage
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/tsrb
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/usb/usbus
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/usb/usbus/cdc/acm
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/usb_board_reset
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/ztimer
   text    data     bss     dec     hex filename
  25808     176    4892   30876    789c /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/tests/sys/shell/bin/feather-m0/tests_shell.elf
make: Leaving directory '/home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/tests/sys/shell'
`tests/sys/shell` on `feather-m0` with this PR:
~/RIOTstuff/riot-ada-bootloader/RIOT$ BOARD=feather-m0 make -C tests/sys/shell
make: Entering directory '/home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/tests/sys/shell'
Building application "tests_shell" for "feather-m0" with CPU "samd21".

"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/pkg/cmsis/
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/boards/common/init
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/boards/common/samdx1-arduino-bootloader
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/boards/feather-m0
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/boards/common/samdx1-arduino-bootloader
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/core
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/core/lib
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/cpu/samd21
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/cpu/cortexm_common
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/cpu/cortexm_common/periph
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/cpu/sam0_common
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/cpu/sam0_common/periph
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/cpu/samd21/periph
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/cpu/samd21/vectors
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/drivers
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/drivers/periph_common
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/app_metadata
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/auto_init
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/auto_init/usb
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/div
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/event
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/fmt
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/frac
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/isrpipe
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/libc
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/luid
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/malloc_thread_safe
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/newlib_syscalls_default
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/pm_layered
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/preprocessor
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/ps
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/shell
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/shell/cmds
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/stdio
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/test_utils/interactive_sync
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/test_utils/print_stack_usage
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/tsrb
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/usb/usbus
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/usb/usbus/cdc/acm
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/usb_board_reset
"make" -C /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/sys/ztimer
   text    data     bss     dec     hex filename
  25836     176    4892   30904    78b8 /home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/tests/sys/shell/bin/feather-m0/tests_shell.elf
make: Leaving directory '/home/cbuec/RIOTstuff/riot-ada-bootloader/RIOT/tests/sys/shell'

Issues/PRs references

Fixes #21298.

@crasbe crasbe added State: WIP State: The PR is still work-in-progress and its code is not in its final presentable form yet Discussion: RFC The issue/PR is used as a discussion starting point about the item of the issue/PR State: waiting for other PR State: The PR requires another PR to be merged first CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Mar 14, 2025
@github-actions github-actions bot added Area: doc Area: Documentation Area: build system Area: Build system Area: boards Area: Board ports labels Mar 14, 2025
@crasbe crasbe added the Community: help wanted The contributors require help from other members of the community label Mar 14, 2025
@riot-ci
Copy link

riot-ci commented Mar 14, 2025

Murdock results

FAILED

d60dcb4 fixup! fixup! fixup! boards/*: adapt boards to new common boards

Build failures (21)
Application Target Toolchain Runtime (s) Worker
examples/networking/misc/lwm2m adafruit-metro-m4-express gnu 2.13 mobi6
examples/networking/misc/lwm2m sltb001a gnu 2.36 mobi6
examples/networking/misc/lwm2m stk3600 gnu 2.22 mobi6
examples/networking/misc/lwm2m seeedstudio-xiao-esp32c3 gnu 4.78 breeze
tests/build_system/kconfig serpente gnu 1.26 mobi7
tests/build_system/kconfig seeedstudio-xiao-esp32c3 gnu 2.93 breeze
tests/net/gcoap_dns stk3200 gnu 2.74 breeze
tests/net/gcoap_dns slstk3400a gnu 4.47 mobi6
tests/net/gcoap_dns seeedstudio-xiao-esp32c3 gnu 4.05 breeze
tests/net/gnrc_sixlowpan_frag_minfwd adafruit-metro-m4-express gnu 1.47 mobi7
tests/net/gnrc_sixlowpan_frag_minfwd stk3600 gnu 5.65 alien
tests/net/gnrc_sixlowpan_frag_minfwd seeedstudio-xiao-esp32c3 gnu 8.84 mobi3
tests/net/gnrc_sixlowpan_frag_sfr sltb001a gnu 1.75 mobi6
tests/net/gnrc_sixlowpan_frag_sfr stk3600 gnu 1.67 mobi6
tests/net/gnrc_sixlowpan_frag_sfr serpente gnu 4.82 tatooine
tests/net/gnrc_sixlowpan_frag_sfr esp32s2-devkit gnu 9.17 mobi3
tests/net/gnrc_sixlowpan_frag_sfr esp32c3-wemos-mini gnu 9.91 mobi3
tests/net/gnrc_sixlowpan_frag_sfr slstk3400a gnu 13.08 mobi3
tests/net/gnrc_sixlowpan_frag_sfr_congure serpente gnu 1.54 mobi6
tests/net/gnrc_sixlowpan_frag_sfr_congure stk3600 gnu 9.03 mobi3

and 13 more build failures...

Artifacts

@crasbe crasbe added the CI: no fast fail don't abort PR build after first error label Mar 14, 2025
@crasbe crasbe force-pushed the pr/boards_common branch 2 times, most recently from 8947c43 to 81f7aa2 Compare March 14, 2025 19:05
Makefile.include Outdated
Comment on lines 611 to 612
COMMON_BOARD_DIRS := $(subst _common_,/common/,$(COMMON_BOARD_MODULES))
COMMON_BOARD_DIRS := $(addprefix $(RIOTBASE)/,$(COMMON_BOARD_DIRS))
Copy link
Contributor

Choose a reason for hiding this comment

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

This introduces a 1-to-1 relationship between the module name and it's folder structure. While I do think that makes sense, I think this is new to RIOT.

Could we mimic the way sys/Makefile* are organized and instead add that to dirs in application.inc.mk?

@crasbe crasbe force-pushed the pr/boards_common branch from 81f7aa2 to 7fd7d2e Compare March 25, 2025 21:59
@github-actions github-actions bot removed the Area: doc Area: Documentation label Mar 25, 2025
@crasbe
Copy link
Contributor Author

crasbe commented Mar 25, 2025

This is a much bigger task than I imagined... the fixup comment is a start for the new approach, but there is still a lot to do:

RIOT/boards$ grep -Rnw -e "DIRS +="
calliope-mini/Makefile:4:  DIRS += $(RIOTBOARD)/common/microbit
microbit/Makefile:4:  DIRS += $(RIOTBOARD)/common/microbit
microbit-v2/Makefile:4:  DIRS += $(RIOTBOARD)/common/microbit
Makefile:3:  DIRS += $(RIOTBOARD)/common/adafruit-nrf52-bootloader
Makefile:6:  DIRS += $(RIOTBOARD)/common/arduino-mkr
Makefile:9:  DIRS += $(RIOTBOARD)/common/atxmega
Makefile:12:  DIRS += $(RIOTBOARD)/common/e104-bt50xxa-tb
Makefile:15:  DIRS += $(RIOTBOARD)/common/esp32
Makefile:18:  DIRS += $(RIOTBOARD)/common/esp32s2
Makefile:21:  DIRS += $(RIOTBOARD)/common/esp32s3
Makefile:24:  DIRS += $(RIOTBOARD)/common/esp32x
Makefile:27:  DIRS += $(RIOTBOARD)/common/microbit
Makefile:30:  DIRS += $(RIOTBOARD)/common/msb-430
Makefile:33:  DIRS += $(RIOTBOARD)/common/nucleo64
Makefile:36:  DIRS += $(RIOTBOARD)/common/particle-mesh
Makefile:39:  DIRS += $(RIOTBOARD)/common/remote
Makefile:42:  DIRS += $(RIOTBOARD)/common/samdx1-arduino-bootloader
Makefile:45:  DIRS += $(RIOTBOARD)/common/silabds
Makefile:48:  DIRS += $(RIOTBOARD)/common/slwstk6000b
Makefile:51:  DIRS += $(RIOTBOARD)/common/sodaq
common/silabs/Makefile:4:  DIRS += drivers/aem
common/silabs/Makefile:8:  DIRS += drivers/bc
common/silabs/Makefile:12:  DIRS += drivers/pic

I'm not sure how to proceed with the microbit based boards, because they have a dependency of whether the microbit module is used, but I'm not sure if that condition is met when BOARD = microbit? (aka always for those boards?)

ifneq (,$(filter microbit,$(USEMODULE)))
DIRS += $(RIOTBOARD)/common/microbit
endif

RIOT/boards$ grep -Rnw -e "DIRS ="
slstk3402a/Makefile:3:DIRS = $(RIOTBOARD)/common/silabs
nucleo-f303ze/Makefile:2:DIRS = $(RIOTBOARD)/common/nucleo
iotlab-a8-m3/Makefile:3:DIRS = $(RIOTBOARD)/common/iotlab
nucleo-f767zi/Makefile:2:DIRS = $(RIOTBOARD)/common/nucleo
arduino-zero/Makefile:3:DIRS = $(RIOTBOARD)/common/arduino-zero
nucleo-l152re/Makefile:2:DIRS = $(RIOTBOARD)/common/nucleo
feather-m0-wifi/Makefile:1:DIRS = $(RIOTBOARD)/feather-m0
nucleo-f746zg/Makefile:2:DIRS = $(RIOTBOARD)/common/nucleo
esp32-ethernet-kit-v1_2/Makefile:1:DIRS = $(RIOTBOARD)/esp32-ethernet-kit-v1_0
yunjia-nrf51822/Makefile:2:DIRS = $(RIOTBOARD)/common/nrf51
adafruit-pybadge/Makefile:3:DIRS = $(RIOTBOARD)/common/samdx1-arduino-bootloader
seeedstudio-xiao-esp32c3/Makefile:3:DIRS = $(RIOTBOARD)/common/esp32c3
stk3200/Makefile:3:DIRS = $(RIOTBOARD)/common/silabs
arduino-mkr1000/Makefile:3:DIRS = $(RIOTBOARD)/common/arduino-mkr
nucleo-l053r8/Makefile:2:DIRS = $(RIOTBOARD)/common/nucleo
nucleo-l476rg/Makefile:2:DIRS = $(RIOTBOARD)/common/nucleo
esp8266-sparkfun-thing/Makefile:3:DIRS = $(RIOTBOARD)/common/esp8266
feather-m0-lora/Makefile:1:DIRS = $(RIOTBOARD)/feather-m0
atxmega-a3bu-xplained/Makefile:3:DIRS = $(RIOTBOARD)/common/atxmega
arduino-duemilanove/Makefile:3:DIRS = $(RIOTBOARD)/common/arduino-atmega
microduino-corerf/Makefile:3:DIRS = $(RIOTBOARD)/common/atmega
adafruit-metro-m4-express/Makefile:3:DIRS = $(RIOTBOARD)/common/samdx1-arduino-bootloader
arduino-mkrfox1200/Makefile:3:DIRS = $(RIOTBOARD)/common/arduino-mkr
arduino-nano-33-iot/Makefile:3:DIRS = $(RIOTBOARD)/common/samdx1-arduino-bootloader
nrf52dk/Makefile:2:DIRS = $(RIOTBOARD)/common/nrf52xxxdk
esp8266-esp-12x/Makefile:3:DIRS = $(RIOTBOARD)/common/esp8266
arduino-leonardo/Makefile:3:DIRS = $(RIOTBOARD)/common/arduino-atmega
nucleo-wl55jc/Makefile:2:DIRS = $(RIOTBOARD)/common/nucleo
nucleo-f207zg/Makefile:2:DIRS = $(RIOTBOARD)/common/nucleo
nucleo-l031k6/Makefile:2:DIRS = $(RIOTBOARD)/common/nucleo
weact-f401ce/Makefile:3:DIRS = $(RIOTBOARD)/common/weact-f4x1cx
p-nucleo-wb55/Makefile:2:DIRS = $(RIOTBOARD)/common/nucleo
nrf52840dk/Makefile:2:DIRS = $(RIOTBOARD)/common/nrf52xxxdk
native/Makefile:3:DIRS = drivers
esp32s3-wt32-sc01-plus/Makefile:3:DIRS = $(RIOTBOARD)/common/esp32s3
bluepill-stm32f103cb/Makefile:3:DIRS = $(RIOTBOARD)/common/blxxxpill
native64/Makefile:1:DIRS = $(RIOTBOARD)/native
slstk3400a/Makefile:3:DIRS = $(RIOTBOARD)/common/silabs
ruuvitag/Makefile:2:DIRS = $(RIOTBOARD)/common/nrf52xxxdk
derfmega256/Makefile:3:DIRS = $(RIOTBOARD)/common/atmega
nucleo-f401re/Makefile:2:DIRS = $(RIOTBOARD)/common/nucleo
nucleo-f429zi/Makefile:2:DIRS = $(RIOTBOARD)/common/nucleo
esp32s3-usb-otg/Makefile:3:DIRS = $(RIOTBOARD)/common/esp32s3
nucleo-f446ze/Makefile:2:DIRS = $(RIOTBOARD)/common/nucleo
sltb001a/Makefile:3:DIRS = $(RIOTBOARD)/common/silabs
arduino-due/Makefile:2:DIRS = $(RIOTBOARD)/common/arduino-due
rpi-pico-w/Makefile:1:DIRS = $(RIOTBOARD)/rpi-pico
adafruit-grand-central-m4-express/Makefile:3:DIRS = $(RIOTBOARD)/common/samdx1-arduino-bootloader
stk3600/Makefile:3:DIRS = $(RIOTBOARD)/common/silabs
blackpill-stm32f103c8/Makefile:3:DIRS = $(RIOTBOARD)/common/blxxxpill
nucleo-g070rb/Makefile:2:DIRS = $(RIOTBOARD)/common/nucleo
nucleo-l4r5zi/Makefile:2:DIRS = $(RIOTBOARD)/common/nucleo
remote-pa/Makefile:3:DIRS = $(RIOTBOARD)/common/remote
esp32s3-pros3/Makefile:3:DIRS = $(RIOTBOARD)/common/esp32s3
nucleo-f410rb/Makefile:2:DIRS = $(RIOTBOARD)/common/nucleo
slwstk6220a/Makefile:3:DIRS = $(RIOTBOARD)/common/silabs
esp32s2-wemos-mini/Makefile:3:DIRS = $(RIOTBOARD)/common/esp32s2
nucleo-f446re/Makefile:2:DIRS = $(RIOTBOARD)/common/nucleo
nucleo-g474re/Makefile:2:DIRS = $(RIOTBOARD)/common/nucleo
atmega328p-xplained-mini/Makefile:3:DIRS = $(RIOTBOARD)/common/atmega
weact-f411ce/Makefile:3:DIRS = $(RIOTBOARD)/common/weact-f4x1cx
nucleo-l552ze-q/Makefile:2:DIRS = $(RIOTBOARD)/common/nucleo
nucleo-f412zg/Makefile:2:DIRS = $(RIOTBOARD)/common/nucleo
nucleo-f042k6/Makefile:2:DIRS = $(RIOTBOARD)/common/nucleo
esp32-wrover-kit/Makefile:3:DIRS = $(RIOTBOARD)/common/esp32
sltb009a/Makefile:3:DIRS = $(RIOTBOARD)/common/silabs
nucleo-f103rb/Makefile:2:DIRS = $(RIOTBOARD)/common/nucleo
usb-kw41z/Makefile:3:DIRS = $(RIOTBOARD)/common/kw41z
sipeed-longan-nano-tft/Makefile:1:DIRS = $(RIOTBOARD)/sipeed-longan-nano
udoo/Makefile:2:DIRS = $(RIOTBOARD)/common/arduino-due
nucleo-f072rb/Makefile:2:DIRS = $(RIOTBOARD)/common/nucleo
esp32c3-devkit/Makefile:3:DIRS = $(RIOTBOARD)/common/esp32c3
iotlab-m3/Makefile:3:DIRS = $(RIOTBOARD)/common/iotlab
nucleo-u575zi-q/Makefile:2:DIRS = $(RIOTBOARD)/common/nucleo
esp32-wemos-lolin-d32-pro/Makefile:3:DIRS = $(RIOTBOARD)/common/esp32
derfmega128/Makefile:3:DIRS = $(RIOTBOARD)/common/atmega
saml11-xpro/Makefile:2:DIRS = $(RIOTBOARD)/common/saml1x
atmega1284p/Makefile:3:DIRS = $(RIOTBOARD)/common/atmega
nucleo-l452re/Makefile:2:DIRS = $(RIOTBOARD)/common/nucleo
slstk3701a/Makefile:3:DIRS = $(RIOTBOARD)/common/silabs
esp8266-olimex-mod/Makefile:3:DIRS = $(RIOTBOARD)/common/esp8266
nucleo-g431rb/Makefile:2:DIRS = $(RIOTBOARD)/common/nucleo
esp32s2-lilygo-ttgo-t8/Makefile:3:DIRS = $(RIOTBOARD)/common/esp32s2
saml10-xpro/Makefile:2:DIRS = $(RIOTBOARD)/common/saml1x
atmega8/Makefile:3:DIRS = $(RIOTBOARD)/common/atmega
nucleo-f303re/Makefile:2:DIRS = $(RIOTBOARD)/common/nucleo
nucleo-l496zg/Makefile:2:DIRS = $(RIOTBOARD)/common/nucleo
arduino-nano/Makefile:3:DIRS = $(RIOTBOARD)/common/arduino-atmega
remote-revb/Makefile:3:DIRS = $(RIOTBOARD)/common/remote
nucleo-l412kb/Makefile:3:DIRS = $(RIOTBOARD)/common/nucleo
blackpill-stm32f103cb/Makefile:3:DIRS = $(RIOTBOARD)/common/blxxxpill
nucleo-f091rc/Makefile:2:DIRS = $(RIOTBOARD)/common/nucleo
arduino-mkrwan1300/Makefile:3:DIRS = $(RIOTBOARD)/common/arduino-mkr
serpente/Makefile:3:DIRS = $(RIOTBOARD)/common/samdx1-arduino-bootloader
stm32f429i-disco/Makefile:1:DIRS = $(RIOTBOARD)/stm32f429i-disc1
esp32-ttgo-t-beam/Makefile:3:DIRS = $(RIOTBOARD)/common/esp32
zigduino/Makefile:3:DIRS = $(RIOTBOARD)/common/atmega
esp32-olimex-evb/Makefile:3:DIRS = $(RIOTBOARD)/common/esp32
stm32f7508-dk/Makefile:3:DIRS = $(RIOTBOARD)/stm32f746g-disco
nucleo-f334r8/Makefile:2:DIRS = $(RIOTBOARD)/common/nucleo
nucleo-f302r8/Makefile:2:DIRS = $(RIOTBOARD)/common/nucleo
esp32-ethernet-kit-v1_0/Makefile:3:DIRS = $(RIOTBOARD)/common/esp32
atmega256rfr2-xpro/Makefile:3:DIRS = $(RIOTBOARD)/common/atmega
nucleo-f031k6/Makefile:2:DIRS = $(RIOTBOARD)/common/nucleo
nucleo-f030r8/Makefile:2:DIRS = $(RIOTBOARD)/common/nucleo
nucleo-l432kc/Makefile:2:DIRS = $(RIOTBOARD)/common/nucleo
arduino-uno/Makefile:3:DIRS = $(RIOTBOARD)/common/arduino-atmega
nucleo-f722ze/Makefile:2:DIRS = $(RIOTBOARD)/common/nucleo
common/esp32c3/Makefile:3:DIRS = $(RIOTBOARD)/common/esp32x
common/esp32s2/Makefile:3:DIRS = $(RIOTBOARD)/common/esp32x
common/arduino-atmega/Makefile:3:DIRS = $(RIOTBOARD)/common/atmega
mega-xplained/Makefile:3:DIRS = $(RIOTBOARD)/common/atmega
nucleo-f439zi/Makefile:2:DIRS = $(RIOTBOARD)/common/nucleo
nucleo-l433rc/Makefile:2:DIRS = $(RIOTBOARD)/common/nucleo
atxmega-a1u-xpro/Makefile:3:DIRS = $(RIOTBOARD)/common/atxmega
esp32-ethernet-kit-v1_1/Makefile:1:DIRS = $(RIOTBOARD)/esp32-ethernet-kit-v1_0
nucleo-f303k8/Makefile:2:DIRS = $(RIOTBOARD)/common/nucleo
bluepill-stm32f103c8/Makefile:3:DIRS = $(RIOTBOARD)/common/blxxxpill
esp32-mh-et-live-minikit/Makefile:3:DIRS = $(RIOTBOARD)/common/esp32
hip-badge/Makefile:3:DIRS = $(RIOTBOARD)/common/esp32c3
openlabs-kw41z-mini-256kib/Makefile:1:DIRS = $(RIOTBOARD)/openlabs-kw41z-mini
nucleo-l073rz/Makefile:2:DIRS = $(RIOTBOARD)/common/nucleo
msb-430h/Makefile:3:DIRS = $(RIOTBOARD)/common/msb-430
atmega328p/Makefile:3:DIRS = $(RIOTBOARD)/common/atmega
seeeduino_xiao/Makefile:3:DIRS = $(RIOTBOARD)/common/samdx1-arduino-bootloader
esp32c3-wemos-mini/Makefile:3:DIRS = $(RIOTBOARD)/common/esp32c3
airfy-beacon/Makefile:2:DIRS = $(RIOTBOARD)/common/nrf51
avr-rss2/Makefile:3:DIRS = $(RIOTBOARD)/common/atmega
nucleo-f411re/Makefile:2:DIRS = $(RIOTBOARD)/common/nucleo
nucleo-f413zh/Makefile:2:DIRS = $(RIOTBOARD)/common/nucleo
slstk3401a/Makefile:3:DIRS = $(RIOTBOARD)/common/silabs
frdm-kw41z/Makefile:3:DIRS = $(RIOTBOARD)/common/kw41z
weact-f401cc/Makefile:3:DIRS = $(RIOTBOARD)/common/weact-f4x1cx
arduino-mega2560/Makefile:3:DIRS = $(RIOTBOARD)/common/arduino-atmega
sensebox_samd21/Makefile:3:DIRS = $(RIOTBOARD)/common/samdx1-arduino-bootloader
nucleo-c031c6/Makefile:2:DIRS = $(RIOTBOARD)/common/nucleo
stk3700/Makefile:3:DIRS = $(RIOTBOARD)/common/silabs
nucleo-l011k4/Makefile:2:DIRS = $(RIOTBOARD)/common/nucleo

@crasbe crasbe force-pushed the pr/boards_common branch from 31cdbcc to 250bef0 Compare March 25, 2025 23:12
@crasbe crasbe added the CI: full build disable CI build filter label Mar 25, 2025
@crasbe crasbe force-pushed the pr/boards_common branch 2 times, most recently from 338944c to 2deeb69 Compare March 25, 2025 23:31
@crasbe crasbe removed the State: waiting for other PR State: The PR requires another PR to be merged first label Mar 25, 2025
@github-actions github-actions bot added the Area: tests Area: tests and testing framework label Mar 26, 2025
@crasbe crasbe force-pushed the pr/boards_common branch from 3880883 to ed8dcba Compare March 26, 2025 00:20
@crasbe
Copy link
Contributor Author

crasbe commented Mar 26, 2025

Okay the Microbit code is a bit weird, apparently the boards/common/microbit library is a bit "misnamed", as it apparently is only used by tests/board_microbit and has some functions for accessing the display and such. Therefore it has the ifndefs in the Makefiles.

@crasbe crasbe force-pushed the pr/boards_common branch from ed8dcba to 5738655 Compare March 26, 2025 00:32
@crasbe
Copy link
Contributor Author

crasbe commented Mar 26, 2025

One could argue that this PR would be a good opportunity to add the include $(RIOTBOARD)/common/xxx/Makefile.include in the boards/yyy/Makefile.include files to the boards/Makefile.include with a similar scheme as the boards/Makefile as well as the Makefile.dep includes and possibly the Makefile.features includes.

That would really clean up the board definition Makefiles IMO and you would only have to add the USEMODULE += boards_common_xxx line and mostly everything else would be set.

@crasbe crasbe force-pushed the pr/boards_common branch from 5738655 to d60dcb4 Compare March 26, 2025 00:57
@crasbe
Copy link
Contributor Author

crasbe commented Mar 26, 2025

I think this PR has to be split up into separate PRs:

  1. Introduce the boards/Makefile, boards/Makefile.{include,dep,features} and adapt one board (family) as an example, for example those that use adafruit-nrf52-bootloader
    2-n) Create separate PRs for each bigger family (like microbit, samdx1-arduino-bootloader, nucleo, ...)

Otherwise this will be a cat-and-mouse game with CI with a lot of potential to break things 😅

Tomorrow I'll split this up and possibly create a tracking issue with groups that have to be adapted.

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: build system Area: Build system Area: tests Area: tests and testing framework CI: full build disable CI build filter CI: no fast fail don't abort PR build after first error CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Community: help wanted The contributors require help from other members of the community Discussion: RFC The issue/PR is used as a discussion starting point about the item of the issue/PR State: WIP State: The PR is still work-in-progress and its code is not in its final presentable form yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Buildsystem: Makefile of Common Board Directories never called without adding DIRS
3 participants