From d768a38302559e5fffab0cccc8ec94c0f7e0a20a Mon Sep 17 00:00:00 2001 From: Marek Pieta Date: Tue, 9 Jul 2024 09:29:24 +0200 Subject: [PATCH] applications: nrf_desktop: Add nRF54L PDK configuration with Fast Pair Change adds configuration with Fast Pair support for nRF54L PDK. Jira: NCSDK-26944 Signed-off-by: Marek Pieta Signed-off-by: Anna Wojdylo --- .../nrf_desktop/board_configuration.rst | 2 + .../mcuboot/mcuboot_private_fast_pair.pem | 28 ++++ .../images/mcuboot/prj_fast_pair.conf | 37 +++++ .../pm_static_fast_pair.yml | 51 ++++++ .../prj_fast_pair.conf | 145 ++++++++++++++++++ .../sysbuild_fast_pair.conf | 12 ++ applications/nrf_desktop/sample.yaml | 7 + .../releases/release-notes-changelog.rst | 6 +- 8 files changed, 285 insertions(+), 3 deletions(-) create mode 100644 applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/images/mcuboot/mcuboot_private_fast_pair.pem create mode 100644 applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/images/mcuboot/prj_fast_pair.conf create mode 100644 applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/pm_static_fast_pair.yml create mode 100644 applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/prj_fast_pair.conf create mode 100644 applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/sysbuild_fast_pair.conf diff --git a/applications/nrf_desktop/board_configuration.rst b/applications/nrf_desktop/board_configuration.rst index c377c4dd554..b07330c042d 100644 --- a/applications/nrf_desktop/board_configuration.rst +++ b/applications/nrf_desktop/board_configuration.rst @@ -122,6 +122,8 @@ Sample mouse or keyboard (``nrf54l15pdk/nrf54l15/cpuapp``) * In debug configurations, logs are provided through the UART. For detailed information on working with the nRF54L15 PDK, see the :ref:`ug_nrf54l15_gs` documentation. * The configurations use the MCUboot bootloader built in the direct-xip mode (``MCUBOOT+XIP``) and support firmware updates using the :ref:`nrf_desktop_dfu`. + * The board supports the ``debug`` :ref:`nrf_desktop_bluetooth_guide_fast_pair` configuration that acts as a mouse (``fast_pair`` file suffix). + The configuration uses the MCUboot bootloader built in the direct-xip mode (``MCUBOOT+XIP``), and supports firmware updates using the :ref:`nrf_desktop_dfu` and :ref:`nrf_desktop_dfu_mcumgr`. Sample mouse (``nrf54h20dk/nrf54h20/cpuapp``) * The configuration uses the nRF54H20 DK. diff --git a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/images/mcuboot/mcuboot_private_fast_pair.pem b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/images/mcuboot/mcuboot_private_fast_pair.pem new file mode 100644 index 00000000000..59463fd2229 --- /dev/null +++ b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/images/mcuboot/mcuboot_private_fast_pair.pem @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQDW6mrXbq6DAPhv +pM31j+H0t/T227c39Ve34HxvsoqnUsmVUpaI1VZqp+r5VZ4j4LAM0ya9gOuHc33Z +isgW6lvy5/T83gq7hpjptOKbOO/yuhropuyqJtAtFEKuHzvebnAcZEf/S3oBOik4 +BF12g6WaGrMauW478C0/HUmLXkXhiUmv4j3AOKvMywe4htvZ6wwKYa8/8GXyxDoF +M2VhYMH+aen6Aj7nZobKmIBMBHFfsqvY4UtQgPkrDFRxiP4LzaeYFB87BJt6scNJ +rNI1hAxSs5Pw9YbA6DXNJWzhJt9bInRsuqTgtOvI/D6PLz2UK/o76NuDUEAOiqos +9UqYui6JAgMBAAECggEAHTZHx3iX596d5i70f8hK4kSO228J/GUwwyGUSGpwRkYO +eGl9ZKP61wxz9+gXUrEbvOKGhYOcgBDGrmcaw2KflOjKeASGWO72oe2gT5DxrIB3 +X+AwkwArk7UJSzmbnaRNQM6wqpbLwpbxO1f8jDtgqw2uApfpz+PZgpashHEP9pO+ +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== +-----END PRIVATE KEY----- diff --git a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/images/mcuboot/prj_fast_pair.conf b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/images/mcuboot/prj_fast_pair.conf new file mode 100644 index 00000000000..783d5269a1f --- /dev/null +++ b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/images/mcuboot/prj_fast_pair.conf @@ -0,0 +1,37 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +CONFIG_SIZE_OPTIMIZATIONS=y + +# Disable memory guard to avoid false faults in application after boot +CONFIG_HW_STACK_PROTECTION=n + +CONFIG_SYSTEM_CLOCK_NO_WAIT=y + +CONFIG_MAIN_STACK_SIZE=10240 +CONFIG_MBEDTLS_CFG_FILE="mcuboot-mbedtls-cfg.h" + +CONFIG_BOOT_MAX_IMG_SECTORS=256 +CONFIG_BOOT_BOOTSTRAP=n + +CONFIG_BOOT_VERSION_CMP_USE_BUILD_NUMBER=y + +# Flash +CONFIG_FLASH=y + +# Reduce memory consumption +CONFIG_BOOT_BANNER=n +CONFIG_NCS_BOOT_BANNER=n +CONFIG_GPIO=n +CONFIG_SERIAL=n +CONFIG_CONSOLE=n +CONFIG_UART_CONSOLE=n +CONFIG_USE_SEGGER_RTT=n + +# Use minimal C library instead of the Picolib +CONFIG_MINIMAL_LIBC=y + +# Improve debugging experience by disabling reset on fatal error +CONFIG_RESET_ON_FATAL_ERROR=n diff --git a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/pm_static_fast_pair.yml b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/pm_static_fast_pair.yml new file mode 100644 index 00000000000..725785cf402 --- /dev/null +++ b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/pm_static_fast_pair.yml @@ -0,0 +1,51 @@ +app: + address: 0x8800 + region: flash_primary + size: 0xb6800 +mcuboot: + address: 0x0 + region: flash_primary + size: 0x8000 +mcuboot_pad: + address: 0x8000 + region: flash_primary + size: 0x800 +mcuboot_primary: + address: 0x8000 + orig_span: &id001 + - app + - mcuboot_pad + region: flash_primary + size: 0xb7000 + span: *id001 +mcuboot_primary_app: + address: 0x8800 + orig_span: &id002 + - app + region: flash_primary + size: 0xb6800 + span: *id002 +mcuboot_secondary: + address: 0xbf000 + orig_span: &id003 + - mcuboot_secondary_pad + - mcuboot_secondary_app + region: flash_primary + size: 0xb7000 + span: *id003 +mcuboot_secondary_pad: + region: flash_primary + address: 0xbf000 + size: 0x800 +mcuboot_secondary_app: + region: flash_primary + address: 0xbf800 + size: 0xb6800 +bt_fast_pair: + address: 0x176000 + region: flash_primary + size: 0x1000 +settings_storage: + address: 0x177000 + region: flash_primary + size: 0x6000 diff --git a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/prj_fast_pair.conf b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/prj_fast_pair.conf new file mode 100644 index 00000000000..48b48f223d9 --- /dev/null +++ b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/prj_fast_pair.conf @@ -0,0 +1,145 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +################################################################################ +# ZDebug: Fast Pair version +# +# This ZDebug build type configuration enables Fast Pair support. +# The build type configuration supports both configuration channel and MCUmgr DFU transports. +# +# Application Configuration + +CONFIG_DESKTOP_INIT_LOG_MOTION_EVENT=n +CONFIG_DESKTOP_INIT_LOG_HID_REPORT_EVENT=n +CONFIG_DESKTOP_INIT_LOG_HID_REPORT_SENT_EVENT=n +CONFIG_CAF_INIT_LOG_KEEP_ALIVE_EVENTS=n + +CONFIG_DESKTOP_ROLE_HID_PERIPHERAL=y +CONFIG_DESKTOP_PERIPHERAL_TYPE_MOUSE=y +CONFIG_DESKTOP_DEVICE_PID=0x52DE +CONFIG_DESKTOP_DEVICE_GENERATION="FastPair" +CONFIG_DESKTOP_HID_BOOT_INTERFACE_MOUSE=y + +CONFIG_DESKTOP_MOTION_BUTTONS_ENABLE=y +CONFIG_DESKTOP_MOTION_BUTTONS_UP_KEY_ID=0 +CONFIG_DESKTOP_MOTION_BUTTONS_DOWN_KEY_ID=3 +CONFIG_DESKTOP_MOTION_BUTTONS_LEFT_KEY_ID=2 +CONFIG_DESKTOP_MOTION_BUTTONS_RIGHT_KEY_ID=1 + +CONFIG_CAF_BUTTONS=y +CONFIG_CAF_BUTTONS_POLARITY_INVERSED=y +CONFIG_CAF_BUTTONS_PM_KEEP_ALIVE=n + +CONFIG_CAF_CLICK_DETECTOR=y + +CONFIG_CAF_LEDS=y + +CONFIG_DESKTOP_DFU_MCUMGR_ENABLE=y +CONFIG_CAF_INIT_LOG_BLE_SMP_TRANSFER_EVENTS=n + +# Align advertising intervals with Fast Pair specification. +CONFIG_CAF_BLE_ADV_FAST_INT_MIN=0x0040 +CONFIG_CAF_BLE_ADV_FAST_INT_MAX=0x0060 +CONFIG_CAF_BLE_ADV_SLOW_INT_MIN=0x0060 +CONFIG_CAF_BLE_ADV_SLOW_INT_MAX=0x0080 + +# Disable filter accept list to allow for multiple bonds for a given local identity. +CONFIG_CAF_BLE_ADV_FILTER_ACCEPT_LIST=n +CONFIG_CAF_BLE_STATE_MAX_LOCAL_ID_BONDS=3 + +# Align the advertised TX power with Fast Pair expectations. +CONFIG_BT_ADV_PROV_TX_POWER_CORRECTION_VAL=-17 + +CONFIG_DESKTOP_BLE_USE_DEFAULT_ID=y + +CONFIG_DESKTOP_BLE_PEER_CONTROL=y +CONFIG_DESKTOP_BLE_PEER_CONTROL_BUTTON=0x0000 +CONFIG_DESKTOP_BLE_PEER_ERASE_ON_START=y + +CONFIG_DESKTOP_BLE_SECURITY_FAIL_TIMEOUT_S=30 +CONFIG_DESKTOP_BLE_LOW_LATENCY_LOCK=y + +CONFIG_DESKTOP_CONFIG_CHANNEL_ENABLE=y +CONFIG_DESKTOP_CONFIG_CHANNEL_OUT_REPORT=y +CONFIG_DESKTOP_CONFIG_CHANNEL_DFU_ENABLE=y + +################################################################################ +# Zephyr Configuration + +CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=1536 +CONFIG_ISR_STACK_SIZE=1536 +CONFIG_MAIN_STACK_SIZE=840 +CONFIG_BT_RX_STACK_SIZE=2048 +CONFIG_BT_HCI_TX_STACK_SIZE_WITH_PROMPT=y +CONFIG_BT_HCI_TX_STACK_SIZE=1536 + +CONFIG_BOOT_BANNER=n +CONFIG_NCS_BOOT_BANNER=n + +CONFIG_NUM_COOP_PRIORITIES=10 +CONFIG_NUM_PREEMPT_PRIORITIES=11 + +CONFIG_HEAP_MEM_POOL_SIZE=2048 + +CONFIG_SYS_CLOCK_TICKS_PER_SEC=1000 +CONFIG_SYSTEM_CLOCK_NO_WAIT=y + +CONFIG_HW_STACK_PROTECTION=y +CONFIG_RESET_ON_FATAL_ERROR=n + +CONFIG_GPIO=y + +CONFIG_REBOOT=y + +CONFIG_SPEED_OPTIMIZATIONS=y + +CONFIG_PWM=y + +CONFIG_LED=y +CONFIG_LED_PWM=y + +# Enable MCUmgr Bluetooth transport and increase Bluetooth buffers to speed up DFU image transfer. +CONFIG_MCUMGR_TRANSPORT_BT=y +CONFIG_MCUMGR_TRANSPORT_BT_AUTHEN=n +CONFIG_MCUMGR_GRP_IMG_VERSION_CMP_USE_BUILD_NUMBER=y + +CONFIG_IMG_MANAGER=y +CONFIG_MCUBOOT_IMG_MANAGER=y + +CONFIG_MCUMGR_GRP_IMG_REJECT_DIRECT_XIP_MISMATCHED_SLOT=y + +CONFIG_BT_L2CAP_TX_MTU=260 +CONFIG_BT_BUF_ACL_RX_SIZE=264 + +CONFIG_BT_MAX_PAIRED=4 +CONFIG_BT_ID_MAX=3 + +CONFIG_BT_CTLR_SDC_LLPM=y +CONFIG_BT_CTLR_TX_PWR_DYNAMIC_CONTROL=y +CONFIG_BT_ATT_TX_COUNT=4 +CONFIG_BT_CONN_TX_MAX=4 + +CONFIG_BT_FAST_PAIR=y +CONFIG_BT_FAST_PAIR_LOG_LEVEL_DBG=y +CONFIG_BT_PRIVACY=y + +################################################################################ + +CONFIG_ASSERT=y +CONFIG_ASSERT_LEVEL=2 + +# nRF54L PDK uses UART for logs. +CONFIG_SERIAL=y +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y + +CONFIG_LOG=y +CONFIG_LOG_BACKEND_UART=y +CONFIG_LOG_BACKEND_SHOW_COLOR=n +CONFIG_LOG_BACKEND_FORMAT_TIMESTAMP=n +CONFIG_LOG_MODE_DEFERRED=y +CONFIG_LOG_PRINTK=y +CONFIG_LOG_BUFFER_SIZE=4096 +CONFIG_LOG_PROCESS_THREAD_STACK_SIZE=1024 diff --git a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/sysbuild_fast_pair.conf b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/sysbuild_fast_pair.conf new file mode 100644 index 00000000000..e2d9e7ec083 --- /dev/null +++ b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/sysbuild_fast_pair.conf @@ -0,0 +1,12 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +################################################################################ + +SB_CONFIG_BT_FAST_PAIR=y +SB_CONFIG_BOOTLOADER_MCUBOOT=y +SB_CONFIG_MCUBOOT_MODE_DIRECT_XIP=y +SB_CONFIG_BOOT_SIGNATURE_TYPE_RSA=y +SB_CONFIG_BOOT_SIGNATURE_KEY_FILE="\${APPLICATION_CONFIG_DIR}/images/mcuboot/mcuboot_private_fast_pair.pem" diff --git a/applications/nrf_desktop/sample.yaml b/applications/nrf_desktop/sample.yaml index d9283dcddd7..38fb6b4e965 100644 --- a/applications/nrf_desktop/sample.yaml +++ b/applications/nrf_desktop/sample.yaml @@ -47,6 +47,13 @@ tests: integration_platforms: - nrf52840dk/nrf52840 extra_args: FILE_SUFFIX=wwcb + applications.nrf_desktop.zdebug_fast_pair.gmouse.uart: + platform_allow: nrf54l15pdk/nrf54l15/cpuapp + integration_platforms: + - nrf54l15pdk/nrf54l15/cpuapp + extra_args: FILE_SUFFIX=fast_pair + FP_MODEL_ID=0x8E717D + FP_ANTI_SPOOFING_KEY=dZxFzP7X9CcfLPC0apyRkmgsh3n2EbWo9NFNXfVuxAM= applications.nrf_desktop.zdebug_fast_pair.gmouse: build_only: true platform_allow: nrf52840dk/nrf52840 nrf52840gmouse/nrf52840 diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst b/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst index 6bad498b6fa..2f88e3c7988 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst @@ -202,10 +202,10 @@ nRF5340 Audio nRF Desktop ----------- -* Updated: +* Added a debug configuration enabling the `Fast Pair`_ feature on the nRF54L15 PDK with the ``nrf54l15pdk/nrf54l15/cpuapp`` board target. - * The :kconfig:option:`CONFIG_BT_ADV_PROV_TX_POWER_CORRECTION_VAL` Kconfig option value in configurations with the Fast Pair support. - The value is now aligned with the Fast Pair requirements. +* Updated the :kconfig:option:`CONFIG_BT_ADV_PROV_TX_POWER_CORRECTION_VAL` Kconfig option value in configurations with the Fast Pair support. + The value is now aligned with the Fast Pair requirements. nRF Machine Learning (Edge Impulse) -----------------------------------