-
Notifications
You must be signed in to change notification settings - Fork 3k
Nordic BLE: Allow configuration of softdevice parameters #6860
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
ade8c38
to
6aeda2a
Compare
The logging in this PR would do well from #5965 once it's finished |
Thank you for the contribution. I think there are too many things going on at the same time in this PR:
Do you mind splitting it up in two PRs please? Regarding 1, you should add a new Regarding 2, just by skimming the code I'm not sure it will play nice with the current UART implementation? At the end of the day, @donatieng would have to sign off on adding this new feature. |
Yeah... Once I dropped the linker settings from the previous pr it needed some way to show the user what they needed to do, it just grew from there. The logging stuff works really well in my testing on both nrf51 and nrf51. It uses the UART defines from the original nrf logging but it doesn't touch the actual uarts, redirecting all logging defines to stdout. |
6aeda2a
to
a8d4fc5
Compare
Thanks for the suggestion about adding a new I've also separated out the logging stuff to its own PR. This has all made the changeset dramatically smaller. |
35786ff
to
a0e0a41
Compare
"macro_name": "NRF_SDH_BLE_SERVICE_CHANGED" | ||
} | ||
} | ||
} |
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 file should probably live here: https://github.com/ARMmbed/mbed-os/tree/master/features/FEATURE_BLE/targets/TARGET_NORDIC
Since it is BLE specific.
I love it! Do you mind making the same changes to the NRF52 folder please? Unfortunately, we haven't consolidated the two implementations yet. |
I checked the nrf52 ble codebase and I'm pretty sure it doesn't need any changes, these config settings are all for existing defines in the softdevice code (notice I removed the hardcoded copies from nrf52 softdevice lib files) That's why I put the lib for where I did, because the settings are documented by nordic as softdevice settings and moving it would now mean duplicating the file to both ble folders. Yeah I was amazed that the settings were already nicely exposed for nfr52, after I'd put so much round and round effort into making this work for nrf51/sdk11. |
But the single mbed_lib.json could live in the Nordic top-level folder and be shared by both NRF51 and NRF52: https://github.com/ARMmbed/mbed-os/tree/master/features/FEATURE_BLE/targets/TARGET_NORDIC |
Ah, sure, yeah that does make sense. I'll change it over when I get in to work. |
It looks good, I think we can add some more configurations, such as "NRF_SDH_BLE_GATT_MAX_MTU_SIZE=23". |
@marcuschangarm Are you happy with this now? |
Yep! Ship it! 🚢 |
Once rebased, we'll start CI. |
bac465e
to
4b1cb4e
Compare
Ok, rebased |
@andrewleech @pan- Good to go! |
Needs rebase, @andrewleech Please do |
… NRF51 softdevice. * CENTRAL_LINK_COUNT * PERIPHERAL_LINK_COUNT * gatts_enable_params.attr_tab_size * gatts_enable_params.service_changed * common_enable_params.vs_uuid_count These settings control the range of functionality enabled in the softdevice as well as ram consumption. In particular reducing these values is critical to enable usage of 16K nrf51 devices.
The functionality added all affects BLE features in use so this location is a better fit.
4b1cb4e
to
bf313aa
Compare
@paul-szczepanek-arm @marcuschangarm Mind re-reviewing? |
/morph build |
Build : SUCCESSBuild number : 2250 Triggering tests/morph test |
Test : SUCCESSBuild number : 2039 |
Exporter Build : SUCCESSBuild number : 1875 |
/morph mbed2-build |
Description
Allow configuration (via defines) of some of the key settings for the nordic softdevice.
These settings control the range of functionality enabled in the softdevice as well as ram consumption.
In particular, reducing these values is critical to enable usage of 16K nrf51 devices.
The defaults have not been changed so this should not effect existing users.
The values can be adjusted on a per-project basis by target_overrides in
mbed_app.json
, eg:Note: There are a couple of minor edits to the logging lines in
mbed-os/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/softdevice/common/softdevice_handler/softdevice_handler.c
These edits were not necessary in any later versions of the SDK.
Status
READY
Migrations
There should be no required changes to end user code.
Related PRs
This is a cleaned up re-submission of #5980
Steps to test or reproduce
Changing the target config values above in defines/config should result in a change of ram requirements.
When adjusting settings it is useful to enable
target.nrf_enable_logging
as shown above. You will then get a printout on the mbed stdout serial port during softdevice configuration as such:If the START value is lower than the RAM ORIGIN in the current linker file, the linker file can be copied into your project and edited to set the RAM ORIGIN and LENGTH to the printed values.
The mbed compile command can then have the linker arg set to your local linker file.
Pull request type