Skip to content

Conversation

@zycz
Copy link
Contributor

@zycz zycz commented Jul 2, 2025

Allow bonding with the same HID host on
multiple Bluetooth local identities.

JIRA: NCSDK-32518

@zycz zycz requested review from a team as code owners July 2, 2025 14:13
@github-actions github-actions bot added the doc-required PR must not be merged without tech writer approval. label Jul 2, 2025
@NordicBuilder
Copy link
Contributor

NordicBuilder commented Jul 2, 2025

CI Information

To view the history of this post, clich the 'edited' button above
Build number: 12

Inputs:

Sources:

sdk-nrf: PR head: 0afef3c132bd0c15993afc35350670619c7fd7ed

more details

sdk-nrf:

PR head: 0afef3c132bd0c15993afc35350670619c7fd7ed
merge base: 30c6c4a23f8dbc82fd96a16728265cde514f0985
target head (main): a62d535996caca5e1ce3ded8334df5cf6327aabc
Diff

Github labels

Enabled Name Description
ci-disabled Disable the ci execution
ci-all-test Run all of ci, no test spec filtering will be done
ci-force-downstream Force execution of downstream even if twister fails
ci-run-twister Force run twister
ci-run-zephyr-twister Force run zephyr twister
List of changed files detected by CI (1)
applications
│  ├── nrf_desktop
│  │  │ Kconfig.ble

Outputs:

Toolchain

Version: 11ad62c2a5
Build docker image: docker-dtr.nordicsemi.no/sw-production/ncs-build:11ad62c2a5_bba2ea5f2e

Test Spec & Results: ✅ Success; ❌ Failure; 🟠 Queued; 🟡 Progress; ◻️ Skipped; ⚠️ Quarantine

  • ◻️ Toolchain - Skipped: existing toolchain is used
  • ✅ Build twister
    • sdk-nrf test count: 49
  • ✅ Integration tests
    • ✅ desktop52_verification
Disabled integration tests
    • test-fw-nrfconnect-nrf_lrcs_mosh
    • test-fw-nrfconnect-nrf_lrcs_positioning
    • doc-internal
    • test_ble_nrf_config
    • test-fw-nrfconnect-apps
    • test-fw-nrfconnect-ble_mesh
    • test-fw-nrfconnect-ble_samples
    • test-fw-nrfconnect-chip
    • test-fw-nrfconnect-fem
    • test-fw-nrfconnect-nfc
    • test-fw-nrfconnect-nrf-iot_cloud
    • test-fw-nrfconnect-nrf-iot_libmodem-nrf
    • test-fw-nrfconnect-nrf-iot_lwm2m
    • test-fw-nrfconnect-nrf-iot_samples
    • test-fw-nrfconnect-nrf-iot_serial_lte_modem
    • test-fw-nrfconnect-nrf-iot_thingy91
    • test-fw-nrfconnect-nrf-iot_zephyr_lwm2m
    • test-fw-nrfconnect-nrf_crypto
    • test-fw-nrfconnect-ps-main
    • test-fw-nrfconnect-rpc
    • test-fw-nrfconnect-rs
    • test-fw-nrfconnect-tfm
    • test-fw-nrfconnect-thread-main
    • test-low-level
    • test-sdk-audio
    • test-sdk-dfu
    • test-sdk-find-my
    • test-sdk-mcuboot
    • test-sdk-pmic-samples
    • test-sdk-wifi
    • test-secdom-samples-public

Note: This message is automatically posted and updated by the CI

@github-actions
Copy link

github-actions bot commented Jul 2, 2025

You can find the documentation preview for this PR here.

Copy link
Contributor

Choose a reason for hiding this comment

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

Please don't imply CONFIG_BT_PRIVACY (not needed for most of the use-cases). You could simply imply BT_ID_AUTO_SWAP_MATCHING_BONDS (or conditionally overwrite default) if needed. Please also add description under Kconfig help.

btw. Can BLE peripheral without privacy also bond with the same peer on multiple BLE local identities (this use-case is relevant for nRF Desktop too)?

Copy link
Contributor

Choose a reason for hiding this comment

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

Whole entry can be removed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, great I thought about it and wanted your opinion on that

Copy link
Contributor

Choose a reason for hiding this comment

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

No need to overwrite default with the same value

Copy link
Contributor

Choose a reason for hiding this comment

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

Please include reference to the Kconfig option and mention that application overwrites Kconfig default for nRF Desktop peripheral.

@zycz zycz force-pushed the issue32518_multiple_identities branch from b76db03 to d044228 Compare July 3, 2025 07:44
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* The :kconfig:option:`CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS` Kconfig option in implied options for nRF Desktop peripherals.
* The :kconfig:option:`CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS` Kconfig option as an imply for nRF Desktop peripherals.

@richabp richabp self-requested a review July 9, 2025 13:23
@zycz zycz force-pushed the issue32518_multiple_identities branch 2 times, most recently from bd2ac83 to 03133d5 Compare July 29, 2025 15:19
@zycz zycz dismissed MarekPieta’s stale review July 29, 2025 15:20

reviver on a sick leave

@zycz zycz added the DNM label Jul 29, 2025
@zycz
Copy link
Contributor Author

zycz commented Jul 29, 2025

@NordicBuilder
Copy link
Contributor

NordicBuilder commented Jul 29, 2025

Memory footprint analysis revealed the following potential issues

applications.nrf_desktop.zdebug.uart[nrf54lm20dk/nrf54lm20a/cpuapp]: ROM size increased by 968[B] in comparison to the main[30c6c4a] branch. - link (cc: @nrfconnect/ncs-si-bluebagel)
applications.nrf_desktop.zdebug.uart[[email protected]/nrf54lm20a/cpuapp]: ROM size increased by 960[B] in comparison to the main[30c6c4a] branch. - link (cc: @nrfconnect/ncs-si-bluebagel)
applications.nrf_desktop.zdebug.uart[[email protected]/nrf54lm20a/cpuapp]: ROM size increased by 960[B] in comparison to the main[30c6c4a] branch. - link (cc: @nrfconnect/ncs-si-bluebagel)
applications.nrf_desktop.zdebug.usb_next[nrf52840dk/nrf52840]: ROM size increased by 1940[B] in comparison to the main[30c6c4a] branch. - link (cc: @nrfconnect/ncs-si-bluebagel)
applications.nrf_desktop.zdebug.usb_next[nrf52840gmouse/nrf52840]: ROM size increased by 1640[B] in comparison to the main[30c6c4a] branch. - link (cc: @nrfconnect/ncs-si-bluebagel)
applications.nrf_desktop.zdebug[nrf52840dk/nrf52840]: ROM size increased by 2052[B] in comparison to the main[30c6c4a] branch. - link (cc: @nrfconnect/ncs-si-bluebagel)
applications.nrf_desktop.zdebug[nrf52840gmouse/nrf52840]: ROM size increased by 1928[B] in comparison to the main[30c6c4a] branch. - link (cc: @nrfconnect/ncs-si-bluebagel)
applications.nrf_desktop.zdebug[nrf52dmouse/nrf52832]: ROM size increased by 1264[B] in comparison to the main[30c6c4a] branch. - link (cc: @nrfconnect/ncs-si-bluebagel)
applications.nrf_desktop.zdebug[nrf52kbd/nrf52832]: ROM size increased by 1276[B] in comparison to the main[30c6c4a] branch. - link (cc: @nrfconnect/ncs-si-bluebagel)
applications.nrf_desktop.zdebug[nrf54l15dk/nrf54l05/cpuapp]: ROM size increased by 1560[B] in comparison to the main[30c6c4a] branch. - link (cc: @nrfconnect/ncs-si-bluebagel)
applications.nrf_desktop.zdebug_fast_pair.gmouse[nrf52840gmouse/nrf52840]: ROM size increased by 1816[B] in comparison to the main[30c6c4a] branch. - link (cc: @nrfconnect/ncs-si-bluebagel)
applications.nrf_desktop.zdebug_keyboard.usb_next[nrf52840dk/nrf52840]: ROM size increased by 1292[B] in comparison to the main[30c6c4a] branch. - link (cc: @nrfconnect/ncs-si-bluebagel)
applications.nrf_desktop.zdebug_keyboard[nrf52840dk/nrf52840]: ROM size increased by 1280[B] in comparison to the main[30c6c4a] branch. - link (cc: @nrfconnect/ncs-si-bluebagel)
applications.nrf_desktop.zdebug_mcuboot_qspi[nrf52840dk/nrf52840]: ROM size increased by 2040[B] in comparison to the main[30c6c4a] branch. - link (cc: @nrfconnect/ncs-si-bluebagel)
applications.nrf_desktop.zdebug_mcuboot_smp[nrf52840dk/nrf52840]: ROM size increased by 2012[B] in comparison to the main[30c6c4a] branch. - link (cc: @nrfconnect/ncs-si-bluebagel)
applications.nrf_desktop.zdebug_nrf21540ek[nrf52840dk/nrf52840]: ROM size increased by 2048[B] in comparison to the main[30c6c4a] branch. - link (cc: @nrfconnect/ncs-si-bluebagel)
applications.nrf_desktop.zdebug_wwcb[nrf52840dk/nrf52840]: ROM size increased by 1960[B] in comparison to the main[30c6c4a] branch. - link (cc: @nrfconnect/ncs-si-bluebagel)
applications.nrf_desktop.zdebugwithshell[nrf52840dk/nrf52840]: ROM size increased by 2064[B] in comparison to the main[30c6c4a] branch. - link (cc: @nrfconnect/ncs-si-bluebagel)
applications.nrf_desktop.zrelease.usb_next[nrf52840dk/nrf52840]: ROM size increased by 512[B] in comparison to the main[30c6c4a] branch. - link (cc: @nrfconnect/ncs-si-bluebagel)
applications.nrf_desktop.zrelease[nrf52kbd/nrf52832]: ROM size increased by 624[B] in comparison to the main[30c6c4a] branch. - link (cc: @nrfconnect/ncs-si-bluebagel)
applications.nrf_desktop.zrelease[nrf54l15dk/nrf54l15/cpuapp]: ROM size increased by 788[B] in comparison to the main[30c6c4a] branch. - link (cc: @nrfconnect/ncs-si-bluebagel)
applications.nrf_desktop.zrelease_fast_pair.gmouse[nrf54l15dk/nrf54l05/cpuapp]: ROM size increased by 912[B] in comparison to the main[30c6c4a] branch. - link (cc: @nrfconnect/ncs-si-bluebagel)
applications.nrf_desktop.zrelease_fast_pair.keyboard[nrf52kbd/nrf52832]: ROM size increased by 640[B] in comparison to the main[30c6c4a] branch. - link (cc: @nrfconnect/ncs-si-bluebagel)
applications.nrf_desktop.zrelease_keyboard[nrf54l15dk/nrf54l05/cpuapp]: ROM size increased by 880[B] in comparison to the main[30c6c4a] branch. - link (cc: @nrfconnect/ncs-si-bluebagel)

Note: This message is automatically posted and updated by the CI (latest/sdk-nrf/PR-23094/12)

Copy link
Contributor

Choose a reason for hiding this comment

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

Please describe removal of CONFIG_ BT_ID_UNPAIR_MATCHING_BONDS

Copy link
Contributor

@PavelVPV PavelVPV left a comment

Choose a reason for hiding this comment

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

LGTM

@zycz zycz force-pushed the issue32518_multiple_identities branch 2 times, most recently from 1d73d30 to 9b90d7a Compare July 30, 2025 15:54
Comment on lines 313 to 331
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* The :kconfig:option:`CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS` Kconfig option as an imply for Fast Pair nRF Desktop peripherals.
The option allows the application to automatically swap matching bonds when the Bluetooth local identity changes.
Due to that change and change in the zephyr host smp module, the nRF Desktop application no longer requires the :kconfig:option:`CONFIG_ BT_ID_UNPAIR_MATCHING_BONDS` Kconfig option to be enabled.
Removing it enables the possibility for bonding with the same HID host on multiple Bluetooth local identities for all nRF Desktop peripherals.
* The :kconfig:option:`CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS` Kconfig option as an imply to the :kconfig:option:`CONFIG_DESKTOP_BT_PERIPHERAL` Kconfig option.
As a result, all nRF Desktop Fast Pair configurations have the :kconfig:option:`CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS` Kconfig option enabled by default.
The option allows the application to automatically swap matching bonds when the Bluetooth local identity changes and the Bluetooth Privacy feature (:kconfig:option:`CONFIG_BT_PRIVACY`) is enabled.
Build configurations without the Bluetooth Privacy feature support the bond swapping without any dedicated Kconfig option.
Due to that change and change in the SMP layer of the Zephyr Bluetooth stack, the nRF Desktop application no longer requires the :kconfig:option:`CONFIG_BT_ID_UNPAIR_MATCHING_BONDS` Kconfig option to be enabled.
Removing it enables the possibility for bonding with the same HID host on multiple Bluetooth local identities for all nRF Desktop peripherals.

Copy link
Contributor

Choose a reason for hiding this comment

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

Add a help section paragraph to explain why this is needed

@kapi-no kapi-no added this to the 3.1.0 milestone Jul 31, 2025
@zycz zycz force-pushed the issue32518_multiple_identities branch 2 times, most recently from eba1066 to 54de8a9 Compare August 1, 2025 06:58
@zycz
Copy link
Contributor Author

zycz commented Aug 1, 2025

Waiting for: nrfconnect/sdk-zephyr#3117

@zycz zycz force-pushed the issue32518_multiple_identities branch from 54de8a9 to 778d53b Compare August 1, 2025 11:37
@zycz zycz requested a review from kapi-no August 1, 2025 11:37
@zycz zycz requested a review from alstrzebonski August 1, 2025 11:37
@zycz
Copy link
Contributor Author

zycz commented Aug 1, 2025

Not needing FAST PAIR to turn on CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS.
The CONFIG_BT_PRIVACY option configures the local device to use privacy features, but it still allows address resolution for peer devices. During pairing, the peer may provide its Identity Address and IRK, which can be used for address resolution regardless of whether CONFIG_BT_PRIVACY is enabled.

@zycz zycz force-pushed the issue32518_multiple_identities branch from 778d53b to 5c5eec1 Compare August 1, 2025 12:00
@zycz zycz requested a review from kapi-no August 1, 2025 12:00
@zycz zycz force-pushed the issue32518_multiple_identities branch from 5c5eec1 to 820798f Compare August 1, 2025 12:13
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add a comment on PR #23631, if this change is for the 3.1.0 release, and remove the entry from this PR.
Also, add the backport label.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added comment under #23631
Also removed changelog entry.
Added backport 3.1 label.

Allow bonding with the same HID host on
multiple Bluetooth local identities.

JIRA: NCSDK-32518

Signed-off-by: Jan Zyczkowski <[email protected]>
@zycz zycz force-pushed the issue32518_multiple_identities branch from 820798f to 0afef3c Compare August 4, 2025 14:28
@github-actions github-actions bot added changelog-entry-required Update changelog before merge. Remove label if entry is not needed or already added. and removed doc-required PR must not be merged without tech writer approval. labels Aug 4, 2025
@zycz zycz added backport v3.1-branch and removed DNM changelog-entry-required Update changelog before merge. Remove label if entry is not needed or already added. labels Aug 4, 2025
@rlubos rlubos merged commit 076057e into nrfconnect:main Aug 4, 2025
17 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants