-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[RFC] boards/cpu: model of 'common' directories #11674
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want me to ignore this issue, please mark it with the "State: don't stale" label. Thank you for your contributions. |
Re-opening this is still valid IMO. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want me to ignore this issue, please mark it with the "State: don't stale" label. Thank you for your contributions. |
re-open |
Description
Boards based on a
common
board sometime only useMakefile.include
but notMakefile.dep
, or do not processMakefile.features
even if it exist.Sometime a common
Makefile.dep
does not exist at the beginning but may be created in the future and not all boards get updated.Some boards do not use the
board_common_abcd
module implemented.This leads to asking is this really in common ?
Because of this, the current model for
common
boards andcommon
cpu is not completely clear as some board could only partially use a common board for good or bad reasons.Questions
Makefile including files
Is it something we would like to have, that if a board/cup uses any of the
Makefile.include|Makefile.dep|Makefile.features
it must also process the other files (if they exist) ?If a board/cpu was always processing all files, we can think of defining a board as
If then this hierarchy can be defined recursively and be consistent, it could remove the need to re-include and add to
DIRS
all the common files in eachMakefile|Makefile.dep|Makefile.features|Makefile.include
and leave this to central files.Also easily give "by which parts is my board/cpu implemented".
It could currently be deduced from
MAKEFILE_LIST
but would not mean allfeatures
ordependencies
are used.Examples
Some of the files not using
Makefile.features
were found during #11477common/msba2
,common/remote
,common/msb-430
not using a commonMakefile.features
. Which was problematic when movingCPU/CPU_MODEL
to it. TODO PR, currently in Tracking: move CPU/CPU_MODEL to Makefile.features #11477common/arduino-atmega/Makefile.include|.dep
common/nrf51/Makefile.dep
nucleo-f410rb
andnucleo-f411re
do not processcommon/nucleo64/Makefile.features
Makefile.include
and has notMakefile.dep
common/wsn430
declares a dependency inMakefile.include
and has notMakefile.dep
TODO:
Find a script that really shows if a board/cpu does not use all the files from the common. And so ignores the non existing common files.
A more verbose output that does not merge including two different common files, but even more false positive.
git grep 'common/.*/Makefile.' boards/ | sed 's/Makefile.[a-z]*/Makefile.xxx/g' | uniq -c | sed 's/Makefile..*//' | grep -v '3 '
Always defining each file
Question, should we move toward all the boards, cpu and commons always define
Makefile.dep/Makefile.features/Makefile.include
?This way it allows a board to use a common one and be future proof as if a dependency is added, it will always be processed. Otherwise, each time a new common included file is created all boards using that common one must be updated at the same time.
common code without function namespacing
Despite the namespacing requirement https://github.com/RIOT-OS/RIOT/wiki/Coding-conventions#naming boards and cpu modules do not respect it.
Some boards/common define
board_init
directly, and haveboard.h
andperiph_conf.h
headers which leads to the board not being able to extend a common board without duplicating the files.Would it be good to change this and define
board_common_abcd_init
to allow re-using it ? Same for the headers and all.Re-use of a board as a common board
Currently due to the previous issue with
namespacing
and that the fact that all boards define theboard
module and all cpu thecpu
module, same for drivers/periph so a board cannot be used as a 'common' board. Having each board defining theboard_boardname
module and then theboard_boardname_init
would allow re-using that code.A generic
board
module should be in riot to call the rightboard_boardname_init
function.Tracking updates
common/kw41z/Makefile.include
phynode-kw41z/Makefile.include does not use thecommon/kw41z/Makefile.include
#11616For the
phynode-kw41z
it was updated so that theUSEMODULE += boards_common_kw41z
is not put in common anymore but let on the board to include the module or not.Related issues
This was currently found while moving
CPU/CPU_MODEL
toMakefile.features
.common/kw41z/Makefile.include
phynode-kw41z/Makefile.include does not use thecommon/kw41z/Makefile.include
#11616The text was updated successfully, but these errors were encountered: