-
Couldn't load subscription status.
- Fork 22
softdevice: Move all SoftDevice files to separate folder #228
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
Conversation
hermabe
commented
Aug 1, 2025
- Easier automated deploy
- Clearer separation between sdk and SoftDevice
d05090d to
2405d50
Compare
| cmock_handle(${ZEPHYR_NRF_BM_MODULE_DIR}/include/s115/ble.h) | ||
| cmock_handle(${ZEPHYR_NRF_BM_MODULE_DIR}/include/s115/ble_gatts.h | ||
| set(SOFTDEVICE_VARIANT "s115") | ||
| set(SOFTDEVICE_INCLUDE_DIR "${ZEPHYR_NRF_BM_MODULE_DIR}/components/softdevice/${SOFTDEVICE_VARIANT}/${SOFTDEVICE_VARIANT}_API/include") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will it be easier to put API to components/softdevice/s115/API
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We still need to know the variant to choose the correct include folder, so no big difference. But it might look nicer to not have the variant repeated as many times.
|
@nrfconnect/ncs-bm @nrfconnect/ncs-co-build-system This is now ready for review |
| # | ||
| # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
| # | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be moved to components/softdevice as well?
(together with Kconfig file)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer to keep it outside of the components directory since all of it will be replaced on each update of the SoftDevice.
That said, there might be a better place to put the files than subsys/softdevice. I just kept them where they were for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why replace the entire directory? Is it not enough to touch the componentes/softdevice/s115 directory? At least you should not touch more than componentes/softdevice, but if we stick to touch only the variant folders we can keep the Kconfig and CMake files here as well. I find it a bit strange and less intuitive to the user that those are in subsys while the rest is in components.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will just replace components/softdevice, other components should not be touched. I want to replace the entire folder in case of future variants in addition to s115. It is possible to work around additional files in components/softdevice that shouldnt be replaced, replacing the whole thing is just simpler.
My idea for the components folder was that it is just a copy of external components and anything sdk-nrf-bm specific should be outside of it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We already have a workaround to not replace CMakeLists.txt or Kconfig files for https://github.com/nrfconnect/sdk-nrfxlib/blob/main/softdevice_controller/CMakeLists.txt, so it is possible to keep the files in components/softdevice.
|
@nrfconnect/ncs-co-build-system Please review |
|
@nrfconnect/ncs-bm-doc @nrfconnect/ncs-code-owners Please review |
subsys/softdevice/CMakeLists.txt
Outdated
| # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
| # | ||
|
|
||
| if (CONFIG_SOFTDEVICE_S115) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no spaces between if and bracket in cmake
subsys/softdevice/CMakeLists.txt
Outdated
|
|
||
| if (CONFIG_SOFTDEVICE_S115) | ||
| zephyr_include_directories(${ZEPHYR_NRF_BM_MODULE_DIR}/include/s115/) | ||
| set(SOFTDEVICE_VARIANT "s115") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should come from Kconfig
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a prompless kconfig that gives a variant string
|
|
||
| cmock_handle(${ZEPHYR_NRF_BM_MODULE_DIR}/include/s115/ble.h) | ||
| cmock_handle(${ZEPHYR_NRF_BM_MODULE_DIR}/include/s115/ble_gatts.h | ||
| set(SOFTDEVICE_VARIANT "s115") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and should not duplicate variables unless there's a good reason
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kconfigs dont work for unittests since the dependencies are not satisfied. Kept it as is
6f2adc1 to
ebedea6
Compare
- Easier automated deploy - Clearer separation between sdk and SoftDevice Signed-off-by: Herman Berget <[email protected]>
ebedea6 to
3455c3e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why have the SoftDevice in components/ and then also in subsys/?
Why not just have it:
subsys/bluetooth/softdevice/ and have everything in there instead? This would be closer to the Zephyr/NCS structure
The stuff in
Putting it in |
But this is NCS BM, so I wonder if it makes sense to consider it as it is, a different codebase that has its own |
We dont have to follow the "components" scheme, it was just a convenient place to collect all the SoftDevice files. My goals with this PR were to collect all the files in one place for automating the update process, and to separate them from the rest of the sdk since these files are build outputs from a separate repo and not regular files that should be changed in this repo. Unless there is a technical reason for the files to be placed somewhere else I would like to merge this PR so that we can continue with the automation work. The files can always be moved later if a reason for moving them shows up. |
Ok by me. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please note that AFAIK this will cause users to have to include #include <components/softdevice/s115/s115_API/include/nrf_error.h> if they want to use NRF_ERRORs, but that's ok for now I guess.
Edit:
Yes, when not enabling CONFIG_SOFTDEVICE (e.g. some peripheral libraries/samples).
Not sure what you mean? |
@hermabe We have peripheral samples using nrf_error.h that does not have the SoftDevice enabled. |
There are currently no users in-tree so we can add something when it is needed. Potential solutions:
|
We were considering point 2. |
Will go with a variant of option 2. Will add to storage PR if this is ready to merge before that. If not we'll need to add it here. |
|
It struck my mind if moving the SoftDevice includes from the include folder is really a good idea, will discuss offline. |
Discussed offline. We will continue with this approach and revisit later if needed. |