boards/nrf52: introduce shared dependencies in common/nrf52 and update boards#11792
boards/nrf52: introduce shared dependencies in common/nrf52 and update boards#11792haukepetersen merged 10 commits intoRIOT-OS:masterfrom
Conversation
|
Are these |
Not exactly CPU_MODEL which is defined as |
|
If all There may be a reason to not do it with a common directory, I am just asking before introducing this pattern that should be supported. One reason I could see is if it could prevent having 500 directories for each variations. |
They are too long for me to see a difference when reading :D |
|
@haukepetersen, maybe this PR could be of interest for you (just saw 2b34b45 which is also done by PR). |
3b9259e to
e9c0d63
Compare
|
Yes, this is interesting to me, I just missed this PR when doing #12114 and #12113, sorry... As stated before, I would not mind to go with this one and close my PRs. However, there are some fixes from #12114 still missing here, so would you mind to sync them into this PR? Than I can just close both of mine... |
I can adapt. After having a look, I see that the |
e9c0d63 to
d7761ae
Compare
|
on the contrary of #12114, ruuvitag and thingy52 are not using the shared nrf52832 dependency file in this PR. This is because nrfmin won't be built by default on those boards by the CI. Another approach could be to play with features and have test applications requiring nrfmin/softdevice/nimble/nrf802154 features explicitly. The dependency resolution would then be managed in another place than in boards. EDIT: the paragraph above doesn't make sense regarding |
haukepetersen
left a comment
There was a problem hiding this comment.
LGTM, just need to run some tests, will do so ASAP...
haukepetersen
left a comment
There was a problem hiding this comment.
Tested different radio options for the effected boards, everything compiles as expected and no more 'dual radio configs' are to be seen -> ACK
|
I am all good with this PR. @cladmi IMHO introducing even more common boards folders here for only 1 or 2 trivial files seems to be overkill to me. I would rather go the opposite direction in the future and see if there is some way we can slim down this common/nrf5x mess in the boards again. So are you ok with merging this PR for now? |
|
@cladmi ping :-) |
|
For me they are not "trivial files", there are a part of a board definition. There was already "features", now "dep" and next step will require putting an "include". Boards could be implemented in a single C file but they are not, even if they are just "trivial files". Keeping one directory allows consistent behavior and handling in the build system. I am still with the goal and doing cleaning so that for a board or cpu, specifying a list of directories could be enough. Even if the directory is a subdirectory of |
|
I see your point. However, I think we need to be practical here! In this context the meaning of One problem I see with the 'shared-configuration-tree' for the Nordic boards is that we don't have a strict tree (at the moment) but rather some overlapping groups: e.g. I guess I will see if I can come up with something else then. |
|
@haukepetersen, if you agree, I think we can merge this PR as it is now. |
|
@haukepetersen, how should we proceed here ? |
|
I would not mind merging this, but @cladmi's concerns are not addressed. So I think we still owe him to propose something more in line with this arguments?! |
|
I also just added a separate test app for the |
|
Ok, just looked into this a little bit more, and I want to propose the following: @cladmi: would that work for you? |
d7761ae to
bdff3f8
Compare
|
Rebased on top of master and fixed conflicts. @cladmi @haukepetersen how shoud we proceed ? I'm fine with @haukepetersen's proposal in #11792 (comment) |
|
It's on my list to look at. |
boards/common/nrf52/Makefile.dep
Outdated
| USEMODULE += nimble_netif | ||
| endif | ||
| endif | ||
| include $(RIOTCPU)/nrf52/Makefile.dep |
There was a problem hiding this comment.
Done automatically as CPU is defined.
|
On my side I would still rather namespace with a directory than with the file names. And a directory in -include $(RIOTBOARD)/common/nrf52/Makefile.nrf52832.dep
+include $(RIOTBOARD)/common/nrf52/nrf52832/Makefile.dep |
I'll follow your suggestion then and adapt this PR. |
d2a0603 to
9364bb4
Compare
|
@haukepetersen, @cladmi, I've updated the PR following @cladmi's suggestion. The dependencies (and features) are now included conditionally from the nrf52 common directory. @haukepetersen, now that there's a nrfmin test application, I can drop the nrfmin automatic dependeny for ruuvitag and thingy52 boards. This way we are consistent across all nrf52(832) boards. |
nice! Will look through the code now once more, just to be safe |
haukepetersen
left a comment
There was a problem hiding this comment.
Just this minor simplification, else everything looks nice to me!
Also tested all possible radio configurations for nimble_netif, nrfmin, nordic_softdevice_ble, nrf802154 for both nrf52832 and nrf52840 based boards, everything builds as expected.
|
|
||
| ifneq (,$(findstring nrf52832, $(CPU_MODEL))) | ||
| # include common nrf52832 features | ||
| include $(RIOTBOARD)/common/nrf52/nrf52832/Makefile.features |
There was a problem hiding this comment.
now look at that included file, we might simply want to drop nrf52832/Makefile.features and decleare the softdevice feature in the if block directly. If ever (and that is to be quite unexpected) there is additional feature(s), we can always re-introduce that file...
There was a problem hiding this comment.
Done, squashed and rebased (there was a conflict introduced by #12290)
This pull in softdevice when netdev_default is used
This pull in nrf802154 when netdev_default is used
80cd0bf to
bba8395
Compare
|
All green -> lets go. |
Contribution description
When reviewing #11769, I found that softdevice package and nrf802154 dependencies could be moved in common files under
boards/common/nrf52using theMakefile.nrf52<family>.deppattern. This is a bit similar to theMakefile.nrf52832.featuresadded in #11769.So this PR is proposing this change and applies it to nrf52840 based boards as well as some nrf52832 based boards. Note that for some nrf52832 boards, the softdevice is now added (nrf52832-mdk, acd52832).
Maybe the naming the new files could be improved (use
softdeviceandnrf802154instead ofnrf52832andnrf52840instead ? This would also allow to add an nrfmin dep file for example).Suggestions are welcome.
Testing procedure
Build and flash
gnrc_networkingon related boards and verify the expected dependencies are pulled in (softdevice on nrf52832, nrf802154 on nrf52840)Issues/PRs references
None