diff --git a/CODEOWNERS b/CODEOWNERS index bca837f5838f..60ff3dbb6a3b 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -235,7 +235,7 @@ /doc/nrf/releases_and_maturity/ @nrfconnect/ncs-doc-release /doc/nrf/releases_and_maturity/abi_compatibility.rst @FrancescoSer /doc/nrf/samples/amazon_sidewalk.rst @nrfconnect/ncs-sidewalk-doc -/doc/nrf/samples/bl.rst @nrfconnect/ncs-dragoon-doc +/doc/nrf/samples/bl.rst @nrfconnect/ncs-doc-leads /doc/nrf/samples/cellular.rst @nrfconnect/ncs-cia-doc /doc/nrf/samples/crypto.rst @nrfconnect/ncs-aegir-doc /doc/nrf/samples/debug.rst @nrfconnect/ncs-cia-doc @@ -525,6 +525,8 @@ /samples/nrf5340/empty_app_core/ @nrfconnect/ncs-si-muffin /samples/nrf5340/extxip_smp_svr/ @nrfconnect/ncs-eris /samples/nrf54h20/empty_app_core/ @nrfconnect/ncs-aurora +/samples/nrf54h20/idle_relocated_tcm/ @nrfconnect/ncs-si-muffin +/samples/nrf54h20/radio_loader/ @nrfconnect/ncs-si-muffin /samples/ironside_se/ @nrfconnect/ncs-aurora /samples/nrf_compress/ @nordicjm /samples/nrf_profiler/ @nrfconnect/ncs-si-bluebagel @@ -651,6 +653,7 @@ /samples/net/**/*.rst @nrfconnect/ncs-cia-doc /samples/net/coap_client/*.rst @nrfconnect/ncs-iot-oulu-tampere-doc /samples/nfc/**/*.rst @nrfconnect/ncs-si-muffin-doc +/samples/nrf54h20/idle_relocated_tcm/*.rst @nrfconnect/ncs-si-muffin-doc /samples/nrf5340/empty_app_core/*.rst @nrfconnect/ncs-si-muffin-doc /samples/nrf5340/extxip_smp_svr/*.rst @nrfconnect/ncs-eris-doc /samples/nrf5340/netboot/*.rst @nrfconnect/ncs-eris-doc @@ -688,7 +691,6 @@ /samples/zephyr/smp_svr_mini_boot/ @nrfconnect/ncs-eris /samples/zephyr/subsys/ipc/ @nrfconnect/ncs-low-level-test /samples/zephyr/subsys/mgmt/mcumgr/smp_svr/ @nrfconnect/ncs-eris -/samples/zephyr/subsys/settings/ @nrfconnect/ncs-low-level-test /samples/zephyr/subsys/usb/ @nrfconnect/ncs-low-level-test /samples/zephyr/sysbuild/ @nrfconnect/ncs-low-level-test @@ -855,6 +857,7 @@ /tests/bluetooth/tester/ @carlescufi @nrfconnect/ncs-paladin /tests/crypto/ @magnev /tests/drivers/audio/ @nrfconnect/ncs-low-level-test +/tests/drivers/can/ @nrfconnect/ncs-low-level-test /tests/drivers/flash/flash_rpc/ @nrfconnect/ncs-eris /tests/drivers/flash_patch/ @nrfconnect/ncs-eris /tests/drivers/fprotect/ @nrfconnect/ncs-eris @@ -923,6 +926,7 @@ /tests/subsys/bluetooth/enocean/ @nrfconnect/ncs-paladin /tests/subsys/bluetooth/fast_pair/ @nrfconnect/ncs-si-bluebagel /tests/subsys/bluetooth/mesh/ @nrfconnect/ncs-paladin +/tests/subsys/bluetooth/rpc_gatt_service/ @nrfconnect/ncs-protocols-serialization /tests/subsys/bootloader/ @nrfconnect/ncs-eris /tests/subsys/caf/ @nrfconnect/ncs-si-muffin @nrfconnect/ncs-si-bluebagel /tests/subsys/debug/cpu_load/ @nordic-krch diff --git a/Kconfig.nrf b/Kconfig.nrf index 149261c73123..25c67b41312d 100644 --- a/Kconfig.nrf +++ b/Kconfig.nrf @@ -4,14 +4,8 @@ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # -# Usually BOARD_DIR is an absolute path and sourced through '/boards/Kconfig'. -# But for compliance and doc generation it's a glob and this line ensures that -# boards in sdk-nrf are sourced properly in those occasions. -orsource "./$(BOARD_DIR)/Kconfig.board" -orsource "./$(BOARD_DIR)/Kconfig" orsource "./cmake/toolchain/$(ZEPHYR_TOOLCHAIN_VARIANT)/Kconfig.defconfig" -rsource "boards/shields/*/Kconfig.shield" rsource "subsys/net/openthread/Kconfig.defconfig" if !TFM_PROFILE_TYPE_MINIMAL diff --git a/applications/matter_bridge/doc/adding_bridged_matter_device.rst b/applications/matter_bridge/doc/adding_bridged_matter_device.rst index 1a44c9da72b8..1d457a58ca6f 100644 --- a/applications/matter_bridge/doc/adding_bridged_matter_device.rst +++ b/applications/matter_bridge/doc/adding_bridged_matter_device.rst @@ -137,7 +137,7 @@ The following steps show how to add support for a new Matter device type, using #. Implement the body of the :c:func:`HandleRead` method to handle reading data operations for all supported attributes. The read operations for the ``Descriptor``, ``Bridged Device Basic Information`` and ``Identify`` clusters, which are common to all devices, are handled in a common bridge module. - The read operations for the ``Pressure Measurement`` cluster are the only ones to that need to be handled in the application. + The read operations for the ``Pressure Measurement`` cluster are the only ones that need to be handled in the application. To provide support for reading attributes for the Pressure Sensor device, edit the :file:`pressure_sensor.h` and :file:`pressure_sensor.cpp` files as follows: diff --git a/applications/matter_bridge/src/ble/data_providers/ble_lbs_data_provider.cpp b/applications/matter_bridge/src/ble/data_providers/ble_lbs_data_provider.cpp index e84dda578370..356dcf63cb42 100644 --- a/applications/matter_bridge/src/ble/data_providers/ble_lbs_data_provider.cpp +++ b/applications/matter_bridge/src/ble/data_providers/ble_lbs_data_provider.cpp @@ -69,8 +69,13 @@ void ProcessCommand(const Binding::TableEntry &aBinding, OperationalDeviceProxy uint8_t BleLBSDataProvider::GattNotifyCallback(bt_conn *conn, bt_gatt_subscribe_params *params, const void *data, uint16_t length) { - BleLBSDataProvider *provider = static_cast( - BLEConnectivityManager::Instance().FindBLEProvider(*bt_conn_get_dst(conn))); + BleLBSDataProvider *provider = nullptr; + const bt_addr_le_t *btAddr = bt_conn_get_dst(conn); + + VerifyOrExit(conn && btAddr, ); + + provider = static_cast( + BLEConnectivityManager::Instance().FindBLEProvider(*btAddr)); VerifyOrExit(data, ); VerifyOrExit(provider, ); diff --git a/applications/nrf5340_audio/doc/configuration.rst b/applications/nrf5340_audio/doc/configuration.rst index 7288f18a1e1b..9401b9f35f5d 100644 --- a/applications/nrf5340_audio/doc/configuration.rst +++ b/applications/nrf5340_audio/doc/configuration.rst @@ -25,7 +25,7 @@ See the :file:`Kconfig.defaults` file in the :file:`nrf5340_audio` directory for The default Kconfig option values are automatically updated if configuration changes are applied directly in the configuration files. -The application-specific Kconfig options mentioned on this page are listed in :ref:`nRF5340 Audio: Application-specific Kconfig options `. +The application-specific Kconfig options mentioned on this page are listed in :ref:`nRF5340 Audio: Application-specific Kconfig options `. |config| @@ -211,7 +211,7 @@ Configuring audio quality The nRF5340 Audio application provides extensive configuration options for audio quality. These settings affect the :ref:`nrf53_audio_app_overview_architecture_sync_module` and overall audio performance. -See :ref:`config_audio_app_options` for the list of options to configure the following audio quality settings: +See :ref:`nrf53_audio_app_config_audio_app_options` for the list of options to configure the following audio quality settings: * Frame duration (example: :option:`CONFIG_AUDIO_FRAME_DURATION_10_MS`) * Sample rates (example: :option:`CONFIG_AUDIO_SAMPLE_RATE_16000_HZ`) @@ -226,7 +226,7 @@ Configuring Bluetooth LE Audio The nRF5340 Audio application introduces application-specific configuration options related to Bluetooth LE Audio. These options configure the Bluetooth stack components described in :ref:`nrf53_audio_app_overview_architecture`. -See :ref:`config_audio_app_options` for options starting with ``CONFIG_BT_AUDIO``. +See :ref:`nrf53_audio_app_config_audio_app_options` for options starting with ``CONFIG_BT_AUDIO``. .. _nrf53_audio_app_configuration_power_measurements: diff --git a/applications/nrf5340_audio/doc/configuration_options.rst b/applications/nrf5340_audio/doc/configuration_options.rst index c5a3fdb53cfe..d39c7db8a942 100644 --- a/applications/nrf5340_audio/doc/configuration_options.rst +++ b/applications/nrf5340_audio/doc/configuration_options.rst @@ -1,4 +1,4 @@ -.. _config_audio_app_options: +.. _nrf53_audio_app_config_audio_app_options: nRF5340 Audio: Application-specific Kconfig options ################################################### diff --git a/applications/nrf5340_audio/unicast_client/overlay-unicast_client.conf b/applications/nrf5340_audio/unicast_client/overlay-unicast_client.conf index f9087c70505f..e107cc11606f 100644 --- a/applications/nrf5340_audio/unicast_client/overlay-unicast_client.conf +++ b/applications/nrf5340_audio/unicast_client/overlay-unicast_client.conf @@ -32,7 +32,9 @@ CONFIG_UTF8=y CONFIG_BT_CONTENT_CTRL_MEDIA=y CONFIG_LC3_ENC_CHAN_MAX=2 -CONFIG_LC3_DEC_CHAN_MAX=1 +CONFIG_LC3_DEC_CHAN_MAX=2 CONFIG_AUDIO_ENCODE_CHANNELS_MAX=2 CONFIG_MBEDTLS_ENABLE_HEAP=y CONFIG_MBEDTLS_HEAP_SIZE=2048 +CONFIG_BT_AUDIO_CONCURRENT_RX_STREAMS_MAX=2 +CONFIG_AUDIO_DECODE_CHANNELS_MAX=2 diff --git a/applications/nrf_desktop/board_configuration.rst b/applications/nrf_desktop/board_configuration.rst index cf2d79ec2f81..17edde178a99 100644 --- a/applications/nrf_desktop/board_configuration.rst +++ b/applications/nrf_desktop/board_configuration.rst @@ -176,15 +176,19 @@ Sample mouse (``nrf54lm20dk/nrf54lm20a/cpuapp``) * Bluetooth LE and USB High-Speed transports are enabled. Bluetooth LE is configured to use Nordic Semiconductor's SoftDevice Link Layer and Low Latency Packet Mode (LLPM). USB High-Speed is configured to use the USB next stack (:kconfig:option:`CONFIG_USB_DEVICE_STACK_NEXT`). - The :option:`CONFIG_DESKTOP_BLE_ADV_CTRL_ENABLE` and :option:`CONFIG_DESKTOP_BLE_ADV_CTRL_SUSPEND_ON_USB` Kconfig options are enabled in mouse configurations to improve the USB High-Speed report rate. - * In ``debug`` configurations, logs are provided through the UART. + The :option:`CONFIG_DESKTOP_BLE_ADV_CTRL_ENABLE` and :option:`CONFIG_DESKTOP_BLE_ADV_CTRL_SUSPEND_ON_USB` Kconfig options are enabled in mouse configurations to improve the HID report rate over USB. + * In ``debug``, ``ram_load``, and ``llvm`` configurations, logs are provided through the UART. For detailed information on working with the nRF54LM20 DK, see the :ref:`ug_nrf54l15_gs` documentation. * In ``llvm`` configurations, the partition layout is different to accommodate for the higher memory footprint of the ``llvm`` toolchain. - * 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 ``debug``, ``release``, and ``llvm`` configurations use the MCUboot bootloader built in the direct-xip mode (``MCUBOOT+XIP``) and support firmware updates using the :ref:`nrf_desktop_dfu`. All of the configurations enable hardware cryptography for the MCUboot bootloader. The application image is verified using a pure ED25519 signature. The public key that MCUboot uses for validating the application image is securely stored in the hardware Key Management Unit (KMU). For more details on nRF54L Series cryptography, see :ref:`ug_nrf54l_cryptography`. + * The ``ram_load`` and ``release_ram_load`` configurations use the MCUboot bootloader built in the RAM load mode (``MCUBOOT``) and support firmware updates using the :ref:`nrf_desktop_dfu`. + Configurations in this bootloader mode use the same security features as direct-xip mode (``MCUBOOT+XIP``), including hardware cryptography, signature type, and public key storage. + The application code is executed from the RAM in this mode to improve the HID report rate over USB. + For more details on the RAM load mode, see the MCUboot :ref:`nrf_desktop_configuring_mcuboot_bootloader_ram_load` documentation section. Sample mouse or dongle (``nrf54h20dk/nrf54h20/cpuapp``) * The configuration uses the nRF54H20 DK. @@ -193,14 +197,15 @@ Sample mouse or dongle (``nrf54h20dk/nrf54h20/cpuapp``) * Bluetooth LE and USB High-Speed transports are enabled. Bluetooth LE is configured to use Nordic Semiconductor's SoftDevice Link Layer and Low Latency Packet Mode (LLPM). USB High-Speed is configured to use the USB next stack (:kconfig:option:`CONFIG_USB_DEVICE_STACK_NEXT`). - The :option:`CONFIG_DESKTOP_BLE_ADV_CTRL_ENABLE` and :option:`CONFIG_DESKTOP_BLE_ADV_CTRL_SUSPEND_ON_USB` Kconfig options are enabled in mouse configurations to improve the USB High-Speed report rate. + The :option:`CONFIG_DESKTOP_BLE_ADV_CTRL_ENABLE` and :option:`CONFIG_DESKTOP_BLE_ADV_CTRL_SUSPEND_ON_USB` Kconfig options are enabled in mouse configurations to improve the HID report rate over USB. * In ``debug`` configurations, logs are provided through the UART. For detailed information on working with the nRF54H20 DK, see the :ref:`ug_nrf54h20_gs` documentation. - * The configurations use the Software Updates for Internet of Things (SUIT) and support firmware updates using the :ref:`nrf_desktop_dfu`. + * The configurations use the MCUboot bootloader built in the direct-xip mode (``MCUBOOT+XIP``) and support firmware updates using the :ref:`nrf_desktop_dfu`. Configurations acting as HID peripherals also support firmware updates using the :ref:`nrf_desktop_dfu_mcumgr`. + For more details on MCUboot, see :ref:`nrf_desktop_bootloader`. - .. note:: - The nRF Desktop application does not build or run for the ``nrf54h20dk/nrf54h20/cpuapp`` board target due to the IronSide SE migration. - See the ``NCSDK-34299`` in the :ref:`known_issues` page for more information. - The :ref:`nrf_desktop` documentation may still refer to concepts that were valid before the IronSide SE migration (for example, to the SUIT solution). - The codebase and documentation will be updated in the future releases to address this issue. + All configurations enable hardware cryptography for the MCUboot bootloader. + The MCUboot bootloader uses the :ref:`ug_crypto_architecture_implementation_standards_ironside` for hardware cryptography. + The application image is verified using a pure ED25519 signature. + In all configurations, the MCUboot bootloader uses a merged image slot that combines both application and radio core images. + For more details on nRF54H Series DFU, see :ref:`ug_nrf54h20_mcuboot_dfu`. diff --git a/applications/nrf_desktop/bootloader_dfu.rst b/applications/nrf_desktop/bootloader_dfu.rst index 6ce917b3164e..4e80dd0e1042 100644 --- a/applications/nrf_desktop/bootloader_dfu.rst +++ b/applications/nrf_desktop/bootloader_dfu.rst @@ -189,6 +189,79 @@ For an example of a bootloader Kconfig configuration file defined by the applica Both mentioned firmware upgrade methods are not used simultaneously by any of the configurations. For example, the ``nrf52840dk/nrf52840`` board in ``mcuboot_smp`` file suffix uses only the background DFU and does not enable the serial recovery feature. +.. _nrf_desktop_configuring_mcuboot_bootloader_ram_load: + +RAM load mode +~~~~~~~~~~~~~ + +The RAM load mode is used for the :ref:`background DFU `. +In this mode, the MCUboot bootloader uses the same NVM partitioning as the direct-xip mode (the dual-bank DFU solution). +Similarly to the direct-xip mode, the RAM load mode also relies on the image version to select the application image slot to be booted. +However, instead of booting the image from the NVM slot, the bootloader in the RAM load mode copies the image from the non-volatile memory (NVM) to the RAM and boots it from there. +The application image is always built for the RAM address space in only one variant. + +.. caution:: + The RAM load mode of the MCUboot bootloader is not officially supported in |NCS|. + However, the mode is available in the |NCS| as the support for this feature has been developed as part of the Zephyr RTOS project. + This feature is only used in a limited context for the ``nrf54lm20dk/nrf54lm20a/cpuapp`` board target configuration to improve performance. + +You can use the RAM load mode of the MCUboot bootloader to speed up the code execution for the application image, as code execution from the RAM is generally faster than from the NVM. +This can improve the device performance during the activities that require high CPU usage. +As an example, the nRF Desktop application uses the RAM load mode for the ``nrf54lm20dk/nrf54lm20a/cpuapp`` board target to achieve 8 kHz report rate over USB in the ``release_ram_load`` configuration variant (the second configuration variant - ``ram_load`` - is used for debugging purposes only). + +To set the MCUboot mode of operations to the RAM load mode, enable the :kconfig:option:`SB_CONFIG_MCUBOOT_MODE_RAM_LOAD` Kconfig option in the sysbuild configuration. + +To support the RAM load mode, you must use DTS as the partitioning method, as the Partition Manager (PM) is not supported in this mode. +To satisfy this requirement, disable explicitly the :kconfig:option:`SB_CONFIG_PARTITION_MANAGER` Kconfig option in your sysbuild configuration. +Additionally, you must define the custom memory layout for the RAM in your target board configuration. +Your RAM layout must define the following DTS child nodes as part of the ``cpuapp_sram`` DTS node in the address order listed below: + +* ``cpuapp_sram_app_rxm_region`` - This DTS node defines the hard limits for the executable ROM section (with the application image) and must be aligned with the :kconfig:option:`CONFIG_BOOT_IMAGE_EXECUTABLE_RAM_START` and the :kconfig:option:`CONFIG_BOOT_IMAGE_EXECUTABLE_RAM_SIZE` Kconfig options that are set in the MCUboot image configuration. + This DTS node describes the region in which the build system places the executable ROM section (code) and RAM section (data) of the application image. + The RAM section is located right after the ROM section - the RAM section may overflow the ``cpuapp_sram_app_rxm_region`` region and spill into the subsequent ``cpuapp_sram_mcuboot_ram_region`` region or even be entirely contained in this subsequent region. + The ``cpuapp_sram_mcuboot_ram_region`` region can be filled with the RAM section of the application image, as the application and bootloader code cannot run simultaneously. +* ``cpuapp_sram_mcuboot_ram_region`` - This DTS node defines the RAM region for the MCUboot image and must be assigned to the MCUboot image as its chosen SRAM DTS node. + +For an example of the custom RAM layout that satisfies these requirements, see the :file:`nrf/applications/nrf_desktop/configuration/nrf54lm20dk_nrf54lm20a_cpuapp/memory_map_ram_load.dtsi` file. +For an example of the RAM layout usage in the MCUboot bootloader image, see the :file:`nrf/applications/nrf_desktop/configuration/nrf54lm20dk_nrf54lm20a_cpuapp/images/mcuboot/app_ram_load.overlay` file. + +.. note:: + The application image and the MCUboot image configuration must use the same memory layout. + +The RAM load mode requires using the Zephyr retention subsystem with the bootloader information sharing system. +This subsystem is used by the MCUboot bootloader to provide image metadata to the application image. +To enable the Zephyr retention subsystem, enable the following Kconfig options in your application image configuration and the MCUboot image configuration: + +* :kconfig:option:`CONFIG_RETENTION` +* :kconfig:option:`CONFIG_RETAINED_MEM` +* :kconfig:option:`CONFIG_RETAINED_MEM_ZEPHYR_RAM` + +In the application image configuration, enable the following Kconfig options: + +* :kconfig:option:`CONFIG_RETENTION_BOOTLOADER_INFO` +* :kconfig:option:`CONFIG_RETENTION_BOOTLOADER_INFO_TYPE_MCUBOOT` +* :kconfig:option:`CONFIG_RETENTION_BOOTLOADER_INFO_OUTPUT_FUNCTION` + +In the MCUboot image configuration, enable the following Kconfig options: + +* :kconfig:option:`CONFIG_BOOT_SHARE_DATA` +* :kconfig:option:`CONFIG_BOOT_SHARE_DATA_BOOTINFO` +* :kconfig:option:`CONFIG_BOOT_SHARE_BACKEND_RETENTION` + +The Zephyr retention subsystem requires the retention partition to be defined in the devicetree. +For an example of the retention partition definition, see the :file:`nrf/applications/nrf_desktop/configuration/nrf54lm20dk_nrf54lm20a_cpuapp/memory_map_ram_load.dtsi` file. +You must also assign the retention partition to the chosen DTS node ``zephyr,bootloader-info`` in both the application image configuration and the MCUboot image configuration. + +.. note:: + If your board target uses the Key Management Unit (KMU) feature (:kconfig:option:`CONFIG_CRACEN_LIB_KMU`), you must additionally define the ``nrf_kmu_reserved_push_area`` DTS node in your custom memory layout. + Place this RAM section at the very beginning of the physical RAM due to the dependency on the ``nrfutil device`` tool and its KMU provisioning functionality. + For an example of the ``nrf_kmu_reserved_push_area`` DTS node definition, see the :file:`nrf/applications/nrf_desktop/configuration/nrf54lm20dk_nrf54lm20a_cpuapp/memory_map_ram_load.dtsi` file. + + The KMU feature (:kconfig:option:`CONFIG_CRACEN_LIB_KMU`) is enabled by default for the nRF54L series. + +.. note:: + The RAM load mode of the MCUboot bootloader is not yet integrated in the :ref:`nrf_desktop_dfu_mcumgr`. + MCUboot bootloader on nRF54 --------------------------- diff --git a/applications/nrf_desktop/configuration/nrf52840gmouse_nrf52840/battery_def.h b/applications/nrf_desktop/configuration/nrf52840gmouse_nrf52840/battery_def.h index 0253d0a4030f..e8352676bde6 100644 --- a/applications/nrf_desktop/configuration/nrf52840gmouse_nrf52840/battery_def.h +++ b/applications/nrf_desktop/configuration/nrf52840gmouse_nrf52840/battery_def.h @@ -8,12 +8,15 @@ * and holds information about battery characteristic. */ +#include +#include + /* This structure enforces the header file is included only once in the build. * Violating this requirement triggers a multiple definition error at link time. */ const struct {} battery_def_include_once; -#define BATTERY_MEAS_ADC_INPUT NRF_SAADC_INPUT_AIN3 +#define BATTERY_MEAS_ADC_INPUT NRFX_ANALOG_EXTERNAL_AIN3 #define BATTERY_MEAS_ADC_GAIN ADC_GAIN_1 #define BATTERY_MEAS_VOLTAGE_GAIN 1 diff --git a/applications/nrf_desktop/configuration/nrf52dmouse_nrf52832/battery_def.h b/applications/nrf_desktop/configuration/nrf52dmouse_nrf52832/battery_def.h index 067d0fff3d8f..55d636d49640 100644 --- a/applications/nrf_desktop/configuration/nrf52dmouse_nrf52832/battery_def.h +++ b/applications/nrf_desktop/configuration/nrf52dmouse_nrf52832/battery_def.h @@ -8,12 +8,15 @@ * module and holds information about battery characteristic. */ +#include +#include + /* This structure enforces the header file is included only once in the build. * Violating this requirement triggers a multiple definition error at link time. */ const struct {} battery_def_include_once; -#define BATTERY_MEAS_ADC_INPUT NRF_SAADC_INPUT_AIN2 +#define BATTERY_MEAS_ADC_INPUT NRFX_ANALOG_EXTERNAL_AIN2 #define BATTERY_MEAS_ADC_GAIN ADC_GAIN_1_4 #define BATTERY_MEAS_VOLTAGE_GAIN 4 diff --git a/applications/nrf_desktop/configuration/nrf52kbd_nrf52832/battery_def.h b/applications/nrf_desktop/configuration/nrf52kbd_nrf52832/battery_def.h index 7c65676838f5..8e271642f962 100644 --- a/applications/nrf_desktop/configuration/nrf52kbd_nrf52832/battery_def.h +++ b/applications/nrf_desktop/configuration/nrf52kbd_nrf52832/battery_def.h @@ -8,12 +8,15 @@ * module and holds information about battery characteristic. */ +#include +#include + /* This structure enforces the header file is included only once in the build. * Violating this requirement triggers a multiple definition error at link time. */ const struct {} battery_def_include_once; -#define BATTERY_MEAS_ADC_INPUT NRF_SAADC_INPUT_VDD +#define BATTERY_MEAS_ADC_INPUT NRFX_ANALOG_INTERNAL_VDD #define BATTERY_MEAS_ADC_GAIN ADC_GAIN_1_6 #define BATTERY_MEAS_VOLTAGE_GAIN 6 diff --git a/applications/nrf_desktop/description.rst b/applications/nrf_desktop/description.rst index 8678625263aa..9b7e8548f85d 100644 --- a/applications/nrf_desktop/description.rst +++ b/applications/nrf_desktop/description.rst @@ -1131,6 +1131,11 @@ Building information Use the configuration with the ``release`` file suffix for the HID report rate measurement. Debug features, such as logging or assertions, decrease the application performance. +.. note:: + You can run the application code from RAM instead of NVM to improve performance as code execution from the RAM is generally faster than from the NVM. + You can configure MCUboot to use the RAM load mode to run the whole application image from RAM. + For details, see the :ref:`nrf_desktop_configuring_mcuboot_bootloader_ram_load` section. + Use the nRF Desktop configuration that acts as a HID mouse reference design for the report rate measurement, as the motion data polling is synchronized with sending HID reports. Make sure your chosen motion data source will generate movement in each poll interval. diff --git a/applications/nrf_desktop/doc/dfu.rst b/applications/nrf_desktop/doc/dfu.rst index 91c1ced28274..4a3fd5aca55f 100644 --- a/applications/nrf_desktop/doc/dfu.rst +++ b/applications/nrf_desktop/doc/dfu.rst @@ -27,7 +27,7 @@ Configuration You can use this module for the following devices: -* nRF52, nRF53, and nRF54L Series - To perform the firmware upgrade, you must enable the bootloader. +* nRF52, nRF53, and nRF54 Series - To perform the firmware upgrade, you must enable the bootloader. You can use the DFU module with either MCUboot or B0 bootloader. For more information on how to enable and configure a bootloader, see the :ref:`nrf_desktop_bootloader` section. @@ -47,19 +47,53 @@ If the buffer is small, the host must perform the DFU progress synchronization m MCUboot bootloader mode ======================= -The MCUboot bootloader can either move the image to the primary slot before booting it (``swap mode``) or boot the image directly from the secondary slot (``direct-xip mode``). +This module supports the following modes of the MCUboot bootloader and reports the corresponding bootloader name: -If the MCUboot bootloader in the swap mode is selected, the DFU module does the following: +* ``swap`` (:kconfig:option:`CONFIG_MCUBOOT_BOOTLOADER_MODE_SWAP_USING_MOVE`) - ``MCUBOOT`` +* ``direct-xip`` (:kconfig:option:`CONFIG_MCUBOOT_BOOTLOADER_MODE_DIRECT_XIP`) - ``MCUBOOT+XIP`` +* ``RAM load`` (:kconfig:option:`CONFIG_MCUBOOT_BOOTLOADER_MODE_RAM_LOAD`) - ``MCUBOOT`` + +The DFU module relies on the listed Kconfig options that indicate the MCUboot bootloader mode to determine the correct behavior. + +.. caution:: + Other bootloader modes might be compatible with this module, but they are not actively tested as part of the nRF Desktop configurations. + +See the :ref:`nrf_desktop_bootloader` section for more information on the MCUboot bootloader modes. + +Swap mode +--------- + +If this bootloader mode is selected, the DFU module does the following: * Requests the image upgrade after the whole image is transferred over the :ref:`nrf_desktop_config_channel`. * Confirms the running image after the device is rebooted. -If the MCUboot bootloader's direct-xip mode is used, the module does not mark the newly uploaded image as pending and does not confirm it after a successful boot. -In that case, the DFU module assumes that the MCUboot direct-xip bootloader simply boots an image with the higher version, so there is no need to mark the image as pending and confirm it. +Direct-xip mode +--------------- -The :kconfig:option:`CONFIG_MCUBOOT_BOOTLOADER_MODE_DIRECT_XIP` Kconfig option is used to inform the DFU module that the device uses the MCUboot bootloader in the direct-xip mode. -If the option is enabled, the DFU module reports the ``MCUBOOT+XIP`` bootloader name instead of ``MCUBOOT`` to indicate that the bootloader working in the direct-xip mode is used. -See the :ref:`nrf_desktop_bootloader` section for more information on the MCUboot bootloader configuration. +If this bootloader mode is selected, the DFU module does not mark the newly uploaded image as pending and does not confirm it after a successful boot. + +RAM load mode +------------- + +If this bootloader mode is selected, the DFU module does not mark the newly uploaded image as pending and does not confirm it after a successful boot. + +.. note:: + Support for the RAM load mode in this module is experimental. + For more details about the support of the MCUboot RAM load mode in the nRF Desktop application, see the MCUboot :ref:`nrf_desktop_configuring_mcuboot_bootloader_ram_load` section in the nRF Desktop documentation. + +.. note:: + DTS is the only supported partitioning method when you use the MCUboot bootloader in the RAM load mode. + +Partitioning methods +==================== + +The DFU module stores the update image received over the configuration channel to a dedicated memory partition. +Due to this responsibility, it uses one of the supported partitioning methods to get the information about this partition location. + +The DFU module is compatible with the memory layout defined using the Partition Manager (PM). +It is also compatible with the memory layout defined using the Devicetree Source (DTS) when you use it with the MCUboot bootloader. +For more details about the memory layout methods, see the :ref:`nrf_desktop_memory_layout` documentation. Device identification information ================================= @@ -134,16 +168,6 @@ fwinfo * Version and length of the image. * Partition ID of the currently booted image, used to specify the image placement. - Additionally, for the nRF54H Series, the following applies: - - * The reported image size is set to zero. - * The booted image version is indicated by: - - * Root manifest sequence number that is encoded in the build number field. - * Manifest semantic version, if supported by the SDFW (requires v0.6.2 or higher). - The semantic version is encoded in the major, minor and patch fields. - If semantic versioning is not supported, these fields are set to zero. - .. _dfu_devinfo: devinfo diff --git a/applications/nrf_desktop/doc/dfu_mcumgr.rst b/applications/nrf_desktop/doc/dfu_mcumgr.rst index 06f3b679687f..4efed6c4f4f1 100644 --- a/applications/nrf_desktop/doc/dfu_mcumgr.rst +++ b/applications/nrf_desktop/doc/dfu_mcumgr.rst @@ -70,7 +70,8 @@ You cannot use this module with the :ref:`caf_ble_smp`. In other words, you cannot simultaneously enable the :option:`CONFIG_DESKTOP_DFU_MCUMGR_ENABLE` option and the :kconfig:option:`CONFIG_CAF_BLE_SMP` Kconfig option. .. note:: - B0 bootloader is not integrated with MCUmgr. + Currently, this module supports only one bootloader backend, the MCUboot bootloader backend. + B0 bootloader is not integrated with MCUmgr. .. _nrf_desktop_dfu_mcumgr_mcuboot: diff --git a/applications/nrf_desktop/doc/hid_state.rst b/applications/nrf_desktop/doc/hid_state.rst index 9579c5c41189..0f408156728c 100644 --- a/applications/nrf_desktop/doc/hid_state.rst +++ b/applications/nrf_desktop/doc/hid_state.rst @@ -12,8 +12,8 @@ It is responsible for the following operations: * Tracking the state of HID subscribers and HID input report subscriptions. The module can simultaneously handle HID input report subscriptions of multiple HID subscribers. - The module provides HID input reports only to one subscriber (*active subscriber*). -* Providing HID input reports to the active HID subscriber. + The module provides HID input reports only to subscribers with the highest priority (*active subscribers*). +* Providing HID input reports to the active HID subscribers. The module relies on HID report providers to aggregate the user input, form HID input reports, and submit a :c:struct:`hid_report_event`. The HID input reports can be formatted according to either HID report protocol or HID boot protocol. * Handling HID output reports. @@ -40,18 +40,37 @@ For details related to HID configuration in the nRF Desktop, see the :ref:`nrf_d Number of supported HID subscribers =================================== +A HID transport (for example, :ref:`nrf_desktop_hids` or :ref:`nrf_desktop_usb_state`) is a module that forwards HID reports to a HID host and forwards HID input report subscriptions of the HID host. +In most cases, a HID transport registers a single HID subscriber that handles all HID input reports. If your application configuration supports more than one HID subscriber, you must align the maximum number of HID subscribers that can be handled simultaneously (:option:`CONFIG_DESKTOP_HID_STATE_SUBSCRIBER_COUNT`). -For example, to use a configuration that allows to simultaneously subscribe to HID reports from HID over GATT (Bluetooth LE) and a single USB HID instance, set the value of this Kconfig option to ``2``. +For example, to use a configuration that allows to simultaneously subscribe to HID input reports from HID over GATT (Bluetooth LE) and a single USB HID instance, set the value of this Kconfig option to ``2``. -If multiple HID subscribers are simultaneously connected, the |hid_state| selects the one with the highest priority as the active subscriber. -The |hid_state| provides HID input reports only to the active subscriber. -The |hid_state| displays the HID keyboard LED state associated with the active subscriber. +Selective HID input report subscription +--------------------------------------- -By default, the subscriber that is associated with USB has priority over a subscriber associated with Bluetooth LE. -As a result, if a HID host connects through the USB while another HID host is connected over the Bluetooth LE, the HID reports will be routed to the USB. +In some cases, a single HID transport can register multiple HID subscribers. +Every HID subscriber handles a subset of HID input reports. + +For example, an nRF Desktop peripheral might use the USB selective HID report subscription feature to split HID input reports among multiple HID-class USB instances (every HID-class USB instance handles a predefined subset of HID input report IDs). +For more details regarding the feature, see the :ref:`nrf_desktop_usb_state_hid_class_instance` documentation section of the USB state module. + +Using selective HID input report subscription requires increasing the value of the :option:`CONFIG_DESKTOP_HID_STATE_SUBSCRIBER_COUNT` Kconfig option. +For example, if a configuration allows simultaneously subscribing to HID input reports from HID over GATT (Bluetooth LE) and two USB HID instances, increase the value of the Kconfig option to ``3``. + +HID subscriber priority +----------------------- + +If multiple HID subscribers are simultaneously connected, the |hid_state| selects the ones with the highest priority as the active subscribers. +The |hid_state| provides HID input reports only to the active subscribers. +The |hid_state| displays the HID keyboard LED state associated with the active subscriber of the HID keyboard input report. +HID subscribers with the same priority cannot simultaneously subscribe to the same HID input report. + +If a HID transport uses a selective HID input report subscription, all subscribers registered by the transport must share the same priority. +Otherwise, subscribers with lower priority would not receive HID input reports from the HID state. .. note:: - The subscriber priority must be unique, which means that two or more subscribers cannot share the same priority value. + By default, a subscriber that is associated with USB has priority over a subscriber associated with Bluetooth LE. + If a HID host connects through the USB while another HID host is connected over the Bluetooth LE, the HID reports will be routed to the USB. HID keyboard LEDs ================= @@ -108,14 +127,13 @@ This section describes implementation details related to responsibilities of the Tracking state of HID subscribers ================================= -A HID transport (for example :ref:`nrf_desktop_hids` or :ref:`nrf_desktop_usb_state`) is a module that forwards HID reports to a HID host and forwards HID subscriptions of the HID host. A HID transport reports the state of a HID subscriber using the :c:struct:`hid_report_subscriber_event`. When the connection to the HID host is indicated by this event, the |hid_state| will create an associated subscriber. The |hid_state| tracks the state of the HID subscribers. As part of the :c:struct:`hid_report_subscriber_event`, the subscriber provides the following parameters: -* Subscriber priority - The |hid_state| provides HID input reports only to the subscriber with the highest priority (active subscriber). +* Subscriber priority - The |hid_state| provides HID input reports only to subscribers with the highest priority (active subscribers). * Pipeline size - The |hid_state| forwards this information to the HID report providers. The information can be used, for example, to synchronize sensor sampling with sending the HID input reports to the HID host. See the :ref:`nrf_desktop_hid_mouse_report_handling` section for information how the pipeline size is used for HID mouse reports. @@ -125,7 +143,7 @@ Tracking state of HID report subscriptions ------------------------------------------ For each subscriber, the |hid_state| tracks the state of HID input report subscriptions. -The HID input reports are only provided after the active subscriber enables the subscription. +The HID input reports are only provided after one of the active subscribers enables the subscription. The subscriber updates its HID report subscriptions using a :c:struct:`hid_report_subscription_event`. The HID report subscriptions are tracked in the subscriber's structure :c:struct:`subscriber`. @@ -213,5 +231,5 @@ HID output reports When the |hid_state| receives a :c:struct:`hid_report_event` that contains a HID output report, it updates the stored information about the state of the HID output report of the appropriate subscriber. By default, nRF Desktop supports only HID keyboard LED output report. -The nRF Desktop peripheral displays the state of the keyboard LEDs that was specified by the active HID subscriber. -When the active subscriber is changed or it updates the state of the keyboard LEDs, the |hid_state| sends :c:struct:`leds_event` to update the state of the hardware LEDs. +The nRF Desktop peripheral displays the state of the keyboard LEDs that was specified by the active HID subscriber of a HID keyboard input report. +When the subscriber changes or updates the state of the keyboard LEDs, the |hid_state| sends a :c:struct:`leds_event` to update the state of the hardware LEDs. diff --git a/boards/nordic/nrf7120pdk/nrf7120pdk_nrf7120-pinctrl.dtsi b/boards/nordic/nrf7120pdk/nrf7120pdk_nrf7120-pinctrl.dtsi index f9cd55542ec9..589d75c817b8 100644 --- a/boards/nordic/nrf7120pdk/nrf7120pdk_nrf7120-pinctrl.dtsi +++ b/boards/nordic/nrf7120pdk/nrf7120pdk_nrf7120-pinctrl.dtsi @@ -30,12 +30,12 @@ /omit-if-no-ref/ uart30_default: uart30_default { group1 { psels = , - ; + ; }; group2 { psels = , - ; + ; bias-pull-up; }; }; @@ -44,8 +44,8 @@ group1 { psels = , , - , - ; + , + ; low-power-enable; }; }; diff --git a/cmake/modules/kconfig.cmake b/cmake/modules/kconfig.cmake index b84cef0a9fcd..7235878c0ac1 100644 --- a/cmake/modules/kconfig.cmake +++ b/cmake/modules/kconfig.cmake @@ -39,6 +39,16 @@ if(CONFIG_NCS_IS_VARIANT_IMAGE) file(STRINGS ${preload_autoconf_h} autoconf_content) file(STRINGS ${preload_dotconfig} dotconfig_content) + # Needed for the correct CONFIG_BUILD_OUTPUT_ADJUST_LMA calculation in the variant image + # .config and autoconf.h files for nRF54H20 CPURAD. + dt_partition_addr(code_partition_abs_addr PATH "${code_partition}" REQUIRED ABSOLUTE) + dt_chosen(sram_property PROPERTY "zephyr,sram") + dt_reg_addr(sram_addr PATH "${sram_property}" REQUIRED) + set(soc_nrf54h20_cpurad 0) + if("${dotconfig_content}" MATCHES "CONFIG_SOC_NRF54H20_CPURAD=y") + set(soc_nrf54h20_cpurad 1) + endif() + # Modify the CONFIG_FLASH_LOAD_OFFSET and CONFIG_FLASH_LOAD_SIZE for both the .config and autoconf.h files. # If partition manager is not used, these values should be taken from the device tree. # Additionally, convert primary slot dependencies to secondary slot dependencies. @@ -56,6 +66,10 @@ if(CONFIG_NCS_IS_VARIANT_IMAGE) string(REGEX REPLACE "primary" "secondary" line ${line}) endif() + if(soc_nrf54h20_cpurad AND "${line}" MATCHES "^CONFIG_BUILD_OUTPUT_ADJUST_LMA=.*$") + string(REGEX REPLACE "CONFIG_BUILD_OUTPUT_ADJUST_LMA=(.*)" "CONFIG_BUILD_OUTPUT_ADJUST_LMA=\"${code_partition_abs_addr}-${sram_addr}\"" line ${line}) + endif() + list(APPEND dotconfig_variant_content "${line}\n") endforeach() @@ -73,6 +87,10 @@ if(CONFIG_NCS_IS_VARIANT_IMAGE) string(REGEX REPLACE "primary" "secondary" line ${line}) endif() + if(soc_nrf54h20_cpurad AND "${line}" MATCHES "^#define CONFIG_BUILD_OUTPUT_ADJUST_LMA .*$") + string(REGEX REPLACE "#define CONFIG_BUILD_OUTPUT_ADJUST_LMA (.*)" "#define CONFIG_BUILD_OUTPUT_ADJUST_LMA \"${code_partition_abs_addr}-${sram_addr}\"" line ${line}) + endif() + list(APPEND autoconf_variant_content "${line}\n") endforeach() diff --git a/cmake/sysbuild/image_signing.cmake b/cmake/sysbuild/image_signing.cmake index de833a9e8121..bb1a35707d07 100644 --- a/cmake/sysbuild/image_signing.cmake +++ b/cmake/sysbuild/image_signing.cmake @@ -90,6 +90,7 @@ function(zephyr_mcuboot_tasks) if(CONFIG_MCUBOOT_BOOTLOADER_MODE_DIRECT_XIP_WITH_REVERT OR CONFIG_MCUBOOT_BOOTLOADER_MODE_DIRECT_XIP) dt_chosen(code_partition PROPERTY "zephyr,code-partition") dt_partition_addr(code_partition_offset PATH "${code_partition}" REQUIRED) + dt_reg_size(slot_size PATH "${code_partition}" REQUIRED) set(imgtool_rom_command --rom-fixed ${code_partition_offset}) endif() set(imgtool_sign ${PYTHON_EXECUTABLE} ${IMGTOOL} sign --version ${CONFIG_MCUBOOT_IMGTOOL_SIGN_VERSION} --align ${write_block_size} --slot-size ${slot_size} --header-size ${CONFIG_ROM_START_OFFSET} ${imgtool_rom_command}) diff --git a/doc/_zoomin/ncs.tags.yml b/doc/_zoomin/ncs.tags.yml index c2d626e2bf3e..92b300eb326f 100644 --- a/doc/_zoomin/ncs.tags.yml +++ b/doc/_zoomin/ncs.tags.yml @@ -11,60 +11,60 @@ mapping_topics: - nrf/index.html: ["nrf91-series", "nrf70-series", "nrf54-series", "nrf53-series", "nrf52-series", "nrf7002", "nrf7001", "nrf7000", "nrf9160", "thingy91", "thingy91x", "nrf9161", "nrf9151", "nrf9131", "nrf54h20", "nrf54l15", "nrf54l05", "nrf54l10", - "nrf54lm20a", "nrf5340", "thingy53", "nrf52840", "nrf52833", "nrf52832", - "nrf52820", "nrf52811", "nrf52810", "nrf52805", "nrf21540", "npm1100", - "npm1300", "npm2100", "npm6001"] + "nrf54lm20a", "nrf54lv10a", "nrf5340", "thingy53", "nrf52840", "nrf52833", + "nrf52832", "nrf52820", "nrf52811", "nrf52810", "nrf52805", "nrf21540", + "npm1100", "npm1300", "npm2100", "npm6001"] - nrf/gsg_guides.html: ["nrf91-series", "nrf70-series", "nrf54-series", "nrf53-series", "nrf52-series", "nrf7002", "nrf7001", "nrf7000", "nrf9160", "thingy91", "thingy91x", "nrf9161", "nrf9151", "nrf9131", "nrf54h20", "nrf54l15", - "nrf54l05", "nrf54l10", "nrf54lm20a", "nrf5340", "thingy53", "nrf52840", - "nrf52833", "nrf52832", "nrf52820", "nrf52811", "nrf52810", "nrf52805", - "nrf21540", "npm1100", "npm1300", "npm2100", "npm6001", + "nrf54l05", "nrf54l10", "nrf54lm20a", "nrf54lv10a", "nrf5340", "thingy53", + "nrf52840", "nrf52833", "nrf52832", "nrf52820", "nrf52811", "nrf52810", + "nrf52805", "nrf21540", "npm1100", "npm1300", "npm2100", "npm6001", "development-kits", "prototyping-platforms", "evaluation-kits", "pmic"] - nrf/installation.html: ["nrf91-series", "nrf70-series", "nrf54-series", "nrf53-series", "nrf52-series", "nrf7002", "nrf7001", "nrf7000", "nrf9160", "thingy91", "thingy91x", "nrf9161", "nrf9151", "nrf9131", "nrf54h20", "nrf54l15", - "nrf54l05", "nrf54l10", "nrf54lm20a", "nrf5340", "thingy53", "nrf52840", - "nrf52833", "nrf52832", "nrf52820", "nrf52811", "nrf52810", "nrf52805", - "nrf21540", "npm1100", "npm1300", "npm2100", "npm6001"] + "nrf54l05", "nrf54l10", "nrf54lm20a", "nrf54lv10a", "nrf5340", + "thingy53", "nrf52840", "nrf52833", "nrf52832", "nrf52820", "nrf52811", + "nrf52810", "nrf52805", "nrf21540", "npm1100", "npm1300", "npm2100", + "npm6001"] - nrf/installation/*.html: ["nrf91-series", "nrf70-series", "nrf54-series", "nrf53-series", "nrf52-series", "nrf7002", "nrf7001", "nrf7000", "nrf9160", "thingy91", "thingy91x", "nrf9161", "nrf9151", "nrf9131", "nrf54h20", - "nrf54l15", "nrf54l05", "nrf54l10", "nrf54lm20a", "nrf5340", - "thingy53", "nrf52840", "nrf52833", "nrf52832", "nrf52820", + "nrf54l15", "nrf54l05", "nrf54l10", "nrf54lm20a", "nrf54lv10a", + "nrf5340", "thingy53", "nrf52840", "nrf52833", "nrf52832", "nrf52820", "nrf52811", "nrf52810", "nrf52805", "nrf21540", "npm1100", "npm1300", "npm2100", "npm6001"] - nrf/app_dev.html: ["nrf91-series", "nrf70-series", "nrf54-series", "nrf53-series", "nrf52-series", "nrf7002", "nrf7001", "nrf7000", "nrf9160", "thingy91", "thingy91x", "nrf9161", "nrf9151", "nrf9131", "nrf54h20", "nrf54l15", - "nrf54l05", "nrf54l10", "nrf54lm20a", "nrf5340", "thingy53", "nrf52840", - "nrf52833", "nrf52832", "nrf52820", "nrf52811", "nrf52810", "nrf52805", - "nrf21540", "npm1100", "npm1300", "npm2100", "npm6001"] + "nrf54l05", "nrf54l10", "nrf54lm20a", "nrf54lv10a", "nrf5340", "thingy53", + "nrf52840", "nrf52833", "nrf52832", "nrf52820", "nrf52811", "nrf52810", + "nrf52805", "nrf21540", "npm1100", "npm1300", "npm2100", "npm6001"] - nrf/app_dev/create_application.html: ["nrf91-series", "nrf70-series", "nrf54-series", "nrf53-series", "nrf52-series", "nrf7002", "nrf7001", "nrf7000", "nrf9160", "thingy91", "thingy91x", "nrf9161", "nrf9151", "nrf9131", "nrf54h20", "nrf54l15", "nrf54l05", - "nrf54l10", "nrf54lm20a", "nrf5340", "thingy53", - "nrf52840", "nrf52833", "nrf52832", "nrf52820", - "nrf52811", "nrf52810", "nrf52805", "nrf21540", "npm1100", - "npm1300", "npm2100", "npm6001", "applications", - "nrf-connect-vsc"] - - nrf/app_dev/board_names.html: ["nrf91-series", "nrf70-series", "nrf54-series", - "nrf53-series", "nrf52-series", "nrf7002", "nrf7001", - "nrf7000", "nrf9160", "thingy91", "thingy91x", "nrf9161", - "nrf9151", "nrf9131", "nrf54h20", "nrf54l15", "nrf54l05", - "nrf54l10", "nrf54lm20a", "nrf5340", "thingy53", "nrf52840", - "nrf52833", "nrf52832", "nrf52820", "nrf52811", "nrf52810", - "nrf52805", "nrf21540", "npm1100", "npm1300", "npm2100", - "npm6001"] + "nrf54l10", "nrf54lm20a", "nrf54lv10a", "nrf5340", + "thingy53", "nrf52840", "nrf52833", "nrf52832", + "nrf52820", "nrf52811", "nrf52810", "nrf52805", + "nrf21540", "npm1100", "npm1300", "npm2100", "npm6001", + "applications", "nrf-connect-vsc"] + - nrf/app_dev/board_names.html: ["nrf91-series", "nrf70-series", "nrf54-series", "nrf53-series", + "nrf52-series", "nrf7002", "nrf7001", "nrf7000", "nrf9160", + "thingy91", "thingy91x", "nrf9161", "nrf9151", "nrf9131", + "nrf54h20", "nrf54l15", "nrf54l05", "nrf54l10", "nrf54lm20a", + "nrf54lv10a", "nrf5340", "thingy53", "nrf52840", "nrf52833", + "nrf52832", "nrf52820", "nrf52811", "nrf52810", "nrf52805", + "nrf21540", "npm1100", "npm1300", "npm2100", "npm6001"] - nrf/app_dev/config_and_build/*.html: ["nrf91-series", "nrf70-series", "nrf54-series", "nrf53-series", "nrf52-series", "nrf7002", "nrf7001", "nrf7000", "nrf9160", "thingy91", "thingy91x", "nrf9161", "nrf9151", "nrf9131", "nrf54h20", "nrf54l15", "nrf54l05", - "nrf54l10", "nrf54lm20a", "nrf5340", "thingy53", - "nrf52840", "nrf52833", "nrf52832", "nrf52820", - "nrf52811", "nrf52810", "nrf52805", "nrf21540", "npm1100", - "npm1300", "npm2100", "npm6001"] + "nrf54l10", "nrf54lm20a", "nrf54lv10a", "nrf5340", + "thingy53", "nrf52840", "nrf52833", "nrf52832", + "nrf52820", "nrf52811", "nrf52810", "nrf52805", + "nrf21540", "npm1100", "npm1300", "npm2100", "npm6001"] - nrf/app_dev/config_and_build/config_and_build_system.html: ["applications", "samples", "kconfig"] - nrf/app_dev/config_and_build/cmake/index.html: ["applications", "samples", "kconfig", @@ -87,42 +87,43 @@ mapping_topics: "nrf52-series", "nrf7002", "nrf7001", "nrf7000", "nrf9160", "thingy91", "thingy91x", "nrf9161", "nnrf9151", "nrf9131", "nrf54h20", "nrf54l15", "nrf54l05", "nrf54l10", "nrf54lm20a", - "nrf5340", "thingy53", "nrf52840", "nrf52833", "nrf52832", - "nrf52820", "nrf52811", "nrf52810", "nrf52805", "nrf21540", - "npm1100", "npm1300", "npm2100", "npm6001", "applications", - "samples", "development-kits", "evaluation-kits", + "nrf54lv10a", "nrf5340", "thingy53", "nrf52840", "nrf52833", + "nrf52832", "nrf52820", "nrf52811", "nrf52810", "nrf52805", + "nrf21540", "npm1100", "npm1300", "npm2100", "npm6001", + "applications", "samples", "development-kits", "evaluation-kits", "prototyping-platforms"] - nrf/app_dev/companion_components.html: ["nrf91-series", "nrf70-series", "nrf54-series", "nrf53-series", "nrf52-series", "nrf7002", "nrf7001", "nrf7000", "nrf9160", "thingy91", "thingy91x", "nrf9161", "nnrf9151", "nrf9131", "nrf54h20", "nrf54l15", "nrf54l05", "nrf54l10", "nrf54lm20a", - "nrf5340", "thingy53", "nrf52840", "nrf52833", - "nrf52832", "nrf52820", "nrf52811", "nrf52810", - "nrf52805", "nrf21540", "npm1100", "npm1300", "npm2100", - "npm6001", "applications", "samples", - "development-kits", "evaluation-kits", + "nrf54lv10a", "nrf5340", "thingy53", "nrf52840", + "nrf52833", "nrf52832", "nrf52820", "nrf52811", + "nrf52810", "nrf52805", "nrf21540", "npm1100", + "npm1300", "npm2100", "npm6001", "applications", + "samples", "development-kits", "evaluation-kits", "prototyping-platforms"] - nrf/app_dev/bootloaders_dfu/index.html: ["nrf91-series", "nrf70-series", "nrf54-series", "nrf53-series", "nrf52-series", "nrf7002", "nrf7001", "nrf7000", "nrf9160", "thingy91", "thingy91x", "nrf9161", "nrf9151", "nrf9131", "nrf54h20", "nrf54l15", "nrf54l05", "nrf54l10", "nrf54lm20a", - "nrf5340", "thingy53", "nrf52840", "nrf52833", - "nrf52832", "nrf52820", "nrf52811", "nrf52810", - "nrf52805", "nrf21540", "npm1100", "npm1300", - "npm2100", "npm6001"] + "nrf54lv10a", "nrf5340", "thingy53", "nrf52840", + "nrf52833", "nrf52832", "nrf52820", "nrf52811", + "nrf52810", "nrf52805", "nrf21540", "npm1100", + "npm1300", "npm2100", "npm6001"] - nrf/app_dev/bootloaders_dfu/mcuboot_nsib/*.html: ["nrf91-series", "nrf70-series", "nrf54-series", "nrf53-series", "nrf52-series", "nrf7002", "nrf7001", "nrf7000", "nrf9160", "thingy91", "thingy91x", "nrf9161", "nrf9151", "nrf9131", "nrf54h20", "nrf54l15", "nrf54l05", "nrf54l10", - "nrf54lm20a", "nrf5340", "thingy53", - "nrf52840", "nrf52833", "nrf52832", - "nrf52820", "nrf52811", "nrf52810", - "nrf52805", "nrf21540", "npm1100", "npm1300", - "npm2100", "npm6001", "applications"] + "nrf54lm20a", "nrf54lv10a", "nrf5340", + "thingy53", "nrf52840", "nrf52833", + "nrf52832", "nrf52820", "nrf52811", + "nrf52810", "nrf52805", "nrf21540", "npm1100", + "npm1300", "npm2100", "npm6001", + "applications"] - nrf/app_dev/bootloaders_dfu/mcuboot_nsib/bootloader_config.html: ["kconfig"] - nrf/app_dev/bootloaders_dfu/qspi_xip_split_image.html: ["nrf52840", "thingy53", "nrf5340"] - nrf/app_dev/bootloaders_dfu/dfu_tools_mcumgr_cli.html: ["nrf91-series", "nrf70-series", @@ -132,11 +133,11 @@ mapping_topics: "thingy91x", "nrf9161", "nrf9151", "nrf9131", "nrf54h20", "nrf54l15", "nrf54l05", "nrf54l10", "nrf54lm20a", - "nrf5340", "thingy53", "nrf52840", - "nrf52833", "nrf52832", "nrf52820", - "nrf52811", "nrf52810", "nrf52805", - "nrf21540", "npm1100", "npm1300", - "npm2100", "npm6001"] + "nrf54lv10a", "nrf5340", "thingy53", + "nrf52840", "nrf52833", "nrf52832", + "nrf52820", "nrf52811", "nrf52810", + "nrf52805", "nrf21540", "npm1100", + "npm1300", "npm2100", "npm6001"] - nrf/app_dev/bootloaders_dfu/mcuboot_image_compression.html: ["nrf91-series", "nrf70-series", "nrf54-series", "nrf53-series", "nrf52-series", "nrf7002", @@ -144,12 +145,12 @@ mapping_topics: "thingy91", "thingy91x", "nrf9161", "nrf9151", "nrf9131", "nrf54h20", "nrf54l15", "nrf54l05", "nrf54l10", - "nrf54lm20a", "nrf5340", - "thingy53", "nrf52840", "nrf52833", - "nrf52832", "nrf52820", "nrf52811", - "nrf52810", "nrf52805", "nrf21540", - "npm1100", "npm1300", "npm2100", - "npm6001"] + "nrf54lm20a", "nrf54lv10a", + "nrf5340", "thingy53", "nrf52840", + "nrf52833", "nrf52832", "nrf52820", + "nrf52811", "nrf52810", "nrf52805", + "nrf21540", "npm1100", "npm1300", + "npm2100", "npm6001"] - nrf/app_dev/bootloaders_dfu/sysbuild_image_ids.html: ["nrf91-series", "nrf70-series", "nrf54-series", "nrf53-series", "nrf52-series", "nrf7002", "nrf7001", @@ -157,11 +158,11 @@ mapping_topics: "thingy91x", "nrf9161", "nrf9151", "nrf9131", "nrf54h20", "nrf54l15", "nrf54l05", "nrf54l10", "nrf54lm20a", - "nrf5340", "thingy53", "nrf52840", - "nrf52833", "nrf52832", "nrf52820", - "nrf52811", "nrf52810", "nrf52805", - "nrf21540", "npm1100", "npm1300", - "npm2100", "npm6001"] + "nrf54lv10a", "nrf5340", "thingy53", + "nrf52840", "nrf52833", "nrf52832", + "nrf52820", "nrf52811", "nrf52810", + "nrf52805", "nrf21540", "npm1100", + "npm1300", "npm2100", "npm6001"] - nrf/app_dev/device_guides/nrf91/index.html: ["nrf9160", "nrf9161", "thingy91", "thingy91x", "nrf9151", "nrf9131", "development-kits", "dect-nr+", "prototyping-platforms"] @@ -206,7 +207,7 @@ mapping_topics: - nrf/app_dev/device_guides/nrf70/nrf7002ek_dev_guide.html: ["evaluation-kits"] - nrf/app_dev/device_guides/nrf70/constrained.html: ["kconfig"] - nrf/app_dev/device_guides/nrf54l/*.html: ["nrf54-series", "nrf54l15", "nrf54l10", "nrf54lm20a", - "nrf54l05", "development-kits"] + "nrf54lv10a", "nrf54l05", "development-kits"] - nrf/app_dev/device_guides/nrf54h/*.html: ["nrf54-series", "nrf54h20", "development-kits"] - nrf/app_dev/device_guides/nrf53/index.html: ["nrf5340", "thingy53", "development-kits", "prototyping-platforms"] @@ -242,17 +243,17 @@ mapping_topics: "nrf52-series", "nrf7002", "nrf7001", "nrf7000", "nrf9160", "thingy91", "thingy91x", "nrf9161", "nrf9151", "nrf9131", "nrf54h20", "nrf54l15", "nrf54l05", "nrf54l10", "nrf54lm20a", - "nrf5340", "thingy53", "nrf52840", "nrf52833", "nrf52832", - "nrf52820", "nrf52811", "nrf52810", "nrf52805", "nrf21540", - "npm1100", "npm1300", "npm2100", "npm6001", "applications", - "samples"] + "nrf54lv10a", "nrf5340", "thingy53", "nrf52840", "nrf52833", + "nrf52832", "nrf52820", "nrf52811", "nrf52810", "nrf52805", + "nrf21540", "npm1100", "npm1300", "npm2100", "npm6001", + "applications", "samples"] - nrf/test_and_optimize/*.html: ["nrf91-series", "nrf70-series", "nrf54-series", "nrf53-series", "nrf52-series", "nrf7002", "nrf7001", "nrf7000", "nrf9160", "thingy91", "thingy91x", "nrf9161", "nrf9151", "nrf9131", "nrf54h20", "nrf54l15", "nrf54l05", "nrf54l10", "nrf54lm20a", - "nrf5340", "thingy53", "nrf52840", "nrf52833", "nrf52832", - "nrf52820", "nrf52811", "nrf52810", "nrf52805", "nrf21540", - "npm1100", "npm1300", "npm2100", "npm6001"] + "nrf54lv10a", "nrf5340", "thingy53", "nrf52840", "nrf52833", + "nrf52832", "nrf52820", "nrf52811", "nrf52810", "nrf52805", + "nrf21540", "npm1100", "npm1300", "npm2100", "npm6001"] - nrf/test_and_optimize/optimizing/*.html: ["applications", "protocols"] - nrf/test_and_optimize/optimizing/memory.html: ["kconfig", "ble", "blemesh", "gazell", "matter", "nfc", "thread", "zigbee", @@ -263,8 +264,8 @@ mapping_topics: "nrf54-series", "nrf53-series", "nrf52-series", "nrf7002", "nrf7001", "nrf7000", "nrf54l15", "nrf54l05", - "nrf54l10", "nrf54lm20a", "nrf5340", - "thingy53", "nrf52840", "nrf52833", + "nrf54l10", "nrf54lm20a", "nrf54lv10a", + "nrf5340", "thingy53", "nrf52840", "nrf52833", "nrf52832", "nrf52820", "nrf52811", "nrf52810", "nrf52805", "nrf9160", "matter", "thread", "lte", "wifi"] @@ -272,21 +273,22 @@ mapping_topics: - nrf/security/*.html: ["kconfig"] - nrf/security/crypto/*.html: ["nrf91-series", "nrf54-series", "nrf53-series", "nrf52-series", "nrf9160", "nrf9161", "nrf9151", "nrf9131", - "nrf54h20", "nrf54l15", "nrf54l10", "nrf54lm20a", "nrf54l05", - "nrf5340", "nrf52840", "nrf52833", "nrf52832", "kconfig"] + "nrf54h20", "nrf54l15", "nrf54l10", "nrf54lm20a", "nrf54lv10a", + "nrf54l05", "nrf5340", "nrf52840", "nrf52833", "nrf52832", + "kconfig"] - nrf/security/tfm/*.html: ["nrf91-series", "nrf70-series", "nrf54-series", "nrf53-series", "nrf9160", "nrf9161", "nrf9151", "nrf9131", "nrf7002", - "nrf54l15", "nrf54l10", "nrf54lm20a", "nrf5340", "thingy91", - "thingy91x", "thingy53", "kconfig"] + "nrf54l15", "nrf54l10", "nrf54lm20a", "nrf54lv10a", "nrf5340", + "thingy91", "thingy91x", "thingy53", "kconfig"] - nrf/security/ap_protect.html: ["nrf91-series", "nrf54-series", "nrf53-series", "nrf52-series", "nrf9160", "nrf9161", "nrf9151", "nrf9131", - "nrf54h20", "nrf54l15", "nrf5340", "nrf52840", "nrf52833", - "nrf52832", "nrf52820", "nrf52811", "nrf52810", "nrf52805", - "kconfig"] + "nrf54h20", "nrf54l15", "nrf54lm20a", "nrf54lv10a", "nrf5340", + "nrf52840", "nrf52833", "nrf52832", "nrf52820", "nrf52811", + "nrf52810", "nrf52805", "kconfig"] - nrf/security/secure_storage.html: ["nrf91-series", "nrf54-series", "nrf53-series", "nrf52-series", "nrf9160", "nrf9161", "nrf9151", "nrf9131", - "nrf54l15", "nrf54l10", "nrf54lm20a", "nrf5340", "nrf52840", - "nrf52833", "nrf52832", "kconfig"] + "nrf54l15", "nrf54l10", "nrf54lm20a", "nrf54lv10a", + "nrf5340", "nrf52840", "nrf52833", "nrf52832", "kconfig"] - nrf/protocols/*.html: ["protocols"] - nrf/protocols.html: ["sidewalk", "ble", "blemesh", "esb", "gazell", "matter", "multiprotocol", "nfc", "thread", "zigbee", "wifi", "dect-nr+", "protocols"] @@ -328,10 +330,10 @@ mapping_topics: - nrf/applications.html: ["nrf91-series", "nrf70-series", "nrf54-series", "nrf53-series", "nrf52-series", "nrf7002", "nrf7001", "nrf7000", "nrf9160", "thingy91", "thingy91x", "nrf9161", "nrf9151", "nrf54h20", "nrf54l15", "nrf54l05", - "nrf54l10", "nrf54lm20a", "nrf5340", "thingy53", "nrf52840", "nrf52833", - "nrf52832", "nrf52820", "nrf52811", "nrf52810", "nrf52805", "nrf21540", - "npm1100", "npm1300", "npm2100", "npm6001", "kconfig", - "development-kits", "prototyping-platforms"] + "nrf54l10", "nrf54lm20a", "nrf54lv10a", "nrf5340", "thingy53", + "nrf52840", "nrf52833", "nrf52832", "nrf52820", "nrf52811", "nrf52810", + "nrf52805", "nrf21540", "npm1100", "npm1300", "npm2100", "npm6001", + "kconfig", "development-kits", "prototyping-platforms"] - nrf/applications/*.html: ["applications", "kconfig"] - nrf/applications/connectivity_bridge/README.html: ["lte"] - nrf/applications/matter_bridge/*.html: ["matter", "wifi"] @@ -342,9 +344,9 @@ mapping_topics: - nrf/samples.html: ["nrf91-series", "nrf70-series", "nrf54-series", "nrf53-series", "nrf52-series", "nrf7002", "nrf7001", "nrf7000", "nrf9160", "thingy91", "thingy91x", "nrf9161", "nrf9151", "nrf54h20", "nrf54l15", "nrf54l05", - "nrf54l10", "nrf54lm20a", "nrf5340", "thingy53", "nrf52840", "nrf52833", - "nrf52832", "nrf52820", "nrf52811", "nrf52810", "nrf52805", "nrf21540", - "npm1100", "npm1300", "npm2100", "npm6001", "development-kits", + "nrf54l10", "nrf54lm20a", "nrf54lv10a", "nrf5340", "thingy53", "nrf52840", + "nrf52833", "nrf52832", "nrf52820", "nrf52811", "nrf52810", "nrf52805", + "nrf21540", "npm1100", "npm1300", "npm2100", "npm6001", "development-kits", "prototyping-platforms", "kconfig"] - nrf/samples/*.html: ["samples", "kconfig"] - nrf/samples/amazon_sidewalk.html: ["sidewalk"] @@ -385,7 +387,7 @@ mapping_topics: - nrf/libraries/bluetooth/*.html: ["ble", "nrf52-series", "nrf52840", "nrf52833", "nrf52832", "nrf52820", "nrf52811", "nrf52810", "nrf52805", "nrf54-series", "nrf54h20", "nrf54l15", "nrf54l05", "nrf54l10", "nrf54lm20a", - "development-kits"] + "nrf54lv10a", "development-kits"] - nrf/libraries/bluetooth/mesh.html: ["blemesh"] - nrf/libraries/bluetooth/mesh/*.html: ["blemesh"] - nrf/libraries/gazell/*.html: ["gazell"] @@ -437,7 +439,8 @@ mapping_topics: - nrfxlib/nrf_modem/*.html: ["nrf91-series", "nrf9160", "nrf9161", "nrf9151", "lte", "dect-nr+"] - nrfxlib/nrf_modem/doc/at_interface.html: ["at-commands"] - nrfxlib/nrf_802154/README.html: ["nrf52-series", "nrf54-series", "nrf54l15", "nrf54l05", - "nrf54l10", "nrf54lm20a", "nrf52840", "nrf52833", "nrf5340"] + "nrf54l10", "nrf54lm20a", "nrf52840", "nrf52833", + "nrf5340"] - nrfxlib/nrf_802154/*.html: ["multiprotocol"] - nrfxlib/nrf_fuel_gauge/*.html: ["pmic", "npm1100", "npm1300", "npm2100", "npm6001", "evaluation-kits"] diff --git a/doc/mcuboot/index-ncs.rst b/doc/mcuboot/index-ncs.rst index 8a5aa3cba8b3..04e2e4190d78 100644 --- a/doc/mcuboot/index-ncs.rst +++ b/doc/mcuboot/index-ncs.rst @@ -3,10 +3,6 @@ Introduction to MCUboot ####################### -.. contents:: - :local: - :depth: 2 - MCUboot is a secure bootloader for 32-bit microcontrollers. Overview diff --git a/doc/nrf/app_dev/device_guides/coprocessors/fault_handling.rst b/doc/nrf/app_dev/device_guides/coprocessors/fault_handling.rst index 972a33c6f0ec..0d6d9da5177b 100644 --- a/doc/nrf/app_dev/device_guides/coprocessors/fault_handling.rst +++ b/doc/nrf/app_dev/device_guides/coprocessors/fault_handling.rst @@ -3,6 +3,10 @@ Fault handling ############## +.. contents:: + :local: + :depth: 2 + .. caution:: The High-Performance Framework (HPF) support in the |NCS| is :ref:`experimental ` and is limited to the nRF54L15 device. diff --git a/doc/nrf/app_dev/device_guides/nrf54h/ug_nrf54h20_architecture_clockman.rst b/doc/nrf/app_dev/device_guides/nrf54h/ug_nrf54h20_architecture_clockman.rst index c757168aa1f9..4499656ec538 100644 --- a/doc/nrf/app_dev/device_guides/nrf54h/ug_nrf54h20_architecture_clockman.rst +++ b/doc/nrf/app_dev/device_guides/nrf54h/ug_nrf54h20_architecture_clockman.rst @@ -99,7 +99,7 @@ These clocks are fixed frequency, and are by default optimized for low power at The firmware can request a minimum level of accuracy and precision using the ``nrf_clock_control`` API provided by Zephyr RTOS, if the default configuration does not meet the required timing specifications. The startup time of these clocks can be relatively long, typically on the order of hundreds of milliseconds. -To ensure that the clocks meet the required timing constraints, retrieve the startup time for a given accuracy and precision using ``nrf_clock_control_get_startup_time``. +To ensure that the clocks meet the required timing constraints, retrieve the startup time for a given accuracy and precision using ``nrf_clock_control_get_startup_time()``. For more information, see the `Zephyr clock control API`_ section. Global HSFLL @@ -130,6 +130,8 @@ Furthermore, the ISR handling latency will be increased. If the local HSFLL is managed at runtime, the clock control driver will force it to its lowest frequency. The firmware must request a higher frequency using the ``nrf_clock_control`` API. +.. _ug_nrf54h20_zephyr_clock_control: + Zephyr clock control API ************************ diff --git a/doc/nrf/app_dev/device_guides/nrf54h/ug_nrf54h20_architecture_pinmap.rst b/doc/nrf/app_dev/device_guides/nrf54h/ug_nrf54h20_architecture_pinmap.rst index 2e4939891fbd..e3385d64a562 100644 --- a/doc/nrf/app_dev/device_guides/nrf54h/ug_nrf54h20_architecture_pinmap.rst +++ b/doc/nrf/app_dev/device_guides/nrf54h/ug_nrf54h20_architecture_pinmap.rst @@ -14,13 +14,13 @@ This comes at the cost of additional management by the firmware, thus additional The following sections describe how pins are powered, which domains they are in, and how to map and handle them. Pin groups ----------- +********** A pin group is a group of pins designated by an index, like P0.x, where P0 is the group containing [P0.0, P0.1, ...]. The pin group P0 is distinct from the GPIO controller with the same instance of P0. The P0 peripheral is routed to pins in the pin group P0, but is not necessarily in the same domain as the pin group P0. -The following table shows which domains the pin groups belong to. +The following table shows which domains the pin groups belong to: .. list-table:: Pin group domains :header-rows: 1 @@ -48,14 +48,13 @@ This power is provided by the domain where the pin and the multiplexers are. If a pin is configured as an output, the output value will be retained even when the power domain is suspended. Peripheral domains ------------------- +****************** Peripherals with an instance ending in 120, like UARTE120, PWM120, SPIS120, are in the FAST_ACTIVE_1 domain. The rest are in the SLOW_MAIN and SLOW_ACTIVE domains. Pin group power management --------------------------- - +************************** If a pin and the peripheral it is routed to are in the same domain, the peripheral forces the domain on when in use, thus powering the pin and the required multiplexers, as well. If a pin and the peripheral it is routed to are in different domains, the peripheral can only force on its own domain, not the domain the pin is in. diff --git a/doc/nrf/app_dev/device_guides/nrf54h/ug_nrf54h20_ironside.rst b/doc/nrf/app_dev/device_guides/nrf54h/ug_nrf54h20_ironside.rst index 147e358a36e3..29ec6b2feebc 100644 --- a/doc/nrf/app_dev/device_guides/nrf54h/ug_nrf54h20_ironside.rst +++ b/doc/nrf/app_dev/device_guides/nrf54h/ug_nrf54h20_ironside.rst @@ -381,6 +381,8 @@ It is divided into a 16-bit major version and a 16-bit minor version. This versioning scheme allows IronSide to support multiple UICR formats, enabling updates to the format without breaking compatibility with existing configurations. +.. _ug_nrf54h20_ironside_se_uicr_lock: + UICR.LOCK ========= @@ -705,7 +707,7 @@ UICR.SECURESTORAGE :kconfig:option:`CONFIG_GEN_UICR_SECURESTORAGE` enables the secure storage system used by |ISE| for persistent storage of cryptographic keys and trusted data. The secure storage is divided into separate partitions for different services and processor domains. -The total size of all configurations specified in ``UICR.SECURESTORAGE.*`` must be aligned to a 4 KB boundary. +The total size of all configurations specified in UICR.SECURESTORAGE.\* must be aligned to a 4 KB boundary. For more information, see :ref:`ug_nrf54h20_ironside_se_secure_storage`. The UICR.SECURESTORAGE configuration consists of the following sub-registers: @@ -735,58 +737,6 @@ UICR.SECURESTORAGE.ITS UICR.SECURESTORAGE.ITS.RADIOCORESIZE1KB Sets the size of the ``RADIOCORE`` domain partition for ITS, specified in 1 kiB blocks. -UICR.SECONDARY -============== - -:kconfig:option:`CONFIG_GEN_UICR_SECONDARY` configures the secondary firmware boot system, which allows |ISE| to boot alternative firmware in response to specific conditions or triggers. -This feature enables a recovery firmware setup through a dual-firmware configuration that includes both main and recovery firmware. - -The UICR.SECONDARY configuration consists of multiple sub-registers organized into functional groups: - -UICR.SECONDARY.ENABLE - Controls whether the secondary firmware boot feature is enabled. - -UICR.SECONDARY.PROCESSOR - Specifies which processor should be used to boot the secondary firmware. - Valid values are: - - * ``APPLICATION`` - Boot secondary firmware on the application domain CPU. - * ``RADIOCORE`` - Boot secondary firmware on the radio core CPU. - -UICR.SECONDARY.ADDRESS - Sets the start address of the secondary firmware. - This value is used as the initial value of the secure Vector Table Offset Register (VTOR) after CPU reset. - The address must be aligned to a 4 KiB boundary. - Bits [11:0] are ignored. - -UICR.SECONDARY.TRIGGER - Configures automatic triggers that cause |ISE| to boot the secondary firmware instead of the primary firmware. - - UICR.SECONDARY.TRIGGER.ENABLE - Controls whether automatic triggers are enabled to boot the secondary firmware. - - UICR.SECONDARY.TRIGGER.RESETREAS - Specifies which reset reasons will trigger an automatic boot into the secondary firmware. - Multiple triggers can be enabled simultaneously by setting the corresponding bits: - - * ``APPLICATIONWDT0`` - Application domain watchdog 0 reset - * ``APPLICATIONWDT1`` - Application domain watchdog 1 reset - * ``APPLICATIONLOCKUP`` - Application domain CPU lockup reset - * ``RADIOCOREWDT0`` - Radio core watchdog 0 reset - * ``RADIOCOREWDT1`` - Radio core watchdog 1 reset - * ``RADIOCORELOCKUP`` - Radio core CPU lockup reset - -UICR.SECONDARY.PROTECTEDMEM - Identical to :kconfig:option:`CONFIG_GEN_UICR_PROTECTEDMEM`, but applies to the secondary firmware. - -UICR.SECONDARY.WDTSTART - Identical to :kconfig:option:`CONFIG_GEN_UICR_WDTSTART`, but applies to the secondary firmware boot process. - Note that if RADIOCORE is specified in ``UICR.SECONDARY.PROCESSOR``, the WDT instances used are the ones in the radio core. - -UICR.SECONDARY.PERIPHCONF - Identical to UICR.PERIPHCONF, but applies to the secondary firmware boot process. - - .. _ug_nrf54h20_ironside_se_debug: Debugging @@ -821,10 +771,10 @@ For information on how to configure these UICR settings, see :ref:`ug_nrf54h20_i .. _ug_nrf54h20_ironside_se_boot_report: -IronSide boot report -******************** +|ISE| boot report +***************** -The IronSide boot report contains device state information communicated from |ISE| to the local domains. +The |ISE| boot report contains device state information communicated from |ISE| to the local domains. It is written to a reserved region in RAM20, which is accessible to the local domain in the default system configuration. There is one boot report per processor that is booted, either directly by |ISE| or via the CPUCONF service. @@ -953,9 +903,9 @@ To enable secondary firmware support, you must complete the following steps: CONFIG_GEN_UICR_SECONDARY=y -2. Create a separate Zephyr application for your secondary firmware (for example in a :file:`secondary/` directory). +#. Create a separate Zephyr application for your secondary firmware (for example in a :file:`secondary/` directory). -3. Include the secondary image as an external project in :file:`sysbuild.cmake`: +#. Include this Zephyr application as an external project in :file:`sysbuild.cmake`: .. code-block:: cmake @@ -964,14 +914,27 @@ To enable secondary firmware support, you must complete the following steps: SOURCE_DIR ${APP_DIR}/secondary ) -4. **Configure secondary firmware**: The secondary firmware image itself must enable the appropriate Kconfig option to indicate it is a secondary firmware. +#. *Configure secondary firmware Kconfig*: The secondary firmware image itself must enable the appropriate Kconfig option to indicate it is a secondary firmware. Add the following to your secondary firmware's :file:`prj.conf`: .. code-block:: kconfig CONFIG_IS_IRONSIDE_SE_SECONDARY_IMAGE=y -5. **Optional: Configure automatic triggers**: If you want automatic triggering based on reset reasons, add trigger options to your :file:`sysbuild/uicr.conf`: +#. *Configure secondary firmware placement*: The secondary firmware image must be placed in the DT partition named ``secondary_partition``. + Add the following to your secondary firmware's :file:`app.overlay`: + + .. code-block:: devicetree + + / { + chosen { + zephyr,code-partition = &secondary_partition; + }; + }; + +#. *Optional: Configure secondary firmware features*: Additional features can be configured by adding more options to your :file:`sysbuild/uicr.conf`: + + For instance, if you want automatic triggering based on reset reasons, add trigger options: .. code-block:: kconfig @@ -993,10 +956,28 @@ Setting bit 5 in ``CTRLAP.BOOTMODE`` will also trigger secondary firmware. |ISE| automatically triggers the secondary firmware in any of the following situations: * The integrity check of the memory specified in :kconfig:option:`CONFIG_GEN_UICR_PROTECTEDMEM` fails. -* Any boot failure occurs, such as missing primary firmware or failure to apply ``UICR.PERIPHCONF`` configurations. -* A local domain is reset with a reason configured to trigger the secondary firmware. -* If one of the triggers configured in :kconfig:option:`CONFIG_GEN_UICR_SECONDARY_TRIGGER` and related options occurs. +* Any boot failure occurs, such as missing primary firmware or failure to apply UICR.PERIPHCONF configurations. +* If :kconfig:option:`CONFIG_GEN_UICR_SECONDARY_TRIGGER` is enabled, and a UICR-configurable trigger occurs. + See the following table for UICR-configurable triggers. +.. list-table:: Secondary firmware trigger Kconfig options + :header-rows: 1 + :widths: auto + + * - Kconfig option + - Description + * - :kconfig:option:`CONFIG_GEN_UICR_SECONDARY_TRIGGER_APPLICATIONWDT0` + - Trigger on Application domain watchdog 0 reset + * - :kconfig:option:`CONFIG_GEN_UICR_SECONDARY_TRIGGER_APPLICATIONWDT1` + - Trigger on Application domain watchdog 1 reset + * - :kconfig:option:`CONFIG_GEN_UICR_SECONDARY_TRIGGER_APPLICATIONLOCKUP` + - Trigger on Application domain CPU lockup reset + * - :kconfig:option:`CONFIG_GEN_UICR_SECONDARY_TRIGGER_RADIOCOREWDT0` + - Trigger on Radio core watchdog 0 reset + * - :kconfig:option:`CONFIG_GEN_UICR_SECONDARY_TRIGGER_RADIOCOREWDT1` + - Trigger on Radio core watchdog 1 reset + * - :kconfig:option:`CONFIG_GEN_UICR_SECONDARY_TRIGGER_RADIOCORELOCKUP` + - Trigger on Radio core CPU lockup reset Protection ========== @@ -1014,7 +995,17 @@ As with the primary firmware, |ISE| does not facilitate updating the secondary f The secondary image can be updated by other components as long as :kconfig:option:`CONFIG_GEN_UICR_SECONDARY_PROTECTEDMEM` is not set. Using the secondary firmware as a bootloader capable of validating and updating a second image enables updating firmware in the secondary boot flow while having secure boot enabled through :kconfig:option:`CONFIG_GEN_UICR_SECONDARY_PROTECTEDMEM`. +Secondary processor +=================== +By default, the secondary firmware uses the application processor. +The radio core can be used instead by enabling the :kconfig:option:`CONFIG_GEN_UICR_SECONDARY_PROCESSOR_RADIOCORE` option. + +Changing the secondary firmware location +======================================== + +You can customize the location of the secondary firmware by modifying the ``secondary_partition`` DT partition in both the UICR image and the secondary firmware image. +This is typically done by editing the relevant devicetree source files (such as ``nrf54h20dk_nrf54h20_common.dts`` or board-specific overlay files) in your application and UICR image projects. .. _ug_nrf54h20_ironside_se_cpuconf_service: @@ -1078,21 +1069,21 @@ To leverage this secure storage functionality, applications must set the key loc The secure storage configuration includes two separate storage regions: -* **UICR.SECURESTORAGE.CRYPTO** - Used for PSA Crypto API operations when storing cryptographic keys -* **UICR.SECURESTORAGE.ITS** - Used for PSA Internal Trusted Storage (ITS) API operations when storing general secure data +* UICR.SECURESTORAGE.CRYPTO - Used for PSA Crypto API operations when storing cryptographic keys +* UICR.SECURESTORAGE.ITS - Used for PSA Internal Trusted Storage (ITS) API operations when storing general secure data Secure Storage through PSA Crypto API ===================================== -When using the PSA Crypto API to operate on keys, the storage region specified by ``UICR.SECURESTORAGE.CRYPTO`` is automatically used if the key attributes are configured with **key location** set to ``PSA_KEY_LOCATION_LOCAL_STORAGE``. +When using the PSA Crypto API to operate on keys, the storage region specified by UICR.SECURESTORAGE.CRYPTO is automatically used if the key attributes are configured with ``key location`` set to ``PSA_KEY_LOCATION_LOCAL_STORAGE``. This ensures that cryptographic keys are stored in the dedicated secure storage region rather than in regular application memory. Secure storage through PSA ITS API ================================== -When using the PSA ITS API for storing general secure data, the storage region specified by ``UICR.SECURESTORAGE.ITS`` is used automatically. +When using the PSA ITS API for storing general secure data, the storage region specified by UICR.SECURESTORAGE.ITS is used automatically. No special configuration is required for PSA ITS operations, as they inherently use the secure storage when available. Security Properties @@ -1103,16 +1094,16 @@ The secure storage provided by |ISE| has the following security characteristics: Access Control -------------- -* **Domain Isolation**: Secure storage regions are not accessible by local domains directly. -* **Ironside Exclusive Access**: Only the Ironside Secure Element can access the secure storage regions. -* **Domain Separation**: Each local domain can only access its own secure storage data, ensuring isolation between different domains. +* *Domain Isolation*: Secure storage regions are not accessible by local domains directly. +* *Ironside Exclusive Access*: Only the |ISE| can access the secure storage regions. +* *Domain Separation*: Each local domain can only access its own secure storage data, ensuring isolation between different domains. Data Protection --------------- -* **Encryption**: All data stored in the secure storage regions is encrypted using device-unique keys. -* **Integrity**: The stored data is protected against tampering through cryptographic integrity checks. -* **Confidentiality**: The encryption ensures that stored data remains confidential even if the storage medium is physically accessed. +* *Encryption*: All data stored in the secure storage regions is encrypted using device-unique keys. +* *Integrity*: The stored data is protected against tampering through cryptographic integrity checks. +* *Confidentiality*: The encryption ensures that stored data remains confidential even if the storage medium is physically accessed. .. note:: The device-unique encryption keys are managed entirely by |ISE| and are not accessible to application code. @@ -1123,7 +1114,7 @@ Configuration Considerations When configuring secure storage, consider the following: -* Ensure sufficient storage space is allocated in both ``UICR.SECURESTORAGE.CRYPTO`` and ``UICR.SECURESTORAGE.ITS`` regions based on your application's requirements +* Ensure sufficient storage space is allocated in both UICR.SECURESTORAGE.CRYPTO and UICR.SECURESTORAGE.ITS regions based on your application's requirements * The sum of these two regions must be 4kB aligned. * The secure storage regions should be properly sized to accommodate the expected number of keys and data items * Access to secure storage is only available when the key location is explicitly set to ``PSA_KEY_LOCATION_LOCAL_STORAGE`` @@ -1137,11 +1128,11 @@ CTRLAP.BOOTMODE register format The format of the CTRLAP.MAILBOX.BOOTMODE register is described in the following table. -+------------------+--------+------------------+-----+----------------+--------+------------+ -| Bit numbers | 31-8 | 7 | 6-5 | 4 | 3-1 | 0 | -+------------------+--------+------------------+-----+----------------+--------+------------+ -| Field | N/A | Reserved | RFU | SAFEMODE (ROM) | OPCODE | MODE (ROM) | -+------------------+--------+------------------+-----+----------------+--------+------------+ ++------------------+--------+------------+-----+----------------+----------------+--------+------------+ +| Bit numbers | 31-8 | 7 | 6 | 5 | 4 | 3-1 | 0 | ++------------------+--------+------------+-----+----------------+----------------+--------+------------+ +| Field | N/A | DEBUGWAIT | RFU | SECONDARYMODE | SAFEMODE (ROM) | OPCODE | MODE (ROM) | ++------------------+--------+------------+-----+----------------+----------------+--------+------------+ .. _ug_nrf54h20_ironside_se_bootstatus_register_format: @@ -1161,11 +1152,11 @@ The BOOTSTAGE field indicates which component in the boot sequence encountered a If ``BOOTSTAGE`` is set to ``0xC`` or ``0xD``, the register has the following format: -+------------------+-------+-----------+-------+-----------+-----------+-----------+-----+-------------+ -| Bit numbers | 31-28 | 27-24 | 23-22 | 21-15 | 14-12 | 11-9 | 8 | 7-0 | -+------------------+-------+-----------+-------+-----------+-----------+-----------+-----+-------------+ -| Field | RFU | BOOTSTAGE | RFU | FWVERSION | CMDOPCODE | CMDERROR | RFU | BOOTERROR | -+------------------+-------+-----------+-------+-----------+-----------+-----------+-----+-------------+ ++------------------+-------+-----------+-------+-----------+-----------+-----------+----------------+-------------+ +| Bit numbers | 31-28 | 27-24 | 23-22 | 21-15 | 14-12 | 11-9 | 8 | 7-0 | ++------------------+-------+-----------+-------+-----------+-----------+-----------+----------------+-------------+ +| Field | RFU | BOOTSTAGE | RFU | FWVERSION | CMDOPCODE | CMDERROR | SECONDARYMODE | BOOTERROR | ++------------------+-------+-----------+-------+-----------+-----------+-----------+----------------+-------------+ This field can have one of the following values: @@ -1186,10 +1177,11 @@ This field can have one of the following values: +--------------------+--------------------------------------------------------------+ .. note:: - The value ``0xB`` indicates a boot status error reported by the Secure Domain running a version earlier than version 20. + The value ``0xB`` indicates a boot status error reported by the Secure Domain running a firmware version earlier than 20. + See :ref:`abi_compatibility` for more information. The register is written by |ISE| at the end of every cold boot sequence. -A value of 0 indicates that |ISE| did not complete the boot process. +A value of ``0`` indicates that |ISE| did not complete the boot process. The following fields are reported by |ISE|: @@ -1200,20 +1192,24 @@ FWVERSION CMDOPCODE The opcode of the boot command issued to |ISE| in the CTRLAP.MAILBOX.BOOTMODE register. - A value of 0 indicates that no boot command has been issued. + A value of ``0`` indicates that no boot command has been issued. CMDERROR A code indicating the execution status of the boot command specified in CMDOPCODE: - * A status value of 0 indicates that the command was executed successfully. + * A status value of ``0`` indicates that the command was executed successfully. * A non-zero value indicates that an error condition occurred during execution of the command. - The error code 0x7 means that an unexpected condition happened that might have prevented the command from executing. + The error code ``0x7`` means that an unexpected condition happened that might have prevented the command from executing. Other error codes must be interpreted based on the boot command in CMDOPCODE. +SECONDARYMODE + Indicates whether the secondary firmware was booted. + A value of ``1`` indicates that the secondary firmware was booted, while a value of ``0`` indicates that the primary firmware was booted. + BOOTERROR A code indicating the status of the application domain boot sequence: - * A status value of 0 indicates that the CPU was started normally. + * A status value of ``0`` indicates that the CPU was started normally. * A non-zero value indicates that an error condition occurred, preventing the CPU from starting. Detailed information about the issue can be found in the boot report. @@ -1267,6 +1263,8 @@ See the following table for a summary of the available boot commands: The following chapters describe each command in detail. +.. _ug_nrf54h20_ironside_se_eraseall_command: + ``ERASEALL`` command ==================== @@ -1298,3 +1296,128 @@ This prevents the CPU from executing any instructions until the CPUWAIT register Use this command to begin debugging at the very first instruction or to program flash memory safely without concurrent CPU access. The ``DEBUGWAIT`` command does not define any command-specific values for the CTRLAP.BOOTSTATUS.CMDERROR field. + +.. _ug_nrf54h20_ironside_se_spu_mramc_feature_configuration: + +|ISE| SPU MRAMC feature configuration +************************************* + +|ISE| configures the SPU.FEATURES.MRAMC registers with default settings for both MRAMC110 and MRAMC111. +Local domains have access to the READY/READYNEXT status registers for monitoring the status of the MRAM controller. +All other MRAMC features (like WAITSTATES and AUTODPOWERDOWN) are managed by |ISE|, with all configurations locked at boot time. + +.. _ug_nrf54h20_ironside_se_counter_service: + +|ISE| Counter service +********************* + +The |ISE| Counter service provides secure monotonic counters for rollback protection, version tracking, and other security-critical applications that require strictly increasing values. + +The header file for this service is :file:`sdk-zephyr/soc/nordic/ironside/include/nrf_ironside/counter.h`. + +It provides four independent 32-bit monotonic counters (``IRONSIDE_COUNTER_0`` through ``IRONSIDE_COUNTER_3``). +Each counter can only be set to a value greater than or equal to its current value, which ensures that counter values never decrease. + +The counters have the following properties: + +.. list-table:: + :header-rows: 1 + + * - Property + - Description + * - Monotonic + - Counter values can only increase or stay the same; they cannot decrease. + * - Persistent + - Counter values are stored in secure storage and survive reboots. + * - Per-boot locking + - Counters can be locked for the current boot session to prevent further modifications. + * - Automatic initialization + - Counters are initialized to 0 during the first boot with an unlocked UICR. + +Operations +========== + +The Counter service provides three primary operations applicable to the counters: ``set``, ``get``, and ``lock``. + +Set +--- + +The ``ironside_counter_set()`` function sets a counter to a specified value. +The new value must be greater than or equal to the current counter value. + +The function takes the following parameters: + +* ``counter_id`` - Counter identifier (``IRONSIDE_COUNTER_0`` through ``IRONSIDE_COUNTER_3``). +* ``value`` - New counter value. + It must be greater than or equal to the current value. + +The function returns the following values: + +* ``0`` on success. +* ``-IRONSIDE_COUNTER_ERROR_INVALID_ID`` if the counter ID is invalid. +* ``-IRONSIDE_COUNTER_ERROR_TOO_LOW`` if the specified value is lower than the current value. +* ``-IRONSIDE_COUNTER_ERROR_LOCKED`` if the counter is locked for this boot session. +* ``-IRONSIDE_COUNTER_ERROR_STORAGE_FAILURE`` if the storage operation failed. + +Get +--- + +The ``ironside_counter_get()`` function retrieves the current value of a counter. + +The function takes the following parameters: + +* ``counter_id`` - Counter identifier (``IRONSIDE_COUNTER_0`` through ``IRONSIDE_COUNTER_3``). +* ``value`` - Pointer to store the retrieved counter value. + +The function returns the following values: + +* ``0`` on success. +* ``-IRONSIDE_COUNTER_ERROR_INVALID_ID`` if the counter ID is invalid. +* ``-IRONSIDE_COUNTER_ERROR_STORAGE_FAILURE`` if the storage operation failed or the counter is not initialized. + +Lock +---- + +The ``ironside_counter_lock()`` function locks a counter for the current boot session, which prevents any further modifications until the next reboot. +Lock states are non-persistent and are cleared on reboot. + +The function takes the following parameter: + +* ``counter_id`` - Counter identifier (``IRONSIDE_COUNTER_0`` through ``IRONSIDE_COUNTER_3``). + +The function returns the following values: + +* ``0`` on success. +* ``-IRONSIDE_COUNTER_ERROR_INVALID_ID`` if the counter ID is invalid. + +Usage +===== + +The Counter service is typically used for the following purposes: + +* *Firmware version tracking* - Store the current firmware version and prevent rollback to older versions. +* *Anti-rollback protection* - Ensure that security-critical updates cannot be reverted. +* *Nonce generation* - Generate unique, strictly increasing values for cryptographic operations. + +The following example demonstrates how to use the Counter service to track firmware versions and prevent rollback: + +.. code-block:: c + + #include + + /* Read the current firmware version counter */ + uint32_t current_version; + int err = ironside_counter_get(IRONSIDE_COUNTER_0, ¤t_version); + if (err != 0) { + /* Handle error */ + } + + /* Update to the new firmware version */ + uint32_t new_version = 42; + err = ironside_counter_set(IRONSIDE_COUNTER_0, new_version); + if (err == -IRONSIDE_COUNTER_ERROR_TOO_LOW) { + /* Firmware rollback detected - reject update */ + } + + /* Lock the counter to prevent tampering during this boot session */ + ironside_counter_lock(IRONSIDE_COUNTER_0); diff --git a/doc/nrf/app_dev/device_guides/nrf54h/ug_nrf54h20_keys.rst b/doc/nrf/app_dev/device_guides/nrf54h/ug_nrf54h20_keys.rst index c5c41bfdab85..8da52a0c722e 100644 --- a/doc/nrf/app_dev/device_guides/nrf54h/ug_nrf54h20_keys.rst +++ b/doc/nrf/app_dev/device_guides/nrf54h/ug_nrf54h20_keys.rst @@ -7,82 +7,77 @@ Provisioning keys on the nRF54H20 SoC :local: :depth: 2 -This guide describes how to generate and provision cryptographic public keys on an nRF54H20 SoC in the Root of Trust (RoT) lifecycle state. -It is intended for developers defining manifest signing keys for the application core, radio core, and OEM root. -A successful provisioning makes the keys available to Secure Domain Firmware through PSA Crypto key identifiers. +This guide describes how to provision pre-generated cryptographic keys on an nRF54H20 SoC. +It is intended for developers who wish to create a predefined set of keys for their application, made available through PSA Crypto key identifiers. Prerequisites ============= -To follow this guide, your nRF54H20 device must meet the following requirement: +To follow this guide, your nRF54H20 device must meet the following requirements: * On the nRF54H20 DK, you must :ref:`provision ` the DK as described in the :ref:`ug_nrf54h20_gs` page. * On a custom nRF54H20-based device, you must :ref:`configure, generate, and program the BICR ` as described in the :ref:`ug_nrf54h20_custom_pcb` page. -* You must configure :ref:`ug_nrf54h20_ironside_uicr_securestorage` in your |ISE| UICR configuration. Overview ======== -The keys provisioning workflow for the nRF54H20 SoC consists of two main steps: +The keys provisioning workflow for the nRF54H20 SoC consists of three main steps: -1. Generating the required metadata using a script provided with the |NCS|. +1. Choosing key identifiers based on the desired properties for each key. +#. Generating the required metadata using a script provided with the |NCS|. #. Provisioning the keys to the nRF54H20 SoC. -.. note:: - The nRF54H20 SoC must be in RoT lifecycle state for key provisioning to work. - For more details on lifecycle states, see :ref:`ug_nrf54h20_architecture_lifecycle`. +.. rst-class:: numbered-step -.. _ug_nrf54h20_keys_generating: +Choosing a key ID +================= + +Key provisioning is supported by the |ISE| firmware through the :ref:`ug_crypto_architecture_implementation_standards_ironside` of the PSA Crypto API. +|ISE| defines two categories of keys that can be provisioned: standard *user keys* and non-standard *revocable keys*. +These categories are tied to distinct key ID ranges. -Generating the keys -=================== +User keys +--------- -A script is used to generate the necessary cryptographic keys, BLOBs, and metadata required for provisioning. -The script follows the PSA Crypto standard to generate the required 28-byte key. -It is located in the :file:`nrf/scripts/generate_psa_key_attributes.py` file. +These are the standard persistent keys conforming to the :ref:`supported version of the PSA Crypto API `: -To generate the keys, follow these steps: +* Minimum ID: ``0x00000001`` (``PSA_KEY_ID_USER_MIN``) +* Maximum ID: ``0x3FFFFFFF`` (``PSA_KEY_ID_USER_MAX``) -1. Generate private keys using Ed25519:: +In order to successfully provision user keys, you must first configure cryptographic partitions in your :ref:`ug_nrf54h20_ironside_uicr_securestorage` configuration. - openssl genpkey -algorithm Ed25519 -out MANIFEST_APPLICATION_GEN1_priv.pem - openssl genpkey -algorithm Ed25519 -out MANIFEST_RADIOCORE_GEN1_priv.pem - openssl genpkey -algorithm Ed25519 -out MANIFEST_OEM_ROOT_GEN1_priv.pem +Revocable keys +-------------- -#. Extract public keys:: +These are an extension of user keys with special properties for secure provisioning during device manufacturing: - openssl pkey -in MANIFEST_APPLICATION_GEN1_priv.pem -pubout -out MANIFEST_APPLICATION_GEN1_pub.pem - openssl pkey -in MANIFEST_RADIOCORE_GEN1_priv.pem -pubout -out MANIFEST_RADIOCORE_GEN1_pub.pem - openssl pkey -in MANIFEST_OEM_ROOT_GEN1_priv.pem -pubout -out MANIFEST_OEM_ROOT_GEN1_pub.pem +* Minimum ID: ``0x40002000`` +* Maximum ID: ``0x4FFFFFFF`` -#. Check the required key IDs:: +Revocable keys can only be provisioned as long as the :ref:`ug_nrf54h20_ironside_se_uicr_lock` configuration is disabled. +Once the UICR is locked, no more keys can be created in this range, which means that when a revocable key is destroyed, it cannot be replaced. - MANIFEST_PUBKEY_APPLICATION_GEN1 = 0x40022100 - MANIFEST_PUBKEY_APPLICATION_GEN2 = 0x40022101 - MANIFEST_PUBKEY_APPLICATION_GEN3 = 0x40022102 - MANIFEST_PUBKEY_OEM_ROOT_GEN1 = 0x4000AA00 - MANIFEST_PUBKEY_OEM_ROOT_GEN2 = 0x4000AA01 - MANIFEST_PUBKEY_OEM_ROOT_GEN3 = 0x4000AA02 - MANIFEST_PUBKEY_RADIOCORE_GEN1 = 0x40032100 - MANIFEST_PUBKEY_RADIOCORE_GEN2 = 0x40032101 - MANIFEST_PUBKEY_RADIOCORE_GEN3 = 0x40032102 +These keys are provisioned into |ISE|'s internal storage, not the location controlled by :ref:`ug_nrf54h20_ironside_uicr_securestorage`. -#. Create a JSON input file with the :ref:`generate_psa_key_attributes_script`: +.. _ug_nrf54h20_keys_generating: - * For the application core:: +.. rst-class:: numbered-step - python generate_psa_key_attributes.py --usage VERIFY --allow-usage-export --id 0x40022100 --type ECC_PUBLIC_KEY_TWISTED_EDWARDS --key-bits 255 --algorithm EDDSA_PURE --location LOCATION_CRACEN --key-from-file MANIFEST_APPLICATION_GEN1_pub.pem --file all_keys.json --cracen-usage RAW --persistence PERSISTENCE_DEFAULT +Generating key metadata +======================= - * For the radio core:: +The :ref:`generate_psa_key_attributes_script` is used to generate a JSON file containing the necessary cryptographic keys, BLOBs, and metadata required for provisioning. - python generate_psa_key_attributes.py --usage VERIFY --allow-usage-export --id 0x40032100 --type ECC_PUBLIC_KEY_TWISTED_EDWARDS --key-bits 255 --algorithm EDDSA_PURE --location LOCATION_CRACEN --key-from-file MANIFEST_RADIOCORE_GEN1_pub.pem --file all_keys.json --cracen-usage RAW --persistence PERSISTENCE_DEFAULT +Here is an example command to generate metadata for provisioning the public key part of an Ed25519 key, from a pre-existing PEM file, as a revocable key: - * For the main root manifest:: +.. parsed-literal:: + :class: highlight - python generate_psa_key_attributes.py --usage VERIFY --allow-usage-export --id 0x4000AA00 --type ECC_PUBLIC_KEY_TWISTED_EDWARDS --key-bits 255 --algorithm EDDSA_PURE --location LOCATION_CRACEN --key-from-file MANIFEST_OEM_ROOT_GEN1_pub.pem --file all_keys.json --cracen-usage RAW --persistence PERSISTENCE_DEFAULT + python generate_psa_key_attributes.py --usage VERIFY --id 0x40002000 --type ECC_PUBLIC_KEY_TWISTED_EDWARDS --key-bits 255 --algorithm EDDSA_PURE --location LOCATION_LOCAL_STORAGE --key-from-file public_key.pem --file all_keys.json --persistence PERSISTENCE_DEFAULT +The output file (named :file:`all_keys.json` in the previous example) serves as an input for the next step. -The generated key data is stored in a JSON file, which serves as an input for the next step. +.. rst-class:: numbered-step Provisioning the keys ===================== @@ -91,13 +86,17 @@ Provisioning the keys :start-after: nrfutil_provision_keys_info_start :end-before: nrfutil_provision_keys_info_end -The Secure Domain Firmware on the device handles the actual key provisioning using PSA Crypto's ``psa_import_key`` function. +The |ISE| firmware on the device handles the actual key provisioning using PSA Crypto's ``psa_import_key`` function. Provisioning a key calls the function to import the key: -* The ``metadata`` field from the JSON file is used for the function's attributes argument. -* The ``value`` field is passed to the function's data argument. -* The function's ``data_length`` is set to the length of the value field. +* The ``metadata`` field from the JSON file is used for the function's ``attributes`` argument. +* The ``value`` field is passed to the function's ``data`` argument. +* The length of the ``value`` field is passed to the function's ``data_length`` argument. .. include:: ../../../../../scripts/generate_psa_key_attributes/generate_psa_key_attributes.rst :start-after: nrfutil_provision_keys_command_start :end-before: nrfutil_provision_keys_command_end + +.. note:: + The :ref:`ug_nrf54h20_ironside_se_eraseall_command` destroys all keys stored on the device. + Whenever you execute this boot command, you have to provision your keys all over again. diff --git a/doc/nrf/app_dev/device_guides/nrf54h/ug_nrf54h20_mcuboot_dfu.rst b/doc/nrf/app_dev/device_guides/nrf54h/ug_nrf54h20_mcuboot_dfu.rst index ed4ba9373ca0..c3f2b2a58b01 100644 --- a/doc/nrf/app_dev/device_guides/nrf54h/ug_nrf54h20_mcuboot_dfu.rst +++ b/doc/nrf/app_dev/device_guides/nrf54h/ug_nrf54h20_mcuboot_dfu.rst @@ -104,7 +104,7 @@ For more information, see the :file:`samples/zephyr/subsys/mgmt/mcumgr/smp_svr` This sample demonstrates how to configure DFU feature in both MCUboot and user application in your project. It uses Simple Management Protocol for DFU and querying device information from the application. -The following build flavours are available: +The following build flavors are available: * ``sample.mcumgr.smp_svr.bt.nrf54h20dk`` - DFU over BLE using the default :ref:`ipc_radio` image and *Swap using move* MCUboot mode. * ``sample.mcumgr.smp_svr.bt.nrf54h20dk.direct_xip_withrevert`` - DFU over BLE using *Direct-XIP with revert* MCUboot mode. diff --git a/doc/nrf/app_dev/device_guides/nrf54h/ug_nrf54h20_pm_optimization.rst b/doc/nrf/app_dev/device_guides/nrf54h/ug_nrf54h20_pm_optimization.rst index 21930746dfb7..07ffceebd48e 100644 --- a/doc/nrf/app_dev/device_guides/nrf54h/ug_nrf54h20_pm_optimization.rst +++ b/doc/nrf/app_dev/device_guides/nrf54h/ug_nrf54h20_pm_optimization.rst @@ -64,6 +64,88 @@ The power management subsystem in a local domain is responsible for scheduling a The wake-up time scheduled in advance by the power management subsystem is combined with the advance time added by the software module. This approach ensures that the local domain and the software modules anticipating an event have sufficient time to fully restore before the event occurs, allowing the event to be handled without latency. +Logical domains, power domains, and locality +============================================ + +The nRF54H20 SoC groups hardware into logical domains and power domains. +The two domain types are defined as follows: + +Logical domain + A software-visible functional grouping that aggregates cores, memories, and peripherals behind a common isolation or security boundary (for example, application domain, radio domain, global domain). + +Power domain + A granular silicon region that can be clock- or power-gated independently. + Each physical silicon region has its own retention and leakage characteristics as well as voltage and frequency constraints (for example, high-speed instead of low-leakage subregions inside the application logical domain). + +A single logical domain can span multiple power domains. +A logical domain frequently contains a low-leakage power domain (cheap retention, low frequency) and one or more high-speed power domains (higher leakage, higher attainable frequency). +DVFS applies only to high-speed domains. + +Locality principle +------------------ + +Power optimization is driven by keeping execution and data access local: + +* Prefer executing code from local RAM (TCM/local SRAM) within the active core's logical domain. +* Minimize accesses to MRAM (global non-volatile memory) to avoid waking other domains and incurring cache refill energy. +* Batch work: Gather peripheral data locally (auxiliary cores) and hand off larger buffers to high-performance cores for computation, instead of driving peripherals directly from high-performance cores. + +Peripheral access strategy +-------------------------- + +High-performance cores (application, radio main CPUs) are optimized for computation, not low-latency I/O paths. +Accessing peripherals from these cores expands the active footprint by adding additional power domains and interconnected segments, increasing energy for each transaction. + +Recommendations: + +* Use auxiliary or peripheral-oriented cores (for example, PPR- or FLPR-type helper cores) to perform SPI, I2C, ADC, or UART transactions, local preprocessing, and DMA into local RAM. +* Signal (IPC or shared memory flag) the application or radio core only when a batch of data is ready. +* Avoid fine-grained peripheral polling from high-performance cores. + Use the following instead: + + * DMA transfers initiated by auxiliary cores. + * Hardware-trigger chains (PPI/DPPI) where possible to reduce wake-ups. + +* Keep high-speed power domains off unless necessary for bursts of compute. + +DMA locality constraints +------------------------ + +Local DMA controllers are restricted to source/destination addresses within their local RAM range. +Plan buffer placement accordingly: + +* Cross-domain transfers should use the following: + + * IPC messages indicating buffer readiness. + * Explicit software copy (only for infrequent cases). + +Local and global wake-up planning +--------------------------------- + +On local domain wake-ups (suspend-to-RAM/suspend-to-idle), schedule GRTC events early enough to cover the following latencies: + + * Core restore latency (cache, context). + * Software module restore latency (driver reconfiguration). + +Integration checklist +--------------------- + +For optimal power management integration, follow these guidelines: + +* Place time-critical ISR code and frequently used data structures in local RAM sections (see code/data relocation). +* Profile cache miss sources. + Reduce MRAM fetches by relocating hot code paths. +* Disable MRAM latency manager (set :kconfig:option:`CONFIG_MRAM_LATENCY` to ``n`` and :kconfig:option:`CONFIG_MRAM_LATENCY_AUTO_REQ` to ``n``) to allow MRAM power gating. + You can set :kconfig:option:`CONFIG_MRAM_LATENCY` to ``y`` to allow requesting low latency MRAM when needed. + However, avoid setting :kconfig:option:`CONFIG_MRAM_LATENCY_AUTO_REQ` to ``y``, as it causes MRAM to always remain in low latency/higher current mode. +* Ensure DVFS settings are evaluated across workloads. + Higher frequencies often yield best energy/operation for periodic burst tasks (quick wake, work, sleep), while lower or middle frequencies are better suited for long-running continuous workloads. +* Consolidate periodic tasks (sensor sample, radio tick) to a shared 1 ms or coarser schedule to avoid fragmented wake-ups. + +.. note:: + The exact wake-up source list can evolve with silicon revisions. + Always verify against the current SoC datasheet and release notes. + Optimization example ******************** @@ -127,8 +209,7 @@ Consider also the following recommendations: * Disable all unused peripherals before entering sleep (Zephyr's API does this automatically when supported). * Build and program an empty image on any unused core to release shared resources. - * If one or more specific sleep states are not desired, disable them in the devicetree by setting their status - to ``disabled``: + * If one or more specific sleep states are not desired, disable them in the devicetree by setting their status to ``disabled``: .. code-block:: dts @@ -186,10 +267,14 @@ The following recommendations help optimize memory placement and cache usage to For more information, see the :ref:`zephyr:code_data_relocation` page. * Profile L1 cache usage to minimize MRAM accesses. For more information, see ``nrf_cache_hal`` in the `nrfx API documentation`_. -* Ensure the MRAM latency manager is disabled: +* Configure the MRAM latency manager: + + * :kconfig:option:`CONFIG_MRAM_LATENCY`: - * :kconfig:option:`CONFIG_MRAM_LATENCY` set to ``n`` (default) allows MRAM to power off when idle. - * :kconfig:option:`CONFIG_MRAM_LATENCY_AUTO_REQ` disabled prevents automatic MRAM-on requests. + * ``n`` (default) allows MRAM to power off when idle. + * ``y`` allows requesting low latency MRAM when needed. + + * :kconfig:option:`CONFIG_MRAM_LATENCY_AUTO_REQ` set to ``n`` prevents MRAM from always being in low latency/higher current mode. Peripheral and clock recommendations ==================================== @@ -208,7 +293,8 @@ DVFS on application core ------------------------ The application core supports Dynamic Voltage and Frequency Scaling (DVFS), offering three distinct frequency options. -While the lowest or middle frequencies typically provide the best power efficiency, it is recommended to test each setting to determine the optimal choice for your specific use case. +Higher frequencies typically provide the best power efficiency for periodic burst workloads (minimizing wake time to maximize sleep), while lower or middle frequencies are better suited for long-running continuous tasks where the CPU remains active. +It is recommended to test each setting to determine the optimal choice for your specific use case. Reduction of wake-ups --------------------- @@ -216,8 +302,8 @@ Reduction of wake-ups Waking up the radio core at a 1-ms interval consumes approximately 50 µA of average current. To minimize power consumption, design your application to avoid frequent wake-ups by synchronizing events, such as sensor sampling, or by using the PPI to trigger tasks without CPU intervention. -Single- vs dual-core considerations -=================================== +Single-core and dual-core considerations +======================================== When choosing between single-core and dual-core architectures (using either the application core, the radio core, or both), consider the following trade-offs: @@ -234,21 +320,63 @@ When choosing between single-core and dual-core architectures (using either the return 0; } -Deep-sleep policy -================= +Deep-sleep policy and latency optimization +========================================== -Some peripherals do not schedule an expected wake-up, which can cause Zephyr's power manager to enter and almost immediately exit a deep sleep state. -This consumes a lot of energy and incurs overhead from pre-sleep checks. -This issue often occurs when the system is awakened by an external source, such as an IPC signal from another core, where it is not possible to properly schedule an expected wake-up event. -Additionally, whenever the application attempts to enter a sleep state, the Zephyr subsystem performs numerous operations to determine whether to transition the SoC into a low-power mode. +Most peripherals do not schedule an expected wake-up event, which can cause Zephyr's power manager to enter and almost immediately exit a deep sleep state. +This consumes unnecessary energy due to the overhead of putting the SoC to sleep and waking it up again, where entering a lighter sleep state would have been more efficient. -The minimum sleep durations that justify entering a deep sleep state are the following: +The minimum sleep durations that justify entering a deep sleep state are defined in the devicetree: * Suspend-to-Idle: ≥ 1 ms * Suspend-to-RAM: ≥ 2 ms -To prevent the system from entering deep sleep prematurely, use policy locks. -By acquiring a policy lock, you can disable deep-sleep states when the application is expected to run again in a short period (for example, at a 1 kHz rate). +For sleep durations shorter than these thresholds, an idle sleep state is more efficient. + +.. code-block:: devicetree + + idle_cache_disabled: idle_cache_disabled { + compatible = "zephyr,power-state"; + power-state-name = "suspend-to-idle"; + substate-id = <2>; + min-residency-us = <1000>; + exit-latency-us = <7>; + }; + + s2ram: s2ram { + compatible = "zephyr,power-state"; + power-state-name = "suspend-to-ram"; + min-residency-us = <2000>; + exit-latency-us = <33>; + }; + +To prevent the system from entering a deep sleep state prematurely, the application must inform Zephyr when the next wake-up event is expected to occur. +The following sections describe different approaches for managing sleep states and latency. + +Scheduling expected wake-up events +---------------------------------- + +Using ``pm_policy_event_register()``, the application can define the exact time when the next wake-up event is expected to occur. +Zephyr uses this information, along with other registered events (including ``k_timer`` timeouts and when sleeping threads are expected to wake up), to prevent entering a sleep state that is too deep. +The ``min-residency-us`` values in the devicetree define the minimum sleep durations required to justify entering each sleep state. + +This approach provides optimal power management for all expected wake-up events, with no notable impact on latency since Zephyr takes the ``exit-latency-us`` wake-up latency into account when selecting a sleep state. + +However, unexpected wake-up events, such as a button press, will have unpredictable latency since the system may be in deep sleep when the event occurs. + +Ensuring consistent latency for unexpected events +------------------------------------------------- + +To ensure consistent latency for unexpected events, use the ``pm_policy_latency_request_add()`` API. +This allows the application to define the maximum acceptable latency at any given time, which corresponds to the ``exit-latency-us`` wake-up time from the power sleep state. + +For example, the application can request a maximum latency of 7 microseconds, which prevents the CPU from entering the ``s2ram`` state (with its 33 µs exit latency) in the previously mentioned devicetree example, regardless of when the next event is scheduled. + +Using policy locks +------------------ + +For simpler use cases, you can use policy locks to disable deep-sleep states when the application is expected to run again in a short period (for example, at a 1 kHz rate). +By acquiring a policy lock, you prevent the system from entering specific sleep states. This can save up to 0.5 mA. .. code-block:: c diff --git a/doc/nrf/app_dev/device_guides/nrf54l/building_nrf54l.rst b/doc/nrf/app_dev/device_guides/nrf54l/building_nrf54l.rst index 5febbef1314b..c2fc3ec89f4e 100644 --- a/doc/nrf/app_dev/device_guides/nrf54l/building_nrf54l.rst +++ b/doc/nrf/app_dev/device_guides/nrf54l/building_nrf54l.rst @@ -141,3 +141,16 @@ Depending on the selected method, complete the following steps: .. code-block:: console west flash + +.. _building_nrf54l_system_off_service: + +Enabling the System OFF service +******************************* + +When :ref:`building with Trusted Firmware-M `, you can build the nRF54L Series devices with the System OFF service enabled. + +The System OFF service is one of the :ref:`TF-M platform services ` specific to the |NCS|. + +.. include:: ../../../security/tfm/tfm_services.rst + :start-after: The System OFF service is one of the TF-M platform services specific to the |NCS|. + :end-before: .. _ug_tfm_services_its: diff --git a/doc/nrf/app_dev/device_guides/nrf54l/cryptography.rst b/doc/nrf/app_dev/device_guides/nrf54l/cryptography.rst index ecedbbcfaf31..b0b205bf5f33 100644 --- a/doc/nrf/app_dev/device_guides/nrf54l/cryptography.rst +++ b/doc/nrf/app_dev/device_guides/nrf54l/cryptography.rst @@ -287,7 +287,7 @@ For each key type, the table lists the supported algorithms and indicates which - No - Yes - Yes - * - ECC secp256r1 key pair (ECDSA and ECDH usage) [4]_ + * - ECC secp256r1 key pair (ECDSA and ECDH usage) - | ``key_type``: ``PSA_KEY_TYPE_ECC_KEY_PAIR(PSA_ECC_FAMILY_SECP_R1)`` | | ``key_bits``: 256 @@ -346,7 +346,6 @@ For each key type, the table lists the supported algorithms and indicates which .. [1] Store each key with only one algorithm to follow PSA Crypto best practices. .. [2] Keys with the Encrypted usage scheme (``CRACEN_KMU_KEY_USAGE_SCHEME_ENCRYPTED``) will require two additional KMU slots to store the nonce and the authentication tag. .. [3] 192-bit key size is not supported on nRF54LM20A. -.. [4] ECDH not supported for key derivation. .. _ug_nrf54l_crypto_kmu_storing_keys: diff --git a/doc/nrf/app_dev/device_guides/nrf54l/index.rst b/doc/nrf/app_dev/device_guides/nrf54l/index.rst index a96baae279b1..6afc6b572262 100644 --- a/doc/nrf/app_dev/device_guides/nrf54l/index.rst +++ b/doc/nrf/app_dev/device_guides/nrf54l/index.rst @@ -64,8 +64,12 @@ Refer to the following information for the list of supported development kits (D | ``nrf54lv10dk/nrf54lv10a/cpuapp/ns`` (:ref:`TF-M `) | ``nrf54lv10dk/nrf54lv10a/cpuflpr`` | ``nrf54lv10dk/nrf54lv10a/cpuflpr/xip`` - - *Documentation not yet available* - - *Product pages not yet available* + - | `Datasheet `_ + | `Quick Start app`_ + | `User Guide `_ + | `nRF54LV10 Compatibility Matrix`_ + - | `nRF54LV10 DK product page `_ + | `nRF54LV10 System-on-Chip (SoC) `_ For the full list of supported protocols, see the :ref:`software maturity documentation`. @@ -87,3 +91,4 @@ This self-paced course introduces the hardware architecture, functionality, capa dfu_config ecies_x25519.rst otp_map_nrf54l + pinmap diff --git a/doc/nrf/app_dev/device_guides/nrf54l/kmu_basics.rst b/doc/nrf/app_dev/device_guides/nrf54l/kmu_basics.rst index c14fee3b59ce..d18f6c15d08a 100644 --- a/doc/nrf/app_dev/device_guides/nrf54l/kmu_basics.rst +++ b/doc/nrf/app_dev/device_guides/nrf54l/kmu_basics.rst @@ -24,7 +24,7 @@ Key types ********* Different types of keys, such as revocable and locked keys, serve distinct purposes and have unique policies associated with their use and management. -In the PSA abstraction, key types are mapped by the ``psa_set_key_lifetime`` function. +In the PSA abstraction, key types are mapped by the ``psa_set_key_lifetime()`` function. Refer to :ref:`PSA Key programming model` for details. Revocable keys diff --git a/doc/nrf/app_dev/device_guides/nrf54l/pinmap.rst b/doc/nrf/app_dev/device_guides/nrf54l/pinmap.rst new file mode 100644 index 000000000000..4ea18f4c9b17 --- /dev/null +++ b/doc/nrf/app_dev/device_guides/nrf54l/pinmap.rst @@ -0,0 +1,49 @@ +.. _ug_nrf54l_pinmap: + +nRF54L pin mapping +################## + +.. contents:: + :local: + :depth: 2 + +The nRF54L Series SoCs manage power for peripherals and pins automatically when both are in the same domain. +The SoCs also support mapping pins across different domains, but this requires additional firmware management and periodic use of the Constant Latency sub-power mode. +As a result, this increases both latency and power consumption. + +Mapping pins across power-domains +********************************* + +The following sections explain how to map and manage pins within a single domain and across different domains. + +Understanding cross power-domain pin mapping +============================================ + +For information on possible pin assignments, refer to the *Pin assignments* chapter in the respective device’s datasheet. +The *Dedicated pins* and *Cross power-domain use* subsections document which pins can be connected across different domains. +See :ref:`ug_nrf54l` for a complete list of references. + +Managing cross power-domain pin mapping +======================================= + +To use a peripheral with pins mapped across different domains, you must enable the Constant Latency sub-power mode. +You can do this by setting the :kconfig:option:`CONFIG_NRF_SYS_EVENT` Kconfig option, and calling the :c:func:`nrf_sys_event_request_global_constlat` function in your application. + +See the following example: + +.. code-block:: c + + #include + + int main(void) + { + /* Request constlat. The API is reference counted. */ + nrf_sys_event_request_global_constlat(); + + /* Use peripherals which have pins mapped across power-domains */ + + /* Release constlat */ + nrf_sys_event_release_global_constlat(); + + return 0; + } diff --git a/doc/nrf/app_dev/device_guides/nrf70/features.rst b/doc/nrf/app_dev/device_guides/nrf70/features.rst index 2dcabe57ca39..5ed3e9efb053 100644 --- a/doc/nrf/app_dev/device_guides/nrf70/features.rst +++ b/doc/nrf/app_dev/device_guides/nrf70/features.rst @@ -39,22 +39,20 @@ Wi-Fi 6 aligns with IEEE 802.11ax and all earlier versions of the IEEE 802.11 su Currently, the nRF70 Series devices support the following modes: -* :ref:`Station (STA) `: Operates as a wireless client device. -* :ref:`Software-enabled Access Point (SoftAP or SAP) `: Operates as a virtual access point device. -* :ref:`Scan `: Operates as a scan-only device. +* :ref:`Wi-Fi mode `: For IEEE 802.11 protocol stack functionality. * :ref:`Radio test `: For PHY (Baseband and Radio) characterizations and calibrations. -* :ref:`Monitor `: Operates as an IEEE 802.11 wireless packet sniffer. +* :ref:`Offloaded raw transmission `: Allows the offloading of raw IEEE 802.11 frame transmission to the nRF Wi-Fi driver. -The nRF70 Series devices also support the following functionalities: +The nRF70 Series devices support the following functionalities in the Wi-Fi mode: +* :ref:`Station (STA) `: Operates as a wireless client device. +* :ref:`Software-enabled Access Point (SoftAP or SAP) `: Operates as a virtual access point device. +* :ref:`Scan `: Operates as a scan-only device. +* :ref:`Wi-Fi advanced security `: Allows the use of advanced security, certificate-based Wi-Fi security, and the Platform Security Architecture (PSA) security framework. +* :ref:`Wi-Fi Direct® (P2P) mode `: Allows the establishment of direct device-to-device connections without requiring a traditional access point. * :ref:`ug_nrf70_developing_raw_ieee_80211_packet_transmission`: Allows the injection of raw IEEE 802.11 frames in Station and Monitor modes. +* :ref:`Monitor `: Operates as an IEEE 802.11 wireless packet sniffer. * :ref:`Promiscuous reception `: Allows the reception of IEEE 802.11 packets from a connected BSSID when operating in Station mode. -* :ref:`Offloaded raw transmission `: Allows the offloading of raw IEEE 802.11 frame transmission to the nRF Wi-Fi driver. -* :ref:`Wi-Fi advanced security modes `: Allows the use of advanced security modes, certificate-based Wi-Fi security, and the Platform Security Architecture (PSA) security framework. - -Peer-to-peer support in the form of Wi-Fi Direct® will be available in the future. - -See the :ref:`ug_wifi` documentation for more information related to Wi-Fi modes of operation. .. _ug_nrf70_features_hostap: diff --git a/doc/nrf/app_dev/device_guides/nrf70/nrf7002eb2_dev_guide.rst b/doc/nrf/app_dev/device_guides/nrf70/nrf7002eb2_dev_guide.rst index 42d9a21181c7..5aed0a9bed03 100644 --- a/doc/nrf/app_dev/device_guides/nrf70/nrf7002eb2_dev_guide.rst +++ b/doc/nrf/app_dev/device_guides/nrf70/nrf7002eb2_dev_guide.rst @@ -31,7 +31,7 @@ The board can be mounted on the **P1** connector of the nRF54L15 DK and the **P1 +===================================+===================+===============================================+ | CLK (CLK) | P1.11 | SPI Clock | +-----------------------------------+-------------------+-----------------------------------------------+ - | CS (CS) | P1.10 | SPI Chip Select | + | CS (CS) | P1.10\ :sup:`1` | SPI Chip Select | +-----------------------------------+-------------------+-----------------------------------------------+ | MOSI (D0) | P1.06 | SPI MOSI | +-----------------------------------+-------------------+-----------------------------------------------+ @@ -50,6 +50,8 @@ The board can be mounted on the **P1** connector of the nRF54L15 DK and the **P1 | STATUS (ST0) | P1.08 | Coexistence status from nRF7002 | +-----------------------------------+-------------------+-----------------------------------------------+ + [1]: There is a pin conflict with **LED1** on **P1.10** (CS) on the nRF54L15 DK, use other LEDs for status indication. + .. group-tab:: nRF54LM20 DK +-----------------------------------+-------------------+-----------------------------------------------+ diff --git a/doc/nrf/app_dev/device_guides/nrf70/wifi_advanced_security_modes.rst b/doc/nrf/app_dev/device_guides/nrf70/wifi_advanced_security_modes.rst index 76b8719566de..1bc4968febee 100644 --- a/doc/nrf/app_dev/device_guides/nrf70/wifi_advanced_security_modes.rst +++ b/doc/nrf/app_dev/device_guides/nrf70/wifi_advanced_security_modes.rst @@ -228,3 +228,9 @@ Enable PSA support To enable the nRF70 PSA crypto support in your applications, use the :kconfig:option:`CONFIG_HOSTAP_CRYPTO_ALT_PSA` Kconfig option. The Wi-Fi connection process is similar to the non-PSA mode, however, the only difference is that the cryptographic operations are performed using PSA crypto APIs. + +WPA3-SAE support +---------------- + +To enable WPA3-SAE support in your applications, use the :kconfig:option:`CONFIG_HOSTAP_CRYPTO_WPA3_PSA` Kconfig option. +This is disabled by default. diff --git a/doc/nrf/app_dev/device_guides/nrf91/images/programmer_erasewrite_nrf9151dk.png b/doc/nrf/app_dev/device_guides/nrf91/images/programmer_erasewrite_nrf9151dk.png deleted file mode 100644 index 2be7fbec9ab2..000000000000 Binary files a/doc/nrf/app_dev/device_guides/nrf91/images/programmer_erasewrite_nrf9151dk.png and /dev/null differ diff --git a/doc/nrf/app_dev/device_guides/nrf91/images/programmer_erasewrite_nrf9160dk.png b/doc/nrf/app_dev/device_guides/nrf91/images/programmer_erasewrite_nrf9160dk.png deleted file mode 100644 index 77614caef387..000000000000 Binary files a/doc/nrf/app_dev/device_guides/nrf91/images/programmer_erasewrite_nrf9160dk.png and /dev/null differ diff --git a/doc/nrf/app_dev/device_guides/nrf91/images/programmer_hex_write_nrf9151.png b/doc/nrf/app_dev/device_guides/nrf91/images/programmer_hex_write_nrf9151.png deleted file mode 100644 index 6228b4c07f75..000000000000 Binary files a/doc/nrf/app_dev/device_guides/nrf91/images/programmer_hex_write_nrf9151.png and /dev/null differ diff --git a/doc/nrf/app_dev/device_guides/nrf91/images/programmer_select_device_nrf9151.png b/doc/nrf/app_dev/device_guides/nrf91/images/programmer_select_device_nrf9151.png deleted file mode 100644 index 5e7bbed56e0d..000000000000 Binary files a/doc/nrf/app_dev/device_guides/nrf91/images/programmer_select_device_nrf9151.png and /dev/null differ diff --git a/doc/nrf/app_dev/device_guides/nrf91/images/programmer_selectdevice_nrf9160.png b/doc/nrf/app_dev/device_guides/nrf91/images/programmer_selectdevice_nrf9160.png deleted file mode 100644 index d2b173cf50ab..000000000000 Binary files a/doc/nrf/app_dev/device_guides/nrf91/images/programmer_selectdevice_nrf9160.png and /dev/null differ diff --git a/doc/nrf/app_dev/device_guides/nrf91/images/programmer_write_nrf9160dk.png b/doc/nrf/app_dev/device_guides/nrf91/images/programmer_write_nrf9160dk.png deleted file mode 100644 index c78036e420ca..000000000000 Binary files a/doc/nrf/app_dev/device_guides/nrf91/images/programmer_write_nrf9160dk.png and /dev/null differ diff --git a/doc/nrf/app_dev/device_guides/nrf91/images/programmerapp_modemdfu.png b/doc/nrf/app_dev/device_guides/nrf91/images/programmerapp_modemdfu.png deleted file mode 100644 index 6ed6c124fc63..000000000000 Binary files a/doc/nrf/app_dev/device_guides/nrf91/images/programmerapp_modemdfu.png and /dev/null differ diff --git a/doc/nrf/app_dev/device_guides/nrf91/images/programmerapp_modemdfu_nrf9151.png b/doc/nrf/app_dev/device_guides/nrf91/images/programmerapp_modemdfu_nrf9151.png deleted file mode 100644 index 1c73217e0aad..000000000000 Binary files a/doc/nrf/app_dev/device_guides/nrf91/images/programmerapp_modemdfu_nrf9151.png and /dev/null differ diff --git a/doc/nrf/app_dev/device_guides/nrf91/nrf91_building.rst b/doc/nrf/app_dev/device_guides/nrf91/nrf91_building.rst index 7b82923b07b9..e2e4f808bbd5 100644 --- a/doc/nrf/app_dev/device_guides/nrf91/nrf91_building.rst +++ b/doc/nrf/app_dev/device_guides/nrf91/nrf91_building.rst @@ -52,8 +52,8 @@ To perform a FOTA update, complete the following steps: In its default configuration, the DFU target library is set to support all the types of FOTA updates except full modem firmware updates, but you can freely enable or disable the support for specific targets. In addition, the following requirements apply: - * To upgrade the application, you must use :doc:`mcuboot:index-ncs` as the upgradable bootloader (:kconfig:option:`CONFIG_BOOTLOADER_MCUBOOT` must be enabled). - * If you want to upgrade the upgradable bootloader, you must use the :ref:`bootloader` (:kconfig:option:`CONFIG_SECURE_BOOT` must be enabled). + * To upgrade the application, use :doc:`mcuboot:index-ncs` as the upgradable bootloader (:kconfig:option:`SB_CONFIG_BOOTLOADER_MCUBOOT` must be enabled). + * If you want to upgrade the upgradable bootloader, use the :ref:`bootloader` (:kconfig:option:`SB_CONFIG_SECURE_BOOT_APPCORE` must be enabled). * If you want to update the modem firmware through modem delta updates, you do not need to use MCUboot or the immutable bootloader, because the modem firmware update is handled by the modem itself. * If you want to perform a full modem firmware update, an |external_flash_size| is required. diff --git a/doc/nrf/app_dev/device_guides/nrf91/nrf91_dk_updating_fw_programmer.rst b/doc/nrf/app_dev/device_guides/nrf91/nrf91_dk_updating_fw_programmer.rst index 814c76ae4274..31814aa3be2d 100644 --- a/doc/nrf/app_dev/device_guides/nrf91/nrf91_dk_updating_fw_programmer.rst +++ b/doc/nrf/app_dev/device_guides/nrf91/nrf91_dk_updating_fw_programmer.rst @@ -9,214 +9,4 @@ Updating the DK firmware using Programmer :depth: 2 Updating the firmware for nRF91 Series devices involves several key steps to ensure the device operates with the latest features, improvements, and security updates. -Before you begin to update the firmware, download and extract the latest application and modem firmware from the `nRF9151 DK Downloads`_, `nRF9161 DK Downloads`_, or `nRF9160 DK Downloads`_ page, depending on the DK you are using. - -The downloaded ZIP archive contains the following firmware: - -Application firmware - The :file:`img_app_bl` folder contains full firmware images for different applications. - The guides in this section use the image for the :ref:`nrf_cloud_multi_service` sample as an example. - The nRF Cloud multi-service sample simulates sensor data and transmits it to Nordic Semiconductor's cloud solution, `nRF Cloud`_. - - The data is transmitted using either LTE-M or NB-IoT. - The nRF Cloud multi-service sample first attempts to use LTE-M, then NB-IoT. - Check with your SIM card provider for the mode they support at your location. - - .. tabs:: - - .. group-tab:: nRF9151 DK - - * For the Onomondo SIM card, check the `Onomondo LTE-M coverage`_ and `Onomondo NB-IoT coverage`_ to see if your country is supported. - - * For the Wireless Logic SIM card, check the `Wireless Logic LTE-M/NB-IoT network coverage`_ to see if your country is supported. - - .. group-tab:: nRF9161 DK - - For the Onomondo SIM card, check the `Onomondo LTE-M coverage`_ and `Onomondo NB-IoT coverage`_ to see the network coverage for different countries. - - .. group-tab:: nRF9160 DK - - For the iBasis SIM card provided with the nRF9160 DK, see `iBasis IoT network coverage`_. - -Application firmware for Device Firmware Update (DFU) - The images in the :file:`img_fota_dfu_bin` and :file:`img_fota_dfu_hex` folders contain firmware images for DFU. - These images are not used in the guides in this section. - -Modem firmware - The modem firmware is in a ZIP archive instead of a folder. - The archive is named :file:`mfw_nrf9160_` or :file:`mfw_nrf91x1_`, followed by the firmware version number. - Do not unzip this file. - -The :file:`CONTENTS.txt` file in the extracted folder contains the location and names of the different firmware images. - -Complete the steps in the following sections to program applications using the `Programmer app`_ from `nRF Connect for Desktop`_. -The nRF Connect for Desktop requires `SEGGER J-Link`_ |jlink_ver|. - -* On Windows, the driver comes bundled with nRF Connect for Desktop. -* On macOS and Linux, you must install the driver manually. - -See the `nRF Connect for Desktop's additional requirements`_ section for more details on the SEGGER J-Link driver. - -You will also need the following USB cables: - -* nRF91x1 DK - USB-C cable -* nRF9160 DK - micro-USB cable - -.. _nrf9161_updating_fw_modem: -.. _nrf9160_updating_fw_modem: -.. _nrf9160_gs_updating_fw_modem: - -Updating the modem firmware -*************************** - -To update the modem firmware, complete the following steps. - -.. tip:: - If you experience any problems during the process, press ``Ctrl+R`` (``command+R`` on macOS) to restart the Programmer app and try again. - -1. Open the Programmer app. -#. For the nRF9160 DK only: Make sure the **PROG/DEBUG SW10** switch on the nRF9160 DK is set to **nRF91**. - On DK v0.9.0 and earlier, this is the **SW5** switch. -#. Connect the DK to the computer with a USB cable, and then turn the DK on. -#. Click :guilabel:`SELECT DEVICE` and select the DK from the drop-down list. - - .. tabs:: - - .. group-tab:: nRF91x1 DK - - .. figure:: images/programmer_select_device_nrf9151.png - :alt: Programmer - Select device (nRF9151 DK shown) - - Programmer - Select device (nRF9151 DK shown) - - .. group-tab:: nRF9160 DK - - .. figure:: images/programmer_selectdevice_nrf9160.png - :alt: Programmer - Select device - - Programmer - Select device - - The drop-down text changes to the type of the selected device, with its SEGGER ID below the name. - The **Device memory layout** section also changes its name to the device name, and indicates that the device is connected. - If the :guilabel:`Auto read memory` option is selected in the **J-LINK SETTINGS** section of the side panel, the memory layout will update. - If it is not selected and you wish to see the memory layout, click :guilabel:`Read` in the **DEVICE** section of the side panel. - -#. Click :guilabel:`Add file` in the **FILE** section, and select :guilabel:`Browse`. -#. Navigate to where you extracted the firmware, and select the file for your DK: - - * nRF9160 DK - :file:`mfw_nrf9160_.zip` - * nRF91x1 DK - :file:`mfw_nrf91x1_.zip` - -#. Click :guilabel:`Write` in the **DEVICE** section of the side panel. - - .. tabs:: - - .. group-tab:: nRF91x1 DK - - .. figure:: images/programmer_hex_write_nrf9151.png - :alt: Programmer - Write (nRF9151 DK shown) - - Programmer - Write (nRF9151 DK shown) - - .. group-tab:: nRF9160 DK - - .. figure:: images/programmer_write_nrf9160dk.png - :alt: Programmer - Write - - Programmer - Write - - The **Modem DFU** window appears. - - .. tabs:: - - .. group-tab:: nRF91x1 DK - - .. figure:: images/programmerapp_modemdfu_nrf9151.png - :alt: Modem DFU window (nRF9151 DK shown) - - The Modem DFU window (nRF9151 DK shown) - - .. group-tab:: nRF9160 DK - - .. figure:: images/programmerapp_modemdfu.png - :alt: Modem DFU window - - The Modem DFU window - -#. Ignore the warning message and click the :guilabel:`Write` button in the **Modem DFU** window to update the firmware. - Do not unplug or turn off the device during this process. - -When the update is complete, you see a success message. -If you update the application firmware now, you can skip the initial steps about connecting and selecting the device in :ref:`nrf9160_updating_fw_application`. - -.. note:: - - If you experience problems updating the modem firmware, click :guilabel:`Erase all` in the **DEVICE** section of the side panel and try updating again. - -.. _nrf9161_updating_fw_application: -.. _nrf9160_updating_fw_application: -.. _nrf9160_gs_updating_fw_application: - -Updating the application firmware -********************************* - -To update the application firmware using the Programmer app, complete the following steps. - -.. tip:: - If you experience any problems during the process, press ``Ctrl+R`` (``command+R`` on macOS) to restart the Programmer app and try again. - -1. Open the Programmer app. -#. For the nRF9160 DK only: Make sure the **PROG/DEBUG SW10** switch (**SW5** on DK v0.9.0 and earlier) on the nRF9160 DK is set to **nRF91** or **nRF52** as appropriate for the application or sample you are programming. - See the `Device programming section in the nRF9160 DK User Guide`_ for more information. - - For the :ref:`nrf_cloud_multi_service` sample, the switch must be set to **nRF91**. - -#. Connect the DK to the computer with a USB cable, and then turn the DK on. -#. Click :guilabel:`SELECT DEVICE` and select the DK from the drop-down list. - - .. tabs:: - - .. group-tab:: nRF91x1 DK - - .. figure:: images/programmer_select_device_nrf9151.png - :alt: Programmer - Select device (nRF9151 DK shown) - - Programmer - Select device (nRF9151 DK shown) - - .. group-tab:: nRF9160 DK - - .. figure:: images/programmer_selectdevice_nrf9160.png - :alt: Programmer - Select device - - Programmer - Select device - - The drop-down text changes to the type of the selected device, with its SEGGER ID below the name. - The **Device memory layout** section also changes its name to the device name, and indicates that the device is connected. - If the :guilabel:`Auto read memory` option is selected in the **J-LINK SETTINGS** section, the memory layout will update. - If it is not selected and you wish to see the memory layout, click :guilabel:`Read` in the **DEVICE** section. - -#. Click :guilabel:`Add file` in the **FILE** section, and select :guilabel:`Browse`. -#. Navigate to where you extracted the firmware, and then to the :file:`img_app_bl` folder there. -#. Select the :file:`.hex` file for your DK for the application you are programming: - - * nRF9160 DK - :file:`nrf9160dk_nrfcloud_multi_service_coap_.hex` - * nRF91x1 DK - :file:`nrf9151dk_nrfcloud_multi_service_coap_.hex` or :file:`nrf9161dk_nrfcloud_multi_service_coap_.hex` - -#. Click the :guilabel:`Erase & write` button in the **DEVICE** section to program the DK. - Do not unplug or turn off the DK during this process. - - .. tabs:: - - .. group-tab:: nRF91x1 DK - - .. figure:: images/programmer_erasewrite_nrf9151dk.png - :alt: Programmer - Erase & write (nRF9151 DK shown) - - Programmer - Erase & write (nRF9151 DK shown) - - .. group-tab:: nRF9160 DK - - .. figure:: images/programmer_erasewrite_nrf9160dk.png - :alt: Programmer - Erase & write - - Programmer - Erase & write +To update the firmware on an mRF91 Series DK using the `Programmer app`_ in nRF Connect for Desktop, complete the steps listed on the `Programming nRF91 Series DK firmware`_ page in the tool documentation. diff --git a/doc/nrf/app_dev/device_guides/nrf91/nrf91_features.rst b/doc/nrf/app_dev/device_guides/nrf91/nrf91_features.rst index fc5ee5da3402..9b611e79299b 100644 --- a/doc/nrf/app_dev/device_guides/nrf91/nrf91_features.rst +++ b/doc/nrf/app_dev/device_guides/nrf91/nrf91_features.rst @@ -121,7 +121,7 @@ Full update Both methods use the :term:`Serial Wire Debug (SWD)` interface to update the firmware. You can use the Programmer app to perform the update, regardless of the images that are part of the existing firmware of the device. - For example, you can update the modem on an nRF9160 DK using the instructions provided in the :ref:`nrf9160_updating_fw_modem` section. + For example, you can update the modem on an nRF9160 DK using the instructions provided in the `Programming nRF91 Series DK firmware`_ page. * When using a wireless connection, the update is applied over-the-air (OTA). See :ref:`nrf91_fota` for more information. diff --git a/doc/nrf/app_dev/device_guides/nrf91/nrf91_testing.rst b/doc/nrf/app_dev/device_guides/nrf91/nrf91_testing.rst index 32741d69d7b1..af6bf37e5ca2 100644 --- a/doc/nrf/app_dev/device_guides/nrf91/nrf91_testing.rst +++ b/doc/nrf/app_dev/device_guides/nrf91/nrf91_testing.rst @@ -12,7 +12,7 @@ You can use it to troubleshoot and debug any connection problems. Complete the following steps to test the cellular connection using the AT Client sample: -1. Follow the steps in :ref:`nrf9160_gs_updating_fw_application` to program the sample to the DK. +1. Follow the steps in the Updating the application firmware tab in the `Programming nRF91 Series DK firmware`_ page to program the sample to the DK. When selecting the HEX file, select the following file instead of the one for :ref:`nrf_cloud_multi_service`: * nRF9151 DK - :file:`nrf9151dk_at_client_.hex` diff --git a/doc/nrf/drivers/wifi/nrf70_native.rst b/doc/nrf/drivers/wifi/nrf70_native.rst index 16d57beaf671..22ca250a09d9 100644 --- a/doc/nrf/drivers/wifi/nrf70_native.rst +++ b/doc/nrf/drivers/wifi/nrf70_native.rst @@ -36,7 +36,7 @@ Design overview The nRF Wi-Fi driver follows an OS-agnostic design, and the driver implementation is split into OS-agnostic and OS (Zephyr)-specific code. The OS-agnostic code is located in the :file:`${ZEPHYR_BASE}/../modules/nrf_wifi/` folder, and the Zephyr OS port is located in the :file:`${ZEPHYR_BASE}/drivers/wifi/nrf_wifi/` folder. -The driver supports two modes of operation: +The driver supports three modes of operation: Wi-Fi mode ========== @@ -52,8 +52,7 @@ The driver supports the following IEEE 802.11 features: * Scan-only mode * IEEE 802.11 :term:`Station mode (STA)` * :term:`Software-enabled Access Point (SoftAP or SAP)` mode - -The Wi-Fi Direct® mode feature is in the driver code but is not yet supported. +* :ref:`Wi-Fi Direct® ` (P2P) mode Except for scan-only mode, the driver uses the host access point daemon (hostapd) to implement AP Media Access Control (MAC) Sublayer Management Entity (AP MLME) and wpa_supplicant to implement 802.1X supplicant. @@ -65,6 +64,14 @@ This is a build time option that you can enable using the :kconfig:option:`CONFI For more details about using this driver in Radio Test mode, see :ref:`wifi_radio_test`. +Offloaded raw TX mode +===================== + +The nRF Wi-Fi driver supports Offloaded raw TX mode, where the nRF70 Series device transmits frames at regular intervals with very low power consumption. +Frame transmission is offloaded to the nRF70 device, minimizing host processing and memory requirements. + +For more details about using this driver in Offloaded raw TX mode, see :ref:`ug_nrf70_developing_offloaded_raw_tx`. + Driver to nRF70 Series device communication ******************************************* diff --git a/doc/nrf/external_comp/memfault.rst b/doc/nrf/external_comp/memfault.rst index dca0cefa01d4..3081f0f7889f 100644 --- a/doc/nrf/external_comp/memfault.rst +++ b/doc/nrf/external_comp/memfault.rst @@ -1,21 +1,21 @@ .. _ug_memfault: -Memfault integration -#################### +nRF Cloud powered by Memfault integration +######################################### .. contents:: :local: :depth: 2 -`Memfault`_ is a cloud-based web application with |NCS| compatibility that monitors devices and allows you to debug issues remotely. -Memfault integration provides the following features to |NCS|: +`nRF Cloud`_ now integrates Memfault technology to monitor devices and allows you to debug issues remotely. +This integration provides the following features to |NCS|: -* `Remote debugging `_ - Memfault issues can be efficiently resolved with automatic detection, alerts, deduplication, and actionable insights sent through the cloud. +* `Remote debugging `_ - Issues can be efficiently resolved with automatic detection, alerts, deduplication, and actionable insights sent through the cloud. * `Continuous monitoring `_ - Monitors device and fleet-level metrics like connectivity and low power state in real-time dashboards and displays prepopulated metrics for your devices. You can access device level data to resolve bugs faster. -See the `Memfault sandbox `_ for a self-guided tour of the platform as well as the `Memfault documentation `_ for more details. +See the `Memfault documentation `_ for more details. .. note:: Memfault has been integrated in |NCS| since the v1.6.0 release. diff --git a/doc/nrf/glossary.rst b/doc/nrf/glossary.rst index 50229c53f174..14ff8dd02c8a 100644 --- a/doc/nrf/glossary.rst +++ b/doc/nrf/glossary.rst @@ -1076,7 +1076,7 @@ Glossary Wi-Fi Protected Access® (WPA) A security protocol developed by Wi-Fi Alliance. - It comes in three flavours WPA, WPA2 and WPA3 respectively, with each offering higher security compared to its predecessor. + It comes in three flavors WPA, WPA2 and WPA3 respectively, with each offering higher security compared to its predecessor. Wireshark A free software tool that captures wireless traffic and reproduces it in a readable format. diff --git a/doc/nrf/gsg_guides.rst b/doc/nrf/gsg_guides.rst index 07906af48cdb..1a945777753d 100644 --- a/doc/nrf/gsg_guides.rst +++ b/doc/nrf/gsg_guides.rst @@ -30,6 +30,8 @@ The application uses Nordic Semiconductor tools and precompiled binaries and doe +----------------------+ +---------------------------------------+ | nRF7002 DK | | `nRF7002 DK Hardware`_ | +----------------------+ +---------------------------------------+ +| nRF54LV10 DK | | `nRF54LV10 DK User Guide`_ | ++----------------------+ +---------------------------------------+ | nRF54LM20 DK | | `nRF54LM20 DK User Guide`_ | +----------------------+ +---------------------------------------+ | nRF54L15 DK | `Quick Start app`_ | `nRF54L15 DK User Guide`_ | diff --git a/doc/nrf/images/nrf_desktop_motion_sensing.svg b/doc/nrf/images/nrf_desktop_motion_sensing.svg index 8f573a38ef25..334b7a81a222 100644 --- a/doc/nrf/images/nrf_desktop_motion_sensing.svg +++ b/doc/nrf/images/nrf_desktop_motion_sensing.svg @@ -2,33 +2,31 @@ + xmlns:v="http://schemas.microsoft.com/visio/2003/SVGExtensions/" width="7.82572in" height="5.63801in" + viewBox="0 0 563.452 405.937" xml:space="preserve" color-interpolation-filters="sRGB" class="st19"> + + @@ -36,161 +34,252 @@ - + - + - + - + - + Page-1 - + + + Nordic Blue - + - - Nordic Lake - Wheel Uses QDEC to measure rotation. Submits wheel_event when... - - Wheel Uses QDEC to measure rotation. Submits wheel_event when rotation is detected. - - Nordic Lake.2558 - Buttons Submits button_event on key press or release. The det... - - Buttons Submits button_event on key press or release. The detection of the first button press is based on interrupts. Then, the module scans keyboard matrix periodically until no button is pressed. - + Nordic Middle Grey - USB state / HIDS Sends the HID input report to the host and n... - - USB state / HIDS Sends the HID input report to the host and notifies when the report is sent. - + USB state/HIDS Sends the HID input report to the host and not... + + + + USB state/HIDSSends the HID input report to the host and notifies when the report is sent. + Nordic Lake.2559 HID state - - HID state - + + + + HID state + Nordic Lake.2560 - Updates the HID report data. - - Updates the HID report data. - - Nordic Lake.2561 - Generates the HID input report based on the report data and s... - - Generates the HID input report based on the report data and sends it to the active subscriber. - + Asks provider to send HID input report. + + + + Asks provider to send HID input report. + Nordic Lake.2566 STATE IDLE Uses the trigger to detect motion after inactivity. - - STATE IDLE Uses the trigger to detect motion after inactivity. - + + + + STATE IDLEUses the trigger to detect motion after inactivity. + Nordic Lake.2567 STATE FETCHING Uses a dedicated thread to fetch samples from ... - - STATE FETCHING Uses a dedicated thread to fetch samples from the sensor. Triggers sampling operation when a HID mouse report is sent. - + + + + STATE FETCHINGUses a dedicated thread to fetch samples from the sensor.Triggers sampling operation when a HID mouse report is sent. + Dynamic connector - + - - Sheet.2569 + + Sheet.15 Sensor data ready - - Sensor data ready - + + + + Sensor data ready + Dynamic connector.2570 - + - - Sheet.2571 + + Sheet.17 No motion for predefined number of samples - - No motion for predefined number of samples - - Sheet.2572 + + + + No motion for predefined number of samples + + Sheet.18 Motion sensor - - Motion sensor - + + + + Motion sensor + Dynamic connector.2574 - - - - Dynamic connector.2578 - + - + Dynamic connector.2580 - + - + Nordic Sun - - - - Dynamic connector.2582 - + - - Dynamic connector.2583 - + + Sheet.30 + hid_report_event + + + + hid_report_event + + Sheet.31 + hid_report_sent_event + + + + hid_report_sent_event + + Sheet.32 + hid_report_sent_event + + + + hid_report_sent_event + + Nordic Lake.33 + Wheel Uses QDEC to measure rotation. Submits wheel_event when... + + + + WheelUses QDEC to measure rotation. Submits wheel_event when rotation is detected. + + Nordic Lake.34 + Buttons Submits button_event on key press or release. The det... + + + + ButtonsSubmits button_event on key press or release. The detection of the first button press is based on interrupts. Then, the module scans keyboard matrix periodically until no button is pressed. + + Nordic Lake.35 + HID provider mouse + + + + HID provider mouse + + Nordic Lake.36 + Updates the HID report data. + + + + Updates the HID report data. + + Nordic Lake.2561 + Generates the HID input report based on the report data and s... + + + + Generates the HID input report based on the report data and sends it to the active subscriber. + + Dynamic connector.39 + - - Dynamic connector.2584 - + + Sheet.40 + wheel_event + + + + wheel_event + + Dynamic connector.2582 + - + Dynamic connector.2585 - + - - Sheet.2586 - wheel_event - - wheel_event - - Sheet.2588 + + Sheet.41 button_event - - button_event - - Sheet.2591 + + + + button_event + + Sheet.42 motion_event - - motion_event - - Sheet.2593 - hid_report_event - - hid_report_event - - Sheet.2595 - hid_report_sent_event - - hid_report_sent_event - - Sheet.2597 - hid_report_sent_event - - hid_report_sent_event + + + + motion_event + + Dynamic connector.2578 + + + + Sheet.45 + hid_report_provider_api.send_report + + + + hid_report_provider_api.send_report + + Sheet.46 + hid_state_api.trigger_report_send + + + + hid_state_api.trigger_report_send + + Dynamic connector.47 + + + + Dynamic connector.49 + + diff --git a/doc/nrf/includes/cert-flashing.txt b/doc/nrf/includes/cert-flashing.txt index a1907cd3d041..b54ae4537899 100644 --- a/doc/nrf/includes/cert-flashing.txt +++ b/doc/nrf/includes/cert-flashing.txt @@ -1,7 +1,7 @@ To provision the certificates and the private key to the nRF91 Series modem, complete the following steps: 1. `Download nRF Connect for Desktop`_. -#. Update the modem firmware on the onboard modem of the nRF91 Series device to the latest version by following the steps in :ref:`nrf9160_gs_updating_fw_modem`. +#. Update the modem firmware on the onboard modem of the nRF91 Series device to the latest version as instructed in the `Programming nRF91 Series DK firmware`_ page. #. Build and program the :ref:`at_client_sample` sample to the nRF91 Series device as explained in :ref:`building` and :ref:`programming`. #. Launch the `Cellular Monitor app`_ in `nRF Connect for Desktop`_. #. Click :guilabel:`CERTIFICATE MANAGER` located at the upper right corner. diff --git a/doc/nrf/includes/nrf_cloud_rest_sample_requirements.txt b/doc/nrf/includes/nrf_cloud_rest_sample_requirements.txt index e8823e434840..e055d40777ea 100644 --- a/doc/nrf/includes/nrf_cloud_rest_sample_requirements.txt +++ b/doc/nrf/includes/nrf_cloud_rest_sample_requirements.txt @@ -12,9 +12,9 @@ For an nRF91x1 DK, modem version v2.0.0 or later is required. For instructions on updating your device's modem firmware, see the following documents: - * :ref:`Updating modem firmware on nRF91x1 DK ` - * :ref:`Updating modem firmware on nRF9160 DK ` - * :ref:`Updating modem firmware on Thingy:91 ` + * `Updating modem firmware on nRF91x1 DK `_ + * `Updating modem firmware on nRF9160 DK `_ + * `Updating modem firmware on Thingy:91 `_ .. requirement_cert_provision_start diff --git a/doc/nrf/installation/recommended_versions.rst b/doc/nrf/installation/recommended_versions.rst index 60a57126dd71..62030967f973 100644 --- a/doc/nrf/installation/recommended_versions.rst +++ b/doc/nrf/installation/recommended_versions.rst @@ -30,7 +30,7 @@ For OS support for additional software tools from Nordic Semiconductor, see :ref * - Operating System - x64 - ARM64 - * - `Windows 10`_ + * - `Windows 11`_ - Built and tested with :ref:`Twister `. - Not supported. * - `Linux - Ubuntu 24.04 LTS`_ diff --git a/doc/nrf/libraries/bluetooth/services/fast_pair/core.rst b/doc/nrf/libraries/bluetooth/services/fast_pair/core.rst index 48ef4219792e..cf56bd3697ed 100644 --- a/doc/nrf/libraries/bluetooth/services/fast_pair/core.rst +++ b/doc/nrf/libraries/bluetooth/services/fast_pair/core.rst @@ -96,7 +96,7 @@ With the :kconfig:option:`CONFIG_BT_FAST_PAIR` Kconfig option enabled, the follo * :kconfig:option:`CONFIG_BT_FAST_PAIR_FMDN_CLOCK_NVM_UPDATE_TIME` - The option configures the time interval (in minutes) of periodic beacon clock writes to the non-volatile memory. * :kconfig:option:`CONFIG_BT_FAST_PAIR_FMDN_CLOCK_NVM_UPDATE_RETRY_TIME` - The option configures the retry time (in seconds) when the beacon clock write to the non-volatile memory fails. -* :kconfig:option:`CONFIG_BT_FAST_PAIR_USE_CASE_UNKNOWN`, :kconfig:option:`CONFIG_BT_FAST_PAIR_USE_CASE_INPUT_DEVICE`, :kconfig:option:`CONFIG_BT_FAST_PAIR_USE_CASE_LOCATOR_TAG` and :kconfig:option:`CONFIG_BT_FAST_PAIR_USE_CASE_MOUSE` - These options are used to select the Fast Pair use case and configure the Fast Pair library according to the `Fast Pair Device Feature Requirements`_ for the chosen use case. +* :kconfig:option:`CONFIG_BT_FAST_PAIR_USE_CASE_UNKNOWN`, :kconfig:option:`CONFIG_BT_FAST_PAIR_USE_CASE_INPUT_DEVICE`, :kconfig:option:`CONFIG_BT_FAST_PAIR_USE_CASE_LOCATOR_TAG`, and :kconfig:option:`CONFIG_BT_FAST_PAIR_USE_CASE_MOUSE` - These options are used to select the Fast Pair use case and configure the Fast Pair library according to the `Fast Pair Device Feature Requirements`_ for the chosen use case. The :kconfig:option:`CONFIG_BT_FAST_PAIR_USE_CASE_UNKNOWN` Kconfig option is used by default. * :kconfig:option:`CONFIG_BT_FAST_PAIR_ADV_MANAGER` - The option enables the :ref:`bt_fast_pair_adv_manager_readme` module. See the :ref:`bt_fast_pair_adv_manager_config` section to learn more about the remaining Kconfig options of this module. diff --git a/doc/nrf/libraries/debug/cpu_load.rst b/doc/nrf/libraries/debug/cpu_load.rst index d5d1e89b4c19..54c1f4f5eda5 100644 --- a/doc/nrf/libraries/debug/cpu_load.rst +++ b/doc/nrf/libraries/debug/cpu_load.rst @@ -28,14 +28,11 @@ To use the module, enable the :kconfig:option:`CONFIG_NRF_CPU_LOAD` Kconfig opti The module allows you to configure the following options in Kconfig: -* :kconfig:option:`CONFIG_NRF_CPU_LOAD_CMDS` - to enable shell commands -* :kconfig:option:`CONFIG_NRF_CPU_LOAD_LOG_PERIODIC` - to enable periodic logging of the - CPU load. You can use the :kconfig:option:`CONFIG_NRF_CPU_LOAD_LOG_INTERVAL` Kconfig option - to configure the interval of the logging. -* :kconfig:option:`CONFIG_NRF_CPU_LOAD_ALIGNED_CLOCKS` - to enable the alignment of the clock sources - for more accurate measurement. -* ``CONFIG_NRF_CPU_LOAD_TIMER_*`` - to choose the TIMER instance for the load measurement (for example, :kconfig:option:`CONFIG_NRF_CPU_LOAD_TIMER_0`) - +* :kconfig:option:`CONFIG_NRF_CPU_LOAD_CMDS` - To enable shell commands. +* :kconfig:option:`CONFIG_NRF_CPU_LOAD_LOG_PERIODIC` - To enable periodic logging of the CPU load. + You can use the :kconfig:option:`CONFIG_NRF_CPU_LOAD_LOG_INTERVAL` Kconfig option to configure the interval of the logging. +* :kconfig:option:`CONFIG_NRF_CPU_LOAD_ALIGNED_CLOCKS` - To enable the alignment of the clock sources for more accurate measurement. +* ``CONFIG_NRF_CPU_LOAD_TIMER_*`` - To choose the TIMER instance for the load measurement (for example, :kconfig:option:`CONFIG_NRF_CPU_LOAD_TIMER_0`). Usage ***** diff --git a/doc/nrf/libraries/dfu/dfu_multi_image.rst b/doc/nrf/libraries/dfu/dfu_multi_image.rst index 919044185606..f426445d4b90 100644 --- a/doc/nrf/libraries/dfu/dfu_multi_image.rst +++ b/doc/nrf/libraries/dfu/dfu_multi_image.rst @@ -53,9 +53,9 @@ To use this option, you must also set the following Kconfig options: * :kconfig:option:`CONFIG_NVS` (the nRF52 and nRF53 Series) or :kconfig:option:`CONFIG_ZMS` (the nRF54L and nRF54H Series) - Enables the settings backend to store data in NVM. .. note:: - Enabling this option uses space in the settings area in NVM to store the progress information. - Data is stored on every call to :c:func:`dfu_multi_image_write`. - Make sure that the settings area is large enough to accommodate this additional data. + Enabling this option uses space in the settings area in NVM to store the progress information. + Data is stored on every call to :c:func:`dfu_multi_image_write`. + Make sure that the settings area is large enough to accommodate this additional data. Dependencies ************ diff --git a/doc/nrf/libraries/others/hw_id.rst b/doc/nrf/libraries/others/hw_id.rst index 63e840531994..a3df269f77b3 100644 --- a/doc/nrf/libraries/others/hw_id.rst +++ b/doc/nrf/libraries/others/hw_id.rst @@ -21,7 +21,7 @@ You can configure one of the following Kconfig options to choose the hardware ID * :kconfig:option:`CONFIG_HW_ID_LIBRARY_SOURCE_IMEI` - This option specifies the :term:`International Mobile (Station) Equipment Identity (IMEI)` of the modem. * :kconfig:option:`CONFIG_HW_ID_LIBRARY_SOURCE_UUID` - This option specifies the UUID of the modem. -* :kconfig:option:`CONFIG_HW_ID_LIBRARY_SOURCE_BLE_MAC` - This option specifies the default Bluetooth® Low Energy MAC address. +* :kconfig:option:`CONFIG_HW_ID_LIBRARY_SOURCE_BT_DEVICE_ADDRESS` - This option specifies the Bluetooth® Device Address. * :kconfig:option:`CONFIG_HW_ID_LIBRARY_SOURCE_NET_MAC` - This option specifies the MAC address of the default network interface. * :kconfig:option:`CONFIG_HW_ID_LIBRARY_SOURCE_DEVICE_ID` - This option specifies a serial number provided by Zephyr's HW Info API. diff --git a/doc/nrf/links.txt b/doc/nrf/links.txt index 0beefedab75c..f8f2cf7024ed 100644 --- a/doc/nrf/links.txt +++ b/doc/nrf/links.txt @@ -124,7 +124,7 @@ .. _`Changelog for nrfx 2.3.0`: https://github.com/NordicSemiconductor/nrfx/blob/master/CHANGELOG.md#user-content-230---2020-08-19 .. _`Changelog for nrfx 2.4.0`: https://github.com/NordicSemiconductor/nrfx/blob/master/CHANGELOG.md#user-content-240---2020-11-13 .. _`Changelog for nrfx 2.5.0`: https://github.com/NordicSemiconductor/nrfx/blob/master/CHANGELOG.md#250---2021-05-05 - +.. _`nrfx 4.0 migration note`: https://github.com/NordicSemiconductor/nrfx/wiki/nrfx-3.14.0-to-4.0.0 .. _`HIDAPI library`: https://github.com/libusb/hidapi .. _`HIDAPI releases`: https://github.com/libusb/hidapi/releases @@ -194,6 +194,7 @@ .. _`Generate partition script`: https://github.com/nrfconnect/sdk-connectedhomeip/blob/bf45da8a28/scripts/tools/nrfconnect/nrfconnect_generate_partition.py .. _`Matter nRF Connect scripts`: https://github.com/nrfconnect/sdk-connectedhomeip/tree/bf45da8a28/scripts/tools/nrfconnect .. _`Matter nRF Connect Kconfig`: https://github.com/nrfconnect/sdk-connectedhomeip/blob/bf45da8a28/config/nrfconnect/chip-module/Kconfig +.. _`Matter Clusters Code-Driven support`: https://github.com/nrfconnect/sdk-connectedhomeip/blob/bf45da8a28/src/app/common/templates/config-data.yaml .. _`bt_nus_service.cpp`: https://github.com/nrfconnect/sdk-nrf/blob/main/samples/matter/common/src/bt_nus/bt_nus_service.cpp .. _`bt_nus_service.h`: https://github.com/nrfconnect/sdk-nrf/blob/main/samples/matter/common/src/bt_nus/bt_nus_service.h @@ -275,12 +276,11 @@ .. _`Key identifiers`: https://arm-software.github.io/psa-api/crypto/1.1/api/keys/ids.html#key-identifiers .. _`Key management functions`: https://arm-software.github.io/psa-api/crypto/1.1/api/keys/management.html .. _`Keystore interface`: https://arm-software.github.io/psa-api/crypto/1.1/overview/goals.html#a-keystore-interface -.. _`PSA Cryptography API 1.0.1`: https://armmbed.github.io/mbed-crypto/1.0.1/html/index.html -.. _`PSA Certified Crypto API 1.0.0`: https://arm-software.github.io/psa-api/crypto/1.0/IHI0086-PSA_Cryptography_API-1.0.0.pdf -.. _`PSA Certified Crypto API 1.3.1`: https://arm-software.github.io/psa-api/crypto/1.3/ .. _`PSA functions for key management`: https://arm-software.github.io/psa-api/crypto/1.1/api/keys/management.html .. _`PSA_KEY_USAGE_EXPORT policy`: https://arm-software.github.io/psa-api/crypto/1.3/api/keys/policy.html#c.PSA_KEY_USAGE_EXPORT +.. _`PSA Certified Crypto API 1.3.1`: https://arm-software.github.io/psa-api/crypto/1.3/ + .. _`PSA Certified Secure Storage API`: https://arm-software.github.io/psa-api/storage/ .. _`PSA Certified Secure Storage API 1.0`: https://arm-software.github.io/psa-api/storage/1.0/ @@ -341,6 +341,9 @@ .. _`nRF54L05`: https://www.nordicsemi.com/Products/nRF54L05 .. _`nRF54L10`: https://www.nordicsemi.com/Products/nRF54L10 +.. _`nRF54LV10 DK`: https://www.nordicsemi.com/Products/Development-hardware/nRF54LV10-DK +.. _`nRF54LV10A System-on-Chip`: https://www.nordicsemi.com/Products/nRF54LV10A + .. _`nRF54LM20A System-on-Chip`: https://www.nordicsemi.com/Products/nRF54LM20A .. _`nRF54LM20 DK`: https://www.nordicsemi.com/Products/Development-hardware/nRF54LM20-DK @@ -452,8 +455,6 @@ .. _`Nordic Semiconductor TechDocs`: https://docs.nordicsemi.com -.. _`nRF Connect for Desktop's additional requirements`: https://docs.nordicsemi.com/bundle/nrf-connect-desktop/page/download_cfd.html#additional-requirements - .. _`nRF Connect SDK v1.4.0 documentation`: https://docs.nordicsemi.com/bundle/ncs-1.4.0/page/nrf/index.html .. _`nRF Connect SDK v1.3.0 documentation`: https://docs.nordicsemi.com/bundle/ncs-1.3.0/page/nrf/index.html .. _`nRF Connect SDK v1.2.1 documentation`: https://docs.nordicsemi.com/bundle/ncs-1.2.1/page/nrf/index.html @@ -559,13 +560,10 @@ .. _`Repositories and revisions for v2.9.0-nRF54H20-1`: https://docs.nordicsemi.com/bundle/ncs-2.9.0-nRF54H20-1/page/nrf/releases_and_maturity/repository_revisions.html .. _`Repositories and revisions for v2.9.0`: https://docs.nordicsemi.com/bundle/ncs-2.9.0/page/nrf/releases_and_maturity/repository_revisions.html .. _`Repositories and revisions for v2.8.0`: https://docs.nordicsemi.com/bundle/ncs-2.8.0/page/nrf/releases_and_maturity/repository_revisions.html -.. _`Repositories and revisions for v2.7.99-cs2`: https://docs.nordicsemi.com/bundle/ncs-2.7.99-cs2/page/nrf/releases_and_maturity/repository_revisions.html -.. _`Repositories and revisions for v2.7.99-cs1`: https://docs.nordicsemi.com/bundle/ncs-2.7.99-cs1/page/nrf/releases_and_maturity/repository_revisions.html .. _`Repositories and revisions for v2.7.0`: https://docs.nordicsemi.com/bundle/ncs-2.7.0/page/nrf/releases_and_maturity/repository_revisions.html .. _`Repositories and revisions for v2.6.4`: https://docs.nordicsemi.com/bundle/ncs-2.6.4/page/nrf/releases_and_maturity/repository_revisions.html .. _`Repositories and revisions for v2.6.3`: https://docs.nordicsemi.com/bundle/ncs-2.6.3/page/nrf/releases_and_maturity/repository_revisions.html .. _`Repositories and revisions for v2.6.2`: https://docs.nordicsemi.com/bundle/ncs-2.6.2/page/nrf/releases_and_maturity/repository_revisions.html -.. _`Repositories and revisions for v2.6.99-cs1`: https://docs.nordicsemi.com/bundle/ncs-2.6.99-cs1/page/nrf/releases_and_maturity/repository_revisions.html .. _`Repositories and revisions for v2.6.1`: https://docs.nordicsemi.com/bundle/ncs-2.6.1/page/nrf/releases_and_maturity/repository_revisions.html .. _`Repositories and revisions for v2.6.0`: https://docs.nordicsemi.com/bundle/ncs-2.6.0/page/nrf/releases_and_maturity/repository_revisions.html .. _`Repositories and revisions for v2.5.3`: https://docs.nordicsemi.com/bundle/ncs-2.5.3/page/nrf/releases_and_maturity/repository_revisions.html @@ -743,6 +741,7 @@ .. _`Programming a Development Kit`: https://docs.nordicsemi.com/bundle/nrf-connect-programmer/page/programming_dk.html .. _`Programming Nordic Thingy53`: .. _`Programming Nordic Thingy prototyping platforms`: https://docs.nordicsemi.com/bundle/nrf-connect-programmer/page/programming_thingy.html +.. _`Programming nRF91 Series DK firmware`: https://docs.nordicsemi.com/bundle/nrf-connect-programmer/page/programming_91dk.html .. _`Serial Terminal app`: https://docs.nordicsemi.com/bundle/nrf-connect-serial-terminal/page/index.html .. _`Connecting using the Serial Terminal app`: https://docs.nordicsemi.com/bundle/nrf-connect-serial-terminal/page/connecting.html @@ -778,7 +777,6 @@ .. _`nRF9160 DK board control section in the nRF9160 DK User Guide`: https://docs.nordicsemi.com/bundle/ug_nrf9160_dk/page/UG/nrf91_DK/hw_description/nrf9160_board_controller.html .. _`Measuring current on nRF9160 DK`: https://docs.nordicsemi.com/bundle/ug_nrf9160_dk/page/UG/nrf91_DK/measuring_current/hw_measure_current.html .. _`External memory section in the nRF9160 DK User Guide`: https://docs.nordicsemi.com/bundle/ug_nrf9160_dk/page/UG/nrf91_DK/hw_description/external_memory.html -.. _`Device programming section in the nRF9160 DK User Guide`: https://docs.nordicsemi.com/bundle/ug_nrf9160_dk/page/UG/nrf91_DK/operating_modes/mcu_device_programming.html .. _`VDD supply rail section in the nRF9160 DK User Guide`: https://docs.nordicsemi.com/bundle/ug_nrf9160_dk/page/UG/nrf91_DK/hw_description/power_sources_vdd.html .. _`nRF9160 RESETREAS`: https://docs.nordicsemi.com/bundle/ps_nrf9160/page/power.html#ariaid-title16 @@ -843,11 +841,16 @@ .. _`nRF54L15 RRAMC`: https://docs.nordicsemi.com/bundle/ps_nrf54L15/page/rramc.html .. _`nRF54L15 REGION.CONFIG`: https://docs.nordicsemi.com/bundle/ps_nrf54L15/page/rramc.html#ariaid-title35 .. _`nRF54L15 CRACEN`: https://docs.nordicsemi.com/bundle/ps_nrf54L15/page/cracen.html +.. _`nRF54L15 Power and clock management`: https://docs.nordicsemi.com/bundle/ps_nrf54L15/page/pmu.html .. _`nRF54LM20A Datasheet`: https://docs.nordicsemi.com/bundle/ps_nrf54LM20A/page/keyfeatures_html5.html .. _`nRF54LM20 DK User Guide`: https://docs.nordicsemi.com/bundle/ug_nrf54lm20_dk/page/UG/nRF54LM20_DK/intro/intro.html .. _`nRF54LM20A Compatibility Matrix`: https://docs.nordicsemi.com/bundle/comp_matrix_nrf54lm20a/page/COMP/nrf54lm20a/nrf54lm20a_comp_matrix.html +.. _`nRF54LV10A Datasheet`: https://docs.nordicsemi.com/bundle/ps_nrf54LV10A/page/keyfeatures_html5.html +.. _`nRF54LV10 DK User Guide`: https://docs.nordicsemi.com/bundle/ug_nrf54lv10_dk/page/UG/nRF54LV10_DK/intro/intro.html +.. _`nRF54LV10 Compatibility Matrix`: https://docs.nordicsemi.com/bundle/comp_matrix_nrf54lv10a/page/COMP/nrf54lv10a/nrf54lv10a_comp_matrix.html + .. _`nRF53 Series`: https://docs.nordicsemi.com/category/nrf-53-series .. _`nRF5340 Product Specification`: https://docs.nordicsemi.com/bundle/ps_nrf5340/page/keyfeatures_html5.html @@ -955,6 +958,8 @@ .. _`AP-Protect for nRF9151`: https://docs.nordicsemi.com/bundle/ps_nrf9151/page/dif.html#ariaid-title3 .. _`AP-Protect for nRF9161`: https://docs.nordicsemi.com/bundle/ps_nrf9161/page/dif.html#ariaid-title3 .. _`Debugger access protection for nRF9160`: https://docs.nordicsemi.com/bundle/ps_nrf9160/page/dif.html#ariaid-title2 +.. _`AP-Protect for nRF54LV10A`: https://docs.nordicsemi.com/bundle/ps_nrf54LV10A/page/ctrl-ap.html +.. _`AP-Protect for nRF54LM20A`: https://docs.nordicsemi.com/bundle/ps_nrf54LM20A/page/ctrl-ap.html .. _`AP-Protect for nRF54L15`: https://docs.nordicsemi.com/bundle/ps_nrf54L15/page/ctrl-ap.html .. _`AP-Protect for nRF5340`: https://docs.nordicsemi.com/bundle/ps_nrf5340/page/debugandtrace.html#ariaid-title9 .. _`AP-Protect for nRF52840`: @@ -1487,7 +1492,7 @@ .. _`Memfault`: https://memfault.com/ -.. _`Memfault registration page`: https://app.memfault.com/register-nordic +.. _`Memfault registration page`: https://app.nrfcloud.com/#/register .. _`Memfault Dashboards`: https://app.memfault.com .. _`Memfault Docs`: https://docs.memfault.com/ @@ -1508,11 +1513,10 @@ .. _`Memfault MCU Guide`: https://docs.memfault.com/docs/mcu/introduction .. _`Memfault: Reboot tracking`: https://docs.memfault.com/docs/mcu/reboot-reason-tracking .. _`Memfault: Coredumps`: https://docs.memfault.com/docs/mcu/coredumps -.. _`Memfault Sandbox`: https://mflt.io/demo .. ### Source: *.nrfcloud.com, https://docs.nordicsemi.com/bundle/nrf-cloud/ -.. _`nRF Cloud`: +.. _`nRF Cloud`: https://nrfcloud.com/ .. _`nRF Connect for Cloud`: https://nrfcloud.com/ .. _`User Account`: https://nrfcloud.com/#/account .. _`Provision Devices`: https://nrfcloud.com/#/provision-devices @@ -1982,10 +1986,6 @@ .. _`latest nRF54H20 SoC binaries`: https://files.nordicsemi.com/artifactory/SDSC/external/ .. _`latest nRF54H20 IronSide SE binaries`: https://files.nordicsemi.com/artifactory/SDSC/external/ -.. ### Descr: Old 54H BICR file - -.. _`BICR binary file`: https://files.nordicsemi.com/artifactory/SDSC/external/bicr_ext_loadcap.hex - .. ### Descr: New 54H BICR file .. _`nRF54H20 DK BICR binary file`: https://files.nordicsemi.com/artifactory/SDSC/external/bicr/bicr.hex diff --git a/doc/nrf/protocols/bt/bt_mesh/configuring.rst b/doc/nrf/protocols/bt/bt_mesh/configuring.rst index 94380b4c1f7e..215d8aa9b7c0 100644 --- a/doc/nrf/protocols/bt/bt_mesh/configuring.rst +++ b/doc/nrf/protocols/bt/bt_mesh/configuring.rst @@ -257,6 +257,9 @@ Zephyr's Mesh security toolbox implementation uses third-party crypto library AP * :kconfig:option:`CONFIG_BT_MESH_USES_TFM_PSA` - Enables use of the `Trusted Firmware M`_ PSA API based security toolbox (default option for platforms that support TF-M). Zephyr's Mesh operates with open key values, including storing them in the persistent memory. +.. note:: + For Bluetooth Mesh provisioning, authenticating with the BTM_ECDH_P256_CMAC_AES128_AES_CCM (0x00) algorithm does not provide protection against an active man-in-the-middle (MITM) attacker during the provisioning process if OOB public keys are not used. + The Bluetooth Mesh security toolbox based on the `PSA Certified Crypto API`_ does not operate with open key values. After Bluetooth Mesh receives an open key value, it immediately imports the key into the crypto library and receives the unique key identifier. The key identifiers are used in the security toolbox and stored in the persistent memory. diff --git a/doc/nrf/protocols/matter/getting_started/custom_clusters.rst b/doc/nrf/protocols/matter/getting_started/custom_clusters.rst index f0abcc2a6eb9..f0d0b558260c 100644 --- a/doc/nrf/protocols/matter/getting_started/custom_clusters.rst +++ b/doc/nrf/protocols/matter/getting_started/custom_clusters.rst @@ -798,19 +798,159 @@ Then, you need to implement the following command in the application code: // TODO: Implement the plugin server init callback. } -The same applies to the extended commands. +Implement the extension handling in the application code +******************************************************** -.. note:: +The way you handle cluster extensions depends on whether the cluster that you want to extend is implemented using the code-driven approach or with ZAP-generated code. + +If the cluster is implemented using the code-driven approach, you must inherit from this cluster delegate class and implement the methods to handle the customized part. +Then, you must unregister the original cluster delegate and register the customized one. +For example, if you want to extend the ``BasicInformation`` cluster, you need to implement it in the application code as follows: + +* Inherit from the ``BasicInformationCluster`` class and override the methods to handle the customized part. + + .. code-block:: C++ + + #include + #include + #include + + class BasicInformationExtension : public chip::app::Clusters::BasicInformationCluster { + public: + BasicInformationExtension() {} + + /* Overrides the default BasicInformationCluster implementation. */ + chip::app::DataModel::ActionReturnStatus + ReadAttribute(const chip::app::DataModel::ReadAttributeRequest &request, + chip::app::AttributeValueEncoder &encoder) override; + + CHIP_ERROR Attributes(const chip::app::ConcreteClusterPath &path, + chip::ReadOnlyBufferBuilder &builder) override; + + CHIP_ERROR AcceptedCommands(const chip::app::ConcreteClusterPath &path, + chip::ReadOnlyBufferBuilder &builder) override; + + CHIP_ERROR GeneratedCommands(const chip::app::ConcreteClusterPath &path, + chip::ReadOnlyBufferBuilder &builder) override; + + CHIP_ERROR Attributes(const chip::app::ConcreteClusterPath &path, + chip::ReadOnlyBufferBuilder &builder) override; + + chip::app::DataModel::ActionReturnStatus SetExtendedAttribute(bool newExtendedAttribute); + + private: + bool mExtendedAttribute; + }; + +* Implement the body of overridden methods to handle the custom attributes, commands and events. + + .. code-block:: C++ + + #include + #include + #include + + using namespace chip; + using namespace chip::app; + + constexpr AttributeId kExtendedAttributeId = 0x17; + + constexpr DataModel::AttributeEntry kExtraAttributeMetadata[] = { + { kExtendedAttributeId, + {} /* qualities */, + Access::Privilege::kView /* readPriv */, + std::nullopt /* writePriv */ }, + }; + + DataModel::ActionReturnStatus BasicInformationExtension::SetExtendedAttribute(bool newExtendedAttribute) + { + mExtendedAttribute = newExtendedAttribute; + return CHIP_NO_ERROR; + } + + DataModel::ActionReturnStatus BasicInformationExtension::ReadAttribute(const DataModel::ReadAttributeRequest &request, + AttributeValueEncoder &encoder) + { + switch (request.path.mAttributeId) { + case kExtendedAttributeId: + return encoder.Encode(mExtendedAttribute); + default: + return chip::app::Clusters::BasicInformationCluster::ReadAttribute(request, encoder); + } + } + + DataModel::ActionReturnStatus BasicInformationExtension::WriteAttribute(const DataModel::WriteAttributeRequest &request, + AttributeValueDecoder &decoder) + { + switch (request.path.mAttributeId) { + case kExtendedAttributeId: + bool newExtendedAttribute; + ReturnErrorOnFailure(decoder.Decode(newExtendedAttribute)); + return NotifyAttributeChangedIfSuccess(request.path.mAttributeId, SetExtendedAttribute(newExtendedAttribute)); + default: + return chip::app::Clusters::BasicInformationCluster::WriteAttribute(request, decoder); + } + } + + CHIP_ERROR BasicInformationExtension::Attributes(const ConcreteClusterPath &path, + ReadOnlyBufferBuilder &builder) + { + ReturnErrorOnFailure(builder.ReferenceExisting(kExtraAttributeMetadata)); + + return chip::app::Clusters::BasicInformationCluster::Attributes(path, builder); + } - Before the |NCS| v3.2.0, the extended commands callback were handled by the ``emberAf...`` functions. - - For example, if you want to extend the ``BasicInformation`` cluster with the ``ExtendedCommand`` command, you need to implement it in the application code as follows: + CHIP_ERROR BasicInformationExtension::AcceptedCommands(const ConcreteClusterPath &path, + ReadOnlyBufferBuilder &builder) + { + /* The BasicInformationCluster does not have any commands, so it is not necessary to call the implementation of the base class. */ + static constexpr DataModel::AcceptedCommandEntry kAcceptedCommands[] = { + Clusters::BasicInformation::Commands::ExtendedCommand::kMetadataEntry + }; + return builder.ReferenceExisting(kAcceptedCommands); + } + + std::optional + BasicInformationExtension::InvokeCommand(const DataModel::InvokeRequest &request, chip::TLV::TLVReader &input_arguments, + CommandHandler *handler) + { + switch (request.path.mCommandId) { + case Clusters::BasicInformation::Commands::ExtendedCommand::Id: { + /* Implement the command handling logic here */ + } + default: + /* The BasicInformationCluster does not have any commands, so it is not necessary to call the implementation of the base class. */ + return Protocols::InteractionModel::Status::UnsupportedCommand; + } + } + +* Unregister the original cluster delegate and register the customized one. + + .. code-block:: C++ + + #include + + /* Replaces the registered BasicInformation cluster with a customized one that adds random number handling. */ + auto ®istry = chip::app::CodegenDataModelProvider::Instance().Registry(); + + ServerClusterInterface *interface = + registry.Get({ kRootEndpointId, chip::app::Clusters::BasicInformation::Id }); + + VerifyOrDie(interface != nullptr); + + registry.Unregister(interface); + static RegisteredServerCluster sBasicInformationExtension; + + VerifyOrDie(registry.Register(sBasicInformationExtension.Registration()) == CHIP_NO_ERROR); + +If the cluster is implemented with ZAP-generated code, you must implement the required extension callbacks by defining the appropriate ``emberAf...Callback`` functions, as described in the code examples and in the cluster XML. +For example, if you want to extend the ``LevelControl`` cluster with the ``ExtendedCommand`` command, you need to implement it in the application code as follows: .. code-block:: c #include - bool emberAfBasicInformationClusterBasicInformationExtendedCommandCallback(chip::app::CommandHandler *commandObj, const chip::app::ConcreteCommandPath &commandPath, + bool emberAfLevelControlClusterExtendedCommandCallback(chip::app::CommandHandler *commandObj, const chip::app::ConcreteCommandPath &commandPath, const chip::app::Clusters::BasicInformation::Commands::ExtendedCommand::DecodableType &commandData) { // TODO: Implement the command. diff --git a/doc/nrf/protocols/matter/getting_started/hw_requirements.rst b/doc/nrf/protocols/matter/getting_started/hw_requirements.rst index 1b0db3f8582b..d79fbdd055e1 100644 --- a/doc/nrf/protocols/matter/getting_started/hw_requirements.rst +++ b/doc/nrf/protocols/matter/getting_started/hw_requirements.rst @@ -66,35 +66,47 @@ Values are provided in kilobytes (KB). +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ | Sample | MCUboot ROM | Application ROM | Factory data | Settings | Total ROM | Total RAM (incl. static HEAP) | +============================================================================+===============+===================+================+============+=============+=================================+ - | :ref:`Light Bulb ` (Debug) | 28 | 784 | 4 | 32 | 848 | 168 | + | :ref:`Closure ` (Debug) | 28 | 767 | 4 | 32 | 831 | 173 | +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Light Bulb ` (Release) | 28 | 629 | 4 | 32 | 693 | 167 | + | :ref:`Closure ` (Release) | 28 | 620 | 4 | 32 | 684 | 170 | +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Light Switch ` (Debug) | 28 | 748 | 4 | 32 | 812 | 155 | + | :ref:`Contact Sensor ` (Debug) | 28 | 740 | 4 | 32 | 804 | 161 | +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Light Switch ` (Release) | 28 | 589 | 4 | 32 | 653 | 153 | + | :ref:`Contact Sensor ` (Release) | 28 | 589 | 4 | 32 | 653 | 159 | +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Lock ` (Debug) | 28 | 761 | 4 | 32 | 825 | 158 | + | :ref:`Light Bulb ` (Debug) | 28 | 791 | 4 | 32 | 855 | 173 | +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Lock ` (Release) | 28 | 591 | 4 | 32 | 655 | 158 | + | :ref:`Light Bulb ` (Release) | 28 | 637 | 4 | 32 | 701 | 171 | +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Smoke CO Alarm ` (Debug) | 28 | 739 | 4 | 32 | 803 | 156 | + | :ref:`Light Switch ` (Debug) | 28 | 757 | 4 | 32 | 821 | 161 | +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Smoke CO Alarm ` (Release) | 28 | 584 | 4 | 32 | 648 | 156 | + | :ref:`Light Switch ` (Release) | 28 | 599 | 4 | 32 | 663 | 157 | +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Template ` (Debug) | 28 | 700 | 4 | 32 | 764 | 153 | + | :ref:`Lock ` (Debug) | 28 | 770 | 4 | 32 | 834 | 164 | +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Template ` (Release) | 28 | 556 | 4 | 32 | 620 | 152 | + | :ref:`Lock ` (Release) | 28 | 601 | 4 | 32 | 665 | 161 | +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Thermostat ` (Debug) | 28 | 756 | 4 | 32 | 820 | 154 | + | :ref:`Smoke CO Alarm ` (Debug) | 28 | 747 | 4 | 32 | 811 | 162 | +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Thermostat ` (Release) | 28 | 590 | 4 | 32 | 654 | 153 | + | :ref:`Smoke CO Alarm ` (Release) | 28 | 592 | 4 | 32 | 656 | 159 | +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Window Covering ` (Debug) | 28 | 732 | 4 | 32 | 796 | 153 | + | :ref:`Temperature Sensor ` (Debug) | 28 | 739 | 4 | 32 | 803 | 161 | +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Window Covering ` (Release) | 28 | 579 | 4 | 32 | 643 | 153 | + | :ref:`Temperature Sensor ` (Release) | 28 | 589 | 4 | 32 | 653 | 159 | +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Manufacturer Specific ` (Debug) | 28 | 701 | 4 | 32 | 765 | 149 | + | :ref:`Template ` (Debug) | 28 | 707 | 4 | 32 | 771 | 158 | + +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + | :ref:`Template ` (Release) | 28 | 563 | 4 | 32 | 627 | 155 | + +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + | :ref:`Thermostat ` (Debug) | 28 | 766 | 4 | 32 | 830 | 160 | + +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + | :ref:`Thermostat ` (Release) | 28 | 601 | 4 | 32 | 665 | 157 | + +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + | :ref:`Window Covering ` (Debug) | 28 | 741 | 4 | 32 | 805 | 159 | + +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + | :ref:`Window Covering ` (Release) | 28 | 588 | 4 | 32 | 652 | 157 | + +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + | :ref:`Manufacturer Specific ` (Debug) | 28 | 709 | 4 | 32 | 773 | 160 | +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ .. note:: @@ -107,39 +119,51 @@ Values are provided in kilobytes (KB). +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ | Sample | MCUboot ROM | Application ROM | Factory data | Settings | Total ROM | Total RAM (incl. static HEAP) | +============================================================================+===============+===================+================+============+=============+=================================+ - | :ref:`Bridge ` (Debug) | 32 | 645 | 4 | 32 | 713 | 195 | + | :ref:`Bridge ` (Debug) | 32 | 654 | 4 | 32 | 722 | 197 | + +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + | :ref:`Bridge ` (Release) | 32 | 581 | 4 | 32 | 649 | 194 | + +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + | :ref:`Closure ` (Debug) | 32 | 696 | 4 | 32 | 764 | 183 | +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Bridge ` (Release) | 32 | 567 | 4 | 32 | 635 | 193 | + | :ref:`Closure ` (Release) | 32 | 547 | 4 | 32 | 615 | 180 | +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Light Bulb ` (Debug) | 32 | 709 | 4 | 32 | 777 | 177 | + | :ref:`Contact Sensor ` (Debug) | 32 | 668 | 4 | 32 | 736 | 172 | +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Light Bulb ` (Release) | 32 | 553 | 4 | 32 | 621 | 176 | + | :ref:`Contact Sensor ` (Release) | 32 | 516 | 4 | 32 | 584 | 169 | +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Light Switch ` (Debug) | 32 | 673 | 4 | 32 | 741 | 165 | + | :ref:`Light Bulb ` (Debug) | 32 | 719 | 4 | 32 | 787 | 184 | +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Light Switch ` (Release) | 32 | 513 | 4 | 32 | 581 | 163 | + | :ref:`Light Bulb ` (Release) | 32 | 565 | 4 | 32 | 633 | 180 | +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Lock ` (Debug) | 32 | 686 | 4 | 32 | 754 | 168 | + | :ref:`Light Switch ` (Debug) | 32 | 685 | 4 | 32 | 753 | 172 | +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Lock ` (Release) | 32 | 515 | 4 | 32 | 583 | 167 | + | :ref:`Light Switch ` (Release) | 32 | 526 | 4 | 32 | 594 | 167 | +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Smoke CO Alarm ` (Debug) | 32 | 663 | 4 | 32 | 731 | 166 | + | :ref:`Lock ` (Debug) | 32 | 698 | 4 | 32 | 766 | 174 | +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Smoke CO Alarm ` (Release) | 32 | 508 | 4 | 32 | 576 | 165 | + | :ref:`Lock ` (Release) | 32 | 528 | 4 | 32 | 596 | 171 | +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Template ` (Debug) | 32 | 624 | 4 | 32 | 692 | 163 | + | :ref:`Smoke CO Alarm ` (Debug) | 32 | 675 | 4 | 32 | 743 | 172 | +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Template ` (Release) | 32 | 480 | 4 | 32 | 548 | 161 | + | :ref:`Smoke CO Alarm ` (Release) | 32 | 519 | 4 | 32 | 587 | 169 | +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Thermostat ` (Debug) | 32 | 681 | 4 | 32 | 749 | 164 | + | :ref:`Temperature Sensor ` (Debug) | 32 | 667 | 4 | 32 | 735 | 172 | +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Thermostat ` (Release) | 32 | 514 | 4 | 32 | 582 | 162 | + | :ref:`Temperature Sensor ` (Release) | 32 | 516 | 4 | 32 | 584 | 169 | +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Window Covering ` (Debug) | 32 | 657 | 4 | 32 | 725 | 163 | + | :ref:`Template ` (Debug) | 32 | 636 | 4 | 32 | 704 | 169 | +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Window Covering ` (Release) | 32 | 502 | 4 | 32 | 570 | 162 | + | :ref:`Template ` (Release) | 32 | 491 | 4 | 32 | 559 | 165 | +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Manufacturer-Specific ` (Debug) | 32 | 626 | 4 | 32 | 694 | 159 | + | :ref:`Thermostat ` (Debug) | 32 | 694 | 4 | 32 | 762 | 170 | + +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + | :ref:`Thermostat ` (Release) | 32 | 528 | 4 | 32 | 596 | 167 | + +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + | :ref:`Window Covering ` (Debug) | 32 | 669 | 4 | 32 | 737 | 170 | + +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + | :ref:`Window Covering ` (Release) | 32 | 515 | 4 | 32 | 583 | 166 | + +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + | :ref:`Manufacturer Specific ` (Debug) | 32 | 638 | 4 | 32 | 706 | 170 | +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ .. note:: @@ -152,9 +176,9 @@ Values are provided in kilobytes (KB). +---------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ | Sample | MCUboot ROM | Application ROM | Factory data | Settings | Total ROM | Total RAM (incl. static HEAP) | +===============================================================+===============+===================+================+============+=============+=================================+ - | :ref:`Weather Station ` (Debug) | 64 | 722 | 16 | 48 | 850 | 203 | + | :ref:`Weather Station ` (Debug) | 64 | 739 | 16 | 48 | 867 | 209 | +---------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Weather Station ` (Release) | 64 | 530 | 16 | 48 | 658 | 183 | + | :ref:`Weather Station ` (Release) | 64 | 542 | 16 | 48 | 670 | 187 | +---------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ .. tab:: nRF7002 DK @@ -164,31 +188,31 @@ Values are provided in kilobytes (KB). +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ | Sample | MCUboot ROM | Application ROM | Factory data | Settings | Total ROM | Total RAM (incl. static HEAP) | +============================================================================+===============+===================+================+============+=============+=================================+ - | :ref:`Bridge ` (Debug) | 48 | 879 | 4 | 32 | 963 | 303 | + | :ref:`Bridge ` (Debug) | 32 | 808 | 4 | 32 | 876 | 314 | +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Bridge ` (Release) | 48 | 811 | 4 | 32 | 895 | 300 | + | :ref:`Bridge ` (Release) | 32 | 743 | 4 | 32 | 811 | 311 | +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Light Bulb ` (Debug) | 48 | 883 | 4 | 32 | 967 | 295 | + | :ref:`Light Bulb ` (Debug) | 32 | 811 | 4 | 32 | 879 | 307 | +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Light Bulb ` (Release) | 48 | 795 | 4 | 32 | 879 | 289 | + | :ref:`Light Bulb ` (Release) | 32 | 724 | 4 | 32 | 792 | 300 | +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Light Switch ` (Debug) | 48 | 890 | 4 | 32 | 974 | 298 | + | :ref:`Light Switch ` (Debug) | 32 | 819 | 4 | 32 | 887 | 310 | +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Light Switch ` (Release) | 48 | 800 | 4 | 32 | 884 | 290 | + | :ref:`Light Switch ` (Release) | 32 | 731 | 4 | 32 | 799 | 302 | +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Lock ` (Debug) | 48 | 904 | 4 | 32 | 988 | 297 | + | :ref:`Lock ` (Debug) | 32 | 833 | 4 | 32 | 901 | 309 | +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Lock ` (Release) | 48 | 801 | 4 | 32 | 885 | 291 | + | :ref:`Lock ` (Release) | 32 | 731 | 4 | 32 | 799 | 303 | +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Template ` (Debug) | 48 | 852 | 4 | 32 | 936 | 294 | + | :ref:`Template ` (Debug) | 32 | 780 | 4 | 32 | 848 | 306 | +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Template ` (Release) | 48 | 770 | 4 | 32 | 854 | 288 | + | :ref:`Template ` (Release) | 32 | 699 | 4 | 32 | 767 | 299 | +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Thermostat ` (Debug) | 48 | 898 | 4 | 32 | 982 | 295 | + | :ref:`Thermostat ` (Debug) | 32 | 828 | 4 | 32 | 896 | 307 | +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Thermostat ` (Release) | 48 | 801 | 4 | 32 | 885 | 289 | + | :ref:`Thermostat ` (Release) | 32 | 733 | 4 | 32 | 801 | 300 | +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Manufacturer Specific ` (Debug) | 48 | 854 | 4 | 32 | 938 | 294 | + | :ref:`Manufacturer Specific ` (Debug) | 32 | 783 | 4 | 32 | 851 | 306 | +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ @@ -202,37 +226,49 @@ Values are provided in kilobytes (KB). +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ | Sample | MCUboot ROM | Application ROM | Factory data | Settings | Total ROM | Total RAM (incl. static HEAP) | +============================================================================+===============+===================+================+============+=============+=================================+ - | :ref:`Light Bulb ` (Debug) | 52 | 777 | 4 | 40 | 873 | 176 | + | :ref:`Closure ` (Debug) | 52 | 765 | 4 | 40 | 861 | 179 | + +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + | :ref:`Closure ` (Release) | 52 | 613 | 4 | 40 | 709 | 175 | + +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + | :ref:`Contact Sensor ` (Debug) | 52 | 736 | 4 | 40 | 832 | 167 | + +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + | :ref:`Contact Sensor ` (Release) | 52 | 582 | 4 | 40 | 678 | 164 | + +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + | :ref:`Light Bulb ` (Debug) | 52 | 788 | 4 | 40 | 884 | 179 | +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Light Bulb ` (Release) | 52 | 617 | 4 | 40 | 713 | 172 | + | :ref:`Light Bulb ` (Release) | 52 | 631 | 4 | 40 | 727 | 175 | +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Light Switch ` (Debug) | 52 | 741 | 4 | 40 | 837 | 164 | + | :ref:`Light Switch ` (Debug) | 52 | 754 | 4 | 40 | 850 | 167 | +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Light Switch ` (Release) | 52 | 577 | 4 | 40 | 673 | 159 | + | :ref:`Light Switch ` (Release) | 52 | 592 | 4 | 40 | 688 | 162 | +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Lock ` (Debug) | 52 | 753 | 4 | 40 | 849 | 167 | + | :ref:`Lock ` (Debug) | 52 | 766 | 4 | 40 | 862 | 170 | +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Lock ` (Release) | 52 | 578 | 4 | 40 | 674 | 162 | + | :ref:`Lock ` (Release) | 52 | 593 | 4 | 40 | 689 | 165 | +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Smoke CO Alarm ` (Debug) | 52 | 731 | 4 | 40 | 827 | 165 | + | :ref:`Smoke CO Alarm ` (Debug) | 52 | 743 | 4 | 40 | 839 | 168 | +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Smoke CO Alarm ` (Release) | 52 | 572 | 4 | 40 | 668 | 161 | + | :ref:`Smoke CO Alarm ` (Release) | 52 | 585 | 4 | 40 | 681 | 164 | +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Template ` (Debug) | 52 | 694 | 4 | 40 | 790 | 161 | + | :ref:`Temperature Sensor ` (Debug) | 52 | 736 | 4 | 40 | 832 | 167 | +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Template ` (Release) | 52 | 545 | 4 | 40 | 641 | 157 | + | :ref:`Temperature Sensor ` (Release) | 52 | 582 | 4 | 40 | 678 | 164 | +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Template ` (Release Internal Memory) | 52 | 539 | 4 | 40 | 635 | 158 | + | :ref:`Template ` (Debug) | 52 | 705 | 4 | 40 | 801 | 164 | +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Thermostat ` (Debug) | 52 | 749 | 4 | 40 | 845 | 162 | + | :ref:`Template ` (Release Internal Memory) | 52 | 551 | 4 | 40 | 647 | 160 | +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Thermostat ` (Release) | 52 | 579 | 4 | 40 | 675 | 158 | + | :ref:`Template ` (Release) | 52 | 557 | 4 | 40 | 653 | 160 | +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Window Covering ` (Debug) | 52 | 724 | 4 | 40 | 820 | 162 | + | :ref:`Thermostat ` (Debug) | 52 | 763 | 4 | 40 | 859 | 166 | +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Window Covering ` (Release) | 52 | 566 | 4 | 40 | 662 | 158 | + | :ref:`Thermostat ` (Release) | 52 | 594 | 4 | 40 | 690 | 161 | +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Manufacturer Specific ` (Debug) | 52 | 696 | 4 | 40 | 792 | 158 | + | :ref:`Window Covering ` (Debug) | 52 | 738 | 4 | 40 | 834 | 165 | + +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + | :ref:`Window Covering ` (Release) | 52 | 581 | 4 | 40 | 677 | 161 | + +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + | :ref:`Manufacturer Specific ` (Debug) | 52 | 707 | 4 | 40 | 803 | 165 | +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ @@ -246,21 +282,21 @@ Values are provided in kilobytes (KB). +----------------------------------------------------------------------------+---------------+------------+-------------------+----------------+------------+----------------+-------------+---------------------------------+ | Sample | MCUboot ROM | TF-M ROM | Application ROM | Factory data | Settings | TF-M Storage | Total ROM | Total RAM (incl. static HEAP) | +============================================================================+===============+============+===================+================+============+================+=============+=================================+ - | :ref:`Light Bulb ` (Debug) | 52 | 126 | 746 | 4 | 40 | 32 | 1000 | 223 | + | :ref:`Light Bulb ` (Debug) | 52 | 126 | 757 | 4 | 40 | 32 | 1011 | 226 | +----------------------------------------------------------------------------+---------------+------------+-------------------+----------------+------------+----------------+-------------+---------------------------------+ - | :ref:`Light Switch ` (Debug) | 52 | 126 | 710 | 4 | 40 | 32 | 964 | 210 | + | :ref:`Light Switch ` (Debug) | 52 | 126 | 723 | 4 | 40 | 32 | 977 | 214 | +----------------------------------------------------------------------------+---------------+------------+-------------------+----------------+------------+----------------+-------------+---------------------------------+ - | :ref:`Lock ` (Debug) | 52 | 126 | 723 | 4 | 40 | 32 | 977 | 213 | + | :ref:`Lock ` (Debug) | 52 | 126 | 735 | 4 | 40 | 32 | 989 | 216 | +----------------------------------------------------------------------------+---------------+------------+-------------------+----------------+------------+----------------+-------------+---------------------------------+ - | :ref:`Template ` (Debug) | 52 | 126 | 663 | 4 | 40 | 32 | 917 | 208 | + | :ref:`Template ` (Debug) | 52 | 126 | 674 | 4 | 40 | 32 | 928 | 211 | +----------------------------------------------------------------------------+---------------+------------+-------------------+----------------+------------+----------------+-------------+---------------------------------+ - | :ref:`Template ` (Release) | 52 | 126 | 522 | 4 | 40 | 32 | 776 | 204 | + | :ref:`Template ` (Release) | 52 | 126 | 534 | 4 | 40 | 32 | 788 | 207 | +----------------------------------------------------------------------------+---------------+------------+-------------------+----------------+------------+----------------+-------------+---------------------------------+ - | :ref:`Thermostat ` (Debug) | 52 | 126 | 719 | 4 | 40 | 32 | 973 | 209 | + | :ref:`Thermostat ` (Debug) | 52 | 126 | 732 | 4 | 40 | 32 | 986 | 212 | +----------------------------------------------------------------------------+---------------+------------+-------------------+----------------+------------+----------------+-------------+---------------------------------+ - | :ref:`Window Covering ` (Debug) | 52 | 126 | 694 | 4 | 40 | 32 | 948 | 209 | + | :ref:`Window Covering ` (Debug) | 52 | 126 | 707 | 4 | 40 | 32 | 961 | 212 | +----------------------------------------------------------------------------+---------------+------------+-------------------+----------------+------------+----------------+-------------+---------------------------------+ - | :ref:`Manufacturer Specific ` (Debug) | 52 | 126 | 665 | 4 | 40 | 32 | 919 | 204 | + | :ref:`Manufacturer Specific ` (Debug) | 52 | 126 | 676 | 4 | 40 | 32 | 930 | 212 | +----------------------------------------------------------------------------+---------------+------------+-------------------+----------------+------------+----------------+-------------+---------------------------------+ .. note:: @@ -270,71 +306,97 @@ Values are provided in kilobytes (KB). The following table lists memory requirements for samples running on the :zephyr:board:`nrf54lm20dk`. - +--------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | Sample | MCUboot ROM | Application ROM | Factory data | Settings | Total ROM | Total RAM (incl. static HEAP) | - +====================================================================+===============+===================+================+============+=============+=================================+ - | :ref:`Light Bulb ` (Debug) | 52 | 780 | 4 | 48 | 884 | 177 | - +--------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Light Bulb ` (Release) | 52 | 619 | 4 | 48 | 723 | 172 | - +--------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Light Switch ` (Debug) | 52 | 743 | 4 | 48 | 847 | 164 | - +--------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Light Switch ` (Release) | 52 | 579 | 4 | 48 | 683 | 159 | - +--------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Lock ` (Debug) | 52 | 756 | 4 | 48 | 860 | 167 | - +--------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Lock ` (Release) | 52 | 580 | 4 | 48 | 684 | 163 | - +--------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Smoke CO Alarm ` (Debug) | 52 | 732 | 4 | 48 | 836 | 165 | - +--------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Smoke CO Alarm ` (Release) | 52 | 572 | 4 | 48 | 676 | 161 | - +--------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Template ` (Debug) | 52 | 697 | 4 | 48 | 801 | 162 | - +--------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Template ` (Release) | 52 | 547 | 4 | 48 | 651 | 158 | - +--------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Template ` (Release Internal Memory) | 40 | 541 | 4 | 48 | 633 | 158 | - +--------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Thermostat ` (Debug) | 52 | 752 | 4 | 48 | 856 | 163 | - +--------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Thermostat ` (Release) | 52 | 581 | 4 | 48 | 685 | 158 | - +--------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Window Covering ` (Debug) | 52 | 727 | 4 | 48 | 831 | 163 | - +--------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Window Covering ` (Release) | 52 | 568 | 4 | 48 | 672 | 158 | - +--------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + | Sample | MCUboot ROM | Application ROM | Factory data | Settings | Total ROM | Total RAM (incl. static HEAP) | + +============================================================================+===============+===================+================+============+=============+=================================+ + | :ref:`Bridge ` (Debug) | 52 | 789 | 4 | 48 | 893 | 206 | + +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + | :ref:`Bridge ` (Release) | 52 | 654 | 4 | 48 | 758 | 205 | + +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + | :ref:`Closure ` (Debug) | 52 | 765 | 4 | 48 | 869 | 179 | + +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + | :ref:`Closure ` (Release Internal Memory) | 40 | 608 | 4 | 48 | 700 | 175 | + +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + | :ref:`Closure ` (Release) | 52 | 613 | 4 | 48 | 717 | 175 | + +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + | :ref:`Contact Sensor ` (Debug) | 52 | 736 | 4 | 48 | 840 | 167 | + +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + | :ref:`Contact Sensor ` (Release) | 52 | 582 | 4 | 48 | 686 | 164 | + +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + | :ref:`Light Bulb ` (Debug) | 52 | 789 | 4 | 48 | 893 | 179 | + +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + | :ref:`Light Bulb ` (Release) | 52 | 631 | 4 | 48 | 735 | 175 | + +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + | :ref:`Light Switch ` (Debug) | 52 | 754 | 4 | 48 | 858 | 167 | + +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + | :ref:`Light Switch ` (Release) | 52 | 592 | 4 | 48 | 696 | 162 | + +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + | :ref:`Lock ` (Debug) | 52 | 767 | 4 | 48 | 871 | 170 | + +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + | :ref:`Lock ` (Release) | 52 | 593 | 4 | 48 | 697 | 166 | + +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + | :ref:`Smoke CO Alarm ` (Debug) | 52 | 744 | 4 | 48 | 848 | 168 | + +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + | :ref:`Smoke CO Alarm ` (Release) | 52 | 585 | 4 | 48 | 689 | 164 | + +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + | :ref:`Temperature Sensor ` (Debug) | 52 | 736 | 4 | 48 | 840 | 167 | + +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + | :ref:`Temperature Sensor ` (Release) | 52 | 582 | 4 | 48 | 686 | 164 | + +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + | :ref:`Template ` (Debug) | 52 | 705 | 4 | 48 | 809 | 164 | + +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + | :ref:`Template ` (Release Internal Memory) | 40 | 551 | 4 | 48 | 643 | 161 | + +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + | :ref:`Template ` (Release) | 52 | 557 | 4 | 48 | 661 | 160 | + +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + | :ref:`Thermostat ` (Debug) | 52 | 764 | 4 | 48 | 868 | 166 | + +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + | :ref:`Thermostat ` (Release) | 52 | 594 | 4 | 48 | 698 | 161 | + +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + | :ref:`Window Covering ` (Debug) | 52 | 738 | 4 | 48 | 842 | 165 | + +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + | :ref:`Window Covering ` (Release) | 52 | 581 | 4 | 48 | 685 | 161 | + +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + | :ref:`Manufacturer Specific ` (Debug) | 52 | 707 | 4 | 48 | 811 | 166 | + +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ .. tab:: nRF54LM20 DK with nRF7002-EB II The following table lists memory requirements for samples running on the :zephyr:board:`nrf54lm20dk` with the nRF7002-EB II. - +------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | Sample | MCUboot ROM | Application ROM | Factory data | Settings | Total ROM | Total RAM (incl. static HEAP) | - +============================================================+===============+===================+================+============+=============+=================================+ - | :ref:`Bridge ` (Debug) | 52 | 922 | 4 | 48 | 1026 | 332 | - +------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Bridge ` (Release) | 52 | 857 | 4 | 48 | 961 | 330 | - +------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Light Bulb ` (Debug) | 52 | 1013 | 4 | 48 | 1117 | 312 | - +------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Light Bulb ` (Release) | 52 | 840 | 4 | 48 | 944 | 306 | - +------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Light Switch ` (Debug) | 52 | 1021 | 4 | 48 | 1125 | 315 | - +------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Light Switch ` (Release) | 52 | 845 | 4 | 48 | 949 | 308 | - +------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Lock ` (Debug) | 52 | 1036 | 4 | 48 | 1140 | 314 | - +------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Lock ` (Release) | 52 | 846 | 4 | 48 | 950 | 309 | - +------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Template ` (Debug) | 52 | 979 | 4 | 48 | 1083 | 311 | - +------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Template ` (Release) | 52 | 816 | 4 | 48 | 920 | 306 | - +------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Thermostat ` (Debug) | 52 | 1031 | 4 | 48 | 1135 | 312 | - +------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ - | :ref:`Thermostat ` (Release) | 52 | 847 | 4 | 48 | 951 | 306 | - +------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + | Sample | MCUboot ROM | Application ROM | Factory data | Settings | Total ROM | Total RAM (incl. static HEAP) | + +============================================================================+===============+===================+================+============+=============+=================================+ + | :ref:`Bridge ` (Debug) | 52 | 1026 | 4 | 48 | 1130 | 335 | + +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + | :ref:`Bridge ` (Release) | 52 | 876 | 4 | 48 | 980 | 333 | + +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + | :ref:`Closure ` (Debug) | 52 | 1003 | 4 | 48 | 1107 | 312 | + +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + | :ref:`Closure ` (Release) | 52 | 835 | 4 | 48 | 939 | 307 | + +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + | :ref:`Light Bulb ` (Debug) | 52 | 1024 | 4 | 48 | 1128 | 313 | + +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + | :ref:`Light Bulb ` (Release) | 52 | 850 | 4 | 48 | 954 | 307 | + +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + | :ref:`Light Switch ` (Debug) | 52 | 1033 | 4 | 48 | 1137 | 316 | + +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + | :ref:`Light Switch ` (Release) | 52 | 856 | 4 | 48 | 960 | 309 | + +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + | :ref:`Lock ` (Debug) | 52 | 1047 | 4 | 48 | 1151 | 315 | + +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + | :ref:`Lock ` (Release) | 52 | 857 | 4 | 48 | 961 | 310 | + +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + | :ref:`Template ` (Debug) | 52 | 988 | 4 | 48 | 1092 | 312 | + +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + | :ref:`Template ` (Release) | 52 | 825 | 4 | 48 | 929 | 306 | + +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + | :ref:`Thermostat ` (Debug) | 52 | 1044 | 4 | 48 | 1148 | 313 | + +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + | :ref:`Thermostat ` (Release) | 52 | 859 | 4 | 48 | 963 | 308 | + +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + | :ref:`Manufacturer Specific ` (Debug) | 52 | 990 | 4 | 48 | 1094 | 312 | + +----------------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ .. _ug_matter_hw_requirements_layouts: diff --git a/doc/nrf/protocols/matter/getting_started/low_power_configuration.rst b/doc/nrf/protocols/matter/getting_started/low_power_configuration.rst index 4142b328feab..55c7122e2f48 100644 --- a/doc/nrf/protocols/matter/getting_started/low_power_configuration.rst +++ b/doc/nrf/protocols/matter/getting_started/low_power_configuration.rst @@ -7,7 +7,7 @@ Reducing power consumption in Matter :local: :depth: 2 -The Matter protocol can be used in various device types that are designed to be battery supplied, where a low power consumption is of critical importance. +The Matter protocol can be used in various device types that are designed to be battery supplied, where low power consumption is of critical importance. There are many ways to reduce the power consumption in your application, including methods related to the adopted network technology, disabling specific modules, or configuring features meant for optimizing power consumption. See the following sections for more information. @@ -204,7 +204,7 @@ Configure Bluetooth LE advertising duration A Matter device uses Bluetooth® Low Energy (LE) to advertise its service for device commissioning purposes. The duration of this advertising is configurable and can last up to 15 minutes in the standard mode and up to 48 hours in the Extended Announcement mode. -An extended advertising duration may improve the user experience, as it gives more time for the user to setup the device, but it also increases the energy consumption. +An extended advertising duration may improve the user experience, as it gives more time for the user to set up the device, but it also increases the energy consumption. Selecting the optimal advertising duration is a compromise and depends on the specific application use case. Use the following Kconfig options to configure the advertising and reduce the consumed energy: diff --git a/doc/nrf/protocols/wifi/wifi_direct.rst b/doc/nrf/protocols/wifi/wifi_direct.rst index ad08a6a55c40..2ef4f5dd026d 100644 --- a/doc/nrf/protocols/wifi/wifi_direct.rst +++ b/doc/nrf/protocols/wifi/wifi_direct.rst @@ -107,14 +107,12 @@ To get detailed information about a specific peer, use the following commands: wpa_cli p2p_peer -For example: +For example, to display detailed information about a specified peer device, use the following command: .. code-block:: console wpa_cli p2p_peer D2:39:FA:43:23:C1 -This command displays detailed information about the specified peer device. - Connecting to a peer ==================== @@ -134,7 +132,7 @@ To establish a Wi-Fi Direct connection with a discovered peer: wpa_cli p2p_connect go_intent= -Parameters: +This command uses the following parameters: * ```` - MAC address of the peer device to connect to. * ```` - WPS provisioning method: diff --git a/doc/nrf/releases_and_maturity/abi_compatibility.rst b/doc/nrf/releases_and_maturity/abi_compatibility.rst index 6eac3f859c59..9f3fc7c2176b 100644 --- a/doc/nrf/releases_and_maturity/abi_compatibility.rst +++ b/doc/nrf/releases_and_maturity/abi_compatibility.rst @@ -74,6 +74,17 @@ nRF54H20 IronSide SE binaries changelog The following sections provide detailed lists of changes by component. + +IronSide Secure Element (IronSide SE) v23.1.1+20 +================================================ + +Fixed +----- + +* L2CACHE now prefetches several cache lines when an L2 cache miss occurs. (HM-26346) + This will improve L2 cache performance in some situations and reduce L2 cache performance in other situations. +* Fixed unintentional behavior of ``psa_copy_key()`` when it was used in an attempt to create a revocable key. (NCSDK-36369) + IronSide Secure Element (IronSide SE) v23.1.0+19 ================================================ diff --git a/doc/nrf/releases_and_maturity/migration/2.4.99-cs3_to_2.6.99-cs2/migration_guide_2.4.99-cs3_to_2.6.99-cs2_environment.rst b/doc/nrf/releases_and_maturity/migration/2.4.99-cs3_to_2.6.99-cs2/migration_guide_2.4.99-cs3_to_2.6.99-cs2_environment.rst index 6cb1e79c1ca6..97cb2c27600d 100644 --- a/doc/nrf/releases_and_maturity/migration/2.4.99-cs3_to_2.6.99-cs2/migration_guide_2.4.99-cs3_to_2.6.99-cs2_environment.rst +++ b/doc/nrf/releases_and_maturity/migration/2.4.99-cs3_to_2.6.99-cs2/migration_guide_2.4.99-cs3_to_2.6.99-cs2_environment.rst @@ -257,7 +257,7 @@ Programming the BICR The Board Information Configuration Registers (BICR) are non-volatile memory (NVM) registers that contain information on how the nRF54H20 SoC must interact with other board elements, including the information about the power and clock delivery to the SoC. To prepare the nRF54H20 DK for first use, you must manually program the values of the BICR using a precompiled BICR binary file (:file:`bicr_ext_loadcap.hex`). -1. Download the `BICR binary file`_ . +1. Download the ``BICR binary file``. #. List all the connected development kits to see their serial number (matching the one on the DK's sticker):: nrfutil device list diff --git a/doc/nrf/releases_and_maturity/migration/migration_guide_3.2.rst b/doc/nrf/releases_and_maturity/migration/migration_guide_3.2.rst index 78f53aedacab..7f105a1e2889 100644 --- a/doc/nrf/releases_and_maturity/migration/migration_guide_3.2.rst +++ b/doc/nrf/releases_and_maturity/migration/migration_guide_3.2.rst @@ -24,6 +24,19 @@ Required changes The following changes are mandatory to make your application work in the same way as in previous releases. +nRF54L +====== + +This section describes the changes specific to the nRF54L series SoCs and DKs support in the |NCS|. + +nRF54L pin cross power-domain use +--------------------------------- + +.. toggle:: + + * You must enable the Constant Latency sub-power mode from the application to allow cross power-domain pin mapping. + For details, see the :ref:`ug_nrf54l_pinmap` page. + nRF54H20 ======== @@ -62,6 +75,110 @@ Samples and applications This section describes the changes related to samples and applications. +nRF Desktop +----------- + +.. toggle:: + + * The configuration of the ``nrf54h20dk/nrf54h20/cpuapp`` board target has been updated in the nRF Desktop application to migrate from the SUIT solution to the IronSide SE solution. + To migrate the configuration for your nRF Desktop based application, complete the following steps: + + 1. Remove the Kconfig options related to the SUIT solution in your project configuration files (for example, :file:`prj.conf`). + #. Configure the MCUboot bootloader in your sysbuild configuration file: + + * :kconfig:option:`SB_CONFIG_BOOTLOADER_MCUBOOT` to ``y``. + * :kconfig:option:`SB_CONFIG_MCUBOOT_MODE_DIRECT_XIP` to ``y``. + * :kconfig:option:`SB_CONFIG_BOOT_SIGNATURE_TYPE_ED25519` to ``y``. + * :kconfig:option:`SB_CONFIG_BOOT_SIGNATURE_TYPE_PURE` to ``y``. + * :kconfig:option:`SB_CONFIG_BOOT_SIGNATURE_KEY_FILE` to the path of the private key file which is used to sign the DFU package. + * :kconfig:option:`SB_CONFIG_MCUBOOT_IMAGES_ROM_END_OFFSET_AUTO` to ``ipc_radio;ipc_radio_secondary_app``. + In the case of a merged image slot, space for the MCUboot trailer is only reserved in the radio slots. + + .. note:: + The nRF Desktop configuration for the ``nrf54h20dk/nrf54h20/cpuapp`` board target uses the MCUboot bootloader in the direct-xip mode. + You can configure other MCUboot bootloader modes (for example, the swap mode) in the nRF Desktop application, but they are not used as part of the nRF Desktop configuration for the ``nrf54h20dk/nrf54h20/cpuapp`` board target and are not covered by this migration guide. + The nRF Desktop application also configures the MCUboot bootloader to use the merged image slot that combines both application and radio core images. + The merged image slot is the default configuration for the direct-xip mode. + Other ways of partitioning the application and radio core images are not covered by this migration guide. + + #. Add the configuration files for the MCUboot bootloader image to your application configuration. + See the :file:`nrf/applications/nrf_desktop/configuration/nrf54h20dk_nrf54h20_cpuapp/images/mcuboot` directory for an example. + + Note the following Kconfig options that are specific to the nRF54H configuration of the MCUboot bootloader: + + * :kconfig:option:`CONFIG_SOC_EARLY_RESET_HOOK` to ``y`` - This option is required to support the Suspend to RAM (S2RAM) functionality in the application. + With this Kconfig option, the MCUboot bootloader can detect a wake-up from S2RAM and redirect the execution to the application’s resume routine. + * :kconfig:option:`CONFIG_POWER_DOMAIN` to ``n`` - This option is required to disable the power domain management in the bootloader and simplify its configuration. + * :kconfig:option:`CONFIG_NRF_SECURITY`, :kconfig:option:`CONFIG_MULTITHREADING` and :kconfig:option:`CONFIG_PSA_SSF_CRYPTO_CLIENT` to ``y`` - These options are required to support the hardware cryptography in the MCUboot bootloader and its dependencies. + + #. Since the MCUboot bootloader in the direct-xip mode uses a merged image slot for the ``nrf54h20dk/nrf54h20/cpuapp`` board target, define the custom memory layout in DTS (the ``partitions`` DTS node) and ensure that this DTS customization is propagated to every image that is built as part of the nRF Desktop application. + See the :file:`nrf/applications/nrf_desktop/configuration/nrf54h20dk_nrf54h20_cpuapp/memory_map.dtsi` file for an example of the memory layout file and the :file:`nrf/applications/nrf_desktop/configuration/nrf54h20dk_nrf54h20_cpuapp/images/mcuboot/app.overlay` file for an example integration of the custom memory layout into the MCUboot bootloader image. + Apart from the MCUboot bootloader image, include the custom memory layout in the following images: + + * The ``nrf_desktop`` image (the default application image) + * The ``ipc_radio`` image + * The ``uicr`` image + + To verify that the custom memory layout is propagated to all the images, use the :file:`//zephyr/zephyr.dts` file and validate it for each image. + + .. note:: + The |NCS| v3.2.0 introduces a new image ``uicr`` for the ``nrf54h20dk/nrf54h20/cpuapp`` board target. + Include the custom memory layout in the ``uicr`` image as well to prevent runtime issues. + See the :file:`nrf/applications/nrf_desktop/configuration/nrf54h20dk_nrf54h20_cpuapp/images/uicr/app.overlay` file for an example integration of the custom memory layout into the ``uicr`` image. + + Assign the secondary image partition to the ``secondary_app_partition`` DTS label in the DTS configuration of your primary image: + + * For the ``nrf_desktop`` (primary) image and the ``mcuboot_secondary_app`` (secondary) image, use the following DTS configuration: + + .. code-block:: + + secondary_app_partition: &cpuapp_slot1_partition {}; + + * For the ``ipc_radio`` (primary) image and the ``ipc_radio_secondary_app`` (secondary) image, use the following DTS configuration: + + .. code-block:: + + secondary_app_partition: &cpurad_slot1_partition {}; + + #. Optionally, you can enable the following Kconfig options to improve the HID report rate over USB by suspending Bluetooth when USB is connected: + + * :kconfig:option:`CONFIG_DESKTOP_BLE_ADV_CTRL_ENABLE` + * :kconfig:option:`CONFIG_DESKTOP_BLE_ADV_CTRL_SUSPEND_ON_USB` + + #. Remove the usage of the following Kconfig options related to the S2RAM functionality: + + * :kconfig:option:`CONFIG_PM_S2RAM` + * :kconfig:option:`CONFIG_PM_S2RAM_CUSTOM_MARKING` + + .. note:: + The S2RAM functionality is now enabled by default for the ``nrf54h20dk/nrf54h20/cpuapp`` board target when the :kconfig:option:`CONFIG_PM` Kconfig option is enabled. + The setting of the :kconfig:option:`CONFIG_PM_S2RAM` Kconfig option is now controlled by the devicetree (DTS) description. + + #. Remove the ``pwmleds`` DTS node from the application configuration to prevent the :kconfig:option:`CONFIG_LED_PWM` and :kconfig:option:`CONFIG_CAF_LEDS_PWM` Kconfig options from being enabled for the ``nrf54h20dk/nrf54h20/cpuapp`` board target. + + .. code-block:: + + / { + /delete-node/ pwmleds; + + aliases { + /delete-property/ pwm-led0; + }; + }; + + .. note:: + The nRF Desktop configuration for the ``nrf54h20dk/nrf54h20/cpuapp`` board target relies on GPIO LEDs - the PWM LEDs are not used. + + #. Disable Link Time Optimization (LTO) as a workaround for linker warnings about the type mismatch (``-Wlto-type-mismatch``) that are caused by the :file:`device_deps.c` file (used by the Zephyr power domain driver): + + * :kconfig:option:`CONFIG_LTO` + * :kconfig:option:`CONFIG_ISR_TABLES_LOCAL_DECLARATION` + + #. Replace the ``interface-name`` property with the ``label`` property in all DTS nodes that set the ``compatible`` property to ``zephyr,hid-device``. + See the :file:`nrf/applications/nrf_desktop/configuration/nrf54h20dk_nrf54h20_cpuapp/app.overlay` file for an example. + + For more information regarding differences between SUIT and IronSide SE solutions, see the :ref:`migration_3.1_54h_suit_ironside` document. + Matter ------ @@ -104,11 +221,72 @@ Matter To build your custom board with Wi-Fi support, set both the :kconfig:option:`CONFIG_CHIP_WIFI` and :kconfig:option:`CONFIG_WIFI_NRF70` Kconfig options to ``y``. - * The :file:`zap-generated` directory now includes the :file:`CodeDrivenCallback.h` and :file:`CodeDrivenInitShutdown.cpp` files. - The Matter build system gradually moves to the new approach of data model handling and does not auto-generate some bits of a code responsible for command handling anymore. - Invoking the ``west zap-generate`` command removes command handler implementations from the existing :file:`IMClusterCommandHandler.cpp` file. - To fix this, you must now manually create the :file:`CodeDrivenCallback.h` and :file:`CodeDrivenInitShutdown.cpp` files, and implement the ``MatterClusterServerInitCallback`` and ``MatterClusterServerShutdownCallback`` callbacks to handle server initialization, shutdown, and Matter cluster commands. - Ensure that these callbacks contain your application's command handling logic as required. + * The Matter build system is transitioning to a code-driven approach for Data Model and Cluster configuration handling. + This approach assumes gradual replacement of the configuration based on the ZAP files and the ZAP-generated code, and handling the configuration in the source code. + This change has the following impacts: + + * The :file:`zap-generated` directory now includes the :file:`CodeDrivenCallback.h` and :file:`CodeDrivenInitShutdown.cpp` files. + Invoking the ``west zap-generate`` command removes command handler implementations from the existing :file:`IMClusterCommandHandler.cpp` file. + To fix this, you must now manually create the :file:`CodeDrivenCallback.h` and :file:`CodeDrivenInitShutdown.cpp` files, and implement the ``MatterClusterServerInitCallback`` and ``MatterClusterServerShutdownCallback`` callbacks to handle server initialization, shutdown, and Matter cluster commands. + Ensure that these callbacks contain your application's command handling logic. + * The code-driven approach is not yet fully implemented for all available clusters, but the coverage will be increasing and it is used for the newly created clusters. + The following clusters are already ported using the code-driven approach: + + * Access Control + * Administrator Commissioning + * Basic Information + * Binding + * Boolean State + * Descriptor + * Diagnostic Logs + * Ethernet Network Diagnostics + * Fixed Label + * General Commissioning + * General Diagnostics + * Group Key Management + * Groupcast + * Identify + * Localization Configuration + * OTA Software Update Provider + * Operational Credentials + * Push AV Stream Transport + * Software Diagnostics + * Time Format Localization + * User Label + * Wi-Fi Network Diagnostics + + For the full list of clusters and their migration status, see the `Matter Clusters Code-Driven support`_ file. + + * By default, all the mandatory attributes are enabled for the cluster. + To enable an optional attribute or set an optional feature in the feature map, you must do that in the source code by calling dedicated methods. + For example, to enable the Positioning feature and the ``CountdownTime`` optional attribute for the Closure Control cluster, perform the following operations: + + * Implement a delegate class for the Closure Control cluster. + See the :file:`samples/matter/closure/src/closure_control_endpoint.h` file for an example. + * Enable the attribute and set the feature on cluster initialization. + See the ``ClosureControlEndpoint::Init`` function in the :file:`samples/matter/closure/src/closure_control_endpoint.cpp` file for an example. + + * To enable an optional cluster, you must register it in the source code by calling a dedicated method. + For example, to enable the Identify cluster, implement the following code: + + .. code-block:: C++ + + #include + #include + + chip::app::RegisteredServerCluster mIdentifyCluster; + chip::app::CodegenDataModelProvider::Instance().Registry().Register(mIdentifyCluster.Registration()); + + * To enable a cluster extension for the cluster that is already implemented using the code-driven approach, you must inherit from this cluster delegate class and implement the methods to handle the customized part. + You also have to unregister the original cluster delegate and register the customized one. + For example, to enable a cluster extension for the Basic Information cluster, perform the following operations: + + * Inherit from the ``BasicInformationCluster`` class and override the methods to handle the customized part. + See the :file:`samples/matter/manufacturer_specific/src/basic_information_extension.h` file for an example. + * Implement the body of overridden methods to handle the custom attributes, commands, and events. + See the :file:`samples/matter/manufacturer_specific/src/basic_information_extension.cpp` file for an example. + * Unregister the original cluster delegate and register the customized one. + See the ``AppTask::StartApp`` function in the :file:`samples/matter/manufacturer_specific/src/app_task.cpp` file for an example. * :ref:`matter_lock_sample` sample: @@ -291,3 +469,245 @@ Memfault integration * :kconfig:option:`CONFIG_MEMFAULT_NCS_DEVICE_ID_RUNTIME` - Use a runtime-applied device ID, commonly used when the serial number of the device is written into settings at manufacturing time, for example. * :kconfig:option:`CONFIG_MEMFAULT_NCS_DEVICE_ID_IMEI` (deprecated) - Use the LTE modem IMEI as the device ID. * :kconfig:option:`CONFIG_MEMFAULT_NCS_DEVICE_ID_NET_MAC` (deprecated) - Use the network interface MAC address as the device ID. + +Drivers +======= + +This section provides detailed lists of changes by drivers. + +nrfx +---- + +.. toggle:: + + * nrfx version has been updated to 4.0. + For nrfx changes see `nrfx 4.0 migration note`_. + + Additionally, to migrate a Zephyr build system application that uses nrfx API directly, complete the following steps: + + #. Kconfig options: + + * Replace: + + * Use :kconfig:option:`CONFIG_NRFX_GPPI` instead of the following: + + * ``CONFIG_NRFX_DPPI`` + * ``CONFIG_NRFX_DPPI0`` + * ``CONFIG_NRFX_DPPI00`` + * ``CONFIG_NRFX_DPPI10`` + * ``CONFIG_NRFX_DPPI20`` + * ``CONFIG_NRFX_DPPI30`` + * ``CONFIG_NRFX_DPPI020`` + * ``CONFIG_NRFX_DPPI120`` + * ``CONFIG_NRFX_DPPI130`` + * ``CONFIG_NRFX_DPPI131`` + * ``CONFIG_NRFX_DPPI132`` + * ``CONFIG_NRFX_DPPI133`` + * ``CONFIG_NRFX_DPPI134`` + * ``CONFIG_NRFX_DPPI135`` + * ``CONFIG_NRFX_DPPI136`` + * ``CONFIG_NRFX_PPI`` + + * Use :kconfig:option:`CONFIG_NRFX_I2S` instead of the following: + + * ``CONFIG_NRFX_I2S0`` + * ``CONFIG_NRFX_I2S20`` + + * Use :kconfig:option:`CONFIG_NRFX_PDM` instead of the following: + + * ``CONFIG_NRFX_PDM0`` + * ``CONFIG_NRFX_PDM20`` + * ``CONFIG_NRFX_PDM21`` + + * Use :kconfig:option:`CONFIG_NRFX_PWM` instead of the following: + + * ``CONFIG_NRFX_PWM0`` + * ``CONFIG_NRFX_PWM1`` + * ``CONFIG_NRFX_PWM2`` + * ``CONFIG_NRFX_PWM3`` + * ``CONFIG_NRFX_PWM20`` + * ``CONFIG_NRFX_PWM21`` + * ``CONFIG_NRFX_PWM22`` + * ``CONFIG_NRFX_PWM120`` + * ``CONFIG_NRFX_PWM130`` + * ``CONFIG_NRFX_PWM131`` + * ``CONFIG_NRFX_PWM132`` + * ``CONFIG_NRFX_PWM133`` + + * Use :kconfig:option:`CONFIG_NRFX_QDEC` instead of the following: + + * ``CONFIG_NRFX_QDEC0`` + * ``CONFIG_NRFX_QDEC1`` + * ``CONFIG_NRFX_QDEC20`` + * ``CONFIG_NRFX_QDEC21`` + * ``CONFIG_NRFX_QDEC130`` + * ``CONFIG_NRFX_QDEC131`` + + * Use :kconfig:option:`CONFIG_NRFX_SPIM` instead of the following: + + * ``CONFIG_NRFX_SPIM0`` + * ``CONFIG_NRFX_SPIM1`` + * ``CONFIG_NRFX_SPIM2`` + * ``CONFIG_NRFX_SPIM3`` + * ``CONFIG_NRFX_SPIM4`` + * ``CONFIG_NRFX_SPIM00`` + * ``CONFIG_NRFX_SPIM01`` + * ``CONFIG_NRFX_SPIM20`` + * ``CONFIG_NRFX_SPIM21`` + * ``CONFIG_NRFX_SPIM22`` + * ``CONFIG_NRFX_SPIM23`` + * ``CONFIG_NRFX_SPIM24`` + * ``CONFIG_NRFX_SPIM30`` + * ``CONFIG_NRFX_SPIM120`` + * ``CONFIG_NRFX_SPIM121`` + * ``CONFIG_NRFX_SPIM130`` + * ``CONFIG_NRFX_SPIM131`` + * ``CONFIG_NRFX_SPIM132`` + * ``CONFIG_NRFX_SPIM133`` + * ``CONFIG_NRFX_SPIM134`` + * ``CONFIG_NRFX_SPIM135`` + * ``CONFIG_NRFX_SPIM136`` + * ``CONFIG_NRFX_SPIM137`` + + * Use :kconfig:option:`CONFIG_NRFX_SPIS` instead of the following: + + * ``CONFIG_NRFX_SPIS0`` + * ``CONFIG_NRFX_SPIS1`` + * ``CONFIG_NRFX_SPIS2`` + * ``CONFIG_NRFX_SPIS3`` + * ``CONFIG_NRFX_SPIS00`` + * ``CONFIG_NRFX_SPIS01`` + * ``CONFIG_NRFX_SPIS20`` + * ``CONFIG_NRFX_SPIS21`` + * ``CONFIG_NRFX_SPIS22`` + * ``CONFIG_NRFX_SPIS23`` + * ``CONFIG_NRFX_SPIS24`` + * ``CONFIG_NRFX_SPIS30`` + * ``CONFIG_NRFX_SPIS120`` + * ``CONFIG_NRFX_SPIS130`` + * ``CONFIG_NRFX_SPIS131`` + * ``CONFIG_NRFX_SPIS132`` + * ``CONFIG_NRFX_SPIS133`` + * ``CONFIG_NRFX_SPIS134`` + * ``CONFIG_NRFX_SPIS135`` + * ``CONFIG_NRFX_SPIS136`` + * ``CONFIG_NRFX_SPIS137`` + + * Use :kconfig:option:`CONFIG_NRFX_TIMER` instead of the following: + + * ``CONFIG_NRFX_TIMER0`` + * ``CONFIG_NRFX_TIMER1`` + * ``CONFIG_NRFX_TIMER2`` + * ``CONFIG_NRFX_TIMER3`` + * ``CONFIG_NRFX_TIMER4`` + * ``CONFIG_NRFX_TIMER00`` + * ``CONFIG_NRFX_TIMER10`` + * ``CONFIG_NRFX_TIMER20`` + * ``CONFIG_NRFX_TIMER21`` + * ``CONFIG_NRFX_TIMER22`` + * ``CONFIG_NRFX_TIMER23`` + * ``CONFIG_NRFX_TIMER24`` + * ``CONFIG_NRFX_TIMER020`` + * ``CONFIG_NRFX_TIMER021`` + * ``CONFIG_NRFX_TIMER022`` + * ``CONFIG_NRFX_TIMER120`` + * ``CONFIG_NRFX_TIMER121`` + * ``CONFIG_NRFX_TIMER130`` + * ``CONFIG_NRFX_TIMER131`` + * ``CONFIG_NRFX_TIMER132`` + * ``CONFIG_NRFX_TIMER133`` + * ``CONFIG_NRFX_TIMER134`` + * ``CONFIG_NRFX_TIMER135`` + * ``CONFIG_NRFX_TIMER136`` + * ``CONFIG_NRFX_TIMER137`` + + * Use :kconfig:option:`CONFIG_NRFX_TWIM` instead of the following: + + * ``CONFIG_NRFX_TWIM0`` + * ``CONFIG_NRFX_TWIM1`` + * ``CONFIG_NRFX_TWIM2`` + * ``CONFIG_NRFX_TWIM3`` + * ``CONFIG_NRFX_TWIM20`` + * ``CONFIG_NRFX_TWIM21`` + * ``CONFIG_NRFX_TWIM22`` + * ``CONFIG_NRFX_TWIM23`` + * ``CONFIG_NRFX_TWIM24`` + * ``CONFIG_NRFX_TWIM30`` + * ``CONFIG_NRFX_TWIM120`` + * ``CONFIG_NRFX_TWIM130`` + * ``CONFIG_NRFX_TWIM131`` + * ``CONFIG_NRFX_TWIM132`` + * ``CONFIG_NRFX_TWIM133`` + * ``CONFIG_NRFX_TWIM134`` + * ``CONFIG_NRFX_TWIM135`` + * ``CONFIG_NRFX_TWIM136`` + * ``CONFIG_NRFX_TWIM137`` + + * Use :kconfig:option:`CONFIG_NRFX_TWIS` instead of the following: + + * ``CONFIG_NRFX_TWIS0`` + * ``CONFIG_NRFX_TWIS1`` + * ``CONFIG_NRFX_TWIS2`` + * ``CONFIG_NRFX_TWIS3`` + * ``CONFIG_NRFX_TWIS20`` + * ``CONFIG_NRFX_TWIS21`` + * ``CONFIG_NRFX_TWIS22`` + * ``CONFIG_NRFX_TWIS23`` + * ``CONFIG_NRFX_TWIS24`` + * ``CONFIG_NRFX_TWIS30`` + * ``CONFIG_NRFX_TWIS120`` + * ``CONFIG_NRFX_TWIS130`` + * ``CONFIG_NRFX_TWIS131`` + * ``CONFIG_NRFX_TWIS132`` + * ``CONFIG_NRFX_TWIS133`` + * ``CONFIG_NRFX_TWIS134`` + * ``CONFIG_NRFX_TWIS135`` + * ``CONFIG_NRFX_TWIS136`` + * ``CONFIG_NRFX_TWIS137`` + + * Use :kconfig:option:`CONFIG_NRFX_UARTE` instead of the following: + + * ``CONFIG_NRFX_UARTE0`` + * ``CONFIG_NRFX_UARTE1`` + * ``CONFIG_NRFX_UARTE2`` + * ``CONFIG_NRFX_UARTE3`` + * ``CONFIG_NRFX_UARTE00`` + * ``CONFIG_NRFX_UARTE20`` + * ``CONFIG_NRFX_UARTE21`` + * ``CONFIG_NRFX_UARTE22`` + * ``CONFIG_NRFX_UARTE23`` + * ``CONFIG_NRFX_UARTE24`` + * ``CONFIG_NRFX_UARTE30`` + * ``CONFIG_NRFX_UARTE120`` + * ``CONFIG_NRFX_UARTE130`` + * ``CONFIG_NRFX_UARTE131`` + * ``CONFIG_NRFX_UARTE132`` + * ``CONFIG_NRFX_UARTE133`` + * ``CONFIG_NRFX_UARTE134`` + * ``CONFIG_NRFX_UARTE135`` + * ``CONFIG_NRFX_UARTE136`` + * ``CONFIG_NRFX_UARTE137`` + + * Use :kconfig:option:`CONFIG_NRFX_WDT` instead of the following: + + * ``CONFIG_NRFX_WDT0`` + * ``CONFIG_NRFX_WDT1`` + * ``CONFIG_NRFX_WDT30`` + * ``CONFIG_NRFX_WDT31`` + * ``CONFIG_NRFX_WDT010`` + * ``CONFIG_NRFX_WDT011`` + * ``CONFIG_NRFX_WDT130`` + * ``CONFIG_NRFX_WDT131`` + * ``CONFIG_NRFX_WDT132`` + + * Remove: + + * ``CONFIG_NRFX_PPIB`` + * ``CONFIG_NRFX_PPIB00`` + * ``CONFIG_NRFX_PPIB01`` + * ``CONFIG_NRFX_PPIB10`` + * ``CONFIG_NRFX_PPIB11`` + * ``CONFIG_NRFX_PPIB20`` + * ``CONFIG_NRFX_PPIB21`` + * ``CONFIG_NRFX_PPIB22`` + * ``CONFIG_NRFX_PPIB30`` diff --git a/doc/nrf/releases_and_maturity/migration/nRF54H20_migration_2.7/migration_guide_2.6.99-cs2_to_2_7_environment.rst b/doc/nrf/releases_and_maturity/migration/nRF54H20_migration_2.7/migration_guide_2.6.99-cs2_to_2_7_environment.rst index 30e74fed69ff..4b229109e81d 100644 --- a/doc/nrf/releases_and_maturity/migration/nRF54H20_migration_2.7/migration_guide_2.6.99-cs2_to_2_7_environment.rst +++ b/doc/nrf/releases_and_maturity/migration/nRF54H20_migration_2.7/migration_guide_2.6.99-cs2_to_2_7_environment.rst @@ -210,7 +210,7 @@ Programming the BICR The Board Information Configuration Registers (BICR) are non-volatile memory (NVM) registers that contain information on how the nRF54H20 SoC must interact with other board elements, including the information about the power and clock delivery to the SoC. To prepare the nRF54H20 DK for first use, you must manually program the values of the BICR using a precompiled BICR binary file (:file:`bicr_ext_loadcap.hex`). -1. Download the `BICR binary file`_ . +1. Download the ``BICR binary file``. #. Connect the nRF54H20 DK to your computer using the **DEBUGGER** port on the DK. .. note:: diff --git a/doc/nrf/releases_and_maturity/migration/nRF54H20_migration_2.7/transition_guide_2.4.99-cs3_to_2.7_environment.rst b/doc/nrf/releases_and_maturity/migration/nRF54H20_migration_2.7/transition_guide_2.4.99-cs3_to_2.7_environment.rst index e411f77a1f04..e965df3b2f51 100644 --- a/doc/nrf/releases_and_maturity/migration/nRF54H20_migration_2.7/transition_guide_2.4.99-cs3_to_2.7_environment.rst +++ b/doc/nrf/releases_and_maturity/migration/nRF54H20_migration_2.7/transition_guide_2.4.99-cs3_to_2.7_environment.rst @@ -214,7 +214,7 @@ Programming the BICR The Board Information Configuration Registers (BICR) are non-volatile memory (NVM) registers that contain information on how the nRF54H20 SoC must interact with other board elements, including the information about the power and clock delivery to the SoC. To prepare the nRF54H20 DK for first use, you must manually program the values of the BICR using a precompiled BICR binary file (:file:`bicr_ext_loadcap.hex`). -1. Download the `BICR binary file`_ . +1. Download the ``BICR binary file``. #. Connect the nRF54H20 DK to your computer using the **DEBUGGER** port on the DK. .. note:: diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-1.1.0.rst b/doc/nrf/releases_and_maturity/releases/release-notes-1.1.0.rst index ea41ba1f910a..14fa641a5189 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-1.1.0.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-1.1.0.rst @@ -43,7 +43,7 @@ Supported modem firmware * mfw_nrf9160_1.1.0 Use the nRF Programmer app of `nRF Connect for Desktop`_ to update the modem firmware. -See :ref:`nrf9160_gs_updating_fw_modem` for instructions. +See the `Programming nRF91 Series DK firmware` page for instructions. Supported boards diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-1.2.0.rst b/doc/nrf/releases_and_maturity/releases/release-notes-1.2.0.rst index 85d9adf4fdfb..929486d6d824 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-1.2.0.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-1.2.0.rst @@ -42,7 +42,7 @@ This version of the |NCS| supports the following modem firmware for cellular IoT * mfw_nrf9160_1.1.1 Use the nRF Programmer app of `nRF Connect for Desktop`_ to update the modem firmware. -See :ref:`nrf9160_gs_updating_fw_modem` for instructions. +See the `Programming nRF91 Series DK firmware` page for instructions. Tested boards ************* diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-1.2.1.rst b/doc/nrf/releases_and_maturity/releases/release-notes-1.2.1.rst index 1d0944ce7815..d865cf07f8f6 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-1.2.1.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-1.2.1.rst @@ -45,7 +45,7 @@ This version of the |NCS| supports the following modem firmware for cellular IoT * mfw_nrf9160_1.1.2 Use the nRF Programmer app of `nRF Connect for Desktop`_ to update the modem firmware. -See :ref:`nrf9160_gs_updating_fw_modem` for instructions. +See the `Programming nRF91 Series DK firmware` page for instructions. Tested boards ************* diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-1.3.0.rst b/doc/nrf/releases_and_maturity/releases/release-notes-1.3.0.rst index 7b370d731b38..e5889a53dd4a 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-1.3.0.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-1.3.0.rst @@ -52,7 +52,7 @@ This version of the |NCS| has been tested with the following modem firmware for * mfw_nrf9160_1.2.0 Use the latest version of the nRF Programmer app of `nRF Connect for Desktop`_ to update the modem firmware. -See :ref:`nrf9160_gs_updating_fw_modem` for instructions. +See the `Programming nRF91 Series DK firmware` page for instructions. Changelog ********* diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-1.3.1.rst b/doc/nrf/releases_and_maturity/releases/release-notes-1.3.1.rst index 9038f2db8ecf..8fba306ca27f 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-1.3.1.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-1.3.1.rst @@ -41,7 +41,7 @@ This version of the |NCS| has been tested with the following modem firmware for * mfw_nrf9160_1.2.1 Use the latest version of the nRF Programmer app of `nRF Connect for Desktop`_ to update the modem firmware. -See :ref:`nrf9160_gs_updating_fw_modem` for instructions. +See the `Programming nRF91 Series DK firmware` page for instructions. Changelog ********* diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-1.3.2.rst b/doc/nrf/releases_and_maturity/releases/release-notes-1.3.2.rst index f4960b980f4d..b218659f319a 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-1.3.2.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-1.3.2.rst @@ -39,7 +39,7 @@ This version of the |NCS| has been tested with the following modem firmware for * mfw_nrf9160_1.2.1 Use the latest version of the nRF Programmer app of `nRF Connect for Desktop`_ to update the modem firmware. -See :ref:`nrf9160_gs_updating_fw_modem` for instructions. +See the `Programming nRF91 Series DK firmware` page for instructions. Changelog ********* diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-1.4.0.rst b/doc/nrf/releases_and_maturity/releases/release-notes-1.4.0.rst index 3f0cb9f6a7da..f45f8c0f93e1 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-1.4.0.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-1.4.0.rst @@ -47,7 +47,7 @@ This version of the |NCS| has been tested with the following modem firmware for * mfw_nrf9160_1.2.2 Use the latest version of the nRF Programmer app of `nRF Connect for Desktop`_ to update the modem firmware. -See :ref:`nrf9160_gs_updating_fw_modem` for instructions. +See the `Programming nRF91 Series DK firmware` page for instructions. Changelog ********* diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-1.4.1.rst b/doc/nrf/releases_and_maturity/releases/release-notes-1.4.1.rst index bd0a41961724..c3c1042ed7b2 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-1.4.1.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-1.4.1.rst @@ -38,7 +38,7 @@ This version of the |NCS| has been tested with the following modem firmware for * mfw_nrf9160_1.2.2 Use the latest version of the nRF Programmer app of `nRF Connect for Desktop`_ to update the modem firmware. -See :ref:`nrf9160_gs_updating_fw_modem` for instructions. +See the `Programming nRF91 Series DK firmware` page for instructions. Changelog ********* diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-1.4.2.rst b/doc/nrf/releases_and_maturity/releases/release-notes-1.4.2.rst index fe85b289e23f..0a18369b525d 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-1.4.2.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-1.4.2.rst @@ -37,7 +37,7 @@ This version of the |NCS| has been tested with the following modem firmware for * mfw_nrf9160_1.2.3 Use the latest version of the nRF Programmer app of `nRF Connect for Desktop`_ to update the modem firmware. -See :ref:`nrf9160_gs_updating_fw_modem` for instructions. +See the `Programming nRF91 Series DK firmware` page for instructions. Changelog ********* diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-1.5.0.rst b/doc/nrf/releases_and_maturity/releases/release-notes-1.5.0.rst index 785933e69682..c20dc021d38d 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-1.5.0.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-1.5.0.rst @@ -49,7 +49,7 @@ This version of the |NCS| has been tested with the following modem firmware for Use the latest version of the nRF Programmer app of `nRF Connect for Desktop`_ to update the modem firmware. -See :ref:`nrf9160_gs_updating_fw_modem` for instructions. +See the `Programming nRF91 Series DK firmware` page for instructions. Changelog ********* diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-1.5.1.rst b/doc/nrf/releases_and_maturity/releases/release-notes-1.5.1.rst index b44afc432e4d..15e808b8ae92 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-1.5.1.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-1.5.1.rst @@ -42,7 +42,7 @@ This version of the |NCS| has been tested with the following modem firmware for Use the latest version of the nRF Programmer app of `nRF Connect for Desktop`_ to update the modem firmware. -See :ref:`nrf9160_gs_updating_fw_modem` for instructions. +See the `Programming nRF91 Series DK firmware` page for instructions. Changelog ********* diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-1.5.2.rst b/doc/nrf/releases_and_maturity/releases/release-notes-1.5.2.rst index dc661511b876..3470e74faac7 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-1.5.2.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-1.5.2.rst @@ -51,7 +51,7 @@ This version of the |NCS| has been tested with the following modem firmware for * mfw_nrf9160_1.1.4 Use the latest version of the nRF Programmer app of `nRF Connect for Desktop`_ to update the modem firmware. -See :ref:`nrf9160_gs_updating_fw_modem` for instructions. +See the `Programming nRF91 Series DK firmware` page for instructions. Changelog ********* diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-1.6.0.rst b/doc/nrf/releases_and_maturity/releases/release-notes-1.6.0.rst index 50718d2120bf..5b8d30d51d00 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-1.6.0.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-1.6.0.rst @@ -45,7 +45,7 @@ Supported modem firmware See `Modem firmware compatibility matrix`_ for an overview of which modem firmware versions have been tested with this version of |NCS|. Use the latest version of the nRF Programmer app of `nRF Connect for Desktop`_ to update the modem firmware. -See :ref:`nrf9160_gs_updating_fw_modem` for instructions. +See the `Programming nRF91 Series DK firmware` page for instructions. Known issues ************ diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-1.6.1.rst b/doc/nrf/releases_and_maturity/releases/release-notes-1.6.1.rst index 30c5d0a435a5..952ba08a18e5 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-1.6.1.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-1.6.1.rst @@ -38,7 +38,7 @@ Supported modem firmware See `Modem firmware compatibility matrix`_ for an overview of which modem firmware versions have been tested with this version of |NCS|. Use the latest version of the nRF Programmer app of `nRF Connect for Desktop`_ to update the modem firmware. -See :ref:`nrf9160_gs_updating_fw_modem` for instructions. +See the `Programming nRF91 Series DK firmware` page for instructions. Known issues ************ diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-1.7.0.rst b/doc/nrf/releases_and_maturity/releases/release-notes-1.7.0.rst index 5a84a3118e17..e7ad8c60ef43 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-1.7.0.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-1.7.0.rst @@ -56,7 +56,7 @@ Supported modem firmware See `Modem firmware compatibility matrix`_ for an overview of which modem firmware versions have been tested with this version of the |NCS|. Use the latest version of the nRF Programmer app of `nRF Connect for Desktop`_ to update the modem firmware. -See :ref:`nrf9160_gs_updating_fw_modem` for instructions. +See the `Programming nRF91 Series DK firmware` page for instructions. Known issues ************ diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-1.7.1.rst b/doc/nrf/releases_and_maturity/releases/release-notes-1.7.1.rst index 3f504710497e..06a6e43bec51 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-1.7.1.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-1.7.1.rst @@ -37,7 +37,7 @@ Supported modem firmware See `Modem firmware compatibility matrix`_ for an overview of which modem firmware versions have been tested with this version of the |NCS|. Use the latest version of the nRF Programmer app of `nRF Connect for Desktop`_ to update the modem firmware. -See :ref:`nrf9160_gs_updating_fw_modem` for instructions. +See the `Programming nRF91 Series DK firmware` page for instructions. Known issues ************ diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-1.8.0.rst b/doc/nrf/releases_and_maturity/releases/release-notes-1.8.0.rst index 93717a3f4243..031da5787f40 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-1.8.0.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-1.8.0.rst @@ -45,7 +45,7 @@ Supported modem firmware See `Modem firmware compatibility matrix`_ for an overview of which modem firmware versions have been tested with this version of the |NCS|. Use the latest version of the nRF Programmer app of `nRF Connect for Desktop`_ to update the modem firmware. -See :ref:`nrf9160_gs_updating_fw_modem` for instructions. +See the `Programming nRF91 Series DK firmware` page for instructions. Known issues ************ diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-1.9.0.rst b/doc/nrf/releases_and_maturity/releases/release-notes-1.9.0.rst index 33fbbda4533d..0286f17f2455 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-1.9.0.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-1.9.0.rst @@ -56,7 +56,7 @@ Supported modem firmware See `Modem firmware compatibility matrix`_ for an overview of which modem firmware versions have been tested with this version of the |NCS|. Use the latest version of the nRF Programmer app of `nRF Connect for Desktop`_ to update the modem firmware. -See :ref:`nrf9160_gs_updating_fw_modem` for instructions. +See the `Programming nRF91 Series DK firmware` page for instructions. Modem-related libraries and versions ==================================== diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-1.9.1.rst b/doc/nrf/releases_and_maturity/releases/release-notes-1.9.1.rst index 23d0e02183ff..c77160bd6537 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-1.9.1.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-1.9.1.rst @@ -48,7 +48,7 @@ Supported modem firmware See `Modem firmware compatibility matrix`_ for an overview of which modem firmware versions have been tested with this version of the |NCS|. Use the latest version of the nRF Programmer app of `nRF Connect for Desktop`_ to update the modem firmware. -See :ref:`nrf9160_gs_updating_fw_modem` for instructions. +See the `Programming nRF91 Series DK firmware` page for instructions. Modem-related libraries and versions ==================================== diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-1.9.2.rst b/doc/nrf/releases_and_maturity/releases/release-notes-1.9.2.rst index 113bde0b041e..b63e8035516c 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-1.9.2.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-1.9.2.rst @@ -47,7 +47,7 @@ Supported modem firmware See `Modem firmware compatibility matrix`_ for an overview of which modem firmware versions have been tested with this version of the |NCS|. Use the latest version of the nRF Programmer app of `nRF Connect for Desktop`_ to update the modem firmware. -See :ref:`nrf9160_gs_updating_fw_modem` for instructions. +See the `Programming nRF91 Series DK firmware` page for instructions. Modem-related libraries and versions ==================================== diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-2.0.0.rst b/doc/nrf/releases_and_maturity/releases/release-notes-2.0.0.rst index 59693180c0cd..2f524ab52c14 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-2.0.0.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-2.0.0.rst @@ -64,7 +64,7 @@ Supported modem firmware See `Modem firmware compatibility matrix`_ for an overview of which modem firmware versions have been tested with this version of the |NCS|. Use the latest version of the nRF Programmer app of `nRF Connect for Desktop`_ to update the modem firmware. -See :ref:`nrf9160_gs_updating_fw_modem` for instructions. +See the `Programming nRF91 Series DK firmware` page for instructions. Modem-related libraries and versions ==================================== diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-2.0.1.rst b/doc/nrf/releases_and_maturity/releases/release-notes-2.0.1.rst index 46ab40b7eccc..0b30a14a8c8f 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-2.0.1.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-2.0.1.rst @@ -49,7 +49,7 @@ Supported modem firmware See `Modem firmware compatibility matrix`_ for an overview of which modem firmware versions have been tested with this version of the |NCS|. Use the latest version of the nRF Programmer app of `nRF Connect for Desktop`_ to update the modem firmware. -See :ref:`nrf9160_gs_updating_fw_modem` for instructions. +See the `Programming nRF91 Series DK firmware` page for instructions. Modem-related libraries and versions ==================================== diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-2.0.2.rst b/doc/nrf/releases_and_maturity/releases/release-notes-2.0.2.rst index 0a2eb8c0053f..43cd366790c1 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-2.0.2.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-2.0.2.rst @@ -49,7 +49,7 @@ Supported modem firmware See `Modem firmware compatibility matrix`_ for an overview of which modem firmware versions have been tested with this version of the |NCS|. Use the latest version of the nRF Programmer app of `nRF Connect for Desktop`_ to update the modem firmware. -See :ref:`nrf9160_gs_updating_fw_modem` for instructions. +See the `Programming nRF91 Series DK firmware` page for instructions. Modem-related libraries and versions ==================================== diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-2.1.0.rst b/doc/nrf/releases_and_maturity/releases/release-notes-2.1.0.rst index cff05782b5f2..dc99f360c304 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-2.1.0.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-2.1.0.rst @@ -66,7 +66,7 @@ Supported modem firmware See `Modem firmware compatibility matrix`_ for an overview of which modem firmware versions have been tested with this version of the |NCS|. Use the latest version of the nRF Programmer app of `nRF Connect for Desktop`_ to update the modem firmware. -See :ref:`nrf9160_gs_updating_fw_modem` for instructions. +See the `Programming nRF91 Series DK firmware` page for instructions. Modem-related libraries and versions ==================================== @@ -1085,7 +1085,7 @@ Documentation * :ref:`ug_nrf91` with the following changes: * In the :ref:`ug_nrf91_features` page, added a section about :ref:`modem_trace`. - * In the :ref:`ug_nrf9160_gs` guide, :ref:`nrf9160_gs_updating_fw_modem` section is now moved before :ref:`nrf9160_gs_updating_fw_application` because updating modem firmware erases application firmware. + * In the :ref:`ug_nrf9160_gs` guide, Updating the modem firmware section is now moved before Updating the application firmware because updating modem firmware erases application firmware. * In the :ref:`ug_nrf9160` guide, the :ref:`build_pgm_nrf9160` section now mentions |VSC| and command-line instructions. * In the :ref:`ug_thingy91_gsg` guide, Programming firmware and :ref:`connect_nRF_cloud` sections now have different structure. * The instructions and images in the :ref:`ug_thingy91_gsg` and :ref:`ug_nrf9160_gs` guides now also mention accepting :term:`eUICC Identifier (EID)` when activating your iBasis SIM card from the `nRF Cloud`_ website. diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-2.1.1.rst b/doc/nrf/releases_and_maturity/releases/release-notes-2.1.1.rst index eb34b59dba01..60e0ef7c141e 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-2.1.1.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-2.1.1.rst @@ -48,7 +48,7 @@ Supported modem firmware See `Modem firmware compatibility matrix`_ for an overview of which modem firmware versions have been tested with this version of the |NCS|. Use the latest version of the nRF Programmer app of `nRF Connect for Desktop`_ to update the modem firmware. -See :ref:`nrf9160_gs_updating_fw_modem` for instructions. +See the `Programming nRF91 Series DK firmware` page for instructions. Modem-related libraries and versions ==================================== diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-2.1.2.rst b/doc/nrf/releases_and_maturity/releases/release-notes-2.1.2.rst index 197176c065b0..28f6136323e6 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-2.1.2.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-2.1.2.rst @@ -48,7 +48,7 @@ Supported modem firmware See `Modem firmware compatibility matrix`_ for an overview of which modem firmware versions have been tested with this version of the |NCS|. Use the latest version of the nRF Programmer app of `nRF Connect for Desktop`_ to update the modem firmware. -See :ref:`nrf9160_gs_updating_fw_modem` for instructions. +See the `Programming nRF91 Series DK firmware` page for instructions. Modem-related libraries and versions ==================================== diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-2.1.3.rst b/doc/nrf/releases_and_maturity/releases/release-notes-2.1.3.rst index 46ee18d71b9c..8d53ea9a4cd9 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-2.1.3.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-2.1.3.rst @@ -57,7 +57,7 @@ Supported modem firmware See `Modem firmware compatibility matrix`_ for an overview of which modem firmware versions have been tested with this version of the |NCS|. Use the latest version of the nRF Programmer app of `nRF Connect for Desktop`_ to update the modem firmware. -See :ref:`nrf9160_gs_updating_fw_modem` for instructions. +See the `Programming nRF91 Series DK firmware` page for instructions. Modem-related libraries and versions ==================================== diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-2.1.4.rst b/doc/nrf/releases_and_maturity/releases/release-notes-2.1.4.rst index 0bdd99352829..25635b192cdb 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-2.1.4.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-2.1.4.rst @@ -46,7 +46,7 @@ Supported modem firmware See `Modem firmware compatibility matrix`_ for an overview of which modem firmware versions have been tested with this version of the |NCS|. Use the latest version of the nRF Programmer app of `nRF Connect for Desktop`_ to update the modem firmware. -See :ref:`nrf9160_gs_updating_fw_modem` for instructions. +See the `Programming nRF91 Series DK firmware` page for instructions. Modem-related libraries and versions ==================================== diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-2.2.0.rst b/doc/nrf/releases_and_maturity/releases/release-notes-2.2.0.rst index 832f6d2c78ab..d74ffec6ef0e 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-2.2.0.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-2.2.0.rst @@ -79,7 +79,7 @@ Supported modem firmware See `Modem firmware compatibility matrix`_ for an overview of which modem firmware versions have been tested with this version of the |NCS|. Use the latest version of the nRF Programmer app of `nRF Connect for Desktop`_ to update the modem firmware. -See :ref:`nrf9160_gs_updating_fw_modem` for instructions. +See the `Programming nRF91 Series DK firmware` page for instructions. Modem-related libraries and versions ==================================== diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-2.3.0.rst b/doc/nrf/releases_and_maturity/releases/release-notes-2.3.0.rst index 013fbf3267e7..c23cd0120b8a 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-2.3.0.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-2.3.0.rst @@ -74,7 +74,7 @@ Supported modem firmware See `Modem firmware compatibility matrix`_ for an overview of which modem firmware versions have been tested with this version of the |NCS|. Use the latest version of the nRF Programmer app of `nRF Connect for Desktop`_ to update the modem firmware. -See :ref:`nrf9160_gs_updating_fw_modem` for instructions. +See the `Programming nRF91 Series DK firmware` page for instructions. Modem-related libraries and versions ==================================== diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-2.4.0.rst b/doc/nrf/releases_and_maturity/releases/release-notes-2.4.0.rst index d9761f4e7abf..d0d196227d49 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-2.4.0.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-2.4.0.rst @@ -118,7 +118,7 @@ Supported modem firmware See `Modem firmware compatibility matrix`_ for an overview of which modem firmware versions have been tested with this version of the |NCS|. Use the latest version of the nRF Programmer app of `nRF Connect for Desktop`_ to update the modem firmware. -See :ref:`nrf9160_gs_updating_fw_modem` for instructions. +See the `Programming nRF91 Series DK firmware` page for instructions. Modem-related libraries and versions ==================================== diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-2.4.1.rst b/doc/nrf/releases_and_maturity/releases/release-notes-2.4.1.rst index e0e5b7911ba8..09fa2ddb3ac0 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-2.4.1.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-2.4.1.rst @@ -46,7 +46,7 @@ Supported modem firmware See `Modem firmware compatibility matrix`_ for an overview of which modem firmware versions have been tested with this version of the |NCS|. Use the latest version of the nRF Programmer app of `nRF Connect for Desktop`_ to update the modem firmware. -See :ref:`nrf9160_gs_updating_fw_modem` for instructions. +See the `Programming nRF91 Series DK firmware` page for instructions. Modem-related libraries and versions ==================================== diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-2.4.2.rst b/doc/nrf/releases_and_maturity/releases/release-notes-2.4.2.rst index 9db887745b10..73bf04b357fa 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-2.4.2.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-2.4.2.rst @@ -46,7 +46,7 @@ Supported modem firmware See `Modem firmware compatibility matrix`_ for an overview of which modem firmware versions have been tested with this version of the |NCS|. Use the latest version of the nRF Programmer app of `nRF Connect for Desktop`_ to update the modem firmware. -See :ref:`nrf9160_gs_updating_fw_modem` for instructions. +See the `Programming nRF91 Series DK firmware` page for instructions. Modem-related libraries and versions ==================================== diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-2.4.3.rst b/doc/nrf/releases_and_maturity/releases/release-notes-2.4.3.rst index fd3a491c0bff..f283879c9bdf 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-2.4.3.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-2.4.3.rst @@ -46,7 +46,7 @@ Supported modem firmware See `Modem firmware compatibility matrix`_ for an overview of which modem firmware versions have been tested with this version of the |NCS|. Use the latest version of the nRF Programmer app of `nRF Connect for Desktop`_ to update the modem firmware. -See :ref:`nrf9160_gs_updating_fw_modem` for instructions. +See the `Programming nRF91 Series DK firmware` page for instructions. Modem-related libraries and versions ==================================== diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-2.4.4.rst b/doc/nrf/releases_and_maturity/releases/release-notes-2.4.4.rst index 2ff2aa55200e..c2a926b7d4f1 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-2.4.4.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-2.4.4.rst @@ -49,7 +49,7 @@ Supported modem firmware See `Modem firmware compatibility matrix`_ for an overview of which modem firmware versions have been tested with this version of the |NCS|. Use the latest version of the nRF Programmer app of `nRF Connect for Desktop`_ to update the modem firmware. -See :ref:`nrf9160_gs_updating_fw_modem` for instructions. +See the `Programming nRF91 Series DK firmware` page for instructions. Modem-related libraries and versions ==================================== diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-2.5.0.rst b/doc/nrf/releases_and_maturity/releases/release-notes-2.5.0.rst index 27bcb129dc3c..3b484979e7ef 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-2.5.0.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-2.5.0.rst @@ -120,7 +120,7 @@ Supported modem firmware See `Modem firmware compatibility matrix`_ for an overview of which modem firmware versions have been tested with this version of the |NCS|. Use the latest version of the nRF Programmer app of `nRF Connect for Desktop`_ to update the modem firmware. -See :ref:`nrf9160_gs_updating_fw_modem` for instructions. +See the `Programming nRF91 Series DK firmware` page for instructions. Modem-related libraries and versions ==================================== diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-2.5.1.rst b/doc/nrf/releases_and_maturity/releases/release-notes-2.5.1.rst index 0d17e6d155d5..64f5fca1bc75 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-2.5.1.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-2.5.1.rst @@ -45,7 +45,7 @@ Supported modem firmware See `Modem firmware compatibility matrix`_ for an overview of which modem firmware versions have been tested with this version of the |NCS|. Use the latest version of the nRF Programmer app of `nRF Connect for Desktop`_ to update the modem firmware. -See :ref:`nrf9160_gs_updating_fw_modem` for instructions. +See the `Programming nRF91 Series DK firmware` page for instructions. Modem-related libraries and versions ==================================== diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-2.5.2.rst b/doc/nrf/releases_and_maturity/releases/release-notes-2.5.2.rst index 804d38a94674..6d5239b2dfb6 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-2.5.2.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-2.5.2.rst @@ -44,7 +44,7 @@ Supported modem firmware See `Modem firmware compatibility matrix`_ for an overview of which modem firmware versions have been tested with this version of the |NCS|. Use the latest version of the nRF Programmer app of `nRF Connect for Desktop`_ to update the modem firmware. -See :ref:`nrf9160_gs_updating_fw_modem` for instructions. +See the `Programming nRF91 Series DK firmware` page for instructions. Modem-related libraries and versions ==================================== diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-2.5.3.rst b/doc/nrf/releases_and_maturity/releases/release-notes-2.5.3.rst index b082219bcffd..df9a09f39399 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-2.5.3.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-2.5.3.rst @@ -44,7 +44,7 @@ Supported modem firmware See `Modem firmware compatibility matrix`_ for an overview of which modem firmware versions have been tested with this version of the |NCS|. Use the latest version of the nRF Programmer app of `nRF Connect for Desktop`_ to update the modem firmware. -See :ref:`nrf9160_gs_updating_fw_modem` for instructions. +See the `Programming nRF91 Series DK firmware` page for instructions. Modem-related libraries and versions ==================================== diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-2.6.0.rst b/doc/nrf/releases_and_maturity/releases/release-notes-2.6.0.rst index a6dd62e228f6..5d5e086705b6 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-2.6.0.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-2.6.0.rst @@ -142,7 +142,7 @@ Supported modem firmware See `Modem firmware compatibility matrix`_ for an overview of which modem firmware versions have been tested with this version of the |NCS|. Use the latest version of the nRF Programmer app of `nRF Connect for Desktop`_ to update the modem firmware. -See :ref:`nrf9160_gs_updating_fw_modem` for instructions. +See the `Programming nRF91 Series DK firmware` page for instructions. Modem-related libraries and versions ==================================== diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-2.6.1.rst b/doc/nrf/releases_and_maturity/releases/release-notes-2.6.1.rst index 5a7ae15db664..dbee0f8ab258 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-2.6.1.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-2.6.1.rst @@ -44,7 +44,7 @@ Supported modem firmware See `Modem firmware compatibility matrix`_ for an overview of which modem firmware versions have been tested with this version of the |NCS|. Use the latest version of the nRF Programmer app of `nRF Connect for Desktop`_ to update the modem firmware. -See :ref:`nrf9160_gs_updating_fw_modem` for instructions. +See the `Programming nRF91 Series DK firmware` page for instructions. Modem-related libraries and versions ==================================== diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-2.6.2.rst b/doc/nrf/releases_and_maturity/releases/release-notes-2.6.2.rst index e2a8ae5e08d4..f35e4474beb6 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-2.6.2.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-2.6.2.rst @@ -44,7 +44,7 @@ Supported modem firmware See `Modem firmware compatibility matrix`_ for an overview of which modem firmware versions have been tested with this version of the |NCS|. Use the latest version of the nRF Programmer app of `nRF Connect for Desktop`_ to update the modem firmware. -See :ref:`nrf9160_gs_updating_fw_modem` for instructions. +See the `Programming nRF91 Series DK firmware` page for instructions. Modem-related libraries and versions ==================================== diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-2.6.3.rst b/doc/nrf/releases_and_maturity/releases/release-notes-2.6.3.rst index ef6e7c4d0be9..6355b7f664bf 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-2.6.3.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-2.6.3.rst @@ -44,7 +44,7 @@ Supported modem firmware See `Modem firmware compatibility matrix`_ for an overview of which modem firmware versions have been tested with this version of the |NCS|. Use the latest version of the nRF Programmer app of `nRF Connect for Desktop`_ to update the modem firmware. -See :ref:`nrf9160_gs_updating_fw_modem` for instructions. +See the `Programming nRF91 Series DK firmware` page for instructions. Modem-related libraries and versions ==================================== diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-2.6.4.rst b/doc/nrf/releases_and_maturity/releases/release-notes-2.6.4.rst index 115aa103f732..0757625dad46 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-2.6.4.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-2.6.4.rst @@ -44,7 +44,7 @@ Supported modem firmware See `Modem firmware compatibility matrix`_ for an overview of which modem firmware versions have been tested with this version of the |NCS|. Use the latest version of the nRF Programmer app of `nRF Connect for Desktop`_ to update the modem firmware. -See :ref:`nrf9160_gs_updating_fw_modem` for instructions. +See the `Programming nRF91 Series DK firmware` page for instructions. Modem-related libraries and versions ==================================== diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-2.7.0.rst b/doc/nrf/releases_and_maturity/releases/release-notes-2.7.0.rst index 18985a03756a..a4ecfd518632 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-2.7.0.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-2.7.0.rst @@ -125,7 +125,7 @@ See the following documentation for an overview of which modem firmware versions * `Modem firmware compatibility matrix for the nRF9161 SoC`_ Use the latest version of the nRF Programmer app of `nRF Connect for Desktop`_ to update the modem firmware. -See :ref:`nrf9160_gs_updating_fw_modem` for instructions. +See the `Programming nRF91 Series DK firmware` page for instructions. Modem-related libraries and versions ==================================== diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-2.7.99-cs1.rst b/doc/nrf/releases_and_maturity/releases/release-notes-2.7.99-cs1.rst index d633c2cc7191..f0e60f67eca0 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-2.7.99-cs1.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-2.7.99-cs1.rst @@ -36,7 +36,7 @@ Check the :file:`west.yml` file for the corresponding tags in the project reposi To use this release, check out the tag in the manifest repository and run ``west update``. See :ref:`cloning_the_repositories` and :ref:`gs_updating_repos_examples` for more information. -For information on the included repositories and revisions, see `Repositories and revisions for v2.7.99-cs1`_. +For information on the included repositories and revisions, see Repositories and revisions for v2.7.99-cs1. IDE and tool support ******************** diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-2.7.99-cs2.rst b/doc/nrf/releases_and_maturity/releases/release-notes-2.7.99-cs2.rst index 5f24142359c1..017ecf5fa69a 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-2.7.99-cs2.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-2.7.99-cs2.rst @@ -49,7 +49,7 @@ Check the :file:`west.yml` file for the corresponding tags in the project reposi To use this release, check out the tag in the manifest repository and run ``west update``. See :ref:`cloning_the_repositories` and :ref:`gs_updating_repos_examples` for more information. -For information on the included repositories and revisions, see `Repositories and revisions for v2.7.99-cs2`_. +For information on the included repositories and revisions, see Repositories and revisions for v2.7.99-cs2. IDE and tool support ******************** diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-2.8.0.rst b/doc/nrf/releases_and_maturity/releases/release-notes-2.8.0.rst index 0b42148871cb..d45671a53545 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-2.8.0.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-2.8.0.rst @@ -145,7 +145,7 @@ See the following documentation for an overview of which modem firmware versions * `Modem firmware compatibility matrix for the nRF9160 SoC`_ Use the latest version of the nRF Programmer app of `nRF Connect for Desktop`_ to update the modem firmware. -See :ref:`nrf9160_gs_updating_fw_modem` for instructions. +See the `Programming nRF91 Series DK firmware` page for instructions. Modem-related libraries and versions ==================================== @@ -530,11 +530,11 @@ nRF5340 Audio * The functions ``bt_hci_err_to_str()`` and ``bt_security_err_to_str()`` that are used to allow printing error codes as strings. Each function returns string representations of the error codes when the corresponding Kconfig option, :kconfig:option:`CONFIG_BT_HCI_ERR_TO_STR` or :kconfig:option:`CONFIG_BT_SECURITY_ERR_TO_STR`, is enabled. - * CSIS to the BIS sink if the scan delegator feature, :ref:`CONFIG_BT_AUDIO_SCAN_DELEGATOR `, is enabled. + * CSIS to the BIS sink if the scan delegator feature, :ref:`CONFIG_BT_AUDIO_SCAN_DELEGATOR `, is enabled. Once a phone is connected to a BIS sink, the phone will find and connect to the second headset. Also, the phone can control the BIS headset in a group and deliver the PAST to both headsets at the same time. * Create CIG after reading the PACS from the first connected unicast server. - * A minimal scan delegator to the unicast server if the feature, :ref:`CONFIG_BT_AUDIO_SCAN_DELEGATOR `, is enabled. + * A minimal scan delegator to the unicast server if the feature, :ref:`CONFIG_BT_AUDIO_SCAN_DELEGATOR `, is enabled. * Available or support context type to PACS in broadcast sink and unicast client if the feature, :kconfig:option:`CONFIG_BT_PAC_SRC_NOTIFIABLE` is enabled. * The :ref:`nrf_auraconfig` sample. diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-2.9.0.rst b/doc/nrf/releases_and_maturity/releases/release-notes-2.9.0.rst index be2733c302e7..dc0fc23d6c09 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-2.9.0.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-2.9.0.rst @@ -94,7 +94,7 @@ See the following documentation for an overview of which modem firmware versions * `Modem firmware compatibility matrix for the nRF9160 SoC`_ Use the latest version of the `Programmer app`_ of `nRF Connect for Desktop`_ to update the modem firmware. -See :ref:`nrf9160_gs_updating_fw_modem` for instructions. +See the `Programming nRF91 Series DK firmware` page for instructions. Modem-related libraries and versions ==================================== diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-2.9.1.rst b/doc/nrf/releases_and_maturity/releases/release-notes-2.9.1.rst index 0376deffff73..4b6acac537ae 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-2.9.1.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-2.9.1.rst @@ -45,7 +45,7 @@ Supported modem firmware See `Modem firmware compatibility matrix`_ for an overview of which modem firmware versions have been tested with this version of the |NCS|. Use the latest version of the nRF Programmer app of `nRF Connect for Desktop`_ to update the modem firmware. -See :ref:`nrf9160_gs_updating_fw_modem` for instructions. +See the `Programming nRF91 Series DK firmware` page for instructions. Modem-related libraries and versions ==================================== diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-2.9.2.rst b/doc/nrf/releases_and_maturity/releases/release-notes-2.9.2.rst index 210ddb265610..ad2f45fa0a2b 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-2.9.2.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-2.9.2.rst @@ -45,7 +45,7 @@ Supported modem firmware See `Modem firmware compatibility matrix`_ for an overview of which modem firmware versions have been tested with this version of the |NCS|. Use the latest version of the nRF Programmer app of `nRF Connect for Desktop`_ to update the modem firmware. -See :ref:`nrf9160_gs_updating_fw_modem` for instructions. +See the `Programming nRF91 Series DK firmware` page for instructions. Modem-related libraries and versions ==================================== diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-3.0.0.rst b/doc/nrf/releases_and_maturity/releases/release-notes-3.0.0.rst index 3052f94f22b6..05d1df42d8cb 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-3.0.0.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-3.0.0.rst @@ -143,7 +143,7 @@ See the following documentation for an overview of which modem firmware versions * `Modem firmware compatibility matrix for the nRF9160 SoC`_ Use the latest version of the `Programmer app`_ of `nRF Connect for Desktop`_ to update the modem firmware. -See :ref:`nrf9160_gs_updating_fw_modem` for instructions. +See the `Programming nRF91 Series DK firmware` page for instructions. Modem-related libraries and versions ==================================== diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-3.0.1.rst b/doc/nrf/releases_and_maturity/releases/release-notes-3.0.1.rst index 0b06ea0640e8..b0f684e09666 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-3.0.1.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-3.0.1.rst @@ -43,7 +43,7 @@ Supported modem firmware See `Modem firmware compatibility matrix`_ for an overview of which modem firmware versions have been tested with this version of the |NCS|. Use the latest version of the nRF Programmer app of `nRF Connect for Desktop`_ to update the modem firmware. -See :ref:`nrf9160_gs_updating_fw_modem` for instructions. +See the `Programming nRF91 Series DK firmware` page for instructions. Modem-related libraries and versions ==================================== diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-3.0.2.rst b/doc/nrf/releases_and_maturity/releases/release-notes-3.0.2.rst index 1dfd1db95721..b7acf02f3823 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-3.0.2.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-3.0.2.rst @@ -43,7 +43,7 @@ Supported modem firmware See `Modem firmware compatibility matrix`_ for an overview of which modem firmware versions have been tested with this version of the |NCS|. Use the latest version of the nRF Programmer app of `nRF Connect for Desktop`_ to update the modem firmware. -See :ref:`nrf9160_gs_updating_fw_modem` for instructions. +See the `Programming nRF91 Series DK firmware` page for instructions. Modem-related libraries and versions ==================================== diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-3.1.0.rst b/doc/nrf/releases_and_maturity/releases/release-notes-3.1.0.rst index 0e326bb18ef6..7d08b731dcc3 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-3.1.0.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-3.1.0.rst @@ -122,7 +122,7 @@ See the following documentation for an overview of which modem firmware versions * `Modem firmware compatibility matrix for the nRF9160 SoC`_ Use the latest version of the `Programmer app`_ of `nRF Connect for Desktop`_ to update the modem firmware. -See :ref:`nrf9160_gs_updating_fw_modem` for instructions. +See the `Programming nRF91 Series DK firmware` page for instructions. Modem-related libraries and versions ==================================== diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-3.1.1.rst b/doc/nrf/releases_and_maturity/releases/release-notes-3.1.1.rst index 91f5a1e380f3..aa517d6ef07e 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-3.1.1.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-3.1.1.rst @@ -76,7 +76,7 @@ Supported modem firmware See `Modem firmware compatibility matrix`_ for an overview of which modem firmware versions have been tested with this version of the |NCS|. Use the latest version of the `Programmer app`_ of `nRF Connect for Desktop`_ to update the modem firmware. -See :ref:`nrf9160_gs_updating_fw_modem` for instructions. +See the `Programming nRF91 Series DK firmware` page for instructions. Modem-related libraries and versions ==================================== diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-3.2.0-preview2.rst b/doc/nrf/releases_and_maturity/releases/release-notes-3.2.0-preview2.rst index 6ab14a2b5fc1..da979b3e3e16 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-3.2.0-preview2.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-3.2.0-preview2.rst @@ -235,7 +235,7 @@ nRF5340 Audio * Added: * The :ref:`Audio application API documentation ` page. - * The :ref:`config_audio_app_options` page. + * The :ref:`nrf53_audio_app_config_audio_app_options` page. * The API documentation in the header files listed on the :ref:`audio_api` page. * Ability to connect by address as a unicast client. diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-3.2.0-preview3.rst b/doc/nrf/releases_and_maturity/releases/release-notes-3.2.0-preview3.rst index 65c83f0185fe..a7646e6868cd 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-3.2.0-preview3.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-3.2.0-preview3.rst @@ -244,7 +244,7 @@ nRF5340 Audio This means that if another device appears with the same address, it will be treated as the same server. * Experimental support for stereo in :ref:`unicast server application`. * The :ref:`Audio application API documentation ` page. - * The :ref:`config_audio_app_options` page. + * The :ref:`nrf53_audio_app_config_audio_app_options` page. * The API documentation in the header files listed on the :ref:`audio_api` page. * Ability to connect by address as a unicast client. 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 c722e8c0f32f..33f90c541a2c 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst @@ -33,18 +33,12 @@ The following sections provide detailed lists of changes by component. IDE, OS, and tool support ========================= -* Added macOS 26 support (Tier 3) to the table listing :ref:`supported operating systems for proprietary tools `. -* Updated: - - * The required `SEGGER J-Link`_ version to v8.76. - * Steps on the :ref:`install_ncs` page for installing the |NCS| and toolchain together. - With this change, the separate steps to install the toolchain and the SDK were merged into a single step. - * The table listing :ref:`supported operating systems for proprietary tools `: Windows 11 is now Tier 1, Windows 10 is now Tier 3, macOS 15 is now Tier 1, and macOS 13 is now Tier 3. +|no_changes_yet_note| Board support ============= -* Added support for the nRF7002-EB II Wi-Fi shield for use with the nRF54LM20 DK board target. +|no_changes_yet_note| Build and configuration system ============================== @@ -54,11 +48,7 @@ Build and configuration system Bootloaders and DFU =================== -* Added support for extra images in DFU packages (multi-image binary and ZIP). - This allows applications to extend the built-in DFU functionality with additional firmware images beyond those natively supported by the |NCS|, for example, firmware for external devices. - See :ref:`lib_dfu_extra` for details. -* Added an option to restore progress after a power failure when using DFU multi-image with MCUboot. -* Updated the NSIB monotonic counter configuration by moving it to sysbuild where it is now configured using the :kconfig:option:`SB_CONFIG_SECURE_BOOT_MONOTONIC_COUNTER` and :kconfig:option:`SB_CONFIG_SECURE_BOOT_NUM_VER_COUNTER_SLOTS` Kconfig options. +|no_changes_yet_note| Developing with nRF91 Series ============================ @@ -73,12 +63,12 @@ Developing with nRF70 Series Developing with nRF54L Series ============================= -* Added the :ref:`ug_nrf54l_otp_map` page, showing the OTP memory allocation for the nRF54L Series devices. +|no_changes_yet_note| Developing with nRF54H Series ============================= -* Updated the location of the merged binaries in direct-xip mode from :file:`build/zephyr` to :file:`build`. +|no_changes_yet_note| Developing with nRF53 Series ============================ @@ -98,11 +88,7 @@ Developing with Thingy:91 X Developing with Thingy:91 ========================= -* Updated the title of the page about updating the Thingy:91 firmware using the Cellular Monitor app to :ref:`thingy91_update_firmware`. - -* Removed the page about updating the Thingy:91 firmware using the Programmer app and cellular app. - Contents are now available in the app documentation on the `Programming Nordic Thingy prototyping platforms`_ and `Programming Nordic Thingy:91 firmware`_ pages, respectively. - The :ref:`thingy91_partition_layout` section has been moved to the :ref:`thingy91_update_firmware` page. +|no_changes_yet_note| Developing with Thingy:53 ========================= @@ -124,63 +110,10 @@ Developing with custom boards |no_changes_yet_note| -Developing with coprocessors -============================ - -|no_changes_yet_note| - Security ======== -* Added: - - * CRACEN and nrf_oberon driver support for nRF54LM20 and nRF54LV10. - For the list of supported features and limitations, see the :ref:`ug_crypto_supported_features` page. - - * Support for disabling Internal Trusted Storage (ITS) on nRF54L series devices when using - :kconfig:option:`CONFIG_TFM_PARTITION_CRYPTO` with Trusted Firmware-M (TF-M) through the - :kconfig:option:`CONFIG_TFM_PARTITION_INTERNAL_TRUSTED_STORAGE` Kconfig option. - - * Support for AES in counter mode and CBC mode using CRACEN for the :zephyr:board:`nrf54lm20dk`. - - * Experimental support for TF-M on the nRF54LV10A SoC. - * Experimental support for NSIB and MCUBoot on the nRF54LV10A SoC. - * Experimental support for KMU on the nRF54LV10A SoC. - * Experimental support for compression and encryption on the nRF54LV10A SoC. - -* Updated: - - * The :ref:`security_index` page with a table that lists the versions of security components implemented in the |NCS|. - * The :ref:`secure_storage_in_ncs` page with updated information about the secure storage configuration in the |NCS|. - Also renamed the page from "Trusted storage in the |NCS|." - * The :ref:`ug_crypto_supported_features` page with the missing entries for the HMAC key type (:kconfig:option:`CONFIG_PSA_WANT_KEY_TYPE_HMAC`). - * The :ref:`ug_nrf54l_crypto_kmu_supported_key_types` section specific for the nRF54L Series devices to list the supported algorithms for each key type. - * The :ref:`ug_nrf54l_developing_provision_kmu` page with more detailed information about requirements for KMU provisioning and steps for provisioning KMU for development and production. - This also led to some updates to the :ref:`ug_nrf54l_crypto_kmu_storing_keys` section on the :ref:`ug_nrf54l_cryptography` page. - -* Removed: - - * Support for curve types smaller than 224 bytes from the :ref:`CRACEN driver `. - * Support for some curve types that were marked as unsupported. - The :ref:`ug_crypto_supported_features` page has been updated accordingly. - -Mbed TLS --------- - -* Updated to version 3.6.5. - -Trusted Firmware-M ------------------- - -* Updated: - - * The TF-M version to 2.2.0. - * Documentation to clarify the support for TF-M on devices emulated using the nRF54L15 DK. - nRF54L05 does not support TF-M. - nRF54L10 supports TF-M experimentally. - -* Removed several documentation pages from the :ref:`tfm_wrapper` section that were misleading or not relevant for understanding the TF-M integration in the |NCS|. - The section now includes only pages that provide background information about TF-M design that are relevant for the |NCS|. +|no_changes_yet_note| Protocols ========= @@ -190,23 +123,12 @@ Protocols Bluetooth® LE ------------- -* Added the :c:func:`bt_nrf_conn_set_ltk` API. - - This API allows you to set a custom Long Term Key (LTK) for a connection. - You can use it when two devices have a shared proprietary method for obtaining an LTK. +|no_changes_yet_note| Bluetooth Mesh -------------- -* Updated the NLC profile configuration system: - - * Introduced individual profile configuration options for better user control. - * Deprecated the :kconfig:option:`CONFIG_BT_MESH_NLC_PERF_CONF` and :kconfig:option:`CONFIG_BT_MESH_NLC_PERF_DEFAULT` Kconfig options. - Existing configurations continue to work but you should migrate to individual profile options. - -* Updated the LE Pairing Responder model: - - * Deprecated the :kconfig:option:`CONFIG_BT_FIXED_PASSKEY` option in favor of the new and supported :kconfig:option:`CONFIG_BT_APP_PASSKEY` option. +|no_changes_yet_note| DECT NR+ -------- @@ -216,15 +138,10 @@ DECT NR+ Enhanced ShockBurst (ESB) ------------------------- -* Added: - - * The :ref:`esb_monitor_mode` feature. - * Experimental support for the nRF54LV10A SoC in the following samples: - - * :ref:`esb_prx` - * :ref:`esb_ptx` +* Updated: - * A workaround for the hardware errata HMPAN-229 for the nRF54H20 SoC. + * Workaround handling for the hardware erratas. + * The implementation of the hardware errata HMPAN-103 for the nRF54H20 SoC. Gazell ------ @@ -234,58 +151,12 @@ Gazell Matter ------ -* Added documentation for leveraging Matter Compliant Platform certification through the Derived Matter Product (DMP) process. - See :ref:`ug_matter_platform_and_dmp`. -* Updated to using the :kconfig:option:`CONFIG_PICOLIBC` Kconfig option as the C library instead of :kconfig:option:`CONFIG_NEWLIB_LIBC`, in compliance with Zephyr requirements. -* Removed the ``CONFIG_CHIP_SPI_NOR`` and ``CONFIG_CHIP_QSPI_NOR`` Kconfig options. -* Released the `Matter Quick Start app`_ v1.0.0 as part of nRF Connect for Desktop. -* Deprecated the Matter over Wi-Fi samples that are using nRF5340 SoC (nRF7002 DK and nRF5340 DK with the nRF7002 EK shield attached). - This is mainly due to the very limited non-volatile memory space left for application code. - As an alternative, it is recommended to use the nRF54LM20A SoC in combination with the nRF7002-EB II shield, which provides a significantly greater amount of available non-volatile memory for Matter over Wi-Fi applications. +|no_changes_yet_note| Matter fork +++++++++++ -The Matter fork in the |NCS| (``sdk-connectedhomeip``) contains all commits from the upstream Matter repository up to, and including, the ``v1.5.0.0`` tag. - -* Added: - - * Support for the following new device types: - * Irrigation System - * Soil Sensor - * Closure - * Closure Panel - * Closure Controller - * Meter Reference Point - * Electrical Energy Tariff - * Electrical Meter - * Electrical Utility Meter - * Camera - * Floodlight Camera - * Video Doorbell - * Snapshot Camera - * Chime - * Camera Controller - * Doorbell - * Intercom - * Audio Doorbell - - * Improved Data Transport by adding full support for operation over TCP transport, which enables more efficient and reliable transmission of large messages. - * The new code-driven approach for the Matter Data Model and Cluster configuration handling. - This approach assumes gradually replacing the configuration based on the ZAP files and the ZAP-generated code, and handling the configuration in the source code. - For example, to enable a specific cluster or its attribute, the new model requires calling a dedicated delegate and registering the cluster in a source code. - The code-driven approach is not yet fully implemented for all the available clusters, but the coverage will be increasing and it is used for the newly created clusters. - The new model is meant to be backward compatible with the previous configuration based on the ZAP files and the ZAP-generated code, until the code-driven approach is fully implemented for all the available clusters. - * The :ref:`ug_matter_gs_tools_matter_west_commands_sync` command to synchronize the ZAP and :file:`zcl.json` files after updating the ZAP tool version. - * The check to all :ref:`ug_matter_gs_tools_matter_west_commands_zap_tool` commands that verify whether ZAP tool sandbox permissions are correctly set. - In case of detecting incorrect permissions, the command will prompt the user to accept automatically updating the permissions to required ones. - -* Updated: - - * The :ref:`ug_matter_gs_tools_matter_west_commands_append` command to accept ``--clusters`` argument instead of ``new_clusters`` argument. - -* Removed dependencies on Nordic DK-specific configurations in Matter configurations. - See the `Migration guide for nRF Connect SDK v3.2.0`_ for more information. +|no_changes_yet_note| nRF IEEE 802.15.4 radio driver ------------------------------ @@ -295,24 +166,17 @@ nRF IEEE 802.15.4 radio driver Thread ------ -* Updated: - - * The :ref:`thread_sed_ssed` documentation to clarify the impact of the SSED configuration on the device's power consumption and provide a guide for :ref:`thread_ssed_fine_tuning` of SSED devices. - * The platform configuration to use the :kconfig:option:`CONFIG_PICOLIBC` Kconfig opiton as the C library instead of :kconfig:option:`CONFIG_NEWLIB_LIBC`, in compliance with Zephyr requirements. +|no_changes_yet_note| Wi-Fi® ------ -Added: - - * Support for Wi-Fi Direct (P2P) mode, see :ref:`ug_wifi_direct` for details. - * Support for WPA3-SAE using the Oberon PSA PAKE implementation, see :ref:`ug_nrf70_wifi_advanced_security_modes` for details. +|no_changes_yet_note| Applications ============ -* Removed the Serial LTE modem application. - Instead, use `Serial Modem`_, an |NCS| add-on application. +|no_changes_yet_note| Connectivity bridge ------------------- @@ -327,117 +191,32 @@ IPC radio firmware Matter bridge ------------- -* Added: - - * Support for the nRF54LM20 DK working with both Thread and Wi-Fi protocol variants. - For the Wi-Fi protocol variant, the nRF54LM20 DK works with the nRF7002-EB II shield attached. - * The ``matter_bridge list`` command to show a list of all bridged devices and their endpoints. - -* Updated: - - * The application to store a portion of the application code related to the nRF70 Series Wi-Fi firmware in the external flash memory by default. - This change breaks the DFU between the previous |NCS| versions and the upcoming release. - To fix this, you need to disable storing the Wi-Fi firmware patch in external memory. - See the :ref:`migration guide ` for more information. - * By moving code from :file:`samples/matter/common/src/bridge` to :file:`applications/matter_bridge/src/core` and :file:`applications/matter_bridge/src/ble` directories. - * The Identify cluster implementation in the application to use the code-driven approach instead of the zap-driven approach. - * The default number of Bluetooth Low Energy connections that can be selected using the kconfig configuration from ``10`` to ``8`` for the Matter bridge over Thread configuration. +|no_changes_yet_note| nRF5340 Audio ------------- -* Added: - - * A way to store servers in RAM on the unicast client (gateway) side. - The storage does a compare on server address to match multiple servers in a unicast group. - This means that if another device appears with the same address, it will be treated as the same server. - * Experimental support for stereo in :ref:`unicast server application`. - * The :ref:`Audio application API documentation ` page. - * The :ref:`config_audio_app_options` page. - * The API documentation in the header files listed on the :ref:`audio_api` page. - * Ability to connect by address as a unicast client. - -* Updated: - - * The unicast client (gateway) application has been rewritten to support N channels. - * The unicast client (gateway) application now checks if a server has a resolvable address. - If this has not been resolved, the discovery process will start in the identity resolved callback. - * The power measurements to be disabled by default in the default debug versions of the applications. - To enable power measurements, see :ref:`nrf53_audio_app_configuration_power_measurements`. - * The audio application targeting the :zephyr:board:`nrf5340dk` to use pins **P1.5** to **P1.9** for the I2S interface instead of **P0.13** to **P0.17**. - This change was made to avoid conflicts with the onboard peripherals on the nRF5340 DK. - * The documentation pages with information about the :ref:`SD card playback module ` and :ref:`how to enable it `. - * The API documentation in the header files listed on the :ref:`audio_api` page. - -* Removed the LC3 QDID from the :ref:`nrf53_audio_feature_support` page. - The QDID is now listed in the `nRF5340 Bluetooth DNs and QDIDs Compatibility Matrix`_. +|no_changes_yet_note| nRF Desktop ----------- - * Updated: - - * The memory layouts for the ``nrf54lm20dk/nrf54lm20a/cpuapp`` board target to make more space for the application code. - This change in the partition map of every nRF54LM20 configuration is a breaking change and cannot be performed using DFU. - As a result, the DFU procedure will fail if you attempt to upgrade the application firmware based on one of the |NCS| v3.1 releases. - * The application and MCUboot configurations for the ``nrf54lm20dk/nrf54lm20a/cpuapp`` board target to use the CRACEN hardware crypto driver instead of the Oberon software crypto driver. - The application image signature is verified with the CRACEN hardware peripheral. - * The MCUboot configurations for the ``nrf54lm20dk/nrf54lm20a/cpuapp`` board target to use the KMU-based key storage. - The public key used by MCUboot for validating the application image is securely stored in the KMU hardware peripheral. - To simplify the programming procedure, the application is configured to use the automatic KMU provisioning. - The KMU provisioning is performed by the west runner as a part of the ``west flash`` command when the ``--erase`` or ``--recover`` flag is used. - * Application configurations to avoid using the deprecated Kconfig options :ref:`CONFIG_DESKTOP_HID_REPORT_EXPIRATION ` and :ref:`CONFIG_DESKTOP_HID_EVENT_QUEUE_SIZE `. - The configurations rely on Kconfig options specific to HID providers instead. - The HID keypress queue sizes for HID consumer control (:ref:`CONFIG_DESKTOP_HID_REPORT_PROVIDER_CONSUMER_CTRL_EVENT_QUEUE_SIZE `) and HID system control (:ref:`CONFIG_DESKTOP_HID_REPORT_PROVIDER_SYSTEM_CTRL_EVENT_QUEUE_SIZE `) reports were decreased to ``10``. - * Application configurations integrating the USB legacy stack (:ref:`CONFIG_DESKTOP_USB_STACK_LEGACY `) to suppress build warnings related to deprecated APIs of the USB legacy stack (:kconfig:option:`CONFIG_USB_DEVICE_STACK`). - The configurations enable the :kconfig:option:`CONFIG_DEPRECATION_TEST` Kconfig option to suppress the deprecation warnings. - The USB legacy stack is still used by default. - * MCUboot configurations that support serial recovery over USB CDC ACM to enable the :kconfig:option:`CONFIG_DEPRECATION_TEST` Kconfig option to suppress deprecation warnings. - The implementation of serial recovery over USB CDC ACM still uses the deprecated APIs of the USB legacy stack (:kconfig:option:`CONFIG_USB_DEVICE_STACK`). - * Configurations of the ``nrf52840dongle/nrf52840`` board target to align them after the ``bare`` variant of the board was introduced in Zephyr. - The application did not switch to the ``bare`` board variant to keep backwards compatibility. - * The :ref:`nrf_desktop_hid_state` to allow for delayed registration of HID report providers. - Before the change was introduced, subscribing to a HID input report before the respective provider was registered triggered an assertion failure. - * HID transports (:ref:`nrf_desktop_hids`, :ref:`nrf_desktop_usb_state`) to use the early :c:struct:`hid_report_event` subscription (:c:macro:`APP_EVENT_SUBSCRIBE_EARLY`). - This update improves the reception speed of HID input reports in HID transports. - * The :ref:`nrf_desktop_motion` implementations to align internal state names for consistency. - * The :ref:`nrf_desktop_motion` implementation that generates simulated motion. - Improved the Zephyr shell (:kconfig:option:`CONFIG_SHELL`) integration to prevent potential race conditions related to using preemptive execution context for shell commands. - * The :c:struct:`motion_event` to include information if the sensor is still active or goes to idle state waiting for user activity (:c:member:`motion_event.active`). - The newly added field is filled by all :ref:`nrf_desktop_motion` implementations. - The :ref:`nrf_desktop_hid_provider_mouse` uses the newly added field to improve the synchronization of motion sensor sampling. - After the motion sensor sampling is triggered, the provider waits for the result before submitting a subsequent HID mouse input report. - * The :ref:`nrf_desktop_hid_state_pm` to skip submitting the :c:struct:`keep_alive_event` if the :c:enum:`POWER_MANAGER_LEVEL_ALIVE` power level is enforced by any application module through the :c:struct:`power_manager_restrict_event`. - This is done to improve performance. - * The documentation of the :ref:`nrf_desktop_hid_state` and default HID report providers to simplify getting started with updating HID input reports used by the application or introducing support for a new HID input report. - * The default value of the :kconfig:option:`CONFIG_SOC_FLASH_NRF_RADIO_SYNC_MPSL_NORMAL_PRIORITY_TIMEOUT_US` Kconfig option to ``0``. - This is done to start using high MPSL timeslot priority quicker and speed up non-volatile memory operations. - * The number of preemptive priorities (:kconfig:option:`CONFIG_NUM_PREEMPT_PRIORITIES`). - The Kconfig option value was increased to ``15`` (default value from Zephyr). - The priority of ``10`` is used by default for preemptive contexts (for example, :kconfig:option:`CONFIG_BT_GATT_DM_WORKQ_PRIO` and :kconfig:option:`CONFIG_BT_LONG_WQ_PRIO`). - The previously used Kconfig option value of ``11`` leads to using the same priority for the mentioned preemptive contexts as the lowest available application thread priority (used for example, by the log processing thread). - * Application image configurations to explicitly specify the LED driver used by the :ref:`nrf_desktop_leds` (:kconfig:option:`CONFIG_CAF_LEDS_GPIO` or :kconfig:option:`CONFIG_CAF_LEDS_PWM`). - Also, disabled unused LED drivers enabled by default to reduce memory footprint. - * The :ref:`nrf_desktop_hid_forward` to allow using the module when configuration channel support (:ref:`CONFIG_DESKTOP_CONFIG_CHANNEL_ENABLE `) is disabled in the application configuration. - * The :ref:`nrf_desktop_keys_state` to rely on runtime assertions, ensuring that the initialization function is called only once and other APIs of the utility are called after the utility was initialized. - This is done to align the utility with other application utilities. +|no_changes_yet_note| nRF Machine Learning (Edge Impulse) ----------------------------------- -* Updated: +|no_changes_yet_note| - * The application to change the default libc from the :ref:`zephyr:c_library_newlib` to the :ref:`zephyr:c_library_picolibc` to align with the |NCS| and Zephyr. - * By changing the number of preemptive priorities (:kconfig:option:`CONFIG_NUM_PREEMPT_PRIORITIES`) from ``11`` to default value ``15`` from Zephyr. - The priority of ``10`` is used by default for some preemptive contexts (for example, :kconfig:option:`CONFIG_BT_LONG_WQ_PRIO`). - The previously used Kconfig option value of ``11`` led to using the lowest available application thread priority for the mentioned preemptive contexts, which at the same time is used, for example, by the log processing thread. +Serial LTE modem +---------------- -* Removed support for the ``thingy53/nrf5340/cpuapp/ns`` build target. +|no_changes_yet_note| Thingy:53: Matter weather station --------------------------------- -* Updated the application to use the code-driven approach for the Identify cluster implementation instead of the zap-driven approach. +|no_changes_yet_note| Samples ======= @@ -447,250 +226,27 @@ This section provides detailed lists of changes by :ref:`sample `. Bluetooth samples ----------------- -* Added: - - * The :ref:`ble_shorter_conn_intervals` sample to demonstrate how to use the Bluetooth Shorter Connection Intervals feature. - * The :ref:`bluetooth_path_loss_monitoring` sample. - * The :ref:`samples_test_app` application to demonstrate how to use the Bluetooth LE Test GATT Server and test Bluetooth LE functionality in peripheral samples. - * Experimental support for the nRF54LV10A SoC in the following Bluetooth samples: - - * :ref:`central_and_peripheral_hrs` - * :ref:`central_bas` - * :ref:`bluetooth_central_hids` - * :ref:`bluetooth_central_hr_coded` - * :ref:`bluetooth_central_dfu_smp` - * :ref:`central_uart` - * :ref:`channel_sounding_ras_initiator` - * :ref:`channel_sounding_ras_reflector` - * :ref:`bluetooth_conn_time_synchronization` - * :ref:`direct_test_mode` - * :ref:`direction_finding_connectionless_tx` - * :ref:`direction_finding_peripheral` - * :ref:`ble_event_trigger` - * :ref:`bluetooth_iso_combined_bis_cis` - * :ref:`bluetooth_isochronous_time_synchronization` - * :ref:`ble_llpm` - * :ref:`multiple_adv_sets` - * :ref:`peripheral_bms` - * :ref:`peripheral_cgms` - * :ref:`peripheral_cts_client` - * :ref:`peripheral_gatt_dm` - * :ref:`peripheral_hids_keyboard` - * :ref:`peripheral_hids_mouse` - * :ref:`peripheral_hr_coded` - * :ref:`peripheral_lbs` - * :ref:`peripheral_mds` - * :ref:`power_profiling` - * :ref:`peripheral_rscs` - * :ref:`peripheral_status` - * :ref:`peripheral_uart` - * :ref:`bt_peripheral_with_multiple_identities` - * :ref:`bluetooth_radio_coex_1wire_sample` - * :ref:`ble_radio_notification_conn_cb` - * :ref:`bt_scanning_while_connecting` - * :ref:`shell_bt_nus` - * :ref:`ble_shorter_conn_intervals` - * :ref:`ble_subrating` - * :ref:`ble_throughput` - -* Added the :ref:`bluetooth_automated_power_control` sample. - -* Updated the network core image applications for the following samples from the :zephyr:code-sample:`bluetooth_hci_ipc` sample to the :ref:`ipc_radio` application for multicore builds: - - * :ref:`bluetooth_conn_time_synchronization` - * :ref:`bluetooth_iso_combined_bis_cis` - * :ref:`bluetooth_isochronous_time_synchronization` - * :ref:`bt_scanning_while_connecting` - * :ref:`channel_sounding_ras_initiator` - * :ref:`channel_sounding_ras_reflector` - - The :ref:`ipc_radio` application is commonly used for multicore builds in other |NCS| samples and projects. - Hence, this is to align with the common practice. - -* Disabled legacy pairing in the following samples: - - * :ref:`central_nfc_pairing` - * :ref:`power_profiling` - - Support for legacy pairing remains exclusively for :ref:`peripheral_nfc_pairing` sample to retain compatibility with older Andorid devices. - -* :ref:`direct_test_mode` sample: - - * Updated by simplifying the 2-wire UART polling. - This is done by replacing the hardware timer with the ``k_sleep()`` function. +|no_changes_yet_note| Bluetooth Mesh samples ---------------------- -* Added: - - * Support for external flash settings for the ``nrf52840dk/nrf52840``, ``nrf54l15dk/nrf54l15/cpuapp``, ``nrf54l15dk/nrf54l10/cpuapp``, and ``nrf54l15dk/nrf54l05/cpuapp`` board targets in all Bluetooth Mesh samples. - * Support for the ``nrf54lm20dk/nrf54lm20a/cpuapp`` board target in all Bluetooth Mesh samples. - -* :ref:`ble_mesh_dfu_distributor` sample: - - * Added: - - * Support for external flash memory for the ``nrf52840dk/nrf52840`` and the ``nrf54l15dk/nrf54l15/cpuapp`` as the secondary partition for the DFU process. - - * Updated: - - * The sample to use the :kconfig:option:`CONFIG_BT_APP_PASSKEY` option instead of the deprecated :kconfig:option:`CONFIG_BT_FIXED_PASSKEY` option. - -* :ref:`ble_mesh_dfu_target` sample: - - * Added: - - * Support for external flash memory for the ``nrf52840dk/nrf52840`` and the ``nrf54l15dk/nrf54l15/cpuapp`` as the secondary partition for the DFU process. - -* :ref:`bluetooth_mesh_sensor_client` sample: - - * Added polling toggle to **Button 1** (**Button 0** on nRF54 DKs) to start/stop the periodic Sensor Get loop, ensuring the functionality is available on all supported devices including single-button hardware. - - * Updated: - - * To demonstrate the Bluetooth :ref:`ug_bt_mesh_nlc` HVAC Integration profile. - - * To use individual NLC profile configurations instead of the deprecated options. - * The sample name to indicate NLC support. - - * Button functions. - Assignments are shifted down one index to accommodate the new polling toggle. - The descriptor action has been removed from button actions but is still available through mesh shell commands. - - * Removed support for the ``nrf52dk/nrf52832``, since it does not have enough RAM space after NLC support was added. - -* :ref:`bluetooth_mesh_sensor_server`: - - * Updated: - - * To use individual NLC profile configurations instead of the deprecated options. - * The sample name to indicate NLC support. - -* :ref:`bluetooth_mesh_light_dim`: - - * Updated: - - * To use individual NLC profile configurations instead of the deprecated options. - * The sample name to indicate NLC support. - -* :ref:`bluetooth_mesh_light_lc`: - - * Updated: - - * To use individual NLC profile configurations instead of the deprecated options. - * The sample name to indicate NLC support. +|no_changes_yet_note| Bluetooth Fast Pair samples --------------------------- -* :ref:`fast_pair_locator_tag` sample: - - * Updated: - - * The memory layout for the ``nrf54lm20dk/nrf54lm20a/cpuapp`` board target to make more space for the application code. - This change in the nRF54LM20 partition map is a breaking change and cannot be performed using DFU. - As a result, the DFU procedure will fail if you attempt to upgrade the sample firmware based on one of the |NCS| v3.1 releases. - * The application and MCUBoot configurations for the ``nrf54lm20dk/nrf54lm20a/cpuapp`` board target to use the CRACEN hardware crypto driver instead of the Oberon software crypto driver. - Note, that the Fast Pair subsystem still uses the Oberon software library. - The application image signature is verified with the CRACEN hardware peripheral. - * The MCUBoot configuration for the ``nrf54lm20dk/nrf54lm20a/cpuapp`` board target to use the KMU-based key storage. - The public key used by MCUboot for validating the application image is securely stored in the KMU hardware peripheral. - To simplify the programming procedure, the samples are configured to use the automatic KMU provisioning. - The KMU provisioning is performed by the west runner as a part of the ``west flash`` command when the ``--erase`` or ``--recover`` flag is used. - -* :ref:`fast_pair_input_device` sample: - - * Updated the application configuration for the ``nrf54lm20dk/nrf54lm20a/cpuapp`` board target to use the CRACEN hardware crypto driver instead of the Oberon software crypto driver. - Note, that the Fast Pair subsystem still uses the Oberon software library. +|no_changes_yet_note| Cellular samples ---------------- -* Added: - - * The :ref:`nrf_cloud_coap_cell_location` sample to demonstrate how to use the `nRF Cloud CoAP API`_ for nRF Cloud's cellular location service. - * The :ref:`nrf_cloud_coap_fota_sample` sample to demonstrate how to use the `nRF Cloud CoAP API`_ for FOTA updates. - * The :ref:`nrf_cloud_coap_device_message` sample to demonstrate how to use the `nRF Cloud CoAP API`_ for device messages. - * The :ref:`nrf_cloud_mqtt_device_message` sample to demonstrate how to use the `nRF Cloud MQTT API`_ for device messages. - * The :ref:`nrf_cloud_mqtt_fota` sample to demonstrate how to use the `nRF Cloud MQTT API`_ for FOTA updates. - * The :ref:`nrf_cloud_mqtt_cell_location` sample to demonstrate how to use the `nRF Cloud MQTT API`_ for nRF Cloud's cellular location service. - -* Updated the following samples to use the new ``SEC_TAG_TLS_INVALID`` definition: - - * :ref:`modem_shell_application` - * :ref:`http_application_update_sample` - * :ref:`http_modem_delta_update_sample` - * :ref:`http_modem_full_update_sample` - -* Removed: - - * The SLM Shell sample. - Use the sample from `Serial Modem`_ instead. - * The deprecated LTE Sensor Gateway sample. - -* :ref:`nrf_cloud_rest_cell_location` sample: - - * Added runtime setting of the log level for the nRF Cloud logging feature. - -* :ref:`modem_shell_application` sample: - - * Added: - - * Support for environment evaluation using the ``link enveval`` command. - * Support for NTN NB-IoT to the ``link sysmode`` and ``link edrx`` commands. - * Support for Non-Terrestrial Network (NTN) helper functionality using the ``ntn`` command. - - * Updated the PDN connection management to use the PDN functionality in the :ref:`lte_lc_readme` library instead of the :ref:`pdn_readme` library. - -* :ref:`pdn_sample` sample: - - * Updated the PDN functionality to use the PDN management in the :ref:`lte_lc_readme` library instead of the :ref:`pdn_readme` library. - -* :ref:`gnss_sample` sample: - - * Added TLS support for connection to the SUPL server. - -* :ref:`nrf_cloud_multi_service` sample: - - * Fixed an issue where sporadically the application was stuck waiting for the device to connect to the internet. - This was due to wrong :ref:`Connection Manager ` initialization. - * Deprecated the sample. +|no_changes_yet_note| Cryptography samples -------------------- -* Added: - - * Support for the ``nrf54lv10dk/nrf54lv10a/cpuapp`` and ``nrf54lv10dk/nrf54lv10a/cpuapp/ns`` board targets to all samples (except :ref:`crypto_test`). - * Support for the ``nrf54lm20dk/nrf54lm20a/cpuapp/ns`` board target in all supported cryptography samples. - * The :ref:`crypto_kmu_cracen_usage` sample. - -* Updated documentation of all samples for style consistency: added lists of cryptographic features used by each sample and sample output in the testing section. - -* :ref:`crypto_persistent_key` sample: - - * Added support for the ``nrf54h20dk/nrf54h20/cpuapp`` board target, demonstrating use of Internal Trusted Storage (ITS) on the nRF54H20 DK. - -* :ref:`crypto_aes_ctr` sample: - - * Added support for the ``nrf54lm20dk/nrf54lm20a/cpuapp`` board target. - -* :ref:`crypto_tls` sample: - - * Updated sample-specific Kconfig configuration structure and documentation. - -* :ref:`crypto_aes_ctr` sample: - - * Added support for ``nrf54lm20dk/nrf54lm20a/cpuapp`` board target. - -* :ref:`crypto_aes_cbc` sample: - - * Added support for ``nrf54lm20dk/nrf54lm20a/cpuapp`` board target. - -* :ref:`crypto_persistent_key` sample: - - * Added support for the ``nrf54h20dk/nrf54h20/cpuapp`` board target, demonstrating use of Internal Trusted Storage (ITS) on the nRF54H20 DK. +|no_changes_yet_note| Debug samples ------------- @@ -700,29 +256,7 @@ Debug samples DECT NR+ samples ---------------- -* :ref:`dect_shell_application` sample: - - * Added: - - * ``dect perf`` command client: LBT (Listen Before Talk) support with configurable LBT period and busy threshold. - - * Updated: - - * PCC and PDC printings improved to show SNR and RSSI-2 values with actual dB/dBm resolutions. - * ``dect perf`` command: improved operation schedulings to avoid scheduling conflicts and fix to TX the results in server side. - * ``dect ping`` command: improved operation schedulings to avoid scheduling conflicts. - -DFU samples ------------ - -* Added: - - * The :ref:`dfu_multi_image_sample` sample to demonstrate how to use the :ref:`lib_dfu_target` library. - * The :ref:`ab_sample` sample to demonstrate how to implement the A/B firmware update strategy using :ref:`MCUboot `. - * The :ref:`fw_loader_ble_mcumgr` sample that provides a minimal configuration for firmware loading using SMP over Bluetooth LE. - This sample is intended as a starting point for developing custom firmware loader applications that work with the MCUboot bootloader. - * The :ref:`single_slot_sample` sample to demonstrate how to maximize the available space for the application with MCUboot using firmware loader mode (single-slot layout). - * The :ref:`mcuboot_with_encryption` sample demonstrating how to build MCUboot with image encryption enabled. +|no_changes_yet_note| Edge Impulse samples -------------------- @@ -732,7 +266,7 @@ Edge Impulse samples Enhanced ShockBurst samples --------------------------- -* Added the :ref:`esb_monitor` sample to demonstrate how to use the :ref:`ug_esb` protocol in Monitor mode. +|no_changes_yet_note| Gazell samples -------------- @@ -747,43 +281,12 @@ Keys samples Matter samples -------------- -* Added: - - * The :ref:`matter_temperature_sensor_sample` sample that demonstrates how to implement and test a Matter temperature sensor device. - * The :ref:`matter_contact_sensor_sample` sample that demonstrates how to implement and test a Matter contact sensor device. - * The :ref:`matter_closure_sample` sample that demonstrates how to implement and test a Matter closure device. - * The ``matter_custom_board`` toggle paragraph in the Matter advanced configuration section of all Matter samples that demonstrates how add and configure a custom board. - * Support for the Matter over Wi-Fi on the nRF54LM20 DK with the nRF7002-EB II shield attached to all Matter over Wi-Fi samples. - * Enabled deprecated warnings for all Matter over Wi-Fi samples that are using nRF5340 SoC. - -* Updated: - - * All Matter over Wi-Fi samples and applications to store a portion of the application code related to the nRF70 Series Wi-Fi firmware in the external flash memory by default. - This change breaks the DFU between the previous |NCS| versions and the |NCS| v3.2.0. - To fix this, you need to disable storing the Wi-Fi firmware patch in external memory. - See the :ref:`migration guide ` for more information. - * All Matter samples that support low-power mode to use the :ref:`lib_ram_pwrdn` feature with the nRF54LM20 DK. - This change resulted in decreasing the sleep current consumption by more than two uA. - * All Matter samples to use the code-driven approach for the Identify cluster implementation instead of the zap-driven approach. - -* :ref:`matter_lock_sample` sample: - - * Added a callback for the auto-relock feature. - This resolves the :ref:`known issue ` KRKNWK-20691. - * Updated the NUS service to use the :kconfig:option:`CONFIG_BT_APP_PASSKEY` Kconfig option instead of the deprecated :kconfig:option:`CONFIG_BT_FIXED_PASSKEY` Kconfig option. +|no_changes_yet_note| Networking samples ------------------ -* Added support for the nRF7002-EB II with the ``nrf54lm20dk/nrf54lm20a/cpuapp`` board target in the following samples: - - * :ref:`aws_iot` - * :ref:`net_coap_client_sample` - * :ref:`download_sample` - * :ref:`http_server` - * :ref:`https_client` - * :ref:`mqtt_sample` - * :ref:`udp_sample` +|no_changes_yet_note| NFC samples ----------- @@ -828,14 +331,7 @@ SUIT samples Trusted Firmware-M (TF-M) samples --------------------------------- -* :ref:`tfm_hello_world` sample: - - * Added support for the ``nrf54lv10dk/nrf54lv10a/cpuapp/ns`` board target. - * Added support for the ``nrf54lm20dk/nrf54lm20a/cpuapp/ns`` board target. - -* :ref:`tfm_secure_peripheral_partition` - - * Added support for the ``nrf54lm20dk/nrf54lm20a/cpuapp/ns`` board target. +|no_changes_yet_note| Thread samples -------------- @@ -845,35 +341,12 @@ Thread samples Wi-Fi samples ------------- -* Removed support for the nRF7002-EB II with the ``nrf54h20dk/nrf54h20/cpuapp`` board target from the following samples: - - * :ref:`wifi_station_sample` - * :ref:`wifi_scan_sample` - * :ref:`wifi_shell_sample` - * :ref:`wifi_radio_test` - * :ref:`ble_wifi_provision` - * :ref:`wifi_provisioning_internal_sample` +|no_changes_yet_note| Other samples ------------- -* Added experimental support for the nRF54LV10A SoC in the following samples: - - * :ref:`event_manager_proxy_sample` - * :ref:`ipc_service_sample` - - -* Added the :ref:`secondary_boot_sample` sample that demonstrates how to build and boot a secondary application image on the nRF54H20 DK. - -* :ref:`nrf_profiler_sample` sample: - - * Added a new testing step demonstrating how to calculate event propagation statistics. - Also added the related test preset for the :file:`calc_stats.py` script (:file:`nrf/scripts/nrf_profiler/stats_nordic_presets/nrf_profiler.json`). - -* :ref:`app_event_manager_profiling_tracer_sample` sample: - - * Added a new testing step demonstrating how to calculate event propagation statistics. - Also added the related test preset for the :file:`calc_stats.py` script (:file:`nrf/scripts/nrf_profiler/stats_nordic_presets/app_event_manager_profiler_tracer.json`). +|no_changes_yet_note| Drivers ======= @@ -888,38 +361,22 @@ Wi-Fi drivers Flash drivers ------------- -* Added a Kconfig option to configure timeout for normal priority MPSL request (:kconfig:option:`CONFIG_SOC_FLASH_NRF_RADIO_SYNC_MPSL_NORMAL_PRIORITY_TIMEOUT_US`) in MPSL flash synchronization driver (:file:`nrf/drivers/mpsl/flash_sync/flash_sync_mpsl.c`). - After the timeout specified by this Kconfig option, a higher timeslot priority is used to increase the priority of the flash operation. - The default timeout has been reduced from 30 milliseconds to 10 milliseconds to speed up non-volatile memory operations. +|no_changes_yet_note| Libraries ========= This section provides detailed lists of changes by :ref:`library `. - * :ref:`nrf_security_readme` library: - - * The ``CONFIG_CRACEN_PROVISION_PROT_RAM_INV_DATA`` Kconfig option has been renamed to :kconfig:option:`CONFIG_CRACEN_PROVISION_PROT_RAM_INV_SLOTS_ON_INIT`. - Binary libraries ---------------- -* :ref:`liblwm2m_carrier_readme` library: - - * Updated: - - * The glue layer to manage PDN connections using the PDN management functionality in the :ref:`lte_lc_readme` library when the :kconfig:option:`CONFIG_LTE_LC_PDN_MODULE` Kconfig option is enabled, or direct AT commands otherwise. - - * Removed the dependency on the deprecated :ref:`pdn_readme` library. +|no_changes_yet_note| Bluetooth libraries and services -------------------------------- -* :ref:`hids_readme` library: - - * Updated the report length of the HID boot mouse to ``3``. - The :c:func:`bt_hids_boot_mouse_inp_rep_send` function only allows to provide the state of the buttons and mouse movement (for both X and Y axes). - No additional data can be provided by the application. +|no_changes_yet_note| Common Application Framework ---------------------------- @@ -934,7 +391,7 @@ Debug libraries DFU libraries ------------- -* Added new library :ref:`lib_dfu_extra`. +|no_changes_yet_note| Gazell libraries ---------------- @@ -944,74 +401,14 @@ Gazell libraries Security libraries ------------------ -* :ref:`trusted_storage_readme` library: - - * Updated the API documentation to be based on headers in :file:`subsys/trusted_storage/include/psa` instead of :file:`include/`. - * Removed the :file:`internal_trusted_storage.h` and :file:`protected_storage.h` files from :file:`include/` as they were duplicating the same files in :file:`subsys/trusted_storage/include/psa`. +|no_changes_yet_note| Modem libraries --------------- -* Added the :ref:`lib_ntn` library to provide helper functionality for Non-Terrestrial Network (NTN) usage. - -* Removed: - - * The AT command parser library. - Use the :ref:`at_parser_readme` library instead. - * The AT parameters library. - * The Modem SLM library. - Use the library from `Serial Modem`_ instead. - * :ref:`lte_lc_readme` library: - * Added: - - * Support for environment evaluation. - * Support for NTN NB-IoT system mode. - * eDRX support for NTN NB-IoT. - * Support for new modem events :c:enumerator:`LTE_LC_MODEM_EVT_RF_CAL_NOT_DONE`, :c:enumerator:`LTE_LC_MODEM_EVT_INVALID_BAND_CONF`, and :c:enumerator:`LTE_LC_MODEM_EVT_DETECTED_COUNTRY`. - * Description of new features supported by mfw_nrf91x1 and mfw_nrf9151-ntn in receive only functional mode. - * Sending of the ``LTE_LC_EVT_PSM_UPDATE`` event with ``tau`` and ``active_time`` set to ``-1`` when registration status is ``LTE_LC_NW_REG_NOT_REGISTERED``. - * New registration statuses and functional modes for the ``mfw_nrf9151-ntn`` modem firmware. - * Support for PDP context and PDN connection management. - The functionality is available when the :kconfig:option:`CONFIG_LTE_LC_PDN_MODULE` Kconfig option is enabled. - * Support for also disabling the default modules that are enabled by default. - This is useful when the application only needs a subset of the functionality provided by the library and to reduce the size of the application image. - To disable a module, set the corresponding ``CONFIG_LTE_LC__MODULE`` Kconfig option to ``n``. - - * Updated: - - * The type of the :c:member:`lte_lc_evt.modem_evt` field to :c:struct:`lte_lc_modem_evt`. - * Replaced modem events ``LTE_LC_MODEM_EVT_CE_LEVEL_0``, ``LTE_LC_MODEM_EVT_CE_LEVEL_1``, ``LTE_LC_MODEM_EVT_CE_LEVEL_2`` and ``LTE_LC_MODEM_EVT_CE_LEVEL_3`` with the :c:enumerator:`LTE_LC_MODEM_EVT_CE_LEVEL` modem event. - * The order of the ``LTE_LC_MODEM_EVT_SEARCH_DONE`` modem event, and registration and cell related events. - See the :ref:`migration guide ` for more information. - - * Fixed an issue where band lock, RAI notification subscription, and DNS fallback address were lost when the modem was put into :c:enumerator:`LTE_LC_FUNC_MODE_POWER_OFF` functional mode. - -* :ref:`nrf_modem_lib_readme` library: - - * Added the :c:func:`nrf_modem_lib_trace_peek_at` function to the :c:struct:`nrf_modem_lib_trace_backend` interface to peek trace data at a byte offset without consuming it. - Support for this API has been added to the flash trace backend. - - * Updated the PDN functionality to use the PDN management in the :ref:`lte_lc_readme` library instead of the :ref:`pdn_readme` library. - - * Removed the deprecated ``CONFIG_NRF_MODEM_LIB_TRACE_BACKEND_UART_ZEPHYR`` Kconfig option. - -* :ref:`at_parser_readme` library: - - * Fixed an issue where an unquoted string parameter in the middle of a response would not be parsed correctly. - -* :ref:`pdn_readme` library: - - * Deprecated the library. - Use the PDN management functionality in the :ref:`lte_lc_readme` library instead. - - * Fixed: - - * An issue where wrong APN rate control event was sent. - * An issue where a malformed +CGEV notification was not handled correctly. - - * Removed the deprecated ``pdn_dynamic_params_get()`` function. + * Added support for new PDN events :c:enumerator:`LTE_LC_EVT_PDN_SUSPENDED` and :c:enumerator:`LTE_LC_EVT_PDN_RESUMED`. Multiprotocol Service Layer libraries ------------------------------------- @@ -1021,61 +418,7 @@ Multiprotocol Service Layer libraries Libraries for networking ------------------------ -* Added missing brackets that caused C++ compilation to fail in the following libraries: - - * :ref:`lib_nrf_cloud_pgps` - * :ref:`lib_nrf_cloud_fota` - -* Updated the following libraries to use the new ``SEC_TAG_TLS_INVALID`` definition for checking whether a security tag is valid: - - * :ref:`lib_aws_fota` - * :ref:`lib_fota_download` - * :ref:`lib_ftp_client` - -* Removed the Download client library. - Use the :ref:`lib_downloader` library instead. - -* :ref:`lib_nrf_provisioning` library: - - * Added a blocking call to wait for a functional-mode change, relocating the logic from the app into the library. - - * Updated: - - * By making internal scheduling optional. - Applications can now trigger provisioning manually using the :kconfig:option:`CONFIG_NRF_PROVISIONING_SCHEDULED` Kconfig option. - * By moving root CA provisioning to modem initialization callback to avoid blocking and ensure proper state. - * By expanding the event handler to report more provisioning events, including failures. - * By making the event handler callback mandatory to notify the application of failures and prevent silent errors. - * By unifying the device‐mode and modem‐mode callbacks into a single handler for cleaner integration. - * The documentation and sample code accordingly. - - * Fixed multiple bugs and enhanced error handling. - -* :ref:`lib_nrf_cloud_rest` library: - - * Deprecated the library. - Use the :ref:`lib_nrf_cloud_coap` library instead. - -* :ref:`lib_nrf_cloud_fota` library: - - * Fixed occasional message truncation notifying that the download was complete. - -* :ref:`lib_nrf_cloud_log` library: - - * Updated by adding a missing CONFIG prefix. - -* :ref:`lib_nrf_cloud` library: - - * Added the :c:func:`nrf_cloud_obj_location_request_create_timestamped` function to make location requests for past cellular or Wi-Fi scans. - * Updated: - - * By refactoring the folder structure of the library to separate the different backend implementations. - * Handling of ports, which led to confusing log messages with byte-inversed values. - -* :ref:`lib_downloader` library: - - * Fixed an issue where HTTP download would hang if the application had not set the socket receive timeout and data flow from the server stopped. - The HTTP transport now sets the socket receive timeout to 30 seconds by default. +|no_changes_yet_note| Libraries for NFC ----------------- @@ -1090,13 +433,11 @@ nRF RPC libraries Other libraries --------------- -* :ref:`nrf_profiler` library: - - * Updated the documentation by separating out the :ref:`nrf_profiler_script` documentation. +|no_changes_yet_note| -* :ref:`lib_ram_pwrdn` library: +* :ref:`lib_hw_id` library: - * Added support for the nRF54LM20A SoC. + * The ``CONFIG_HW_ID_LIBRARY_SOURCE_BLE_MAC`` Kconfig option has been renamed to :kconfig:option:`CONFIG_HW_ID_LIBRARY_SOURCE_BT_DEVICE_ADDRESS`. Shell libraries --------------- @@ -1111,16 +452,7 @@ See the changelog for each library in the :doc:`nrfxlib documentation `. + * - nRF54LV10A + - n/a + - ✔ + - `AP-Protect for nRF54LV10A`_ + - Also :ref:`supports Secure AP-Protect ` + * - nRF54LM20A + - n/a + - ✔ + - `AP-Protect for nRF54LM20A`_ + - Also :ref:`supports Secure AP-Protect ` * - nRF54L15 - n/a - ✔ diff --git a/doc/nrf/security/crypto/crypto_supported_features.rst b/doc/nrf/security/crypto/crypto_supported_features.rst index bc74544bc4ff..4ec2bfaa0cf2 100644 --- a/doc/nrf/security/crypto/crypto_supported_features.rst +++ b/doc/nrf/security/crypto/crypto_supported_features.rst @@ -737,8 +737,8 @@ The options are grouped by Series and drivers available for the device Series, a - nRF54L05 - nRF54L10 - nRF54L15 - - nRF54LM20 - - nRF54LV10 + - nRF54LM20A + - nRF54LV10A * - AES - :kconfig:option:`CONFIG_PSA_WANT_KEY_TYPE_AES` - Supported @@ -989,8 +989,8 @@ The options are grouped by Series and drivers available for the device Series, a - nRF54L05 - nRF54L10 - nRF54L15 - - nRF54LM20 - - nRF54LV10 + - nRF54LM20A + - nRF54LV10A * - AES - :kconfig:option:`CONFIG_PSA_WANT_KEY_TYPE_AES` - Supported @@ -2174,8 +2174,8 @@ The options are grouped by Series and drivers available for the device Series, a - nRF54L05 - nRF54L10 - nRF54L15 - - nRF54LM20 - - nRF54LV10 + - nRF54LM20A + - nRF54LV10A * - ECB no padding - :kconfig:option:`CONFIG_PSA_WANT_ALG_ECB_NO_PADDING` - Supported @@ -2188,14 +2188,14 @@ The options are grouped by Series and drivers available for the device Series, a - Supported - Supported - Supported - - Experimental (with exceptions, see note) + - Experimental - Experimental * - CBC PKCS#7 padding - :kconfig:option:`CONFIG_PSA_WANT_ALG_CBC_PKCS7` - Supported - Supported - Supported - - Experimental (with exceptions, see note) + - Experimental - Experimental * - CTR - :kconfig:option:`CONFIG_PSA_WANT_ALG_CTR` @@ -2221,15 +2221,11 @@ The options are grouped by Series and drivers available for the device Series, a .. note:: - The following limitations apply for nRF54LM20 when using the CRACEN driver: + The following limitations apply for nRF54LM20A and nRF54LV10A when using the CRACEN driver: * 192-bit keys are not supported. See also :ref:`ug_crypto_supported_features_aes_key_sizes`. - * For CBC no padding and CBC PKCS#7 padding cipher modes: - - * Multi-part encrypt and decrypt APIs are not supported. - .. tab:: nrf_oberon .. list-table:: Cipher mode support per device (nrf_oberon driver) - nRF54L Series @@ -2241,8 +2237,8 @@ The options are grouped by Series and drivers available for the device Series, a - nRF54L05 - nRF54L10 - nRF54L15 - - nRF54LM20 - - nRF54LV10 + - nRF54LM20A + - nRF54LV10A * - ECB no padding - :kconfig:option:`CONFIG_PSA_WANT_ALG_ECB_NO_PADDING` - Supported @@ -2670,8 +2666,8 @@ The options are grouped by Series and drivers available for the device Series, a - nRF54L05 - nRF54L10 - nRF54L15 - - nRF54LM20 - - nRF54LV10 + - nRF54LM20A + - nRF54LV10A * - ECDH - :kconfig:option:`CONFIG_PSA_WANT_ALG_ECDH` - Supported @@ -2691,8 +2687,8 @@ The options are grouped by Series and drivers available for the device Series, a - nRF54L05 - nRF54L10 - nRF54L15 - - nRF54LM20 - - nRF54LV10 + - nRF54LM20A + - nRF54LV10A * - ECDH - :kconfig:option:`CONFIG_PSA_WANT_ALG_ECDH` - Supported @@ -2934,8 +2930,8 @@ The options are grouped by Series and drivers available for the device Series, a - nRF54L05 - nRF54L10 - nRF54L15 - - nRF54LM20 - - nRF54LV10 + - nRF54LM20A + - nRF54LV10A * - ML-KEM - :kconfig:option:`CONFIG_PSA_WANT_ALG_ML_KEM` - Experimental @@ -3240,8 +3236,8 @@ The options are grouped by Series and drivers available for the device Series, a - nRF54L05 - nRF54L10 - nRF54L15 - - nRF54LM20 - - nRF54LV10 + - nRF54LM20A + - nRF54LV10A * - HKDF - :kconfig:option:`CONFIG_PSA_WANT_ALG_HKDF` - Supported @@ -3324,8 +3320,8 @@ The options are grouped by Series and drivers available for the device Series, a - nRF54L05 - nRF54L10 - nRF54L15 - - nRF54LM20 - - nRF54LV10 + - nRF54LM20A + - nRF54LV10A * - HKDF - :kconfig:option:`CONFIG_PSA_WANT_ALG_HKDF` - Supported @@ -3762,15 +3758,15 @@ The options are grouped by Series and drivers available for the device Series, a - nRF54L05 - nRF54L10 - nRF54L15 - - nRF54LM20 - - nRF54LV10 + - nRF54LM20A + - nRF54LV10A * - CMAC - :kconfig:option:`CONFIG_PSA_WANT_ALG_CMAC` - Supported - Supported - Supported - Experimental (with exceptions, see note) - - Experimental + - Experimental (with exceptions, see note) * - HMAC - :kconfig:option:`CONFIG_PSA_WANT_ALG_HMAC` - Supported @@ -3781,7 +3777,7 @@ The options are grouped by Series and drivers available for the device Series, a .. note:: - The following limitations apply for nRF54LM20 when using the CRACEN driver: + The following limitations apply for nRF54LM20A and nRF54LV10A when using the CRACEN driver: * 192-bit keys are not supported. See also :ref:`ug_crypto_supported_features_aes_key_sizes`. @@ -3797,8 +3793,8 @@ The options are grouped by Series and drivers available for the device Series, a - nRF54L05 - nRF54L10 - nRF54L15 - - nRF54LM20 - - nRF54LV10 + - nRF54LM20A + - nRF54LV10A * - CMAC - :kconfig:option:`CONFIG_PSA_WANT_ALG_CMAC` - Supported @@ -3958,7 +3954,7 @@ Based on this setting, Oberon PSA Crypto selects the most appropriate driver for * - Kconfig option - Supported MAC algorithms * - :kconfig:option:`CONFIG_PSA_USE_CRACEN_MAC_DRIVER` - - | :kconfig:option:`CONFIG_PSA_WANT_ALG_CMAC` + - | :kconfig:option:`CONFIG_PSA_WANT_ALG_CMAC` (all AES key sizes except the 192-bit key size on nRF54LM20A and nRF54LV10A) | :kconfig:option:`CONFIG_PSA_WANT_ALG_HMAC` .. tab:: nrf_oberon @@ -4185,8 +4181,8 @@ The options are grouped by Series and drivers available for the device Series, a - nRF54L05 - nRF54L10 - nRF54L15 - - nRF54LM20 - - nRF54LV10 + - nRF54LM20A + - nRF54LV10A * - CCM - :kconfig:option:`CONFIG_PSA_WANT_ALG_CCM` - Supported @@ -4219,7 +4215,7 @@ The options are grouped by Series and drivers available for the device Series, a .. note:: * CRACEN only supports a 96-bit IV for AES GCM. - * The following limitations apply for nRF54LM20 when using the CRACEN driver: + * The following limitations apply for nRF54LM20A when using the CRACEN driver: * 192-bit keys are not supported. See also :ref:`ug_crypto_supported_features_aes_key_sizes`. @@ -4232,7 +4228,10 @@ The options are grouped by Series and drivers available for the device Series, a * Multi-part encrypt and decrypt APIs are not supported. - * The following limitations apply for nRF54LV10 when using the CRACEN driver: + * The following limitations apply for nRF54LV10A when using the CRACEN driver: + + * 192-bit keys are not supported. + See also :ref:`ug_crypto_supported_features_aes_key_sizes`. * CCM cipher mode: @@ -4249,8 +4248,8 @@ The options are grouped by Series and drivers available for the device Series, a - nRF54L05 - nRF54L10 - nRF54L15 - - nRF54LM20 - - nRF54LV10 + - nRF54LM20A + - nRF54LV10A * - CCM - :kconfig:option:`CONFIG_PSA_WANT_ALG_CCM` - Supported @@ -4450,7 +4449,7 @@ Based on this setting, Oberon PSA Crypto selects the most appropriate driver for - Supported AEAD algorithms * - :kconfig:option:`CONFIG_PSA_USE_CRACEN_AEAD_DRIVER` - | :kconfig:option:`CONFIG_PSA_WANT_ALG_CCM` - | :kconfig:option:`CONFIG_PSA_WANT_ALG_GCM` + | :kconfig:option:`CONFIG_PSA_WANT_ALG_GCM` (all AES key sizes except the 192-bit key size on nRF54LM20A and nRF54LV10A) | :kconfig:option:`CONFIG_PSA_WANT_ALG_CHACHA20_POLY1305` .. tab:: nrf_oberon @@ -4851,8 +4850,8 @@ The options are grouped by Series and drivers available for the device Series, a - nRF54L05 - nRF54L10 - nRF54L15 - - nRF54LM20 - - nRF54LV10 + - nRF54LM20A + - nRF54LV10A * - ECDSA - :kconfig:option:`CONFIG_PSA_WANT_ALG_ECDSA` - Supported @@ -4963,8 +4962,8 @@ The options are grouped by Series and drivers available for the device Series, a - nRF54L05 - nRF54L10 - nRF54L15 - - nRF54LM20 - - nRF54LV10 + - nRF54LM20A + - nRF54LV10A * - ECDSA - :kconfig:option:`CONFIG_PSA_WANT_ALG_ECDSA` - Supported @@ -5593,8 +5592,8 @@ The options are grouped by Series and drivers available for the device Series, a - nRF54L05 - nRF54L10 - nRF54L15 - - nRF54LM20 - - nRF54LV10 + - nRF54LM20A + - nRF54LV10A * - RSA OAEP - :kconfig:option:`CONFIG_PSA_WANT_ALG_RSA_OAEP` - Supported @@ -5621,8 +5620,8 @@ The options are grouped by Series and drivers available for the device Series, a - nRF54L05 - nRF54L10 - nRF54L15 - - nRF54LM20 - - nRF54LV10 + - nRF54LM20A + - nRF54LV10A * - RSA OAEP - :kconfig:option:`CONFIG_PSA_WANT_ALG_RSA_OAEP` - Supported @@ -6193,8 +6192,8 @@ The options are grouped by Series and drivers available for the device Series, a - nRF54L05 - nRF54L10 - nRF54L15 - - nRF54LM20 - - nRF54LV10 + - nRF54LM20A + - nRF54LV10A * - BrainpoolP224r1 - :kconfig:option:`CONFIG_PSA_WANT_ECC_BRAINPOOL_P_R1_224` - Supported @@ -6246,11 +6245,11 @@ The options are grouped by Series and drivers available for the device Series, a - Experimental * - Edwards448 (Ed448) - :kconfig:option:`CONFIG_PSA_WANT_ECC_TWISTED_EDWARDS_448` - - -- - - -- - - -- - - -- - - -- + - Supported + - Supported + - Supported + - Experimental + - Experimental * - secp192k1 - :kconfig:option:`CONFIG_PSA_WANT_ECC_SECP_K1_192` - Supported @@ -6312,8 +6311,8 @@ The options are grouped by Series and drivers available for the device Series, a - nRF54L05 - nRF54L10 - nRF54L15 - - nRF54LM20 - - nRF54LV10 + - nRF54LM20A + - nRF54LV10A * - BrainpoolP224r1 - :kconfig:option:`CONFIG_PSA_WANT_ECC_BRAINPOOL_P_R1_224` - -- @@ -6744,6 +6743,7 @@ Based on this setting, Oberon PSA Crypto selects the most appropriate driver for | :kconfig:option:`CONFIG_PSA_WANT_ECC_BRAINPOOL_P_R1_512` | :kconfig:option:`CONFIG_PSA_WANT_ECC_MONTGOMERY_255` | :kconfig:option:`CONFIG_PSA_WANT_ECC_TWISTED_EDWARDS_255` + | :kconfig:option:`CONFIG_PSA_WANT_ECC_TWISTED_EDWARDS_448` | :kconfig:option:`CONFIG_PSA_WANT_ECC_SECP_K1_192` | :kconfig:option:`CONFIG_PSA_WANT_ECC_SECP_K1_256` | :kconfig:option:`CONFIG_PSA_WANT_ECC_SECP_R1_192` @@ -6984,8 +6984,8 @@ The options are grouped by Series and drivers available for the device Series, a - nRF54L05 - nRF54L10 - nRF54L15 - - nRF54LM20 - - nRF54LV10 + - nRF54LM20A + - nRF54LV10A * - RNG support - :kconfig:option:`CONFIG_PSA_WANT_GENERATE_RANDOM` - Supported @@ -7019,8 +7019,8 @@ The options are grouped by Series and drivers available for the device Series, a - nRF54L05 - nRF54L10 - nRF54L15 - - nRF54LM20 - - nRF54LV10 + - nRF54LM20A + - nRF54LV10A * - RNG support - :kconfig:option:`CONFIG_PSA_WANT_GENERATE_RANDOM` - Supported @@ -7593,8 +7593,8 @@ The options are grouped by Series and drivers available for the device Series, a - nRF54L05 - nRF54L10 - nRF54L15 - - nRF54LM20 - - nRF54LV10 + - nRF54LM20A + - nRF54LV10A * - SHA-1 (weak) - :kconfig:option:`CONFIG_PSA_WANT_ALG_SHA_1` - Supported @@ -7688,11 +7688,11 @@ The options are grouped by Series and drivers available for the device Series, a - Experimental * - SHAKE256 512 bits - :kconfig:option:`CONFIG_PSA_WANT_ALG_SHAKE256_512` - - -- - - -- - - -- - - -- - - -- + - Supported + - Supported + - Supported + - Experimental + - Experimental .. tab:: nrf_oberon @@ -7705,8 +7705,8 @@ The options are grouped by Series and drivers available for the device Series, a - nRF54L05 - nRF54L10 - nRF54L15 - - nRF54LM20 - - nRF54LV10 + - nRF54LM20A + - nRF54LV10A * - SHA-1 (weak) - :kconfig:option:`CONFIG_PSA_WANT_ALG_SHA_1` - Supported @@ -8116,6 +8116,7 @@ Based on this setting, Oberon PSA Crypto selects the most appropriate driver for | :kconfig:option:`CONFIG_PSA_WANT_ALG_SHA3_256` | :kconfig:option:`CONFIG_PSA_WANT_ALG_SHA3_384` | :kconfig:option:`CONFIG_PSA_WANT_ALG_SHA3_512` + | :kconfig:option:`CONFIG_PSA_WANT_ALG_SHAKE256_512` .. tab:: nrf_oberon @@ -8327,8 +8328,8 @@ The options are grouped by Series and drivers available for the device Series, a - nRF54L05 - nRF54L10 - nRF54L15 - - nRF54LM20 - - nRF54LV10 + - nRF54LM20A + - nRF54LV10A * - EC J-PAKE - :kconfig:option:`CONFIG_PSA_WANT_ALG_JPAKE` - Supported @@ -8383,8 +8384,8 @@ The options are grouped by Series and drivers available for the device Series, a - nRF54L05 - nRF54L10 - nRF54L15 - - nRF54LM20 - - nRF54LV10 + - nRF54LM20A + - nRF54LV10A * - EC J-PAKE - :kconfig:option:`CONFIG_PSA_WANT_ALG_JPAKE` - Supported @@ -8740,8 +8741,8 @@ The options are grouped by Series and drivers available for the device Series, a - nRF54L05 - nRF54L10 - nRF54L15 - - nRF54LM20 - - nRF54LV10 + - nRF54LM20A + - nRF54LV10A * - Import - :kconfig:option:`CONFIG_PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_IMPORT` - Supported @@ -8782,8 +8783,8 @@ The options are grouped by Series and drivers available for the device Series, a - nRF54L05 - nRF54L10 - nRF54L15 - - nRF54LM20 - - nRF54LV10 + - nRF54LM20A + - nRF54LV10A * - Import - :kconfig:option:`CONFIG_PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_IMPORT` - Supported @@ -8986,8 +8987,8 @@ The options are grouped by Series and drivers available for the device Series, a - nRF54L05 - nRF54L10 - nRF54L15 - - nRF54LM20 - - nRF54LV10 + - nRF54LM20A + - nRF54LV10A * - Import - :kconfig:option:`CONFIG_PSA_WANT_KEY_TYPE_SRP_KEY_PAIR_IMPORT` - Supported @@ -9028,8 +9029,8 @@ The options are grouped by Series and drivers available for the device Series, a - nRF54L05 - nRF54L10 - nRF54L15 - - nRF54LM20 - - nRF54LV10 + - nRF54LM20A + - nRF54LV10A * - Import - :kconfig:option:`CONFIG_PSA_WANT_KEY_TYPE_SRP_KEY_PAIR_IMPORT` - Supported @@ -9230,8 +9231,8 @@ The options are grouped by Series and drivers available for the device Series, a - nRF54L05 - nRF54L10 - nRF54L15 - - nRF54LM20 - - nRF54LV10 + - nRF54LM20A + - nRF54LV10A * - Import - :kconfig:option:`CONFIG_PSA_WANT_KEY_TYPE_SPAKE2P_KEY_PAIR_IMPORT` - Supported @@ -9272,8 +9273,8 @@ The options are grouped by Series and drivers available for the device Series, a - nRF54L05 - nRF54L10 - nRF54L15 - - nRF54LM20 - - nRF54LV10 + - nRF54LM20A + - nRF54LV10A * - Import - :kconfig:option:`CONFIG_PSA_WANT_KEY_TYPE_SPAKE2P_KEY_PAIR_IMPORT` - Supported @@ -9518,8 +9519,8 @@ The options are grouped by Series and drivers available for the device Series, a - nRF54L05 - nRF54L10 - nRF54L15 - - nRF54LM20 - - nRF54LV10 + - nRF54LM20A + - nRF54LV10A * - Generate - :kconfig:option:`CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE` - Supported @@ -9560,8 +9561,8 @@ The options are grouped by Series and drivers available for the device Series, a - nRF54L05 - nRF54L10 - nRF54L15 - - nRF54LM20 - - nRF54LV10 + - nRF54LM20A + - nRF54LV10A * - Generate - :kconfig:option:`CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE` - Supported @@ -9837,8 +9838,8 @@ The options are grouped by Series and drivers available for the device Series, a - nRF54L05 - nRF54L10 - nRF54L15 - - nRF54LM20 - - nRF54LV10 + - nRF54LM20A + - nRF54LV10A * - 128 bits - :kconfig:option:`CONFIG_PSA_WANT_AES_KEY_SIZE_128` - Supported @@ -9872,8 +9873,8 @@ The options are grouped by Series and drivers available for the device Series, a - nRF54L05 - nRF54L10 - nRF54L15 - - nRF54LM20 - - nRF54LV10 + - nRF54LM20A + - nRF54LV10A * - 128 bits - :kconfig:option:`CONFIG_PSA_WANT_AES_KEY_SIZE_128` - Supported @@ -10145,8 +10146,8 @@ The options are grouped by Series and drivers available for the device Series, a - nRF54L05 - nRF54L10 - nRF54L15 - - nRF54LM20 - - nRF54LV10 + - nRF54LM20A + - nRF54LV10A * - 1024 bits - :kconfig:option:`CONFIG_PSA_WANT_RSA_KEY_SIZE_1024` - -- @@ -10208,8 +10209,8 @@ The options are grouped by Series and drivers available for the device Series, a - nRF54L05 - nRF54L10 - nRF54L15 - - nRF54LM20 - - nRF54LV10 + - nRF54LM20A + - nRF54LV10A * - 1024 bits - :kconfig:option:`CONFIG_PSA_WANT_RSA_KEY_SIZE_1024` - Supported diff --git a/doc/nrf/security/psa_certified_api_overview.rst b/doc/nrf/security/psa_certified_api_overview.rst index 77fa5571c2c9..18a0f5ecad2c 100644 --- a/doc/nrf/security/psa_certified_api_overview.rst +++ b/doc/nrf/security/psa_certified_api_overview.rst @@ -62,8 +62,7 @@ The following table provides an overview of the PSA Certified APIs support statu * - `PSA Certified Crypto API`_ - Supported - | `PSA Certified Crypto API 1.3.1`_ for IronSide Secure Element firmware for nRF54H20 - | `PSA Certified Crypto API 1.3.1`_ for :ref:`nRF54L cryptography ` and PSA Crypto API builds without TF-M - | `PSA Certified Crypto API 1.0.0`_ for builds with TF-M + | `PSA Certified Crypto API 1.3.1`_ for :ref:`nRF54L cryptography ` and PSA Crypto API builds with and without TF-M * - `PSA Certified Attestation API`_ - Supported - `PSA Certified Attestation API 1.0`_ (not supported for IronSide Secure Element firmware for nRF54H20) @@ -116,7 +115,7 @@ The PSA Crypto API has the following implementations in the |NCS|: * :ref:`TF-M Crypto Service `- which provides PSA Crypto API access through TF-M for applications that require enhanced security. * :ref:`IronSide Secure Element ` - which provides PSA Crypto API interface for the :ref:`Secure Domain of nRF54H20 `. -Depending on the implementation you are using, the |NCS| build system uses different versions of the PSA Crypto API. +Depending on the implementation you are using, the |NCS| build system can use different versions of the PSA Crypto API. .. psa_crypto_support_tfm_build_start @@ -129,7 +128,7 @@ Depending on the implementation you are using, the |NCS| build system uses diffe * - :ref:`Oberon PSA Crypto ` - `v1.3.1 `_ * - :ref:`TF-M Crypto Service ` - - `v1.0.0 `_ + - `v1.3.1 `_ * - :ref:`IronSide Secure Element ` - `v1.3.1 `_ diff --git a/doc/nrf/security/tfm/tfm_services.rst b/doc/nrf/security/tfm/tfm_services.rst index 8582247929ec..f3fbeb8c414a 100644 --- a/doc/nrf/security/tfm/tfm_services.rst +++ b/doc/nrf/security/tfm/tfm_services.rst @@ -36,6 +36,31 @@ See :ref:`lib_tfm_ioctl_api` for more information about APIs available for the n For more information about the general features of the TF-M Platform partition, see `TF-M Platform`_. +.. _ug_tfm_services_system_reset: + +System Reset service +-------------------- + +The System Reset service is one of the default TF-M platform services that has a specific implementation for the |NCS|. +It allows to perform a system reset through the TF-M platform service using the :c:func:`tfm_hal_system_reset` function. + +This service is enabled when you enable the :kconfig:option:`CONFIG_TFM_PARTITION_PLATFORM` Kconfig option. + +.. _ug_tfm_services_system_off: + +System OFF service +------------------ + +The System OFF service is one of the TF-M platform services specific to the |NCS|. +It allows the non-secure application to request the system to enter the System OFF mode using a secure service call. + +The System OFF mode is part of the power and clock management system and is available on selected Nordic Semiconductor devices, including the nRF54L Series. +For more details about the System OFF mode, see the device datasheet, for example the `nRF54L15 Power and clock management`_ page. + +To enable the System OFF service in the |NCS|, enable the :kconfig:option:`CONFIG_TFM_NRF_SYSTEM_OFF_SERVICE` Kconfig option. + +Zephyr's :zephyr:code-sample:`nrf_system_off` sample demonstrates how to use the System OFF service. + .. _ug_tfm_services_its: Internal Trusted Storage service diff --git a/doc/nrf/shortcuts.txt b/doc/nrf/shortcuts.txt index f292268647ab..9e21e5faf6da 100644 --- a/doc/nrf/shortcuts.txt +++ b/doc/nrf/shortcuts.txt @@ -10,6 +10,7 @@ .. |54H_nrfutil_device_ver| replace:: 2.15.2 .. |54H_nrfutil_trace_ver| replace:: 4.4.0 +.. |ironside_se_ver| replace:: v23.1.1+20 .. ### Config shortcuts diff --git a/drivers/mspi/CMakeLists.txt b/drivers/mspi/CMakeLists.txt index 67d109ad46f1..5f3f6bf7e185 100644 --- a/drivers/mspi/CMakeLists.txt +++ b/drivers/mspi/CMakeLists.txt @@ -8,8 +8,8 @@ zephyr_library_amend() zephyr_library_sources_ifdef(CONFIG_MSPI_HPF mspi_hpf.c) if(CONFIG_MSPI_NRF_SQSPI) - set(SP_DIR ${ZEPHYR_NRFXLIB_MODULE_DIR}/softperipheral) - set(SQSPI_DIR ${SP_DIR}/sQSPI) + set(sp_dir ${ZEPHYR_NRFXLIB_MODULE_DIR}/softperipheral) + set(sqspi_dir ${sp_dir}/sQSPI) dt_comp_path(sqspi_path COMPATIBLE "nordic,nrf-sqspi" IDX 0) dt_reg_addr(sqspi_addr PATH ${sqspi_path}) @@ -21,12 +21,12 @@ if(CONFIG_MSPI_NRF_SQSPI) NRF_SQSPI_SP_FIRMWARE_ADDR=${sqspi_sp_firmware_addr} ) zephyr_library_include_directories( - ${SP_DIR}/include - ${SQSPI_DIR}/include - ${SQSPI_DIR}/include/${CONFIG_SOC} + ${sp_dir}/include + ${sqspi_dir}/include + ${sqspi_dir}/include/${CONFIG_SOC_SERIES} ) zephyr_library_sources( - ${SQSPI_DIR}/src/nrf_sqspi.c + ${sqspi_dir}/src/nrf_sqspi.c mspi_sqspi.c ) endif() diff --git a/dts/common/nordic/nrf54ls05b.dtsi b/dts/common/nordic/nrf54ls05b.dtsi index 0491e052ed86..c5d01f57ad50 100644 --- a/dts/common/nordic/nrf54ls05b.dtsi +++ b/dts/common/nordic/nrf54ls05b.dtsi @@ -403,6 +403,11 @@ status = "disabled"; }; + tampc: tampc@e7000 { + compatible = "nordic,nrf-tampc"; + reg = <0xe7000 0x1000>; + status = "disabled"; + }; dppic30: dppic@102000 { compatible = "nordic,nrf-dppic"; diff --git a/dts/common/nordic/nrf7120_enga.dtsi b/dts/common/nordic/nrf7120_enga.dtsi index 55ba72123a19..918d1e2fd6db 100644 --- a/dts/common/nordic/nrf7120_enga.dtsi +++ b/dts/common/nordic/nrf7120_enga.dtsi @@ -643,7 +643,7 @@ gpio-controller; #gpio-cells = <2>; port = <1>; - ngpios = <20>; + ngpios = <16>; gpiote-instance = <&gpiote20>; status = "disabled"; }; @@ -654,7 +654,7 @@ gpio-controller; #gpio-cells = <2>; port = <3>; - ngpios = <13>; + ngpios = <12>; gpiote-instance = <&gpiote20>; status = "disabled"; }; @@ -842,7 +842,7 @@ gpio-controller; #gpio-cells = <2>; port = <0>; - ngpios = <10>; + ngpios = <13>; gpiote-instance = <&gpiote30>; status = "disabled"; }; diff --git a/include/hw_id.h b/include/hw_id.h index dc1fc10de33d..41c2a39bf873 100644 --- a/include/hw_id.h +++ b/include/hw_id.h @@ -19,7 +19,7 @@ extern "C" { #endif -#if defined(CONFIG_HW_ID_LIBRARY_SOURCE_BLE_MAC) +#if defined(CONFIG_HW_ID_LIBRARY_SOURCE_BT_DEVICE_ADDRESS) #define HW_ID_LEN (12 + 1) #elif defined(CONFIG_HW_ID_LIBRARY_SOURCE_DEVICE_ID) #define HW_ID_LEN (16 + 1) diff --git a/include/modem/lte_lc.h b/include/modem/lte_lc.h index 8a2261d5d082..70a008becdfa 100644 --- a/include/modem/lte_lc.h +++ b/include/modem/lte_lc.h @@ -455,8 +455,8 @@ enum lte_lc_evt_type { * @ref lte_lc_rai_cfg in the event. * * @note This is only supported by the following modem firmware: - * - mfw_nrf91x1 >= v2.0.2 - * - mfw_nrf9151-ntn + * - mfw_nrf91x1 >= v2.0.2 + * - mfw_nrf9151-ntn */ LTE_LC_EVT_RAI_UPDATE = 12, #endif /* CONFIG_LTE_LC_RAI_MODULE */ @@ -1481,6 +1481,36 @@ enum lte_lc_pdn_evt_type { */ LTE_LC_EVT_PDN_IPV6_DOWN, + /** + * PDN is suspended. + * + * PDNs can be suspended when cellular profiles are used. While suspended, the PDNs remain + * active, but can not be used for data transmission. PDNs associated with a cellular + * profile are suspended when the device is switched to flight mode using + * @ref LTE_LC_FUNC_MODE_OFFLINE_KEEP_REG or @ref LTE_LC_FUNC_MODE_OFFLINE_KEEP_REG_UICC_ON. + * The PDNs remain suspended when switching to a different access technology. When the + * device is switched back to the original access technology and LTE is activated, the + * associated PDNs are resumed. + * + * The associated payload is the @c lte_lc_evt.pdn member of type + * @ref lte_lc_pdn_evt in the event. + * + * @note This is only supported by the following modem firmware: + * - mfw_nrf9151-ntn + */ + LTE_LC_EVT_PDN_SUSPENDED, + + /** + * PDN is resumed. + * + * The associated payload is the @c lte_lc_evt.pdn member of type + * @ref lte_lc_pdn_evt in the event. + * + * @note This is only supported by the following modem firmware: + * - mfw_nrf9151-ntn + */ + LTE_LC_EVT_PDN_RESUMED, + /** * Network detached. * diff --git a/lib/hw_id/Kconfig b/lib/hw_id/Kconfig index 9763c0808aa5..b2e9b50225ea 100644 --- a/lib/hw_id/Kconfig +++ b/lib/hw_id/Kconfig @@ -26,8 +26,8 @@ config HW_ID_LIBRARY_SOURCE_UUID help This option requires modem firmware v1.3.0 or higher. -config HW_ID_LIBRARY_SOURCE_BLE_MAC - bool "BLE MAC address" +config HW_ID_LIBRARY_SOURCE_BT_DEVICE_ADDRESS + bool "Bluetooth Device Address" depends on BT config HW_ID_LIBRARY_SOURCE_NET_MAC diff --git a/lib/hw_id/hw_id.c b/lib/hw_id/hw_id.c index 3fe615d87345..878679296d8e 100644 --- a/lib/hw_id/hw_id.c +++ b/lib/hw_id/hw_id.c @@ -8,9 +8,9 @@ #include /* includes for the different HW ID sources */ -#if defined(CONFIG_HW_ID_LIBRARY_SOURCE_BLE_MAC) +#if defined(CONFIG_HW_ID_LIBRARY_SOURCE_BT_DEVICE_ADDRESS) #include -#endif /* defined(CONFIG_HW_ID_LIBRARY_SOURCE_BLE_MAC) */ +#endif /* defined(CONFIG_HW_ID_LIBRARY_SOURCE_BT_DEVICE_ADDRESS) */ #if defined(CONFIG_HW_ID_LIBRARY_SOURCE_DEVICE_ID) #include #endif /* defined(CONFIG_HW_ID_LIBRARY_SOURCE_DEVICE_ID) */ @@ -26,8 +26,8 @@ #define IMEI_LEN 15 -#if defined(CONFIG_HW_ID_LIBRARY_SOURCE_BLE_MAC) -/* Ask BLE stack for default MAC address */ +#if defined(CONFIG_HW_ID_LIBRARY_SOURCE_BT_DEVICE_ADDRESS) +/* Ask Bluetooth stack for default MAC address */ int hw_id_get(char *buf, size_t buf_len) { @@ -53,7 +53,7 @@ int hw_id_get(char *buf, size_t buf_len) addr.a.val[0]); return 0; } -#endif /* defined(CONFIG_HW_ID_LIBRARY_SOURCE_BLE_MAC) */ +#endif /* defined(CONFIG_HW_ID_LIBRARY_SOURCE_BT_DEVICE_ADDRESS) */ #if defined(CONFIG_HW_ID_LIBRARY_SOURCE_DEVICE_ID) /* Directly read Device ID from registers */ diff --git a/lib/lte_link_control/modules/pdn.c b/lib/lte_link_control/modules/pdn.c index 03a5fe49f011..bde25b6eefee 100644 --- a/lib/lte_link_control/modules/pdn.c +++ b/lib/lte_link_control/modules/pdn.c @@ -196,6 +196,10 @@ static void parse_cgev(const char *notif) {"ME PDN DEACT ", LTE_LC_EVT_PDN_DEACTIVATED}, /* +CGEV: NW PDN DEACT */ {"NW PDN DEACT ", LTE_LC_EVT_PDN_DEACTIVATED}, + /* +CGEV: ME PDN SUSPENDED */ + {"ME PDN SUSPENDED ", LTE_LC_EVT_PDN_SUSPENDED}, + /* +CGEV: ME PDN RESUMED */ + {"ME PDN RESUMED ", LTE_LC_EVT_PDN_RESUMED}, /* +CGEV: ME DETACH [] */ {"ME DETACH", LTE_LC_EVT_PDN_NETWORK_DETACH}, /* +CGEV: NW DETACH [] */ @@ -244,6 +248,8 @@ static void parse_cgev(const char *notif) case LTE_LC_EVT_PDN_DEACTIVATED: case LTE_LC_EVT_PDN_IPV6_UP: case LTE_LC_EVT_PDN_IPV6_DOWN: + case LTE_LC_EVT_PDN_SUSPENDED: + case LTE_LC_EVT_PDN_RESUMED: evt.pdn.cid = (int8_t)strtoul(p, &p, 10); break; diff --git a/lib/ntn/ntn.c b/lib/ntn/ntn.c index 58e0ab6d79b5..b3564fd4dbcb 100644 --- a/lib/ntn/ntn.c +++ b/lib/ntn/ntn.c @@ -194,13 +194,11 @@ static void at_handler_location(const char *notif) static void location_ntf_subscribe(void) { - int err; - - err = nrf_modem_at_printf("AT%%LOCATION=1"); - if (err) { - LOG_WRN("Enabling location notifications failed, error: %d", err); - LOG_WRN("Modem firmware with NTN support required"); - } + /* Error is ignored because this basically only fails when the firmware does not have + * NTN support. There are applications which support both NTN and non-NTN modem + * firmware, so we don't want to log an error here with non-NTN firmware. + */ + (void)nrf_modem_at_printf("AT%%LOCATION=1"); } #if defined(CONFIG_UNITY) diff --git a/modules/trusted-firmware-m/Kconfig b/modules/trusted-firmware-m/Kconfig index 78bdd98287d9..cd0b52be06d3 100644 --- a/modules/trusted-firmware-m/Kconfig +++ b/modules/trusted-firmware-m/Kconfig @@ -539,17 +539,17 @@ config TFM_PSA_FRAMEWORK_HAS_MM_IOVEC the Secure Partition. config TFM_NRF_SYSTEM_OFF_SERVICE - bool "TF-M NRF System Off Service [EXPERIMENTAL]" + bool "TF-M System OFF service [EXPERIMENTAL]" depends on TFM_ISOLATION_LEVEL = 1 depends on TFM_SFN depends on SOC_SERIES_NRF54LX depends on !RETAINED_MEM_NRF_RAM_CTRL select EXPERIMENTAL help - Provide a system off service for the nRF54L series SoCs. + Provide a System OFF service for the nRF54L Series SoCs. This service allows the non-secure application to request - the system to enter system off mode via a secure service call. - This service will disable RAM retention for all RAM blocks - before entering system off mode. + the system to enter the System OFF mode using a secure service call. + This service disables RAM retention for all RAM blocks + before entering the System OFF mode. endif # BUILD_WITH_TFM diff --git a/modules/wfa-qt/src/indigo_api_callback_dut.c b/modules/wfa-qt/src/indigo_api_callback_dut.c index e297e7acc55d..e27a4080f723 100644 --- a/modules/wfa-qt/src/indigo_api_callback_dut.c +++ b/modules/wfa-qt/src/indigo_api_callback_dut.c @@ -1883,7 +1883,7 @@ static int configure_sta_handler(struct packet_wrapper *req, struct packet_wrapp ret = run_qt_command(buffer); CHECK_RET(); } else { - ret = run_qt_command("SET_NETWORK 0 ieee80211w 0"); + ret = run_qt_command("SET_NETWORK 0 ieee80211w 1"); CHECK_RET(); } } else if (strstr(tlv->value, "SAE")) { @@ -2002,6 +2002,9 @@ static int configure_sta_handler(struct packet_wrapper *req, struct packet_wrapp ret = run_qt_command(buffer); CHECK_RET(); } + + ret = run_qt_command("SET_NETWORK 0 scan_ssid 1"); + CHECK_RET(); done: fill_wrapper_message_hdr(resp, API_CMD_RESPONSE, req->hdr.seq); fill_wrapper_tlv_byte(resp, TLV_STATUS, status); diff --git a/samples/benchmarks/coremark/README.rst b/samples/benchmarks/coremark/README.rst index a6b6ccedee28..82525ef168c6 100644 --- a/samples/benchmarks/coremark/README.rst +++ b/samples/benchmarks/coremark/README.rst @@ -17,11 +17,6 @@ The sample supports the following development kits: .. table-from-sample-yaml:: -.. note:: - This sample does not build or run for the ``nrf54h20dk/nrf54h20/cpuapp`` board target due to the IronSide SE migration. - See the ``NCSDK-34698`` in the :ref:`known_issues` page for more information. - The codebase and documentation will be updated in the future releases to address this issue. - Overview ******** diff --git a/samples/bluetooth/conn_time_sync/src/controller_time_nrf52.c b/samples/bluetooth/conn_time_sync/src/controller_time_nrf52.c index 31fcac3e3bca..d1a6f386ce82 100644 --- a/samples/bluetooth/conn_time_sync/src/controller_time_nrf52.c +++ b/samples/bluetooth/conn_time_sync/src/controller_time_nrf52.c @@ -121,8 +121,8 @@ static int timer_config(void) uint32_t tep; ret = nrfx_timer_init(&app_timer_instance, &timer_cfg, unused_timer_isr_handler); - if (ret != NRFX_SUCCESS) { - printk("Failed initializing timer (ret: %d)\n", ret - NRFX_ERROR_BASE_NUM); + if (ret != 0) { + printk("Failed initializing timer (ret: %d)\n", ret); return -ENODEV; } @@ -182,7 +182,7 @@ int config_egu_trigger_on_rtc_and_timer_match(void) printk("Failed allocating for RTC match\n"); return ret; } - (void)nrfx_gppi_ep_attach(ppi_on_timer_match, nrfx_gppi_group_task_dis_addr(group)); + (void)nrfx_gppi_ep_attach(nrfx_gppi_group_task_dis_addr(group), ppi_on_timer_match); return 0; } diff --git a/samples/bluetooth/conn_time_sync/src/controller_time_nrf53_app.c b/samples/bluetooth/conn_time_sync/src/controller_time_nrf53_app.c index dabaef53e13b..e5ef4d7b63a9 100644 --- a/samples/bluetooth/conn_time_sync/src/controller_time_nrf53_app.c +++ b/samples/bluetooth/conn_time_sync/src/controller_time_nrf53_app.c @@ -95,8 +95,8 @@ static int timer_config(void) uint32_t tep = nrfx_timer_task_address_get(&app_timer_instance, NRF_TIMER_TASK_CLEAR); ret = nrfx_timer_init(&app_timer_instance, &timer_cfg, unused_timer_isr_handler); - if (ret != NRFX_SUCCESS) { - printk("Failed initializing timer (ret: %d)\n", ret - NRFX_ERROR_BASE_NUM); + if (ret != 0) { + printk("Failed initializing timer (ret: %d)\n", ret); return -ENODEV; } @@ -153,7 +153,7 @@ int config_egu_trigger_on_rtc_and_timer_match(void) printk("Failed allocating for RTC match\n"); return ret; } - (void)nrfx_gppi_ep_attach(ppi_on_timer_match, nrfx_gppi_group_task_dis_addr(group)); + (void)nrfx_gppi_ep_attach(nrfx_gppi_group_task_dis_addr(group), ppi_on_timer_match); return 0; } diff --git a/samples/bluetooth/conn_time_sync/src/controller_time_nrf54.c b/samples/bluetooth/conn_time_sync/src/controller_time_nrf54.c index 6bf550e92ac4..82becae620d1 100644 --- a/samples/bluetooth/conn_time_sync/src/controller_time_nrf54.c +++ b/samples/bluetooth/conn_time_sync/src/controller_time_nrf54.c @@ -42,8 +42,8 @@ void controller_time_trigger_set(uint64_t timestamp_us) }; ret = nrfx_grtc_syscounter_cc_absolute_set(&chan_data, timestamp_us, false); - if (ret != NRFX_SUCCESS) { - printk("Failed setting CC (ret: %d)\n", ret - NRFX_ERROR_BASE_NUM); + if (ret != 0) { + printk("Failed setting CC (ret: %d)\n", ret); } } diff --git a/samples/bluetooth/direct_test_mode/README.rst b/samples/bluetooth/direct_test_mode/README.rst index 846cf58b9cdc..79cfef3fd47a 100644 --- a/samples/bluetooth/direct_test_mode/README.rst +++ b/samples/bluetooth/direct_test_mode/README.rst @@ -188,7 +188,7 @@ Antenna matrix configuration To use this sample to test the Bluetooth Direction Finding feature, additional configuration of GPIOs is required to control the antenna array. An example of such configuration is provided in a devicetree overlay file :file:`nrf5340dk_nrf5340_cpunet.overlay`. -The overlay file provides the information about of the GPIOs to be used by the Radio peripheral to switch between antenna patches during the Constant Tone Extension (CTE) reception or transmission. +The overlay file provides the information of the GPIOs to be used by the Radio peripheral to switch between antenna patches during the Constant Tone Extension (CTE) reception or transmission. At least one GPIO must be provided to enable antenna switching. The GPIOs are used by the radio peripheral in the order provided by the ``dfegpio#-gpios`` properties. diff --git a/samples/bluetooth/direct_test_mode/src/dtm.c b/samples/bluetooth/direct_test_mode/src/dtm.c index bef31f1b8ba4..9219984b1dc7 100644 --- a/samples/bluetooth/direct_test_mode/src/dtm.c +++ b/samples/bluetooth/direct_test_mode/src/dtm.c @@ -795,7 +795,7 @@ BUILD_ASSERT(false, "No Clock Control driver"); static int timer_init(void) { - nrfx_err_t err; + int err; nrfx_timer_config_t timer_cfg = { .frequency = NRFX_MHZ_TO_HZ(1), .mode = NRF_TIMER_MODE_TIMER, @@ -803,7 +803,7 @@ static int timer_init(void) }; err = nrfx_timer_init(&dtm_inst.timer, &timer_cfg, dtm_timer_handler); - if (err != NRFX_SUCCESS) { + if (err != 0) { printk("nrfx_timer_init failed with: %d\n", err); return -EAGAIN; } @@ -817,7 +817,7 @@ static int timer_init(void) #if NRF52_ERRATA_172_PRESENT static int anomaly_timer_init(void) { - nrfx_err_t err; + int err; nrfx_timer_config_t timer_cfg = { .frequency = NRFX_KHZ_TO_HZ(125), .mode = NRF_TIMER_MODE_TIMER, @@ -826,7 +826,7 @@ static int anomaly_timer_init(void) err = nrfx_timer_init(&dtm_inst.anomaly_timer, &timer_cfg, anomaly_timer_handler); - if (err != NRFX_SUCCESS) { + if (err != 0) { printk("nrfx_timer_init failed with: %d\n", err); return -EAGAIN; } @@ -1647,16 +1647,16 @@ static void radio_ppi_clear(void) static void radio_ppi_configure(bool rx, uint32_t timer_short_mask) { - nrfx_gppi_ep_attach(dtm_inst.ppi_radio_start, - nrf_egu_event_address_get(DTM_EGU, DTM_EGU_EVENT)); - nrfx_gppi_ep_attach(dtm_inst.ppi_radio_start, - nrf_radio_task_address_get(NRF_RADIO, - rx ? NRF_RADIO_TASK_RXEN : NRF_RADIO_TASK_TXEN)); + nrfx_gppi_ep_attach(nrf_egu_event_address_get(DTM_EGU, DTM_EGU_EVENT), + dtm_inst.ppi_radio_start); + nrfx_gppi_ep_attach(nrf_radio_task_address_get(NRF_RADIO, + rx ? NRF_RADIO_TASK_RXEN : NRF_RADIO_TASK_TXEN), + dtm_inst.ppi_radio_start); atomic_set_bit(&dtm_inst.endpoint_state, (rx ? ENDPOINT_EGU_RADIO_RX : ENDPOINT_EGU_RADIO_TX)); - nrfx_gppi_ep_attach(dtm_inst.ppi_radio_start, - nrf_timer_task_address_get(dtm_inst.timer.p_reg, NRF_TIMER_TASK_START)); + nrfx_gppi_ep_attach(nrf_timer_task_address_get(dtm_inst.timer.p_reg, NRF_TIMER_TASK_START), + dtm_inst.ppi_radio_start); atomic_set_bit(&dtm_inst.endpoint_state, ENDPOINT_FORK_EGU_TIMER); nrfx_gppi_conn_enable(dtm_inst.ppi_radio_start); @@ -1672,10 +1672,11 @@ static void radio_tx_ppi_reconfigure(void) endpoints_clear(); - nrfx_gppi_ep_attach(dtm_inst.ppi_radio_start, - nrf_timer_event_address_get(dtm_inst.timer.p_reg, NRF_TIMER_EVENT_COMPARE0)); - nrfx_gppi_ep_attach(dtm_inst.ppi_radio_start, - nrf_radio_task_address_get(NRF_RADIO, NRF_RADIO_TASK_TXEN)); + nrfx_gppi_ep_attach(nrf_timer_event_address_get(dtm_inst.timer.p_reg, + NRF_TIMER_EVENT_COMPARE0), + dtm_inst.ppi_radio_start); + nrfx_gppi_ep_attach(nrf_radio_task_address_get(NRF_RADIO, NRF_RADIO_TASK_TXEN), + dtm_inst.ppi_radio_start); atomic_set_bit(&dtm_inst.endpoint_state, ENDPOINT_TIMER_RADIO_TX); nrfx_gppi_conn_enable(dtm_inst.ppi_radio_start); } diff --git a/samples/bluetooth/fast_pair/locator_tag/sysbuild/common/dfu_speedup_fragment.conf b/samples/bluetooth/fast_pair/locator_tag/sysbuild/common/dfu_speedup_fragment.conf index 510f075d551a..9b88dffb7d92 100644 --- a/samples/bluetooth/fast_pair/locator_tag/sysbuild/common/dfu_speedup_fragment.conf +++ b/samples/bluetooth/fast_pair/locator_tag/sysbuild/common/dfu_speedup_fragment.conf @@ -9,5 +9,5 @@ CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU_SPEEDUP=y # Needs to be set explicitly as the CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU_SPEEDUP # only sets the defaults which are overwritten by the prj.conf file CONFIG_BT_BUF_ACL_TX_SIZE=251 -CONFIG_BT_BUF_ACL_RX_SIZE=502 +CONFIG_BT_BUF_ACL_RX_SIZE=251 CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 diff --git a/samples/bluetooth/iso_time_sync/src/controller_time_nrf52.c b/samples/bluetooth/iso_time_sync/src/controller_time_nrf52.c index e18c27d8071e..27d5b84c2748 100644 --- a/samples/bluetooth/iso_time_sync/src/controller_time_nrf52.c +++ b/samples/bluetooth/iso_time_sync/src/controller_time_nrf52.c @@ -121,8 +121,8 @@ static int timer_config(void) uint32_t tep = nrfx_timer_task_address_get(&app_timer_instance, NRF_TIMER_TASK_CLEAR); ret = nrfx_timer_init(&app_timer_instance, &timer_cfg, unused_timer_isr_handler); - if (ret != NRFX_SUCCESS) { - printk("Failed initializing timer (ret: %d)\n", ret - NRFX_ERROR_BASE_NUM); + if (ret != 0) { + printk("Failed initializing timer (ret: %d)\n", ret); return -ENODEV; } @@ -181,7 +181,7 @@ int config_egu_trigger_on_rtc_and_timer_match(void) printk("Failed allocating for RTC match\n"); return ret; } - (void)nrfx_gppi_ep_attach(ppi_on_timer_match, nrfx_gppi_group_task_dis_addr(group)); + (void)nrfx_gppi_ep_attach(nrfx_gppi_group_task_dis_addr(group), ppi_on_timer_match); return 0; } diff --git a/samples/bluetooth/iso_time_sync/src/controller_time_nrf53_app.c b/samples/bluetooth/iso_time_sync/src/controller_time_nrf53_app.c index e9411ce535f1..92039212a753 100644 --- a/samples/bluetooth/iso_time_sync/src/controller_time_nrf53_app.c +++ b/samples/bluetooth/iso_time_sync/src/controller_time_nrf53_app.c @@ -95,8 +95,8 @@ static int timer_config(void) uint32_t tep = nrfx_timer_task_address_get(&app_timer_instance, NRF_TIMER_TASK_CLEAR); ret = nrfx_timer_init(&app_timer_instance, &timer_cfg, unused_timer_isr_handler); - if (ret != NRFX_SUCCESS) { - printk("Failed initializing timer (ret: %d)\n", ret - NRFX_ERROR_BASE_NUM); + if (ret != 0) { + printk("Failed initializing timer (ret: %d)\n", ret); return -ENODEV; } @@ -154,7 +154,7 @@ int config_egu_trigger_on_rtc_and_timer_match(void) printk("Failed allocating for RTC match\n"); return ret; } - (void)nrfx_gppi_ep_attach(ppi_on_timer_match, nrfx_gppi_group_task_dis_addr(group)); + (void)nrfx_gppi_ep_attach(nrfx_gppi_group_task_dis_addr(group), ppi_on_timer_match); return 0; } diff --git a/samples/bluetooth/iso_time_sync/src/controller_time_nrf54.c b/samples/bluetooth/iso_time_sync/src/controller_time_nrf54.c index 20935f398b9e..ad485994c05f 100644 --- a/samples/bluetooth/iso_time_sync/src/controller_time_nrf54.c +++ b/samples/bluetooth/iso_time_sync/src/controller_time_nrf54.c @@ -42,8 +42,8 @@ void controller_time_trigger_set(uint64_t timestamp_us) }; ret = nrfx_grtc_syscounter_cc_absolute_set(&chan_data, timestamp_us, false); - if (ret != NRFX_SUCCESS) { - printk("Failed setting CC (ret: %d)\n", ret - NRFX_ERROR_BASE_NUM); + if (ret != 0) { + printk("Failed setting CC (ret: %d)\n", ret); } } diff --git a/samples/bluetooth/peripheral_power_profiling/boards/nrf54lv10dk_nrf54lv10a_cpuapp_ns.conf b/samples/bluetooth/peripheral_power_profiling/boards/nrf54lv10dk_nrf54lv10a_cpuapp_ns.conf index 3a6ccd751049..e08859b792a6 100644 --- a/samples/bluetooth/peripheral_power_profiling/boards/nrf54lv10dk_nrf54lv10a_cpuapp_ns.conf +++ b/samples/bluetooth/peripheral_power_profiling/boards/nrf54lv10dk_nrf54lv10a_cpuapp_ns.conf @@ -17,3 +17,6 @@ CONFIG_PM_DEVICE_RUNTIME=y # RRAM always on, not needed for basic bluetooth features. CONFIG_MPSL_FORCE_RRAM_ON_ALL_THE_TIME=n + +CONFIG_TFM_SFN=y +CONFIG_TFM_NRF_SYSTEM_OFF_SERVICE=y diff --git a/samples/bluetooth/peripheral_power_profiling/src/main.c b/samples/bluetooth/peripheral_power_profiling/src/main.c index 5ccad49be18b..490218faa6e9 100644 --- a/samples/bluetooth/peripheral_power_profiling/src/main.c +++ b/samples/bluetooth/peripheral_power_profiling/src/main.c @@ -653,7 +653,7 @@ static void reset_reason_print(void) static void system_off(void) { -#if !IS_ENABLED(CONFIG_SOC_SERIES_NRF54HX) && !IS_ENABLED(CONFIG_TFM_EXPERIMENTAL) +#if !IS_ENABLED(CONFIG_SOC_SERIES_NRF54HX) printk("Powering off\n"); /* Clear the reset reason if it didn't do previously. */ @@ -674,7 +674,7 @@ static void system_off(void) } sys_poweroff(); -#endif /* !IS_ENABLED(CONFIG_SOC_SERIES_NRF54HX) && !IS_ENABLED(CONFIG_TFM_EXPERIMENTAL) */ +#endif /* !IS_ENABLED(CONFIG_SOC_SERIES_NRF54HX) */ } static void system_off_work_handler(struct k_work *work) diff --git a/samples/bluetooth/peripheral_uart/Kconfig b/samples/bluetooth/peripheral_uart/Kconfig index 67a0216fc435..997add55eb5c 100644 --- a/samples/bluetooth/peripheral_uart/Kconfig +++ b/samples/bluetooth/peripheral_uart/Kconfig @@ -21,11 +21,11 @@ config BT_NUS_UART_BUFFER_SIZE Size of the payload buffer in each RX and TX FIFO element config BT_NUS_SECURITY_ENABLED - bool "Enable security" + bool "Security" default y select BT_SMP help - "Enable BLE security for the UART service" + Enable Bluetooth LE security for the UART service config BT_NUS_UART_RX_WAIT_TIME int "Timeout for UART RX complete event" diff --git a/samples/bluetooth/peripheral_uart/boards/nrf54lv10dk_nrf54lv10a_cpuapp_ns.conf b/samples/bluetooth/peripheral_uart/boards/nrf54lv10dk_nrf54lv10a_cpuapp_ns.conf deleted file mode 100644 index f5ed71dc1549..000000000000 --- a/samples/bluetooth/peripheral_uart/boards/nrf54lv10dk_nrf54lv10a_cpuapp_ns.conf +++ /dev/null @@ -1,8 +0,0 @@ -# -# Copyright (c) 2025 Nordic Semiconductor -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# Disable the unspupported UART0 driver -CONFIG_NRFX_UARTE0=n diff --git a/samples/bluetooth/shorter_conn_intervals/README.rst b/samples/bluetooth/shorter_conn_intervals/README.rst index 7eaa9b69d8ed..3ff32e1f4fb5 100644 --- a/samples/bluetooth/shorter_conn_intervals/README.rst +++ b/samples/bluetooth/shorter_conn_intervals/README.rst @@ -139,8 +139,8 @@ The result should look similar to the following output: I: HCI: version 6.2 (0x10) revision 0x3012, manufacturer 0x0059 I: LMP: version 6.2 (0x10) subver 0x3012 I: Bluetooth initialized - I: Local minimum connection interval: 750 μs - I: SCI default connection rate parameters set (min=750 μs, max=10000 μs) + I: Local minimum connection interval: 750 us + I: SCI default connection rate parameters set (min=750 us, max=10000 us) I: Should this device initiate connection interval updates? Type y (yes, this device will initiate) or n (no, peer will initiate): @@ -152,25 +152,25 @@ The result should look similar to the following output: I: Central. Starting scanning I: Scanning successfully started I: Connected as central - I: Conn. interval is 10000 μs + I: Conn. interval is 10000 us I: Security changed: level 2, err: 0 I: Latency service discovery completed I: SCI service discovery completed I: Found SCI min interval characteristic, handle: 0x0013 I: LE PHY updated: TX PHY LE 2M, RX PHY LE 2M - I: Frame space updated: 63 μs, PHYs: 0x02, spacing types: 0x0003, initiator: Local Host - I: Minimum connection intervals: Local: 750 μs, Peer: 750 μs, Common: 750 μs - I: Transmission Latency: 9153 μs - I: Requesting new connection interval: 750 μs - I: Connection rate changed: interval 750 μs, subrate factor 1, peripheral latency 0, continuation number 0, supervision timeout 4000 ms - I: Transmission Latency: 834 μs - I: Transmission Latency: 792 μs - I: Transmission Latency: 747 μs - I: Requesting new connection interval: 1000 μs - I: Connection rate changed: interval 1000 μs, subrate factor 1, peripheral latency 0, continuation number 0, supervision timeout 4000 ms - I: Transmission Latency: 1056 μs - I: Transmission Latency: 838 μs - I: Transmission Latency: 1161 μs + I: Frame space updated: 63 us, PHYs: 0x02, spacing types: 0x0003, initiator: Local Host + I: Minimum connection intervals: Local: 750 us, Peer: 750 us, Common: 750 us + I: Transmission Latency: 9153 us + I: Requesting new connection interval: 750 us + I: Connection rate changed: interval 750 us, subrate factor 1, peripheral latency 0, continuation number 0, supervision timeout 4000 ms + I: Transmission Latency: 834 us + I: Transmission Latency: 792 us + I: Transmission Latency: 747 us + I: Requesting new connection interval: 1000 us + I: Connection rate changed: interval 1000 us, subrate factor 1, peripheral latency 0, continuation number 0, supervision timeout 4000 ms + I: Transmission Latency: 1056 us + I: Transmission Latency: 838 us + I: Transmission Latency: 1161 us * For the device not initiating connection interval updates:: @@ -180,23 +180,23 @@ The result should look similar to the following output: I: Peripheral. Starting advertising I: Advertising successfully started I: Connected as peripheral - I: Conn. interval is 10000 μs + I: Conn. interval is 10000 us I: Security changed: level 2, err: 0 I: Latency service discovery completed I: SCI service discovery completed I: Found SCI min interval characteristic, handle: 0x0013 - I: Minimum connection intervals: Local: 750 μs, Peer: 750 μs, Common: 750 μs + I: Minimum connection intervals: Local: 750 us, Peer: 750 us, Common: 750 us I: LE PHY updated: TX PHY LE 2M, RX PHY LE 2M - I: Frame space updated: 63 μs, PHYs: 0x02, spacing types: 0x0003, initiator: Peer - I: Transmission Latency: 11551 μs - I: Connection rate changed: interval 750 μs, subrate factor 1, peripheral latency 0, continuation number 0, supervision timeout 4000 ms - I: Transmission Latency: 718 μs - I: Transmission Latency: 962 μs - I: Transmission Latency: 804 μs - I: Connection rate changed: interval 1000 μs, subrate factor 1, peripheral latency 0, continuation number 0, supervision timeout 4000 ms - I: Transmission Latency: 630 μs - I: Transmission Latency: 1056 μs - I: Transmission Latency: 838 μs + I: Frame space updated: 63 us, PHYs: 0x02, spacing types: 0x0003, initiator: Peer + I: Transmission Latency: 11551 us + I: Connection rate changed: interval 750 us, subrate factor 1, peripheral latency 0, continuation number 0, supervision timeout 4000 ms + I: Transmission Latency: 718 us + I: Transmission Latency: 962 us + I: Transmission Latency: 804 us + I: Connection rate changed: interval 1000 us, subrate factor 1, peripheral latency 0, continuation number 0, supervision timeout 4000 ms + I: Transmission Latency: 630 us + I: Transmission Latency: 1056 us + I: Transmission Latency: 838 us References diff --git a/samples/bluetooth/shorter_conn_intervals/src/main.c b/samples/bluetooth/shorter_conn_intervals/src/main.c index e8bdc39bc6d9..82c72dab0f5b 100644 --- a/samples/bluetooth/shorter_conn_intervals/src/main.c +++ b/samples/bluetooth/shorter_conn_intervals/src/main.c @@ -349,7 +349,7 @@ static void connected(struct bt_conn *conn, uint8_t err) LOG_INF("Connected as %s", conn_info.role == BT_CONN_ROLE_CENTRAL ? "central" : "peripheral"); - LOG_INF("Conn. interval is %u μs", conn_info.le.interval_us); + LOG_INF("Conn. interval is %u us", conn_info.le.interval_us); #if defined(CONFIG_BT_SMP) if (conn_info.role == BT_CONN_ROLE_PERIPHERAL) { @@ -436,7 +436,7 @@ static int set_conn_rate_defaults(uint32_t interval_min_us, uint32_t interval_ma return err; } - LOG_INF("SCI default connection rate parameters set (min=%u μs, max=%u μs)", + LOG_INF("SCI default connection rate parameters set (min=%u us, max=%u us)", interval_min_us, interval_max_us); return 0; } @@ -491,7 +491,7 @@ static void conn_rate_changed(struct bt_conn *conn, uint8_t status, { if (status == BT_HCI_ERR_SUCCESS) { LOG_INF("Connection rate changed: " - "interval %u μs, " + "interval %u us, " "subrate factor %d, " "peripheral latency %d, " "continuation number %d, " @@ -534,7 +534,7 @@ static void frame_space_updated(struct bt_conn *conn, const struct bt_conn_le_frame_space_updated *params) { if (params->status == BT_HCI_ERR_SUCCESS) { - LOG_INF("Frame space updated: %u μs, PHYs: 0x%02x, spacing types: 0x%04x, " + LOG_INF("Frame space updated: %u us, PHYs: 0x%02x, spacing types: 0x%04x, " "initiator: %s", params->frame_space, params->phys, params->spacing_types, fsu_initiator_to_str(params->initiator)); @@ -599,8 +599,8 @@ static void test_run(void) common_min_interval_us = MAX(local_min_interval_us, remote_min_interval_us); test_intervals[0] = common_min_interval_us; - LOG_INF("Minimum connection intervals: Local: %u μs, Peer: %u μs, " - "Common: %u μs", + LOG_INF("Minimum connection intervals: Local: %u us, Peer: %u us, " + "Common: %u us", local_min_interval_us, remote_min_interval_us, common_min_interval_us); } @@ -621,7 +621,7 @@ static void test_run(void) k_sleep(K_MSEC(200)); /* wait for latency response */ if (latency_response) { - LOG_INF("Transmission Latency: %u μs", latency_response); + LOG_INF("Transmission Latency: %u us", latency_response); } else { LOG_WRN("Did not receive a latency response"); } @@ -636,7 +636,7 @@ static void test_run(void) uint32_t new_interval_us = test_intervals[interval_index]; - LOG_INF("Requesting new connection interval: %u μs", + LOG_INF("Requesting new connection interval: %u us", new_interval_us); /* As a central, the lowest supported interval of the peripheral @@ -694,7 +694,7 @@ int main(void) LOG_WRN("Failed to read min conn interval (err %d)", err); return 0; } - LOG_INF("Local minimum connection interval: %u μs", local_min_interval_us); + LOG_INF("Local minimum connection interval: %u us", local_min_interval_us); /* Set the initial allowed range of parameters that can be requested by the peripheral. * They will be overridden by any calls to bt_conn_le_conn_rate_request(). diff --git a/samples/cellular/gnss/src/factory_almanac_v2.h b/samples/cellular/gnss/src/factory_almanac_v2.h index 1397bb25f2cf..5336d2a88657 100644 --- a/samples/cellular/gnss/src/factory_almanac_v2.h +++ b/samples/cellular/gnss/src/factory_almanac_v2.h @@ -7,46 +7,46 @@ #ifndef FACTORY_ALMANAC_V2_H_ #define FACTORY_ALMANAC_V2_H_ -/* Factory almanac generated on 2025-11-03 08:45:44. +/* Factory almanac generated on 2025-12-01 09:46:07. * * Note, that the almanac gets more inaccurate with time and it should be updated periodically. */ #define FACTORY_ALMANAC_DATA_V2 \ - "f0ea02003157090000000031f407395709840a32fd00c50ca10064a6d6ff40ca" \ - "fbffc564720073010000315089395709230e30fd00b60ca1008900d0ff700edb" \ - "ff558ca9ffdbff020031d6333957096c207cfd003a0da100bfb2feff0e193200" \ - "8fc91300aa02feff31931d395709581146fd00a50da100545e2a008f2487ff1e" \ - "1b95ff1700010031402d395709b71772fd00d20ca1001c54fcff6caf3a0057e6" \ - "a8ff16ff000031bd1d395709681d4bfd000b0da100857fd4ffd256e3ff302650" \ - "00b0fdfeff3168a33957092e0542fd00da0ca1002485530061bdadff06922700" \ - "95fffeff318d59395709d1011cfd00a80ca100ef04a7ff694013004b7e9cff26" \ - "02ffff31f91c395709820d44fd006e0ca100ebc82700712a5300a3cfb2ff1c03" \ - "0100313c5839570923207dfd00ea0ca1009b98feff3621a2ff5536eeffb8fdfe" \ - "ff31ad12395709500e37fd00910da100a85ed5ff5013a2ff662d7800b8fd0400" \ - "31d0483957097a0b60fd008d0ca100150881ff6a0d3e0000f70c0088fd000031" \ - "7950395709101547fd00e70ca100f6da2e00ad0d2900fe7890ffd90200003192" \ - "333957099b0052fd00c60ca10030e27e00fd4c8fffb6c10500ea02010031ab88" \ - "3957090dff31fd00ab0ca1007a0822001f553c00ece272007401010031d77839" \ - "5709f50a5efd006b0ca100feba81ffe0da24008ab3c3ff9200020031c26b3957" \ - "09050c29fd00d80da1008c36abff3751d0ff313f98ff2f00fcff31be2e395709" \ - "99133dfd00ed0ca1005f5cd4ff42218bffb6ad4600e8fd030031cd583957097a" \ - "0b24fd000d0da1006e01adffe6cb7500b7bde4ffc202010031d01d395709d60b" \ - "5ffd00940ca100a8b5f6ffd50fa8ffc04952007c01000031cf013957097a0c63" \ - "fd00430da1009218ffff1472efff0946060048010400314b67395709940a5ffd" \ - "00cc0ca10098dd81ff7f7fd6ff85d6b1ffabff0100312e30395709e51c78fd00" \ - "340da1000350fdff56fa8dff3d761c005302010031bd90395709a7fa2afd00bc" \ - "0ca1004b2f4f006a552d00589d4f00fbfe0400317967395709d40358fd00e00d" \ - "a100d0437d00d14c2e0087a70a00e601ffff31565739570945f748fd00e20ca1" \ - "002a527a00e0581b009384e7ffdffeffff316070395709bb0723fd00d50ca100" \ - "8248a8ff1edc2200fca59fffddffffff318103395709520c4bfd003b0da1006b" \ - "6a5200466e16008c93210067fd0100310e1b395709b80d27fd00270ca1009ee1" \ - "abff9d8d7100379798ff3dfe020031143f3957098cfb34fd003d0ca100903953" \ - "00a80ca0ff6a3e23000f000300316559395709ac0746fd00700da100897c5400" \ - "87cf2400dcd6feff3fff0000313848395709870f48fd00f30ca100ea752800ee" \ - "33acff8a1fbaffeefe0400000000000000000000000000000000000000000000" \ + "f0ea0200315b0900000000313509395b09560a28fd00b50ca1002935c2ff870b" \ + "fcff68399bff7201000031578a395b09f70d2cfd009e0ca1003c90bbff5cd7db" \ + "ff43ebd1fff1ff020031b833395b09952078fd001d0da1008250eaffa5d23100" \ + "07bd3c009702feff310b1e395b09cb1158fd00a50da10007f615005ecb87ff41" \ + "89bcff1e00010031972c395b09d61769fd00ef0ca100d3ede7fff9813a00c010" \ + "d2ff14ff000031a11e395b09381d40fd002a0da1006016c0ff6ff9e3ff1d3678" \ + "009dfdfeff31eea3395b090d0540fd00b90ca100b3173f0030f0adff07625000" \ + "87fffeff31175b395b09c70131fd00cd0ca100039392ffbd9f1300a03bc5ff1f" \ + "02ffff31a01c395b09f90d53fd005c0ca100da5e13008fbc5300daa2dbff2303" \ + "0100313c59395b094a2079fd00eb0ca1005c36eaff34b6a2ff54931600abfdff" \ + "ff31c612395b09210e2efd00a60da10025efc0ff556da3ffc8009fffdafd0400" \ + "318d49395b09390b62fd00660ca10048a06c00c82c3e007c48360086fd000031" \ + "b350395b097a155cfd00ef0ca100f8731a008d0829005153b9ffd7020000312c" \ + "34395b09530058fd00c30ca100b9756a006e458fff54ed2e00f2020100314e88" \ + "395b0989ff47fd00cd0ca100f1970d00af923c00b4b49bff7d010100310a7a39" \ + "5b09b30a62fd00800ca100ca526d004f20250087e4ecffa700020031286b395b" \ + "09fd0b3afd00030ea10077c896ff1bfad0ff416fbfff0e00fdff31ba2e395b09" \ + "6a1332fd00db0ca1000fefbfff269b8bffb31f6f0001fe0300312a59395b0972" \ + "0b35fd002b0da100da9298ff4f2c7600b10f0d00c702010031311e395b09e30b" \ + "55fd00bb0ca1008849e2ffc01daaffb77579007c01000031d302395b09a50c5c" \ + "fd00640da100b3adeaff8214ebffe12733006901030031e265395b09540a66fd" \ + "00c00ca10077756d00b6ecd6ffc58bdaffb3ff010031bd30395b09081d74fd00" \ + "3f0da1003dece8ff0de78eff4428440060020100317391395b0998fa2dfd00af" \ + "0ca10050bc3a007fac2d009b5b78001dff040031b768395b098a0359fd00bd0d" \ + "a1009dd86800d8802e002c803200e101ffff319d58395b09f5f64afd00f50ca1" \ + "0050e16500dbe41b0093f30f00d2fefeff31ad71395b09b30736fd00e20ca100" \ + "e6d893ffddf822000082c8ffd1ffffff317d03395b09330c48fd00590da10053" \ + "003e0084301600714c4a006efd010031171b395b09b10d38fd001b0ca1002874" \ + "97ff1a0071005eddc2ff4cfe020031643f395b096efb30fd00150ca100acc73e" \ + "00032fa0ff0bc74c002d000300317259395b09870743fd00760da1006b104000" \ + "275a2500549e260043ff0100314349395b09fc0f58fd00190da100db0c1400e8" \ + "86acff7a89e2ff15ff0400000000000000000000000000000000000000000000" \ "0000000000" #define FACTORY_ALMANAC_CHECKSUM_V2 \ - "5d83e6da802ca18689ec1f2375813cdd8f757d9a13d12c2cce7b44355dc8cf65" + "998f2ae578d8edc0b1831b9043d4a376e9fce0ee99895e1b607d1e845bc8f1b6" #endif /* FACTORY_ALMANAC_V2_H_ */ diff --git a/samples/cellular/gnss/src/factory_almanac_v3.h b/samples/cellular/gnss/src/factory_almanac_v3.h index 73bea14bfed9..4a201e4f941e 100644 --- a/samples/cellular/gnss/src/factory_almanac_v3.h +++ b/samples/cellular/gnss/src/factory_almanac_v3.h @@ -7,55 +7,55 @@ #ifndef FACTORY_ALMANAC_V3_H_ #define FACTORY_ALMANAC_V3_H_ -/* Factory almanac generated on 2025-11-01 19:19:46. +/* Factory almanac generated on 2025-12-01 08:32:26. * * Note, that the almanac gets more inaccurate with time and it should be updated periodically. */ #define FACTORY_ALMANAC_DATA_V3 \ - "f0ea03003157090000000031e907245709890a3cfd00c90ca100d2add6ffe1db" \ - "fbff0224730073010000314489245709270e3afd00ba0ca1000208d0ff9b09db" \ - "ff7961aaffdaff020031d833245709672076fd00360da10085b9fefff91d3200" \ - "af991400ab02feff31951d24570953113cfd00a40da100ac652a00b72487ff25" \ - "f495ff1600010031492d245709b3176dfd00cd0ca100045bfcff4cb33a0091b3" \ - "a9ff16ff000031b41d2457096d1d56fd000e0da100af86d4ff1357e3ff65f950" \ - "00b0fdfeff3161a3245709340545fd00e60ca100818c5300b0baadff89662800" \ - "96fffeff318459245709cf0116fd00a00ca100b40ca7ffe73c130047519dff26" \ - "02ffff31f91c2457097c0d38fd006c0ca10053d02700ba2e5300ec98b3ff1c03" \ - "0100312e582457091e2078fd00e50ca100629ffeff381ba2ff580eefffb9fdfe" \ - "ff31a912245709550e41fd00940da1000a66d5ff8c00a2ff96187900b6fd0400" \ - "31c9482457097a0b57fd008b0ca100300f81ffe10c3e0011c60d0088fd000031" \ - "72502457090d153ffd00e80ca10047e22e007e0f29005b4991ffd9020000318c" \ - "332457099b004afd00c30ca10070e97e009e4d8fffad910600ea02010031ab88" \ - "24570906ff25fd00a60ca100181022003c543c0088b373007401010031c87824" \ - "5709f40a56fd00660ca1001ec281ffecd82400aa82c4ff9200020031c76b2457" \ - "09030c23fd00d00da100333eabffd14bd0ff5d1f99ff3000fcff31be2e245709" \ - "9d1348fd00f10ca100b063d4ffca188bff8e884700e7fd030031c55824570979" \ - "0b20fd00050da1001909adff46c975009d93e5ffc102010031c81d245709d40b" \ - "5efd00910ca100c0bcf6ff18f9a7ff4c2f53007c01000031c401245709750c5d" \ - "fd003d0da100a91fffff00dfefff5eae060046010400315b67245709940a57fd" \ - "00c80ca100b8e481ff4a7ad6ff86acb2ffabff0100312730245709e11c72fd00" \ - "2f0da100d556fdff0dee8dff50571d005202010031b590245709aefa2efd00c6" \ - "0ca100e2364f00c9522d00a4705000fafe0400316b67245709d40351fd00df0d" \ - "a100024b7d00874b2e00f5830b00e601ffff31465724570947f742fd00e00ca1" \ - "008a597a0045531b00d55be8ffdffeffff315970245709b9071efd00cd0ca100" \ - "3350a8ffe3d922006079a0ffddffffff318003245709590c4efd00440da100ad" \ - "715200928f1600a247220067fd0100310a1b245709b60d23fd00210ca1003ce9" \ - "abffa1917100fd5d99ff3cfe020031123f24570993fb37fd00480ca100174153" \ - "004209a0ffc20d24000e000300316459245709b3074afd007a0da100d8835400" \ - "36cb240085b2ffff3eff0000313848245709820f3dfd00f00ca1004b7d280078" \ - "30acff79f5baffecfe0400000000000000000000000000000000000000000000" \ - "000000000000000000000000000031128515570903c5f8fe010de7ca004bc191" \ - "ffee6dbfff2fb011000000000031e47b155709d8c926ff0172ecca00c5dcd8ff" \ - "fb28c0fffc3bc9fffdff0000314479155709aaa4c7fe10aceaca0049791d00ab" \ - "99c0ffaf4e82fffeff0000000000000000000000000000000000000000000000" \ + "f0ea0300315b0900000000313509395b09560a28fd00b50ca1002935c2ff870b" \ + "fcff68399bff7201000031578a395b09f70d2cfd009e0ca1003c90bbff5cd7db" \ + "ff43ebd1fff1ff020031b833395b09952078fd001d0da1008250eaffa5d23100" \ + "07bd3c009702feff310b1e395b09cb1158fd00a50da10007f615005ecb87ff41" \ + "89bcff1e00010031972c395b09d61769fd00ef0ca100d3ede7fff9813a00c010" \ + "d2ff14ff000031a11e395b09381d40fd002a0da1006016c0ff6ff9e3ff1d3678" \ + "009dfdfeff31eea3395b090d0540fd00b90ca100b3173f0030f0adff07625000" \ + "87fffeff31175b395b09c70131fd00cd0ca100039392ffbd9f1300a03bc5ff1f" \ + "02ffff31a01c395b09f90d53fd005c0ca100da5e13008fbc5300daa2dbff2303" \ + "0100313c59395b094a2079fd00eb0ca1005c36eaff34b6a2ff54931600abfdff" \ + "ff31c612395b09210e2efd00a60da10025efc0ff556da3ffc8009fffdafd0400" \ + "318d49395b09390b62fd00660ca10048a06c00c82c3e007c48360086fd000031" \ + "b350395b097a155cfd00ef0ca100f8731a008d0829005153b9ffd7020000312c" \ + "34395b09530058fd00c30ca100b9756a006e458fff54ed2e00f2020100314e88" \ + "395b0989ff47fd00cd0ca100f1970d00af923c00b4b49bff7d010100310a7a39" \ + "5b09b30a62fd00800ca100ca526d004f20250087e4ecffa700020031286b395b" \ + "09fd0b3afd00030ea10077c896ff1bfad0ff416fbfff0e00fdff31ba2e395b09" \ + "6a1332fd00db0ca1000fefbfff269b8bffb31f6f0001fe0300312a59395b0972" \ + "0b35fd002b0da100da9298ff4f2c7600b10f0d00c702010031311e395b09e30b" \ + "55fd00bb0ca1008849e2ffc01daaffb77579007c01000031d302395b09a50c5c" \ + "fd00640da100b3adeaff8214ebffe12733006901030031e265395b09540a66fd" \ + "00c00ca10077756d00b6ecd6ffc58bdaffb3ff010031bd30395b09081d74fd00" \ + "3f0da1003dece8ff0de78eff4428440060020100317391395b0998fa2dfd00af" \ + "0ca10050bc3a007fac2d009b5b78001dff040031b768395b098a0359fd00bd0d" \ + "a1009dd86800d8802e002c803200e101ffff319d58395b09f5f64afd00f50ca1" \ + "0050e16500dbe41b0093f30f00d2fefeff31ad71395b09b30736fd00e20ca100" \ + "e6d893ffddf822000082c8ffd1ffffff317d03395b09330c48fd00590da10053" \ + "003e0084301600714c4a006efd010031171b395b09b10d38fd001b0ca1002874" \ + "97ff1a0071005eddc2ff4cfe020031643f395b096efb30fd00150ca100acc73e" \ + "00032fa0ff0bc74c002d000300317259395b09870743fd00760da1006b104000" \ + "275a2500549e260043ff0100314349395b09fc0f58fd00190da100db0c1400e8" \ + "86acff7a89e2ff15ff0400000000000000000000000000000000000000000000" \ + "000000000000000000000000000031f97e4c5b0985c44dff01dee8ca00ffd87d" \ + "002699bfff1ffcc3ff0000000031267f4c5b0983c91bff0101eeca0044f0c4ff" \ + "5bd4c0ffe79e7800fcff000031557a4c5b09dba522ff10b1ecca00308909006e" \ + "dcc0ffe7b43200feff0000000000000000000000000000000000000000000000" \ "0000000000000000000000000000000000000000000000000000000000000000" \ - "000000000000000000318d01155709b200610001feebca0094577000850f0b00" \ - "757bdeff000000003199011557096f005200105bebca00aa87efff516993ff11" \ - "02bdff0000000000000000000000000000000000000000000000000000000000" \ + "000000000000000000312d014c5b09d7004b001f85ecca0085011f0095ae6500" \ + "876c72000000000031e7014c5b0965005d0010a3ebca006317baff3b28d0ff99" \ + "0053000000000000000000000000000000000000000000000000000000000000" \ "0000000000000000000000000000000000000000000000000000000000000000" \ "00000000000000000000000000000000000000000000000000000000000000" #define FACTORY_ALMANAC_CHECKSUM_V3 \ - "ef6f0c079c3fdf5eca2dd00b344290b1924d8de63a8a54cc4c68e1beda9cb9d3" + "b9681a93075a743f7634abe279bd8e2074013216e554ad9a1778b0b7544725c2" #endif /* FACTORY_ALMANAC_V3_H_ */ diff --git a/samples/cellular/modem_shell/README.rst b/samples/cellular/modem_shell/README.rst index fd1f260726d2..ddf62c0463b6 100644 --- a/samples/cellular/modem_shell/README.rst +++ b/samples/cellular/modem_shell/README.rst @@ -1038,7 +1038,7 @@ Getting nRF91 Series DK out-of-the-box and to nRF Cloud To program the certificates and connect to nRF Cloud, complete the following steps: 1. `Download nRF Connect for Desktop`_. -#. Update the modem firmware on the on-board modem of the nRF91 Series DK to the latest version as instructed in :ref:`nrf9160_updating_fw_modem`. +#. Update the modem firmware on the on-board modem of the nRF91 Series DK to the latest version as instructed in `Programming nRF91 Series DK firmware`_. #. Build and program the MoSh to the nRF91 Series DK using the default MoSh configuration (with REST as the transport): .. parsed-literal:: diff --git a/samples/cellular/modem_shell/src/link/link_shell_pdn.c b/samples/cellular/modem_shell/src/link/link_shell_pdn.c index 2a976673b597..d17f6cb48b3d 100644 --- a/samples/cellular/modem_shell/src/link/link_shell_pdn.c +++ b/samples/cellular/modem_shell/src/link/link_shell_pdn.c @@ -41,6 +41,8 @@ const char *link_pdn_event_to_string(enum lte_lc_evt_type event, char *out_str_b { LTE_LC_EVT_PDN_DEACTIVATED, "deactivated" }, { LTE_LC_EVT_PDN_IPV6_UP, "IPv6 up" }, { LTE_LC_EVT_PDN_IPV6_DOWN, "IPv6 down" }, + { LTE_LC_EVT_PDN_SUSPENDED, "suspended" }, + { LTE_LC_EVT_PDN_RESUMED, "resumed" }, { LTE_LC_EVT_PDN_NETWORK_DETACH, "network detach" }, { LTE_LC_EVT_PDN_APN_RATE_CONTROL_ON, "APN rate control on" }, { LTE_LC_EVT_PDN_APN_RATE_CONTROL_OFF, "APN rate control off" }, diff --git a/samples/cellular/pdn/src/main.c b/samples/cellular/pdn/src/main.c index f59ed6462c14..5de60141d4cc 100644 --- a/samples/cellular/pdn/src/main.c +++ b/samples/cellular/pdn/src/main.c @@ -146,6 +146,12 @@ int main(void) */ lte_lc_register_handler(lte_lc_evt_handler); + err = lte_lc_pdn_default_ctx_events_enable(); + if (err) { + printk("lte_lc_pdn_default_ctx_events_enable() failed, err %d\n", err); + return 0; + } + err = lte_lc_connect(); if (err) { return 0; diff --git a/samples/common/mcumgr_bt_ota_dfu/CMakeLists.txt b/samples/common/mcumgr_bt_ota_dfu/CMakeLists.txt index 0edad3ad81ba..c8f57f8d7860 100644 --- a/samples/common/mcumgr_bt_ota_dfu/CMakeLists.txt +++ b/samples/common/mcumgr_bt_ota_dfu/CMakeLists.txt @@ -7,7 +7,7 @@ if(CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU_VALIDATION) if(CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU_SPEEDUP AND CONFIG_HAS_BT_CTLR) if((NOT (CONFIG_BT_BUF_ACL_TX_SIZE EQUAL 251)) OR - (NOT (CONFIG_BT_BUF_ACL_RX_SIZE EQUAL 502)) OR + (NOT (CONFIG_BT_BUF_ACL_RX_SIZE EQUAL 251)) OR (NOT (CONFIG_BT_CTLR_DATA_LENGTH_MAX EQUAL 251)) ) message(WARNING "MCUmgr Bluetooth OTA DFU: suboptimal configuration " @@ -20,8 +20,8 @@ if(CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU_VALIDATION) if(CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU_SPEEDUP AND CONFIG_BT_HCI_HOST) if((NOT (CONFIG_BT_BUF_ACL_TX_SIZE EQUAL 251)) OR - (NOT (CONFIG_BT_BUF_ACL_RX_SIZE EQUAL 502)) OR - (NOT (CONFIG_BT_L2CAP_TX_MTU EQUAL 498)) + (NOT (CONFIG_BT_BUF_ACL_RX_SIZE EQUAL 251)) OR + (NOT (CONFIG_BT_L2CAP_TX_MTU EQUAL 247)) ) message(WARNING "MCUmgr Bluetooth OTA DFU: suboptimal configuration " "of Bluetooth Host buffers. Consider using optimal values " @@ -33,7 +33,10 @@ if(CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU_VALIDATION) if(CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU) if(CONFIG_MCUMGR_TRANSPORT_BT_REASSEMBLY) - if(NOT (CONFIG_MCUMGR_TRANSPORT_NETBUF_SIZE EQUAL 2475)) + # Allow for using default value specified by `nrf/samples/common/mcumgr_bt_ota_dfu/Kconfig` + # or `nrf/Kconfig.nrf`. + if((NOT (CONFIG_MCUMGR_TRANSPORT_NETBUF_SIZE EQUAL 1230)) AND + (NOT (CONFIG_MCUMGR_TRANSPORT_NETBUF_SIZE EQUAL 2475))) message(WARNING "MCUmgr Bluetooth OTA DFU: suboptimal configuration " "of the MCUmgr buffer with the Reassembly feature support. Consider using" "the optimal value defined in the ${CMAKE_CURRENT_LIST_DIR}/Kconfig " diff --git a/samples/crypto/persistent_key_usage/sysbuild/uicr/prj.conf b/samples/crypto/persistent_key_usage/sysbuild/uicr/prj.conf index f32d32389395..173568a67283 100644 --- a/samples/crypto/persistent_key_usage/sysbuild/uicr/prj.conf +++ b/samples/crypto/persistent_key_usage/sysbuild/uicr/prj.conf @@ -2,3 +2,4 @@ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # Intentionally left blank +CONFIG_IS_GEN_UICR_IMAGE=y diff --git a/samples/crypto/psa_tls/prj.conf b/samples/crypto/psa_tls/prj.conf index 5f3442c516d8..c39b1333f43d 100644 --- a/samples/crypto/psa_tls/prj.conf +++ b/samples/crypto/psa_tls/prj.conf @@ -52,6 +52,7 @@ CONFIG_MBEDTLS_HEAP_SIZE=32768 CONFIG_MBEDTLS_SSL_IN_CONTENT_LEN=2304 CONFIG_MBEDTLS_SSL_OUT_CONTENT_LEN=2304 CONFIG_MBEDTLS_SSL_CLI_C=y +CONFIG_MBEDTLS_SSL_CACHE_C=y CONFIG_MBEDTLS_TLS_LIBRARY=y CONFIG_MBEDTLS_X509_LIBRARY=y diff --git a/samples/crypto/psa_tls/src/psa_dtls_functions_client.c b/samples/crypto/psa_tls/src/psa_dtls_functions_client.c index 167777717d4b..c9ff33de16b1 100644 --- a/samples/crypto/psa_tls/src/psa_dtls_functions_client.c +++ b/samples/crypto/psa_tls/src/psa_dtls_functions_client.c @@ -64,6 +64,15 @@ static int setup_dtls_client_socket(void) return -errno; } + int cache = TLS_SESSION_CACHE_ENABLED; + + err = setsockopt(sock, SOL_TLS, TLS_SESSION_CACHE, &cache, sizeof(cache)); + if (err < 0) { + LOG_ERR("Failed to set TLS Session cache. Err: %d", errno); + (void)close(sock); + return -errno; + } + return sock; } diff --git a/samples/crypto/psa_tls/src/psa_dtls_functions_server.c b/samples/crypto/psa_tls/src/psa_dtls_functions_server.c index 58e938f6ea25..b9eb5c2aa2d5 100644 --- a/samples/crypto/psa_tls/src/psa_dtls_functions_server.c +++ b/samples/crypto/psa_tls/src/psa_dtls_functions_server.c @@ -63,6 +63,15 @@ static int setup_dtls_server_socket(void) return -errno; } + int cache = TLS_SESSION_CACHE_ENABLED; + + err = setsockopt(sock, SOL_TLS, TLS_SESSION_CACHE, &cache, sizeof(cache)); + if (err < 0) { + LOG_ERR("Failed to set TLS Session cache. Err: %d", errno); + (void)close(sock); + return -errno; + } + err = bind(sock, (struct sockaddr *)&my_addr, sizeof(my_addr)); if (err < 0) { LOG_ERR("Failed to bind DTLS socket. Err: %d", errno); diff --git a/samples/crypto/psa_tls/src/psa_tls_functions_client.c b/samples/crypto/psa_tls/src/psa_tls_functions_client.c index ee8b8031c3db..30b6b4feaf0f 100644 --- a/samples/crypto/psa_tls/src/psa_tls_functions_client.c +++ b/samples/crypto/psa_tls/src/psa_tls_functions_client.c @@ -72,6 +72,15 @@ static int setup_tls_client_socket(void) return -errno; } + int cache = TLS_SESSION_CACHE_ENABLED; + + err = setsockopt(sock, SOL_TLS, TLS_SESSION_CACHE, &cache, sizeof(cache)); + if (err < 0) { + LOG_ERR("Failed to set TLS Session cache. Err: %d", errno); + (void)close(sock); + return -errno; + } + return sock; } diff --git a/samples/crypto/psa_tls/src/psa_tls_functions_server.c b/samples/crypto/psa_tls/src/psa_tls_functions_server.c index 3ea0030cd467..fdd472f69b0a 100644 --- a/samples/crypto/psa_tls/src/psa_tls_functions_server.c +++ b/samples/crypto/psa_tls/src/psa_tls_functions_server.c @@ -55,6 +55,15 @@ static int setup_tls_server_socket(void) return -errno; } + int cache = TLS_SESSION_CACHE_ENABLED; + + err = setsockopt(sock, SOL_TLS, TLS_SESSION_CACHE, &cache, sizeof(cache)); + if (err < 0) { + LOG_ERR("Failed to set TLS Session cache. Err: %d", errno); + (void)close(sock); + return -errno; + } + err = bind(sock, (struct sockaddr *)&my_addr, sizeof(my_addr)); if (err < 0) { LOG_ERR("Failed to bind TLS socket. Err: %d", errno); diff --git a/samples/debug/memfault/boards/nrf9160dk_nrf9160_ns.conf b/samples/debug/memfault/boards/nrf9160dk_nrf9160_ns.conf index 53c1b66a3b7f..ac87bc9938b7 100644 --- a/samples/debug/memfault/boards/nrf9160dk_nrf9160_ns.conf +++ b/samples/debug/memfault/boards/nrf9160dk_nrf9160_ns.conf @@ -13,6 +13,8 @@ CONFIG_MEMFAULT_NCS_LTE_METRICS=y CONFIG_MEMFAULT_NCS_POST_COREDUMP_ON_NETWORK_CONNECTED=y CONFIG_LTE_LC_EDRX_MODULE=y CONFIG_LTE_LC_PSM_MODULE=y + +CONFIG_HW_ID_LIBRARY_SOURCE_IMEI=y CONFIG_MODEM_INFO=y # Certificate management diff --git a/samples/debug/memfault/boards/nrf9161dk_nrf9161_ns.conf b/samples/debug/memfault/boards/nrf9161dk_nrf9161_ns.conf index 53c1b66a3b7f..ac87bc9938b7 100644 --- a/samples/debug/memfault/boards/nrf9161dk_nrf9161_ns.conf +++ b/samples/debug/memfault/boards/nrf9161dk_nrf9161_ns.conf @@ -13,6 +13,8 @@ CONFIG_MEMFAULT_NCS_LTE_METRICS=y CONFIG_MEMFAULT_NCS_POST_COREDUMP_ON_NETWORK_CONNECTED=y CONFIG_LTE_LC_EDRX_MODULE=y CONFIG_LTE_LC_PSM_MODULE=y + +CONFIG_HW_ID_LIBRARY_SOURCE_IMEI=y CONFIG_MODEM_INFO=y # Certificate management diff --git a/samples/debug/memfault/boards/thingy91_nrf9160_ns.conf b/samples/debug/memfault/boards/thingy91_nrf9160_ns.conf index 195b4b6e80c0..ac87bc9938b7 100644 --- a/samples/debug/memfault/boards/thingy91_nrf9160_ns.conf +++ b/samples/debug/memfault/boards/thingy91_nrf9160_ns.conf @@ -14,6 +14,9 @@ CONFIG_MEMFAULT_NCS_POST_COREDUMP_ON_NETWORK_CONNECTED=y CONFIG_LTE_LC_EDRX_MODULE=y CONFIG_LTE_LC_PSM_MODULE=y +CONFIG_HW_ID_LIBRARY_SOURCE_IMEI=y +CONFIG_MODEM_INFO=y + # Certificate management CONFIG_MEMFAULT_ROOT_CERT_STORAGE_NRF9160_MODEM=y CONFIG_MODEM_KEY_MGMT=y diff --git a/samples/dfu/ab/README.rst b/samples/dfu/ab/README.rst index cf93370469c5..a372821cc560 100644 --- a/samples/dfu/ab/README.rst +++ b/samples/dfu/ab/README.rst @@ -59,7 +59,7 @@ The following conditions decide which slot will be booted (active) on the next r #. If both slots are valid and none is marked as "preferred," the slot with the higher version number is selected as active. #. If none of the above conditions is met, slot A is selected as active. -You can set the preferred slot using the ``boot_request_set_preferred_slot`` function. +You can set the preferred slot using the ``boot_request_set_preferred_slot()`` function. If the :kconfig:option:`CONFIG_NRF_MCUBOOT_BOOT_REQUEST_PREFERENCE_KEEP` option is enabled, the slot preference remains persistent across reboots. Otherwise, the slot preference is cleared on reboot. To enable the persistence of a preferred slot, define a backup region for the bootloader request area by using the ``nrf,bootloader-request-backup`` chosen node in the devicetree. diff --git a/samples/dfu/dfu_target/README.rst b/samples/dfu/dfu_target/README.rst index f49fbeb4ca69..d1d737df6f36 100644 --- a/samples/dfu/dfu_target/README.rst +++ b/samples/dfu/dfu_target/README.rst @@ -55,7 +55,7 @@ After programming the sample to your development kit, perform the following step ``Starting dfu_target sample, build time: `` ```` indicates the build time. - Iit will be used later to verify the update. + It will be used later to verify the update. #. Build a second version of the sample. For simplicity, it is assumed to be built in the :file:`build_v2` directory. diff --git a/samples/esb/esb_monitor/src/main.c b/samples/esb/esb_monitor/src/main.c index d4f5a07e4c94..e629b68495fc 100644 --- a/samples/esb/esb_monitor/src/main.c +++ b/samples/esb/esb_monitor/src/main.c @@ -183,8 +183,11 @@ int clocks_start(void) } } while (err == -EAGAIN); - nrf_lrcconf_clock_always_run_force_set(NRF_LRCCONF000, 0, true); - nrf_lrcconf_task_trigger(NRF_LRCCONF000, NRF_LRCCONF_TASK_CLKSTART_0); + /* HMPAN-84 */ + if (nrf54h_errata_84()) { + nrf_lrcconf_clock_always_run_force_set(NRF_LRCCONF000, 0, true); + nrf_lrcconf_task_trigger(NRF_LRCCONF000, NRF_LRCCONF_TASK_CLKSTART_0); + } LOG_DBG("HF clock started"); diff --git a/samples/esb/esb_prx/boards/nrf54h20dk_nrf54h20_cpurad.conf b/samples/esb/esb_prx/boards/nrf54h20dk_nrf54h20_cpurad.conf new file mode 100644 index 000000000000..cd068ebe840a --- /dev/null +++ b/samples/esb/esb_prx/boards/nrf54h20dk_nrf54h20_cpurad.conf @@ -0,0 +1 @@ +CONFIG_NRFX_GPPI_V1=n diff --git a/samples/esb/esb_prx/src/main.c b/samples/esb/esb_prx/src/main.c index 27a387a85034..acdf28e203b1 100644 --- a/samples/esb/esb_prx/src/main.c +++ b/samples/esb/esb_prx/src/main.c @@ -144,8 +144,11 @@ int clocks_start(void) } } while (err == -EAGAIN); - nrf_lrcconf_clock_always_run_force_set(NRF_LRCCONF000, 0, true); - nrf_lrcconf_task_trigger(NRF_LRCCONF000, NRF_LRCCONF_TASK_CLKSTART_0); + /* HMPAN-84 */ + if (nrf54h_errata_84()) { + nrf_lrcconf_clock_always_run_force_set(NRF_LRCCONF000, 0, true); + nrf_lrcconf_task_trigger(NRF_LRCCONF000, NRF_LRCCONF_TASK_CLKSTART_0); + } LOG_DBG("HF clock started"); diff --git a/samples/esb/esb_ptx/boards/nrf54h20dk_nrf54h20_cpurad.conf b/samples/esb/esb_ptx/boards/nrf54h20dk_nrf54h20_cpurad.conf new file mode 100644 index 000000000000..cd068ebe840a --- /dev/null +++ b/samples/esb/esb_ptx/boards/nrf54h20dk_nrf54h20_cpurad.conf @@ -0,0 +1 @@ +CONFIG_NRFX_GPPI_V1=n diff --git a/samples/esb/esb_ptx/src/main.c b/samples/esb/esb_ptx/src/main.c index 9effc6bde522..9b84ade02df2 100644 --- a/samples/esb/esb_ptx/src/main.c +++ b/samples/esb/esb_ptx/src/main.c @@ -134,8 +134,11 @@ int clocks_start(void) } } while (err == -EAGAIN); - nrf_lrcconf_clock_always_run_force_set(NRF_LRCCONF000, 0, true); - nrf_lrcconf_task_trigger(NRF_LRCCONF000, NRF_LRCCONF_TASK_CLKSTART_0); + /* HMPAN-84 */ + if (nrf54h_errata_84()) { + nrf_lrcconf_clock_always_run_force_set(NRF_LRCCONF000, 0, true); + nrf_lrcconf_task_trigger(NRF_LRCCONF000, NRF_LRCCONF_TASK_CLKSTART_0); + } LOG_DBG("HF clock started"); return 0; diff --git a/samples/hw_id/overlay-ble-mac.conf b/samples/hw_id/overlay-ble-mac.conf index d54d4e98a7dd..4c92f96e5988 100644 --- a/samples/hw_id/overlay-ble-mac.conf +++ b/samples/hw_id/overlay-ble-mac.conf @@ -4,4 +4,4 @@ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # CONFIG_BT=y -CONFIG_HW_ID_LIBRARY_SOURCE_BLE_MAC=y +CONFIG_HW_ID_LIBRARY_SOURCE_BT_DEVICE_ADDRESS=y diff --git a/samples/ironside_se/protectedmem_periphconf/README.rst b/samples/ironside_se/protectedmem_periphconf/README.rst index 7e9ed17e3dbe..83b91a4e9103 100644 --- a/samples/ironside_se/protectedmem_periphconf/README.rst +++ b/samples/ironside_se/protectedmem_periphconf/README.rst @@ -7,7 +7,7 @@ Protected Memory with PERIPHCONF Partition :local: :depth: 2 -This sample demonstrates how to protect the PERIPHCONF Partition using UICR.PROTECTEDMEM. +This sample demonstrates how to protect the PERIPHCONF partition using UICR.PROTECTEDMEM. Requirements ************ diff --git a/samples/ironside_se/protectedmem_periphconf/sample.yaml b/samples/ironside_se/protectedmem_periphconf/sample.yaml index 757bdc77aaab..48497c6f9153 100644 --- a/samples/ironside_se/protectedmem_periphconf/sample.yaml +++ b/samples/ironside_se/protectedmem_periphconf/sample.yaml @@ -15,13 +15,10 @@ common: type: multi_line ordered: true regex: - - "=== Protected Memory Demo ===" - - "Attempting to write test pattern" - - "Write successful \\(in current boot\\)\\." - - "Rebooting\\.\\.\\." + - "Writing test pattern to protected memory\\.\\.\\." + - "Rebooting\\. Secondary firmware should boot if protection is working\\." # When PROTECTEDMEM integrity check fails, secondary firmware boots - - "=== Secondary Firmware Booted ===" - - "PROTECTEDMEM integrity check FAILED" + - "PROTECTEDMEM integrity check failed - secondary firmware booted" tests: samples.protectedmem_periphconf.nrf54h20dk: diff --git a/samples/ironside_se/protectedmem_periphconf/sysbuild/uicr.conf b/samples/ironside_se/protectedmem_periphconf/sysbuild/uicr.conf index 2c072f1db0a8..886a0eacf8cf 100644 --- a/samples/ironside_se/protectedmem_periphconf/sysbuild/uicr.conf +++ b/samples/ironside_se/protectedmem_periphconf/sysbuild/uicr.conf @@ -3,6 +3,8 @@ # # Configuration overlay for uicr image +CONFIG_IS_GEN_UICR_IMAGE=y + # Enable PROTECTEDMEM CONFIG_GEN_UICR_PROTECTEDMEM=y diff --git a/samples/ironside_se/secondary_boot_gen_uicr/sysbuild/uicr.conf b/samples/ironside_se/secondary_boot_gen_uicr/sysbuild/uicr.conf index e31cfbe35997..99aa57c0fb93 100644 --- a/samples/ironside_se/secondary_boot_gen_uicr/sysbuild/uicr.conf +++ b/samples/ironside_se/secondary_boot_gen_uicr/sysbuild/uicr.conf @@ -1,6 +1,8 @@ # Copyright (c) 2025 Nordic Semiconductor ASA # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +CONFIG_IS_GEN_UICR_IMAGE=y + # Configuration overlay for uicr image # Enable UICR.SECONDARY.ENABLE CONFIG_GEN_UICR_SECONDARY=y diff --git a/samples/ironside_se/secondary_boot_trigger_lockup/sysbuild/uicr.conf b/samples/ironside_se/secondary_boot_trigger_lockup/sysbuild/uicr.conf index 929e422b1c96..a66d61d79b29 100644 --- a/samples/ironside_se/secondary_boot_trigger_lockup/sysbuild/uicr.conf +++ b/samples/ironside_se/secondary_boot_trigger_lockup/sysbuild/uicr.conf @@ -1,6 +1,8 @@ # Copyright (c) 2025 Nordic Semiconductor ASA # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +CONFIG_IS_GEN_UICR_IMAGE=y + # Configuration overlay for uicr image # Enable UICR.SECONDARY with automatic trigger on APPLICATIONLOCKUP CONFIG_GEN_UICR_SECONDARY=y diff --git a/samples/matter/light_bulb/README.rst b/samples/matter/light_bulb/README.rst index 19d84598fb6d..3eb283ccca87 100644 --- a/samples/matter/light_bulb/README.rst +++ b/samples/matter/light_bulb/README.rst @@ -39,7 +39,7 @@ IPv6 network support The development kits for this sample offer the following IPv6 network support for Matter: -* Matter over Thread is supported for ``nrf52840dk/nrf52840``, ``nrf5340dk/nrf5340/cpuapp``, ``nrf21540dk/nrf52840``, ``nrf54l15dk/nrf54l15/cpuapp`` and ``nrf54lm20dk/nrf54lm20a/cpuapp``. +* Matter over Thread is supported for ``nrf52840dk/nrf52840``, ``nrf5340dk/nrf5340/cpuapp``, ``nrf21540dk/nrf52840``, ``nrf54l15dk/nrf54l15/cpuapp``, and ``nrf54lm20dk/nrf54lm20a/cpuapp``. * Matter over Wi-Fi is supported for ``nrf5340dk/nrf5340/cpuapp`` with the ``nrf7002ek`` shield attached, ``nrf7002dk/nrf5340/cpuapp``, or ``nrf54lm20dk/nrf54lm20a/cpuapp`` with the ``nrf7002eb2`` shield attached. Overview diff --git a/samples/matter/light_switch/README.rst b/samples/matter/light_switch/README.rst index 737a679887f8..4a4cafed3b31 100644 --- a/samples/matter/light_switch/README.rst +++ b/samples/matter/light_switch/README.rst @@ -43,7 +43,7 @@ IPv6 network support The development kits for this sample offer the following IPv6 network support for Matter: -* Matter over Thread is supported for ``nrf52840dk/nrf52840``, ``nrf5340dk/nrf5340/cpuapp``, ``nrf21540dk/nrf52840``, ``nrf54l15dk/nrf54l15/cpuapp`` and ``nrf54lm20dk/nrf54lm20a/cpuapp``. +* Matter over Thread is supported for ``nrf52840dk/nrf52840``, ``nrf5340dk/nrf5340/cpuapp``, ``nrf21540dk/nrf52840``, ``nrf54l15dk/nrf54l15/cpuapp``, and ``nrf54lm20dk/nrf54lm20a/cpuapp``. * Matter over Wi-Fi is supported for ``nrf5340dk/nrf5340/cpuapp`` with the ``nrf7002ek`` shield attached, ``nrf7002dk/nrf5340/cpuapp``, or ``nrf54lm20dk/nrf54lm20a/cpuapp`` with the ``nrf7002eb2`` shield attached. Overview diff --git a/samples/matter/lock/README.rst b/samples/matter/lock/README.rst index a4ed9e735185..e2b3f6ee45ac 100644 --- a/samples/matter/lock/README.rst +++ b/samples/matter/lock/README.rst @@ -43,7 +43,7 @@ IPv6 network support The development kits for this sample offer the following IPv6 network support for Matter: -* Matter over Thread is supported for the ``nrf52840dk/nrf52840``, ``nrf5340dk/nrf5340/cpuapp``, ``nrf21540dk/nrf52840``, ``nrf54l15dk/nrf54l15/cpuapp`` and ``nrf54lm20dk/nrf54lm20a/cpuapp`` board targets. +* Matter over Thread is supported for the ``nrf52840dk/nrf52840``, ``nrf5340dk/nrf5340/cpuapp``, ``nrf21540dk/nrf52840``, ``nrf54l15dk/nrf54l15/cpuapp``, and ``nrf54lm20dk/nrf54lm20a/cpuapp`` board targets. * Matter over Wi-Fi is supported for the ``nrf5340dk/nrf5340/cpuapp`` board target with the ``nrf7002ek`` shield attached, the ``nrf7002dk/nrf5340/cpuapp`` (2.4 GHz and 5 GHz), ``nrf7002dk/nrf5340/cpuapp/nrf7001`` board targets (2.4 GHz only), or the ``nrf54lm20dk/nrf54lm20a/cpuapp`` board target with the ``nrf7002eb2`` shield attached. * :ref:`Switching between Matter over Thread and Matter over Wi-Fi ` is supported for ``nrf5340dk/nrf5340/cpuapp`` with the ``nrf7002ek`` shield attached, using the :ref:`switched Thread and Wi-Fi configuration `. diff --git a/samples/matter/manufacturer_specific/README.rst b/samples/matter/manufacturer_specific/README.rst index 1569c3bd5ab5..53cbc32bfee3 100644 --- a/samples/matter/manufacturer_specific/README.rst +++ b/samples/matter/manufacturer_specific/README.rst @@ -32,7 +32,7 @@ IPv6 network support The development kits for this sample offer the following IPv6 network support for Matter: -* Matter over Thread is supported for the ``nrf52840dk/nrf52840``, ``nrf5340dk/nrf5340/cpuapp``, ``nrf21540dk/nrf52840``, ``nrf54l15dk/nrf54l15/cpuapp``, ``nrf54l15dk/nrf54l10/cpuapp`` and ``nrf54lm20dk/nrf54lm20a/cpuapp`` board targets. +* Matter over Thread is supported for the ``nrf52840dk/nrf52840``, ``nrf5340dk/nrf5340/cpuapp``, ``nrf21540dk/nrf52840``, ``nrf54l15dk/nrf54l15/cpuapp``, ``nrf54l15dk/nrf54l10/cpuapp``, and ``nrf54lm20dk/nrf54lm20a/cpuapp`` board targets. * Matter over Wi-Fi is supported for the ``nrf5340dk/nrf5340/cpuapp`` board target with the ``nrf7002ek`` shield attached, ``nrf7002dk/nrf5340/cpuapp`` board target, or ``nrf54lm20dk/nrf54lm20a/cpuapp`` board target with the ``nrf7002eb2`` shield attached. Overview diff --git a/samples/matter/template/README.rst b/samples/matter/template/README.rst index 22d5450b1f1d..0f6f3f42c769 100644 --- a/samples/matter/template/README.rst +++ b/samples/matter/template/README.rst @@ -32,7 +32,7 @@ IPv6 network support The development kits for this sample offer the following IPv6 network support for Matter: -* Matter over Thread is supported for the ``nrf52840dk/nrf52840``, ``nrf5340dk/nrf5340/cpuapp``, ``nrf21540dk/nrf52840``, ``nrf54l15dk/nrf54l15/cpuapp``, ``nrf54l15dk/nrf54l10/cpuapp`` and ``nrf54lm20dk/nrf54lm20a/cpuapp`` board targets. +* Matter over Thread is supported for the ``nrf52840dk/nrf52840``, ``nrf5340dk/nrf5340/cpuapp``, ``nrf21540dk/nrf52840``, ``nrf54l15dk/nrf54l15/cpuapp``, ``nrf54l15dk/nrf54l10/cpuapp``, and ``nrf54lm20dk/nrf54lm20a/cpuapp`` board targets. * Matter over Wi-Fi is supported for the ``nrf5340dk/nrf5340/cpuapp`` board target with the ``nrf7002ek`` shield attached, ``nrf7002dk/nrf5340/cpuapp`` board target, or ``nrf54lm20dk/nrf54lm20a/cpuapp`` board target with the ``nrf7002eb2`` shield attached. Overview diff --git a/samples/net/https_client/overlay-pdn-nrf91-ipv4.conf b/samples/net/https_client/overlay-pdn-nrf91-ipv4.conf index 2506124827c2..45e1dffe8016 100644 --- a/samples/net/https_client/overlay-pdn-nrf91-ipv4.conf +++ b/samples/net/https_client/overlay-pdn-nrf91-ipv4.conf @@ -4,5 +4,5 @@ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # -CONFIG_PDN_DEFAULTS_OVERRIDE=y -CONFIG_PDN_DEFAULT_FAM_IPV4=y +CONFIG_LTE_LC_PDN_DEFAULTS_OVERRIDE=y +CONFIG_LTE_LC_PDN_DEFAULT_FAM_IPV4=y diff --git a/samples/net/mqtt/src/modules/led/Kconfig.led b/samples/net/mqtt/src/modules/led/Kconfig.led index 7c04bf9e11f0..e2e34666e810 100644 --- a/samples/net/mqtt/src/modules/led/Kconfig.led +++ b/samples/net/mqtt/src/modules/led/Kconfig.led @@ -4,10 +4,18 @@ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # +# Hidden symbol to group conditions +config NRF7002EB2_NRF54L15DK_LED1_CONFLICT + bool + default y if (SHIELD_NRF7002EB2 || SHIELD_NRF7002EB2_NRF7001 || \ + SHIELD_NRF7002EB2_NRF7000) && BOARD_NRF54L15DK + + menuconfig MQTT_SAMPLE_LED bool "LED" + depends on !NRF7002EB2_NRF54L15DK_LED1_CONFLICT select LED - default y if !BOARD_NATIVE_SIM + default y if !BOARD_NATIVE_SIM && !NRF7002EB2_NRF54L15DK_LED1_CONFLICT if MQTT_SAMPLE_LED diff --git a/samples/nrf5340/empty_app_core/README.rst b/samples/nrf5340/empty_app_core/README.rst index f38ee44743f0..faf7da224ad3 100644 --- a/samples/nrf5340/empty_app_core/README.rst +++ b/samples/nrf5340/empty_app_core/README.rst @@ -55,10 +55,10 @@ Dependencies This sample has the following `nrfx`_ dependencies: -* ``nrfx/nrfx.h`` +* :file:`nrfx/nrfx.h` In addition, it uses the following Zephyr libraries: * :ref:`zephyr:kernel_api`: - * ``include/init.h`` + * :file:`include/init.h` diff --git a/samples/nrf54h20/idle_relocated_tcm/CMakeLists.txt b/samples/nrf54h20/idle_relocated_tcm/CMakeLists.txt new file mode 100644 index 000000000000..163cfe990a2f --- /dev/null +++ b/samples/nrf54h20/idle_relocated_tcm/CMakeLists.txt @@ -0,0 +1,19 @@ +# +# Copyright (c) 2025 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +cmake_minimum_required(VERSION 3.20.0) + +find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) + +if(NOT SYSBUILD) + message(FATAL_ERROR + " This is a multi-image application that should be built using sysbuild.\n" + " Add --sysbuild argument to west build command to prepare all the images.") +endif() + +project(idle_relocated_tcm) + +target_sources(app PRIVATE src/main.c) diff --git a/samples/nrf54h20/idle_relocated_tcm/Kconfig.sysbuild b/samples/nrf54h20/idle_relocated_tcm/Kconfig.sysbuild new file mode 100644 index 000000000000..00421a021359 --- /dev/null +++ b/samples/nrf54h20/idle_relocated_tcm/Kconfig.sysbuild @@ -0,0 +1,23 @@ +# +# Copyright (c) 2025 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +choice NETCORE + default NETCORE_REMOTE + +config NETCORE_REMOTE + bool "Remote radio" + help + Use remote radio. + +endchoice + +config NETCORE_IMAGE_NAME + default "remote" if NETCORE_REMOTE + +config NETCORE_IMAGE_PATH + default "$(ZEPHYR_NRF_MODULE_DIR)/samples/nrf54h20/idle_relocated_tcm/remote" if NETCORE_REMOTE + +source "share/sysbuild/Kconfig" diff --git a/samples/nrf54h20/idle_relocated_tcm/README.rst b/samples/nrf54h20/idle_relocated_tcm/README.rst new file mode 100644 index 000000000000..6a4197d0b2ce --- /dev/null +++ b/samples/nrf54h20/idle_relocated_tcm/README.rst @@ -0,0 +1,273 @@ +.. _idle_relocated_tcm_sample: + +Multicore idle test with firmware relocated to radio core TCM +############################################################# + +.. contents:: + :local: + :depth: 2 + +The test benchmarks the idle behavior of an application that runs on multiple cores. +It demonstrates a radio loader pattern where the radio core firmware is loaded from MRAM into Tightly Coupled Memory (TCM) at runtime. + +Requirements +************ + +The test supports the following development kit: + +.. table-from-rows:: /includes/sample_board_rows.txt + :header: heading + :rows: nrf54h20dk_nrf54h20_cpuapp + +Overview +******** + +This test demonstrates how to build a multicore idle application with :ref:`configuration_system_overview_sysbuild` using a two-stage boot process for the radio core: + +* Radio Loader - A small bootloader that runs on the radio core, copies firmware from MRAM to TCM, and jumps to it. +* Remote Firmware - The actual application that runs from TCM after being loaded. + +The test automatically relocates the remote firmware binary to the correct MRAM address during build time, ensuring it can be loaded by the radio loader. + +Architecture +============ + +The system uses the memory layout compatible with the MCUboot bootloader. +By default, the system uses the MCUboot in the direct-xip mode in the merged slot configuration (no file suffix used). +To configure the system to use the MCUboot in the direct-xip mode in the split slot configuration, build the test with the ``split_slot`` file suffix. + +Memory map configuration +======================== + +The memory maps are defined in the :file:`common` directory and are shared between all images to ensure consistency. + +The following changes are included in the project overlay files: + +.. tabs:: + + .. group-tab:: Merged slot configuration + + 1. Entire Radio TCM RAM region is used for the remote firmware (:file:`common/memory_map_ram_cpurad.dtsi`). + #. A small part of Global RAM is used for the radio loader for the firmware relocation time (:file:`common/memory_map.dtsi`). + #. The MRAM is partitioned for the MCUboot, application, and radio core images (:file:`common/memory_map.dtsi`). + + .. group-tab:: Split slot configuration + + 1. Entire Radio TCM RAM region is used for the remote firmware (:file:`common/memory_map_ram_cpurad.dtsi`). + #. A small part of Global RAM is used for the radio loader for the firmware relocation time (:file:`common/memory_map_split_slot.dtsi`). + #. The MRAM is partitioned for the MCUboot, application, and radio core images (:file:`common/memory_map_split_slot.dtsi`). + #. The ``pm_ramfunc`` DTS node is relocated to the end of the RAM block but before the MCUboot trailer (:file:`common/memory_map_ram_pm_cpurad.dtsi`) to make the image link properly. + +Enabling the Radio Loader +************************* + +The radio loader is automatically added to the build when you enable it in sysbuild configuration. + +Set the :kconfig:option:`SB_CONFIG_NRF_RADIO_LOADER` Kconfig option to ``y`` in the :file:`sysbuild.conf` file. +This single configuration option automatically adds the ``radio_loader`` application located in the :file:`nrf/samples/nrf54h20/radio_loader` folder and builds it for the CPURAD core. +No manual ``ExternalZephyrProject_Add()`` is needed in sysbuild. + +You must provide the DTS overlay file for the radio loader that includes the following DTS node labels: + +* ``cpurad_slot0_partition`` - The primary slot of the radio loader code. +* ``cpurad_slot1_partition`` - The secondary slot of the radio loader code. +* ``cpurad_slot2_partition`` - The primary slot of the remote firmware code to be relocated to TCM. +* ``cpurad_slot3_partition`` - The secondary slot of the remote firmware code to be relocated to TCM. +* ``cpurad_ram0`` - The radio core TCM RAM region to be used for the remote firmware. + +Automatic firmware relocation +***************************** + +The remote firmware is linked against the target memory partition (TCM) and must be relocated to match the MRAM partition address where it will be initially stored. +This is automatically done by the :kconfig:option:`CONFIG_BUILD_OUTPUT_ADJUST_LMA` Kconfig option when the devicetree chosen nodes are configured correctly. + +How it works +============ + +Firmware relocation is handled automatically by Zephyr's build system using the :kconfig:option:`CONFIG_BUILD_OUTPUT_ADJUST_LMA` Kconfig option, which is configured in the :file:`nrf/soc/nordic/nrf54h/Kconfig.defconfig.nrf54h20_cpurad` file for all nRF54H20 CPURAD projects. + +The configuration automatically detects if the :kconfig:option:`CONFIG_XIP` is enabled in the remote firmware project. +When this option is enabled, the remote firmware runs directly from the ``zephyr,code-partition`` location and no relocation is needed. +When this option is disabled, the remote firmware will run from the ``zephyr,sram`` location but the image is first stored in the MRAM in the ``zephyr,code-partition`` location. +The build system calculates the LMA adjustment to relocate the firmware from TCM to MRAM. + +Zephyr automatically calculates the Load Memory Address (LMA) adjustment based on the chosen nodes: + +.. code-block:: text + + LMA_adjustment = zephyr,code-partition address - zephyr,sram address + +The build system adjusts the hex file so that the code is loaded from MRAM (``0xe000000`` address space), but runs from TCM (``0x23000000`` address space). + +Configuration of remote radio firmware +====================================== + +To use the radio loader pattern, you must configure the remote radio firmware in the following way: + +* Disable the :kconfig:option:`CONFIG_XIP` option in the remote firmware project. +* Assign the TCM RAM region to the remote firmware code using the ``zephyr,sram`` chosen node. +* Assign the MRAM partition to the remote firmware code using the ``zephyr,code-partition`` chosen node. + +Building and running +******************** + +.. |test path| replace:: :file:`samples/nrf54h20/idle_relocated_tcm` + +.. include:: /includes/build_and_run_test.txt + +Testing +======= + +After programming the test to your development kit, complete the following steps to test it: + +1. |connect_terminal| +#. Reset the kit. +#. Observe the console output for both cores: + + .. tabs:: + + .. group-tab:: Merged slot configuration + + * For the application core, the output should be as follows: + + .. code-block:: console + + *** Booting MCUboot v2.3.0-dev-0d9411f5dda3 *** + *** Using nRF Connect SDK v3.1.99-329079d0237c *** + *** Using Zephyr OS v4.2.99-56fbb4f3c7bb *** + I: Starting Direct-XIP bootloader + I: Primary slot: version=0.0.0+0 + I: Image 0 Secondary slot: Image not found + I: Image 0 loaded from the primary slot + I: Bootloader chainload address offset: 0x40000 + I: Image version: v0.0.0 + I: Jumping to the image slot + *** Booting nRF Connect SDK v3.1.99-329079d0237c *** + *** Using Zephyr OS v4.2.99-56fbb4f3c7bb *** + [00:00:00.336,735] idle: Multicore idle test on nrf54h20dk@0.9.0/nrf54h20/cpuapp + [00:00:00.336,742] idle: build time: Dec 2 2025 08:52:18 + [00:00:00.336,745] idle: Multicore idle test iteration 0 + [00:00:02.336,834] idle: Multicore idle test iteration 1 + ... + + * For the radio core, the output should be as follows: + + .. code-block:: console + + *** Booting nRF Connect SDK v3.1.99-329079d0237c *** + *** Using Zephyr OS v4.2.99-56fbb4f3c7bb *** + [00:00:00.512,002] idle: Multicore idle test on nrf54h20dk@0.9.0/nrf54h20/cpurad + [00:00:00.512,004] idle: Original code partition start address: 0xe094000 + [00:00:00.512,006] idle: Running from the SRAM, start address: 0x23000000, size: 0x30000 + [00:00:00.512,007] idle: Current PC (program counter) address: 0x23000a90 + [00:00:00.512,009] idle: build time: Dec 2 2025 08:52:24 + [00:00:00.512,012] idle: Multicore idle test iteration 0 + [00:00:02.512,072] idle: Multicore idle test iteration 1 + ... + + .. group-tab:: Split slot configuration + + * For the application core, the output should be as follows: + + .. code-block:: console + + *** Booting MCUboot v2.3.0-dev-0d9411f5dda3 *** + *** Using nRF Connect SDK v3.1.99-b9ff3eff5eb7 *** + *** Using Zephyr OS v4.2.99-56fbb4f3c7bb *** + I: Starting Direct-XIP bootloader + I: Primary slot: version=0.0.0+0 + I: Image 0 Secondary slot: Image not found + I: Primary slot: version=0.0.0+0 + I: Image 1 Secondary slot: Image not found + I: Primary slot: version=0.0.0+0 + I: Image 2 Secondary slot: Image not found + I: Loading image 0 from slot 0 + I: bootutil_img_validate: slot 0 manifest verified + I: Try to validate images using manifest in slot 0 + I: Loading image 1 from slot 0 + I: Loading image 2 from slot 0 + I: Image 0 loaded from the primary slot + I: Image 1 loaded from the primary slot + I: Image 2 loaded from the primary slot + I: Bootloader chainload address offset: 0x40000 + I: Image version: v0.0.0 + I: Jumping to the image slot + *** Booting nRF Connect SDK v3.1.99-b9ff3eff5eb7 *** + *** Using Zephyr OS v4.2.99-56fbb4f3c7bb *** + [00:00:00.116,189] idle: Multicore idle test on nrf54h20dk@0.9.0/nrf54h20/cpuapp + [00:00:00.116,196] idle: build time: Dec 2 2025 09:01:59 + [00:00:00.116,198] idle: Multicore idle test iteration 0 + [00:00:02.116,271] idle: Multicore idle test iteration 1 + ... + + * For the radio core, the output should be as follows: + + .. code-block:: console + + *** Booting nRF Connect SDK v3.1.99-b9ff3eff5eb7 *** + *** Using Zephyr OS v4.2.99-56fbb4f3c7bb *** + [00:00:00.291,381] idle: Multicore idle test on nrf54h20dk@0.9.0/nrf54h20/cpurad + [00:00:00.291,383] idle: Original code partition start address: 0xe096000 + [00:00:00.291,385] idle: Running from the SRAM, start address: 0x23000000, size: 0x30000 + [00:00:00.291,386] idle: Current PC (program counter) address: 0x23001290 + [00:00:00.291,388] idle: build time: Dec 2 2025 09:01:44 + [00:00:00.291,391] idle: Multicore idle test iteration 0 + [00:00:02.291,443] idle: Multicore idle test iteration 1 + ... + + The radio loader first loads the firmware from MRAM to TCM and then jumps to the loaded firmware. + This process is transparent and happens during the early boot stage. + +#. Verify the DFU process: + + a. Build the firmware for the secondary app slot, increase the version number in the :file:`prj.conf` file (uncomment the line): + + .. code-block:: kconfig + + CONFIG_MCUBOOT_IMGTOOL_SIGN_VERSION="0.0.1+0" + + #. Build the firmware: + + .. tabs:: + + .. group-tab:: Merged slot configuration + + .. code-block:: console + + west build -p -b nrf54h20dk/nrf54h20/cpuapp + + .. group-tab:: Split slot configuration + + .. code-block:: console + + west build -p -b nrf54h20dk/nrf54h20/cpuapp -- -DFILE_SUFFIX=split_slot + + #. Program the firmware to the secondary application slot: + + .. tabs:: + + .. group-tab:: Merged slot configuration + + .. code-block:: console + + nrfutil device program --firmware build/zephyr_secondary_app.merged.hex --options chip_erase_mode=ERASE_NONE + + .. group-tab:: Split slot configuration + + .. code-block:: console + + nrfutil device program --firmware build/mcuboot_secondary_app/zephyr/zephyr.signed.hex --options chip_erase_mode=ERASE_NONE + nrfutil device program --firmware build/radio_loader_secondary_app/zephyr/zephyr.signed.hex --options chip_erase_mode=ERASE_NONE + nrfutil device program --firmware build/remote_rad_secondary_app/zephyr/zephyr.signed.hex --options chip_erase_mode=ERASE_NONE + + #. Reset the development kit. + + .. code-block:: console + + nrfutil device reset + + #. Observe the following changes in the console output: + + * The application core boots from the secondary application slot. + * The radio core boots from the secondary radio slot. + * The build time changes. diff --git a/samples/nrf54h20/idle_relocated_tcm/app.overlay b/samples/nrf54h20/idle_relocated_tcm/app.overlay new file mode 100644 index 000000000000..dc561921d6e8 --- /dev/null +++ b/samples/nrf54h20/idle_relocated_tcm/app.overlay @@ -0,0 +1,13 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include "common/memory_map.dtsi" + +&cpuapp_data { + reg = <0x2f000000 0x39000>; +}; + +secondary_app_partition: &cpuapp_slot1_partition {}; diff --git a/samples/nrf54h20/idle_relocated_tcm/app_split_slot.overlay b/samples/nrf54h20/idle_relocated_tcm/app_split_slot.overlay new file mode 100644 index 000000000000..8e20296a9d4d --- /dev/null +++ b/samples/nrf54h20/idle_relocated_tcm/app_split_slot.overlay @@ -0,0 +1,13 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include "common/memory_map_split_slot.dtsi" + +&cpuapp_data { + reg = <0x2f000000 0x39000>; +}; + +secondary_app_partition: &cpuapp_slot1_partition {}; diff --git a/samples/nrf54h20/idle_relocated_tcm/common/memory_map.dtsi b/samples/nrf54h20/idle_relocated_tcm/common/memory_map.dtsi new file mode 100644 index 000000000000..049033626837 --- /dev/null +++ b/samples/nrf54h20/idle_relocated_tcm/common/memory_map.dtsi @@ -0,0 +1,147 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/ { + soc { + /* Small piece of Global RAM for the radio loader to use during FW relocation. */ + cpurad_loader_ram: sram@2f039000 { + compatible = "mmio-sram"; + reg = <0x2f039000 0x1000>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x2f039000 0x1000>; + }; + }; +}; + +&mram1x { + /delete-node/ partitions; + + /* Redefine the "partitions" DTS node. */ + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + cpuapp_boot_partition: boot_partition: partition@30000 { + reg = <0x30000 0x10000>; + label = "mcuboot"; + }; + + /* Image 0, slot 0 (primary slot): merged application and radio core images. */ + slot0_partition: partition@40000 { + reg = <0x40000 DT_SIZE_K(656)>; + }; + + /* Application code for cpuapp core. */ + cpuapp_slot0_partition: partition@40800 { + label = "image-0"; + reg = <0x40800 DT_SIZE_K(326)>; + }; + + /* Radio core firmware loader code for cpurad core. */ + cpurad_slot0_partition: cpurad_loader_partition: partition@92000 { + label = "cpurad_loader_partition"; + reg = <0x92000 DT_SIZE_K(8)>; /* 8 KB allocated (~4 KB actual) */ + }; + + /* Radio core application code initially stored in MRAM that will be loaded to TCM + * by radio loader for cpurad core. + */ + cpurad_slot2_partition: cpurad_loaded_fw: partition@94000 { + label = "cpurad_loaded_fw"; + reg = <0x94000 DT_SIZE_K(192)>; + }; + + /* Remaining space in the slot 0. */ + cpurad_slot0_partition_container: partition@c4000 { + reg = <0xc4000 DT_SIZE_K(128)>; + }; + + cpuppr_code_partition: partition@e4000 { + reg = <0xe4000 DT_SIZE_K(64)>; + }; + + cpuflpr_code_partition: partition@f4000 { + reg = <0xf4000 DT_SIZE_K(48)>; + }; + + /* Image 0, slot 1 (secondary slot): merged application and radio core images. */ + slot1_partition: partition@100000 { + reg = <0x100000 DT_SIZE_K(656)>; + }; + + /* Application code for cpuapp core. */ + cpuapp_slot1_partition: partition@100800 { + reg = <0x100800 DT_SIZE_K(326)>; + }; + + /* Radio core firmware loader code for cpurad core. */ + cpurad_slot1_partition: cpurad_loader_partition_slot1: partition@152000 { + label = "cpurad_loader_partition_slot1"; + reg = <0x152000 DT_SIZE_K(8)>; /* 8 KB allocated (~4 KB actual) */ + }; + + + /* Radio core application code initially stored in MRAM that will be loaded to TCM + * by radio loader for cpurad core. + */ + cpurad_slot3_partition: cpurad_loaded_fw_slot1: partition@154000 { + label = "cpurad_loaded_fw_slot1"; + reg = <0x154000 DT_SIZE_K(192)>; + }; + + /* Remaining space in the slot 1. */ + cpurad_slot1_partition_container: partition@184000 { + reg = <0x184000 DT_SIZE_K(128)>; + }; + + storage_partition: partition@1a4000 { + reg = <0x1a4000 DT_SIZE_K(40)>; + }; + + periphconf_partition: partition@1ae000 { + reg = <0x1ae000 DT_SIZE_K(8)>; + }; + + secondary_partition: partition@1b0000 { + reg = <0x1b0000 DT_SIZE_K(64)>; + }; + + secondary_periphconf_partition: partition@1c0000 { + reg = <0x1c0000 DT_SIZE_K(8)>; + }; + + /* NB: A gap has been left here for future partitions */ + + /* 0x1fd000 was chosen for secure_storage_partition such that + * there is no more space after secure_storage_partition. + */ + secure_storage_partition: partition@1fd000 { + compatible = "fixed-subpartitions"; + reg = <0x1fd000 DT_SIZE_K(12)>; + ranges = <0x0 0x1fd000 0x3000>; + #address-cells = <1>; + #size-cells = <1>; + + cpuapp_crypto_partition: partition@0 { + reg = <0x0 DT_SIZE_K(4)>; + }; + + cpurad_crypto_partition: partition@1000 { + reg = <0x1000 DT_SIZE_K(4)>; + }; + + cpuapp_its_partition: partition@2000 { + reg = <0x2000 DT_SIZE_K(2)>; + }; + + cpurad_its_partition: partition@2800 { + reg = <0x2800 DT_SIZE_K(2)>; + }; + }; + }; +}; diff --git a/samples/nrf54h20/idle_relocated_tcm/common/memory_map_ram_cpurad.dtsi b/samples/nrf54h20/idle_relocated_tcm/common/memory_map_ram_cpurad.dtsi new file mode 100644 index 000000000000..80bce10237d7 --- /dev/null +++ b/samples/nrf54h20/idle_relocated_tcm/common/memory_map_ram_cpurad.dtsi @@ -0,0 +1,13 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/* Use the whole TCM region for the remote firmware. */ +&cpurad_ram0 { + compatible = "mmio-sram"; + /delete-property/ reg; + reg = <0x23000000 0x30000>; + ranges = <0x0 0x23000000 0x30000>; +}; diff --git a/samples/nrf54h20/idle_relocated_tcm/common/memory_map_ram_pm_cpurad.dtsi b/samples/nrf54h20/idle_relocated_tcm/common/memory_map_ram_pm_cpurad.dtsi new file mode 100644 index 000000000000..09e14db3acda --- /dev/null +++ b/samples/nrf54h20/idle_relocated_tcm/common/memory_map_ram_pm_cpurad.dtsi @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/* Power Management relocates the key functions to TCM under the address + * from the pm_ramfunc DTS node. + * It is done at the zephyr/soc/nordic/nrf54h/CMakeLists.txt file. + * Theoretically it would not be necessary to relocate it if the whole code is in TCM. + * The changes in Zephyr would be required to allow it. + * As a workaround, relocate the pm_ramfunc to the end of the RAM block but before + * the MCUboot trailer. + */ +/delete-node/ &pm_ramfunc; + +/ { + soc { + /* cache control functions - must be executed from RAM */ + pm_ramfunc: cpurad_s2ram@2302df40 { + compatible = "zephyr,memory-region", "mmio-sram"; + reg = <0x2302df40 192>; + zephyr,memory-region = "PMLocalRamfunc"; + }; + }; +}; diff --git a/samples/nrf54h20/idle_relocated_tcm/common/memory_map_split_slot.dtsi b/samples/nrf54h20/idle_relocated_tcm/common/memory_map_split_slot.dtsi new file mode 100644 index 000000000000..e270df2cc335 --- /dev/null +++ b/samples/nrf54h20/idle_relocated_tcm/common/memory_map_split_slot.dtsi @@ -0,0 +1,135 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/ { + soc { + /* Small piece of Global RAM for the radio loader to use during FW relocation. */ + cpurad_loader_ram: sram@2f039000 { + compatible = "mmio-sram"; + reg = <0x2f039000 0x1000>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x2f039000 0x1000>; + }; + }; +}; + +&mram1x { + /delete-node/ partitions; + + /* Redefine the "partitions" DTS node. */ + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + cpuapp_boot_partition: boot_partition: partition@30000 { + label = "mcuboot"; + reg = <0x30000 0x10000>; + }; + + /* Image 0, slot 0 (primary slot) - Application code for cpuapp core. */ + slot0_partition: cpuapp_slot0_partition: partition@40000 { + reg = <0x40000 DT_SIZE_K(326)>; + }; + + /* Image 2, slot 0 (primary slot) - radio loader code for cpurad core. */ + slot4_partition: cpurad_slot0_partition: cpurad_loader_partition: + partition@92000 { + label = "cpurad_loader_partition"; + reg = <0x92000 DT_SIZE_K(16)>; + /* size: radio loader + 2KB trailer MCUboot + * (imgtool assumes that the swap mode is used always) + */ + }; + + /* Image 1, slot 0 (primary slot) - radio core application code initially stored + * in MRAM that will be loaded to TCM by radio loader for cpurad core. + */ + slot2_partition: cpurad_slot2_partition: cpurad_loaded_fw: partition@96000 { + label = "cpurad_loaded_fw"; + reg = <0x96000 (DT_SIZE_K(192))>; + /* size: application + 192B for s2ram + 2KB trailer MCUboot */ + }; + + cpuppr_code_partition: partition@e4000 { + reg = <0xe4000 DT_SIZE_K(64)>; + }; + + cpuflpr_code_partition: partition@f4000 { + reg = <0xf4000 DT_SIZE_K(48)>; + }; + + /* Image 0, slot 1 (secondary slot) - Application code for cpuapp core. */ + slot1_partition: cpuapp_slot1_partition: partition@100000 { + reg = <0x100000 DT_SIZE_K(326)>; + }; + + /* Image 2, slot 1 (secondary slot) - radio loader code for cpurad core. */ + slot5_partition: cpurad_slot1_partition: cpurad_loader_partition_slot1: + partition@152000 { + label = "cpurad_loader_partition_slot1"; + reg = <0x152000 DT_SIZE_K(16)>; + /* size: radio loader + 2KB trailer MCUboot + * (imgtool assumes that the swap mode is used always) + */ + }; + + /* Image 1, slot 1 (secondary slot) - radio core application code initially stored + * in MRAM that will be loaded to TCM by radio loader for cpurad core. + */ + slot3_partition: cpurad_slot3_partition: cpurad_loaded_fw_slot1: partition@156000 { + label = "cpurad_loaded_fw_slot1"; + reg = <0x156000 (DT_SIZE_K(192))>; + /* size: application + 192B for s2ram + 2KB trailer MCUboot */ + }; + + storage_partition: partition@1a4000 { + reg = <0x1a4000 DT_SIZE_K(40)>; + }; + + periphconf_partition: partition@1ae000 { + reg = <0x1ae000 DT_SIZE_K(8)>; + }; + + secondary_partition: partition@1b0000 { + reg = <0x1b0000 DT_SIZE_K(64)>; + }; + + secondary_periphconf_partition: partition@1c0000 { + reg = <0x1c0000 DT_SIZE_K(8)>; + }; + + /* NB: A gap has been left here for future partitions */ + + /* 0x1fd000 was chosen for secure_storage_partition such that + * there is no more space after secure_storage_partition. + */ + secure_storage_partition: partition@1fd000 { + compatible = "fixed-subpartitions"; + reg = <0x1fd000 DT_SIZE_K(12)>; + ranges = <0x0 0x1fd000 0x3000>; + #address-cells = <1>; + #size-cells = <1>; + + cpuapp_crypto_partition: partition@0 { + reg = <0x0 DT_SIZE_K(4)>; + }; + + cpurad_crypto_partition: partition@1000 { + reg = <0x1000 DT_SIZE_K(4)>; + }; + + cpuapp_its_partition: partition@2000 { + reg = <0x2000 DT_SIZE_K(2)>; + }; + + cpurad_its_partition: partition@2800 { + reg = <0x2800 DT_SIZE_K(2)>; + }; + }; + }; +}; diff --git a/samples/nrf54h20/idle_relocated_tcm/prj.conf b/samples/nrf54h20/idle_relocated_tcm/prj.conf new file mode 100644 index 000000000000..d8e41511b6f7 --- /dev/null +++ b/samples/nrf54h20/idle_relocated_tcm/prj.conf @@ -0,0 +1,12 @@ +# +# Copyright (c) 2025 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_LOG=y + +CONFIG_SOC_NRF54H20_CPURAD_ENABLE=y + +# Set the version number for the firmware to verify dfu process +#CONFIG_MCUBOOT_IMGTOOL_SIGN_VERSION="0.0.1+0" diff --git a/samples/zephyr/subsys/settings/CMakeLists.txt b/samples/nrf54h20/idle_relocated_tcm/remote/CMakeLists.txt similarity index 66% rename from samples/zephyr/subsys/settings/CMakeLists.txt rename to samples/nrf54h20/idle_relocated_tcm/remote/CMakeLists.txt index 32b6271e57b1..81220c38da13 100644 --- a/samples/zephyr/subsys/settings/CMakeLists.txt +++ b/samples/nrf54h20/idle_relocated_tcm/remote/CMakeLists.txt @@ -5,7 +5,9 @@ # cmake_minimum_required(VERSION 3.20.0) + find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) -project(settings_sample) -target_sources(app PRIVATE ${ZEPHYR_BASE}/samples/subsys/settings/src/main.c) +project(idle_relocated_tcm_remote) + +target_sources(app PRIVATE src/main.c) diff --git a/samples/nrf54h20/idle_relocated_tcm/remote/prj.conf b/samples/nrf54h20/idle_relocated_tcm/remote/prj.conf new file mode 100644 index 000000000000..be2e7240bd9b --- /dev/null +++ b/samples/nrf54h20/idle_relocated_tcm/remote/prj.conf @@ -0,0 +1,9 @@ +# +# Copyright (c) 2025 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_LOG=y + +CONFIG_XIP=n diff --git a/samples/nrf54h20/idle_relocated_tcm/remote/src/main.c b/samples/nrf54h20/idle_relocated_tcm/remote/src/main.c new file mode 100644 index 000000000000..c07d05bdc87b --- /dev/null +++ b/samples/nrf54h20/idle_relocated_tcm/remote/src/main.c @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include + +LOG_MODULE_REGISTER(idle); + +#define CODE_PARTITION_NODE DT_CHOSEN(zephyr_code_partition) +#define CODE_PARTITION_START_ADDR DT_FIXED_PARTITION_ADDR(CODE_PARTITION_NODE) + +#define SRAM_NODE DT_CHOSEN(zephyr_sram) +#define SRAM_START_ADDR DT_REG_ADDR(SRAM_NODE) +#define SRAM_SIZE DT_REG_SIZE(SRAM_NODE) + +int main(void) +{ + unsigned int cnt = 0; + uintptr_t pc; + + __asm__ volatile("adr %0, ." : "=r"(pc)); + LOG_INF("Multicore idle test on %s", CONFIG_BOARD_TARGET); + LOG_INF("Original code partition start address: 0x%lx", + (unsigned long)CODE_PARTITION_START_ADDR); + LOG_INF("Running from the SRAM, start address: 0x%lx, size: 0x%lx", + (unsigned long)SRAM_START_ADDR, (unsigned long)SRAM_SIZE); + LOG_INF("Current PC (program counter) address: 0x%lx", (unsigned long)pc); + + /* Using __TIME__ ensure that a new binary will be built on every + * compile which is convenient when testing firmware upgrade. + */ + LOG_INF("build time: " __DATE__ " " __TIME__); + + while (1) { + LOG_INF("Multicore idle test iteration %u", cnt++); + k_msleep(2000); + } + + return 0; +} diff --git a/samples/nrf54h20/idle_relocated_tcm/src/main.c b/samples/nrf54h20/idle_relocated_tcm/src/main.c new file mode 100644 index 000000000000..7acdf97ffb5d --- /dev/null +++ b/samples/nrf54h20/idle_relocated_tcm/src/main.c @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include + +LOG_MODULE_REGISTER(idle); + +int main(void) +{ + unsigned int cnt = 0; + + LOG_INF("Multicore idle test on %s", CONFIG_BOARD_TARGET); + + /* Using __TIME__ ensure that a new binary will be built on every + * compile which is convenient when testing firmware upgrade. + */ + LOG_INF("build time: " __DATE__ " " __TIME__); + + while (1) { + LOG_INF("Multicore idle test iteration %u", cnt++); + k_msleep(2000); + } + + return 0; +} diff --git a/samples/nrf54h20/idle_relocated_tcm/sysbuild.conf b/samples/nrf54h20/idle_relocated_tcm/sysbuild.conf new file mode 100644 index 000000000000..0546bdd7dd2f --- /dev/null +++ b/samples/nrf54h20/idle_relocated_tcm/sysbuild.conf @@ -0,0 +1,16 @@ +# +# Copyright (c) 2025 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# This automatically adds the radio_loader application to the build +SB_CONFIG_NRF_RADIO_LOADER=y +SB_CONFIG_NETCORE_REMOTE=y + +SB_CONFIG_BOOTLOADER_MCUBOOT=y +SB_CONFIG_MCUBOOT_MODE_DIRECT_XIP=y +SB_CONFIG_BOOT_SIGNATURE_TYPE_ED25519=y +SB_CONFIG_BOOT_SIGNATURE_TYPE_PURE=y +# Reserve space for MCUboot trailer in CPURAD slots +SB_CONFIG_MCUBOOT_IMAGES_ROM_END_OFFSET_AUTO="remote;remote_secondary_app" diff --git a/samples/nrf54h20/idle_relocated_tcm/sysbuild/mcuboot.overlay b/samples/nrf54h20/idle_relocated_tcm/sysbuild/mcuboot.overlay new file mode 100644 index 000000000000..844690c2f623 --- /dev/null +++ b/samples/nrf54h20/idle_relocated_tcm/sysbuild/mcuboot.overlay @@ -0,0 +1,13 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include "../common/memory_map.dtsi" + +/ { + chosen { + zephyr,code-partition = &boot_partition; + }; +}; diff --git a/samples/nrf54h20/idle_relocated_tcm/sysbuild/mcuboot_split_slot.conf b/samples/nrf54h20/idle_relocated_tcm/sysbuild/mcuboot_split_slot.conf new file mode 100644 index 000000000000..f1caef92309b --- /dev/null +++ b/samples/nrf54h20/idle_relocated_tcm/sysbuild/mcuboot_split_slot.conf @@ -0,0 +1,8 @@ +# +# Copyright (c) 2025 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_NRF_SECURITY=y +CONFIG_MULTITHREADING=y diff --git a/samples/nrf54h20/idle_relocated_tcm/sysbuild/mcuboot_split_slot.overlay b/samples/nrf54h20/idle_relocated_tcm/sysbuild/mcuboot_split_slot.overlay new file mode 100644 index 000000000000..096d587025eb --- /dev/null +++ b/samples/nrf54h20/idle_relocated_tcm/sysbuild/mcuboot_split_slot.overlay @@ -0,0 +1,13 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include "../common/memory_map_split_slot.dtsi" + +/ { + chosen { + zephyr,code-partition = &boot_partition; + }; +}; diff --git a/samples/nrf54h20/idle_relocated_tcm/sysbuild/radio_loader.overlay b/samples/nrf54h20/idle_relocated_tcm/sysbuild/radio_loader.overlay new file mode 100644 index 000000000000..94a04c7ec65e --- /dev/null +++ b/samples/nrf54h20/idle_relocated_tcm/sysbuild/radio_loader.overlay @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include "../common/memory_map.dtsi" +#include "../common/memory_map_ram_cpurad.dtsi" + +/{ + chosen { + zephyr,code-partition = &cpurad_loader_partition; + zephyr,sram = &cpurad_loader_ram; + }; +}; + +secondary_app_partition: &cpurad_loader_partition_slot1 {}; diff --git a/samples/nrf54h20/idle_relocated_tcm/sysbuild/radio_loader_split_slot.overlay b/samples/nrf54h20/idle_relocated_tcm/sysbuild/radio_loader_split_slot.overlay new file mode 100644 index 000000000000..028f915a2c12 --- /dev/null +++ b/samples/nrf54h20/idle_relocated_tcm/sysbuild/radio_loader_split_slot.overlay @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include "../common/memory_map_split_slot.dtsi" +#include "../common/memory_map_ram_cpurad.dtsi" + +/{ + chosen { + zephyr,code-partition = &cpurad_loader_partition; + zephyr,sram = &cpurad_loader_ram; + }; +}; + +secondary_app_partition: &cpurad_loader_partition_slot1 {}; diff --git a/samples/nrf54h20/idle_relocated_tcm/sysbuild/remote.overlay b/samples/nrf54h20/idle_relocated_tcm/sysbuild/remote.overlay new file mode 100644 index 000000000000..1e64044d384c --- /dev/null +++ b/samples/nrf54h20/idle_relocated_tcm/sysbuild/remote.overlay @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include "../common/memory_map.dtsi" +#include "../common/memory_map_ram_cpurad.dtsi" + +/{ + chosen { + zephyr,code-partition = &cpurad_loaded_fw; + zephyr,sram = &cpurad_ram0; + }; +}; + +secondary_app_partition: &cpurad_loaded_fw_slot1 {}; diff --git a/samples/nrf54h20/idle_relocated_tcm/sysbuild/remote_split_slot.overlay b/samples/nrf54h20/idle_relocated_tcm/sysbuild/remote_split_slot.overlay new file mode 100644 index 000000000000..795813aa927e --- /dev/null +++ b/samples/nrf54h20/idle_relocated_tcm/sysbuild/remote_split_slot.overlay @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include "../common/memory_map_split_slot.dtsi" +#include "../common/memory_map_ram_cpurad.dtsi" +#include "../common/memory_map_ram_pm_cpurad.dtsi" + +/{ + chosen { + zephyr,code-partition = &cpurad_loaded_fw; + zephyr,sram = &cpurad_ram0; + }; +}; + +secondary_app_partition: &cpurad_loaded_fw_slot1 {}; diff --git a/samples/nrf54h20/idle_relocated_tcm/sysbuild_split_slot.conf b/samples/nrf54h20/idle_relocated_tcm/sysbuild_split_slot.conf new file mode 100644 index 000000000000..327ab856e235 --- /dev/null +++ b/samples/nrf54h20/idle_relocated_tcm/sysbuild_split_slot.conf @@ -0,0 +1,20 @@ +# +# Copyright (c) 2025 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# This automatically adds the radio_loader application to the build +SB_CONFIG_NRF_RADIO_LOADER=y +SB_CONFIG_NETCORE_REMOTE=y + +SB_CONFIG_BOOTLOADER_MCUBOOT=y +SB_CONFIG_MCUBOOT_MODE_DIRECT_XIP=y +SB_CONFIG_BOOT_SIGNATURE_TYPE_ED25519=y +SB_CONFIG_BOOT_SIGNATURE_TYPE_PURE=y + +# Disable merging of slots -> use separate slots for each image +SB_CONFIG_MCUBOOT_SIGN_MERGED_BINARY=n + +# Enable manifest-based updates +SB_CONFIG_MCUBOOT_MANIFEST_UPDATES=y diff --git a/samples/nrf54h20/idle_relocated_tcm/testcase.yaml b/samples/nrf54h20/idle_relocated_tcm/testcase.yaml new file mode 100644 index 000000000000..76d90466f7c5 --- /dev/null +++ b/samples/nrf54h20/idle_relocated_tcm/testcase.yaml @@ -0,0 +1,28 @@ +common: + sysbuild: true + tags: + - ci_build + - ci_samples_nrf54h20 + harness_config: + type: multi_line + ordered: true + regex: + - "Multicore idle test on" + - "Multicore idle test iteration 0" + - "Multicore idle test iteration 1" + +tests: + benchmarks.multicore.idle_relocated_tcm.nrf54h20dk_cpuapp_cpurad.direct_xip.merged_slot: + harness: console + platform_allow: + - nrf54h20dk/nrf54h20/cpuapp + integration_platforms: + - nrf54h20dk/nrf54h20/cpuapp + benchmarks.multicore.idle_relocated_tcm.nrf54h20dk_cpuapp_cpurad.direct_xip.split_slot: + harness: console + platform_allow: + - nrf54h20dk/nrf54h20/cpuapp + integration_platforms: + - nrf54h20dk/nrf54h20/cpuapp + extra_args: + - FILE_SUFFIX=split_slot diff --git a/samples/nrf54h20/radio_loader/CMakeLists.txt b/samples/nrf54h20/radio_loader/CMakeLists.txt new file mode 100644 index 000000000000..a3b2753538db --- /dev/null +++ b/samples/nrf54h20/radio_loader/CMakeLists.txt @@ -0,0 +1,13 @@ +# +# Copyright (c) 2025 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +cmake_minimum_required(VERSION 3.20.0) + +find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) + +project(radio_loader) + +target_sources(app PRIVATE src/main.c) diff --git a/samples/nrf54h20/radio_loader/app.overlay b/samples/nrf54h20/radio_loader/app.overlay new file mode 100644 index 000000000000..cfbbe44e589d --- /dev/null +++ b/samples/nrf54h20/radio_loader/app.overlay @@ -0,0 +1,14 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/* Use existing node as source partition for demo purposes. */ +&cpuapp_slot0_partition { + reg = <0x92000 DT_SIZE_K(128)>; +}; + +/* Mock the node labels to satisfy the build */ +cpurad_slot2_partition: &cpuapp_slot0_partition {}; +cpurad_slot3_partition: &cpuapp_slot0_partition {}; diff --git a/samples/nrf54h20/radio_loader/prj.conf b/samples/nrf54h20/radio_loader/prj.conf new file mode 100644 index 000000000000..6f57c25fea86 --- /dev/null +++ b/samples/nrf54h20/radio_loader/prj.conf @@ -0,0 +1,94 @@ +# +# Copyright (c) 2025 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# ============================================================================== +# Optimized minimal configuration for radio_loader +# ============================================================================== +# This loader only runs SYS_INIT(load_and_jump_to_firmware, EARLY, 0) which: +# 1. Copies firmware from MRAM to TCM using memcpy() +# 2. Jumps to the loaded firmware's reset handler +# No Zephyr services, threading, or drivers are needed. +# +# Memory footprint target: < 4 KB + +# ============================================================================== +# Power Management +# ============================================================================== +CONFIG_PM=n +CONFIG_PM_DEVICE=n + +# ============================================================================== +# Kernel - Threading Disabled +# ============================================================================== +# We never reach main() or start the scheduler, so disable all threading +CONFIG_MULTITHREADING=n +CONFIG_MAIN_STACK_SIZE=512 +CONFIG_THREAD_STACK_INFO=n + +# Disable kernel features that require threading/scheduler +CONFIG_EVENTS=n +CONFIG_POLL=n +CONFIG_TIMESLICING=n + +# ============================================================================== +# Console, Debug, and Logging +# ============================================================================== +# No console output needed - loader jumps immediately to firmware +CONFIG_CONSOLE=n +CONFIG_UART_CONSOLE=n +CONFIG_SERIAL=n +CONFIG_PRINTK=n +CONFIG_EARLY_CONSOLE=n +CONFIG_LOG=n + +# Banners and debug features +CONFIG_NCS_BOOT_BANNER=n +CONFIG_BOOT_BANNER=n +CONFIG_ERRNO=n + +# ============================================================================== +# Device Drivers +# ============================================================================== +# No peripheral drivers needed - we only use memcpy and jump +CONFIG_GPIO=n +CONFIG_PINCTRL=n +CONFIG_I2C=n +CONFIG_SPI=n +CONFIG_WATCHDOG=n + +# ============================================================================== +# Interrupt Management +# ============================================================================== +CONFIG_DYNAMIC_INTERRUPTS=n +CONFIG_IRQ_OFFLOAD=n +CONFIG_GEN_IRQ_VECTOR_TABLE=n +CONFIG_GEN_ISR_TABLES=n +CONFIG_GEN_SW_ISR_TABLE=n + +# ============================================================================== +# Hardware Protection +# ============================================================================== +CONFIG_HW_STACK_PROTECTION=n +CONFIG_ARM_MPU=n + +# ============================================================================== +# Security and Crypto +# ============================================================================== +# No crypto needed for simple memory copy operation +CONFIG_NRF_SECURITY=n +CONFIG_MBEDTLS_PSA_CRYPTO_C=n +CONFIG_PSA_CRYPTO_DRIVER_OBERON=n +CONFIG_PSA_CRYPTO=n +CONFIG_PSA_SSF_CRYPTO_CLIENT=n + +# ============================================================================== +# Memory Optimization +# ============================================================================== +CONFIG_HEAP_MEM_POOL_SIZE=0 +CONFIG_SYS_HEAP_RUNTIME_STATS=n + +# Use nano printf for minimal footprint (only used if PRINTK somehow gets enabled) +CONFIG_CBPRINTF_NANO=y diff --git a/samples/nrf54h20/radio_loader/src/main.c b/samples/nrf54h20/radio_loader/src/main.c new file mode 100644 index 000000000000..47ff6d76fc1f --- /dev/null +++ b/samples/nrf54h20/radio_loader/src/main.c @@ -0,0 +1,122 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include + +#define FIXED_PARTITION_ADDRESS(label) \ + (DT_REG_ADDR(DT_NODELABEL(label)) + \ + DT_REG_ADDR(COND_CODE_1(DT_FIXED_SUBPARTITION_EXISTS(DT_NODELABEL(label)), \ + (DT_GPARENT(DT_PARENT(DT_NODELABEL(label)))), \ + (DT_GPARENT(DT_NODELABEL(label)))))) + +#define FIXED_PARTITION_SIZE(label) DT_REG_SIZE(DT_NODELABEL(label)) + +#ifdef CONFIG_USE_DT_CODE_PARTITION +#define FLASH_LOAD_OFFSET DT_REG_ADDR(DT_CHOSEN(zephyr_code_partition)) +#elif defined(CONFIG_FLASH_LOAD_OFFSET) +#define FLASH_LOAD_OFFSET CONFIG_FLASH_LOAD_OFFSET +#endif + +#define PARTITION_IS_RUNNING_APP_PARTITION(label) \ + (DT_REG_ADDR(DT_NODELABEL(label)) <= FLASH_LOAD_OFFSET && \ + DT_REG_ADDR(DT_NODELABEL(label)) + DT_REG_SIZE(DT_NODELABEL(label)) > FLASH_LOAD_OFFSET) + +/* Used to determine the running slot of the radio loader. */ +#define RADIO_LOADER_PRIMARY_SLOT cpurad_slot0_partition +#define RADIO_LOADER_SECONDARY_SLOT cpurad_slot1_partition + +/* Used to determine the loaded firmware source address from NVM and size. */ +#define LOADED_FW_PRIMARY_SLOT cpurad_slot2_partition +#define LOADED_FW_SECONDARY_SLOT cpurad_slot3_partition + +/* Used to determine the running slot of the radio core. */ +#define RUNNING_FW_SLOT cpurad_ram0 +#define RUNNING_FW_SLOT_NODE DT_NODELABEL(RUNNING_FW_SLOT) +#define RUNNING_FW_SLOT_ADDR DT_REG_ADDR(RUNNING_FW_SLOT_NODE) +#define RUNNING_FW_SLOT_SIZE DT_REG_SIZE(RUNNING_FW_SLOT_NODE) + +BUILD_ASSERT(DT_NODE_EXISTS(DT_NODELABEL(RADIO_LOADER_PRIMARY_SLOT)), + "Missing nodelabel: cpurad_slot0_partition"); +BUILD_ASSERT(DT_NODE_EXISTS(DT_NODELABEL(RADIO_LOADER_SECONDARY_SLOT)), + "Missing nodelabel: cpurad_slot1_partition"); + +BUILD_ASSERT(DT_NODE_EXISTS(DT_NODELABEL(LOADED_FW_PRIMARY_SLOT)), + "Missing nodelabel: cpurad_slot2_partition"); +BUILD_ASSERT(DT_NODE_EXISTS(DT_NODELABEL(LOADED_FW_SECONDARY_SLOT)), + "Missing nodelabel: cpurad_slot3_partition"); +BUILD_ASSERT((FIXED_PARTITION_SIZE(LOADED_FW_PRIMARY_SLOT) == + FIXED_PARTITION_SIZE(LOADED_FW_SECONDARY_SLOT)), + "LOADED_FW_PRIMARY_SLOT and LOADED_FW_SECONDARY_SLOT sizes are not equal"); + +BUILD_ASSERT(DT_NODE_EXISTS(DT_NODELABEL(RUNNING_FW_SLOT)), + "Missing nodelabel: cpurad_ram0"); +BUILD_ASSERT((FIXED_PARTITION_SIZE(LOADED_FW_PRIMARY_SLOT) <= RUNNING_FW_SLOT_SIZE), + "LOADED_FW_PRIMARY_SLOT size exceeds RUNNING_FW_SLOT size"); +BUILD_ASSERT((FIXED_PARTITION_SIZE(LOADED_FW_SECONDARY_SLOT) <= RUNNING_FW_SLOT_SIZE), + "LOADED_FW_SECONDARY_SLOT size exceeds RUNNING_FW_SLOT size"); + +/** + * @brief Copy firmware from MRAM to TCM and jump to it + * + * This function runs as SYS_INIT(EARLY, 0) before main() and the scheduler. + * It copies the firmware from MRAM to TCM for optimal performance, then + * transfers execution to the loaded firmware's reset handler. + * + * This function never returns - execution transfers to the loaded firmware. + * + * @return 0 on success (never reached), -1 on failure (never reached) + */ +static int load_and_jump_to_firmware(void) +{ + /* Get the loaded firmware source address from NVM and size */ + void *loaded_fw_nvm_addr = NULL; + size_t loaded_fw_nvm_size = 0; + + /* Get the loaded firmware destination address from RAM and size */ + void *loaded_fw_ram_addr = (void *)(RUNNING_FW_SLOT_ADDR); + + if (PARTITION_IS_RUNNING_APP_PARTITION(RADIO_LOADER_PRIMARY_SLOT)) { + loaded_fw_nvm_addr = (void *)(FIXED_PARTITION_ADDRESS(LOADED_FW_PRIMARY_SLOT)); + loaded_fw_nvm_size = (size_t)(FIXED_PARTITION_SIZE(LOADED_FW_PRIMARY_SLOT)); + } else { + loaded_fw_nvm_addr = (void *)(FIXED_PARTITION_ADDRESS(LOADED_FW_SECONDARY_SLOT)); + loaded_fw_nvm_size = (size_t)(FIXED_PARTITION_SIZE(LOADED_FW_SECONDARY_SLOT)); + } + + /* Copy firmware from MRAM to TCM */ + memcpy(loaded_fw_ram_addr, loaded_fw_nvm_addr, loaded_fw_nvm_size); + + /* Extract reset handler from ARM Cortex-M vector table (entry 1) */ + uint32_t *vector_table = + (uint32_t *)((uint8_t *)loaded_fw_ram_addr + CONFIG_ROM_START_OFFSET); + typedef void reset_handler_t(void); + reset_handler_t *reset_handler = (reset_handler_t *)(vector_table[1]); + + /* Jump to loaded firmware - this never returns */ + reset_handler(); + + /* Should never reach here */ + return -1; +} + +SYS_INIT(load_and_jump_to_firmware, EARLY, 0); + +/** + * @brief Main function - should never be reached + * + * If we reach main(), the firmware load and jump failed. + * This indicates a critical error in the loader. + */ +int main(void) +{ +#ifdef CONFIG_PRINTK + printk("ERROR: Firmware jump failed!\n"); +#endif + while (1) { + /* Hang here if jump fails */ + } + return -1; +} diff --git a/samples/nrf54h20/radio_loader/testcase.yaml b/samples/nrf54h20/radio_loader/testcase.yaml new file mode 100644 index 000000000000..b3583e1fc48a --- /dev/null +++ b/samples/nrf54h20/radio_loader/testcase.yaml @@ -0,0 +1,12 @@ +common: + sysbuild: true + tags: + - ci_build + - ci_samples_nrf54h20 + +tests: + radio_loader.nrf54h20dk_cpurad: + platform_allow: + - nrf54h20dk/nrf54h20/cpurad + integration_platforms: + - nrf54h20dk/nrf54h20/cpurad diff --git a/samples/nrf_rpc/protocols_serialization/client/README.rst b/samples/nrf_rpc/protocols_serialization/client/README.rst index d2cba9a8f827..d945d3441f07 100644 --- a/samples/nrf_rpc/protocols_serialization/client/README.rst +++ b/samples/nrf_rpc/protocols_serialization/client/README.rst @@ -64,7 +64,7 @@ Testing To test the client sample, follow the instructions in the :ref:`protocols_serialization_server_sample_testing` section of the protocol serialization server sample test procedure. .. note:: - When using the nRF54L15 DK, do not press **Button 1** or **Button 2**. + When using the nRF54L15 DK or nRF54LM20 DK, do not press **Button 1** or **Button 2**. The GPIO pins connected to these buttons are used by the UART peripheral for communication with the server device. Dependencies diff --git a/samples/nrf_rpc/protocols_serialization/client/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/samples/nrf_rpc/protocols_serialization/client/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay new file mode 100644 index 000000000000..e744993e0723 --- /dev/null +++ b/samples/nrf_rpc/protocols_serialization/client/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay @@ -0,0 +1,54 @@ +/* Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/ { + chosen { + nordic,rpc-uart = &uart21; + }; + + /* delete all buttons except button0 to free GPIO pins assigned to uart21 below */ + aliases { + /delete-property/ sw1; + /delete-property/ sw2; + /delete-property/ sw3; + }; +}; + +/delete-node/ &button1; +/delete-node/ &button2; +/delete-node/ &button3; + +&pinctrl { + uart21_default: uart21_default { + group1 { + psels = , + , + ; + }; + group2 { + psels = ; + bias-pull-up; + }; + }; + + uart21_sleep: uart21_sleep { + group1 { + psels = , + , + , + ; + low-power-enable; + }; + }; +}; + +&uart21 { + status = "okay"; + current-speed = <1000000>; + pinctrl-0 = <&uart21_default>; + pinctrl-1 = <&uart21_sleep>; + pinctrl-names = "default", "sleep"; + hw-flow-control; +}; diff --git a/samples/nrf_rpc/protocols_serialization/client/sample.yaml b/samples/nrf_rpc/protocols_serialization/client/sample.yaml index 92ab0b1bc333..50f750545fd0 100644 --- a/samples/nrf_rpc/protocols_serialization/client/sample.yaml +++ b/samples/nrf_rpc/protocols_serialization/client/sample.yaml @@ -9,9 +9,11 @@ common: platform_allow: - nrf52840dk/nrf52840 - nrf54l15dk/nrf54l15/cpuapp + - nrf54lm20dk/nrf54lm20a/cpuapp integration_platforms: - nrf52840dk/nrf52840 - nrf54l15dk/nrf54l15/cpuapp + - nrf54lm20dk/nrf54lm20a/cpuapp tags: - ci_build - ci_samples_nrf_rpc diff --git a/samples/nrf_rpc/protocols_serialization/client/snippets/ble/ble.conf b/samples/nrf_rpc/protocols_serialization/client/snippets/ble/ble.conf index 8789616d2993..961fc57dca88 100644 --- a/samples/nrf_rpc/protocols_serialization/client/snippets/ble/ble.conf +++ b/samples/nrf_rpc/protocols_serialization/client/snippets/ble/ble.conf @@ -9,7 +9,7 @@ CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2144 # Enable and configure Bluetooth LE CONFIG_BT=y CONFIG_BT_RPC_STACK=y -CONFIG_BT_RPC_INITIALIZE_NRF_RPC=n +CONFIG_NRF_RPC_INIT=n CONFIG_BT_RPC_GATT_SRV_MAX=4 CONFIG_BT_PERIPHERAL=y CONFIG_BT_MAX_CONN=1 diff --git a/samples/nrf_rpc/protocols_serialization/server/README.rst b/samples/nrf_rpc/protocols_serialization/server/README.rst index d4ceac722f2e..78a33ba6d249 100644 --- a/samples/nrf_rpc/protocols_serialization/server/README.rst +++ b/samples/nrf_rpc/protocols_serialization/server/README.rst @@ -63,7 +63,7 @@ User interface This is used for testing the core dump feature. * Otherwise: not available. - .. group-tab:: nRF54L15 DK + .. group-tab:: nRF54L15 and nRF54LM20 DKs Button 0: @@ -86,7 +86,7 @@ Testing After building the Protocols serialization server sample and programming it to your development kit, connect it to a second device running the :ref:`Protocol serialization client ` sample to test either the Bluetooth LE, OpenThread or NFC functionality. .. note:: - When using the nRF54L15 DK, do not press **Button 1** or **Button 2**. + When using the nRF54L15 DK or nRF54LM20 DK, do not press **Button 1** or **Button 2**. The GPIO pins connected to these buttons are used by the UART peripheral for communication with the client device. .. _protocols_serialization_server_app_connection: @@ -167,6 +167,36 @@ One peripheral is used for shell and logging purposes, similarly to other applic .. figure:: /images/ps_nrf54l_connections.webp :alt: nRF54L15 DK server and client pin connections + .. group-tab:: nRF54LM20 DK + + By default, the nRF54LM20 DK uses the ``uart20`` peripheral for shell and logging purposes, and the ``uart21`` peripheral for sending and receiving remote procedure calls (RPCs). + + The ``uart21`` peripheral is configured to use the following pins: + + .. list-table:: + :header-rows: 1 + + * - Server + - Client + - Function on server + * - **P1.9** + - **P1.8** + - RX + * - **P1.8** + - **P1.9** + - TX + * - **P1.11** + - **P1.12** + - RTS (hardware flow control) + * - **P1.12** + - **P1.11** + - CTS (hardware flow control) + * - **GND** + - **GND** + - Ground + + To enable the communication between the client and the server devices, connect the pins on the two nRF54LM20 DKs using jumper wires. + Testing Bluetooth LE API serialization ====================================== diff --git a/samples/bluetooth/central_uart/boards/nrf54lv10dk_nrf54lv10a_cpuapp_ns.conf b/samples/nrf_rpc/protocols_serialization/server/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf similarity index 60% rename from samples/bluetooth/central_uart/boards/nrf54lv10dk_nrf54lv10a_cpuapp_ns.conf rename to samples/nrf_rpc/protocols_serialization/server/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf index f5ed71dc1549..d81cd861e744 100644 --- a/samples/bluetooth/central_uart/boards/nrf54lv10dk_nrf54lv10a_cpuapp_ns.conf +++ b/samples/nrf_rpc/protocols_serialization/server/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf @@ -3,6 +3,5 @@ # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # - -# Disable the unspupported UART0 driver -CONFIG_NRFX_UARTE0=n +CONFIG_MAIN_STACK_SIZE=4196 +CONFIG_NRF_RPC_THREAD_STACK_SIZE=6144 diff --git a/samples/nrf_rpc/protocols_serialization/server/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/samples/nrf_rpc/protocols_serialization/server/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay new file mode 100644 index 000000000000..cd029f94c778 --- /dev/null +++ b/samples/nrf_rpc/protocols_serialization/server/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay @@ -0,0 +1,57 @@ +/* Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/ { + chosen { + nordic,rpc-uart = &uart21; + }; + + aliases { + rpc-alive-led = &led0; + fatal-error-trigger = &button0; + + /* delete all buttons except button0 to free GPIO pins assigned to uart21 below */ + /delete-property/ sw1; + /delete-property/ sw2; + /delete-property/ sw3; + }; +}; + +/delete-node/ &button1; +/delete-node/ &button2; +/delete-node/ &button3; + +&pinctrl { + uart21_default: uart21_default { + group1 { + psels = , + , + ; + }; + group2 { + psels = ; + bias-pull-up; + }; + }; + + uart21_sleep: uart21_sleep { + group1 { + psels = , + , + , + ; + low-power-enable; + }; + }; +}; + +&uart21 { + status = "okay"; + current-speed = <1000000>; + pinctrl-0 = <&uart21_default>; + pinctrl-1 = <&uart21_sleep>; + pinctrl-names = "default", "sleep"; + hw-flow-control; +}; diff --git a/samples/nrf_rpc/protocols_serialization/server/pm_static_nrf54lm20dk_nrf54lm20a_cpuapp.yml b/samples/nrf_rpc/protocols_serialization/server/pm_static_nrf54lm20dk_nrf54lm20a_cpuapp.yml new file mode 100644 index 000000000000..cff1116c1d7e --- /dev/null +++ b/samples/nrf_rpc/protocols_serialization/server/pm_static_nrf54lm20dk_nrf54lm20a_cpuapp.yml @@ -0,0 +1,4 @@ +coredump_partition: + region: flash_primary + address: 0x1fa000 + size: 0x3000 diff --git a/samples/nrf_rpc/protocols_serialization/server/sample.yaml b/samples/nrf_rpc/protocols_serialization/server/sample.yaml index 138c86587e9b..79b0ede838dc 100644 --- a/samples/nrf_rpc/protocols_serialization/server/sample.yaml +++ b/samples/nrf_rpc/protocols_serialization/server/sample.yaml @@ -9,9 +9,11 @@ common: platform_allow: - nrf52840dk/nrf52840 - nrf54l15dk/nrf54l15/cpuapp + - nrf54lm20dk/nrf54lm20a/cpuapp integration_platforms: - nrf52840dk/nrf52840 - nrf54l15dk/nrf54l15/cpuapp + - nrf54lm20dk/nrf54lm20a/cpuapp tags: - ci_build - ci_samples_nrf_rpc diff --git a/samples/nrf_rpc/protocols_serialization/server/snippets/ble/ble.conf b/samples/nrf_rpc/protocols_serialization/server/snippets/ble/ble.conf index 4bbff24d886c..4a2b3d80753e 100644 --- a/samples/nrf_rpc/protocols_serialization/server/snippets/ble/ble.conf +++ b/samples/nrf_rpc/protocols_serialization/server/snippets/ble/ble.conf @@ -8,7 +8,7 @@ CONFIG_BT=y CONFIG_BT_RPC=y CONFIG_BT_RPC_HOST=y -CONFIG_BT_RPC_INITIALIZE_NRF_RPC=n +CONFIG_NRF_RPC_INIT=n CONFIG_BT_PERIPHERAL=y CONFIG_BT_MAX_CONN=1 diff --git a/samples/peripheral/802154_phy_test/src/periph_proc.c b/samples/peripheral/802154_phy_test/src/periph_proc.c index 6a4854d9aee4..47acb685baab 100644 --- a/samples/peripheral/802154_phy_test/src/periph_proc.c +++ b/samples/peripheral/802154_phy_test/src/periph_proc.c @@ -99,7 +99,7 @@ void periph_init(void) nrfx_timer_config_t clk_timer_cfg = NRFX_TIMER_DEFAULT_CONFIG(base_frequency); err_code = nrfx_timer_init(&clk_timer, &clk_timer_cfg, clk_timer_handler); - NRFX_ASSERT(err_code); + __ASSERT_NO_MSG(err_code == 0); for (int i = 0; i < GPIO_COUNT; ++i) { nrfx_gpiote_t *gpiote = NRF_GPIOTE_FOR_GPIO(i); diff --git a/samples/peripheral/radio_test/src/radio_test.c b/samples/peripheral/radio_test/src/radio_test.c index dd0687e78135..d3981947ddc2 100644 --- a/samples/peripheral/radio_test/src/radio_test.c +++ b/samples/peripheral/radio_test/src/radio_test.c @@ -452,15 +452,15 @@ static void radio_ppi_config(bool rx) { endpoints_clear(); - nrfx_gppi_ep_attach(ppi_radio_start, - nrf_egu_event_address_get(RADIO_TEST_EGU, RADIO_TEST_EGU_EVENT)); - nrfx_gppi_ep_attach(ppi_radio_start, - nrf_radio_task_address_get(NRF_RADIO, - rx ? NRF_RADIO_TASK_RXEN : NRF_RADIO_TASK_TXEN)); + nrfx_gppi_ep_attach(nrf_egu_event_address_get(RADIO_TEST_EGU, RADIO_TEST_EGU_EVENT), + ppi_radio_start); + nrfx_gppi_ep_attach(nrf_radio_task_address_get(NRF_RADIO, + rx ? NRF_RADIO_TASK_RXEN : NRF_RADIO_TASK_TXEN), + ppi_radio_start); atomic_set_bit(&endpoint_state, (rx ? ENDPOINT_EGU_RADIO_RX : ENDPOINT_EGU_RADIO_TX)); - nrfx_gppi_ep_attach(ppi_radio_start, - nrf_timer_task_address_get(timer.p_reg, NRF_TIMER_TASK_START)); + nrfx_gppi_ep_attach(nrf_timer_task_address_get(timer.p_reg, NRF_TIMER_TASK_START), + ppi_radio_start); atomic_set_bit(&endpoint_state, ENDPOINT_FORK_EGU_TIMER); nrfx_gppi_conn_enable(ppi_radio_start); @@ -472,10 +472,10 @@ static void radio_ppi_tx_reconfigure(void) endpoints_clear(); - nrfx_gppi_ep_attach(ppi_radio_start, - nrf_timer_event_address_get(timer.p_reg, NRF_TIMER_EVENT_COMPARE1)); - nrfx_gppi_ep_attach(ppi_radio_start, - nrf_radio_task_address_get(NRF_RADIO, NRF_RADIO_TASK_TXEN)); + nrfx_gppi_ep_attach(nrf_timer_event_address_get(timer.p_reg, NRF_TIMER_EVENT_COMPARE1), + ppi_radio_start); + nrfx_gppi_ep_attach(nrf_radio_task_address_get(NRF_RADIO, NRF_RADIO_TASK_TXEN), + ppi_radio_start); atomic_set_bit(&endpoint_state, ENDPOINT_TIMER_RADIO_TX); nrfx_gppi_conn_enable(ppi_radio_start); diff --git a/samples/wifi/promiscuous/prj.conf b/samples/wifi/promiscuous/prj.conf index 2dfa2d02b46e..3365d815b49d 100644 --- a/samples/wifi/promiscuous/prj.conf +++ b/samples/wifi/promiscuous/prj.conf @@ -58,6 +58,7 @@ CONFIG_NET_SOCKETS_POLL_MAX=10 CONFIG_MAIN_STACK_SIZE=5200 CONFIG_NET_TX_STACK_SIZE=4096 CONFIG_NET_RX_STACK_SIZE=4096 +CONFIG_NET_PKT_BUF_RX_DATA_POOL_SIZE=20000 # Debugging CONFIG_STACK_SENTINEL=y diff --git a/samples/wifi/wfa_qt_app/overlay-slip.conf b/samples/wifi/wfa_qt_app/overlay-slip.conf index 1d5e5c98dc92..98fb0591dff0 100644 --- a/samples/wifi/wfa_qt_app/overlay-slip.conf +++ b/samples/wifi/wfa_qt_app/overlay-slip.conf @@ -4,7 +4,6 @@ CONFIG_SLIP_TAP=y CONFIG_SLIP_MAC_ADDR="00:00:00:00:00:01" # Shell should be disabled for SLIP to work -CONFIG_NET_L2_WIFI_SHELL=n CONFIG_NET_SHELL=n CONFIG_DEVICE_SHELL=n CONFIG_DATE_SHELL=n diff --git a/samples/wifi/wfa_qt_app/sample.yaml b/samples/wifi/wfa_qt_app/sample.yaml index 5426d3bc94ac..24f54a104a54 100644 --- a/samples/wifi/wfa_qt_app/sample.yaml +++ b/samples/wifi/wfa_qt_app/sample.yaml @@ -12,7 +12,7 @@ tests: - ci_build - sysbuild - ci_samples_wifi - sample.nrf7002.enterprise_mode.wfa_qt_app: + sample.nrf7002.enterprise_mode.wfa_qt_app.netusb: sysbuild: true build_only: true extra_args: @@ -25,6 +25,20 @@ tests: - ci_build - sysbuild - ci_samples_wifi + sample.nrf7002.enterprise_mode.wfa_qt_app.slip: + sysbuild: true + build_only: true + extra_args: + - EXTRA_CONF_FILE="overlay-slip.conf;overlay-enterprise.conf" + - EXTRA_DTC_OVERLAY_FILE="nrf7002_uart_pipe.overlay" + - wfa_qt_app_SNIPPET="wifi-enterprise" + integration_platforms: + - nrf7002dk/nrf5340/cpuapp + platform_allow: nrf7002dk/nrf5340/cpuapp + tags: + - ci_build + - sysbuild + - ci_samples_wifi sample.nrf7002_eks.wfa_qt_app: sysbuild: true build_only: true diff --git a/samples/zephyr/drivers/adc/adc_dt/boards/nrf54ls05dk_nrf54ls05b_cpuapp.overlay b/samples/zephyr/drivers/adc/adc_dt/boards/nrf54ls05dk_nrf54ls05b_cpuapp.overlay index ab79ca4f73ee..4acd596500ee 100644 --- a/samples/zephyr/drivers/adc/adc_dt/boards/nrf54ls05dk_nrf54ls05b_cpuapp.overlay +++ b/samples/zephyr/drivers/adc/adc_dt/boards/nrf54ls05dk_nrf54ls05b_cpuapp.overlay @@ -6,7 +6,7 @@ / { zephyr,user { - io-channels = <&adc 0>, <&adc 1>, <&adc 7>; + io-channels = <&adc 0>, <&adc 1>, <&adc 3>; }; }; @@ -34,8 +34,8 @@ zephyr,oversampling = <8>; }; - channel@7 { - reg = <7>; + channel@3 { + reg = <3>; zephyr,gain = "ADC_GAIN_1"; zephyr,reference = "ADC_REF_INTERNAL"; zephyr,acquisition-time = ; diff --git a/samples/zephyr/drivers/i2c/rtio_loopback/boards/nrf7120pdk_nrf7120_cpuapp.overlay b/samples/zephyr/drivers/i2c/rtio_loopback/boards/nrf7120pdk_nrf7120_cpuapp.overlay index 3035cc168c2f..e2cde1e64c84 100644 --- a/samples/zephyr/drivers/i2c/rtio_loopback/boards/nrf7120pdk_nrf7120_cpuapp.overlay +++ b/samples/zephyr/drivers/i2c/rtio_loopback/boards/nrf7120pdk_nrf7120_cpuapp.overlay @@ -6,7 +6,7 @@ /* * SDA = P1.8 and P1.9 - * SCL = P1.14 and P1.15 + * SCL = P1.2 and P1.3 */ / { @@ -20,7 +20,7 @@ i2c21_default: i2c21_default { group1 { psels = , - ; + ; bias-pull-up; }; }; @@ -28,7 +28,7 @@ i2c21_sleep: i2c21_sleep { group1 { psels = , - ; + ; low-power-enable; }; }; @@ -36,7 +36,7 @@ i2c22_default: i2c22_default { group1 { psels = , - ; + ; bias-pull-up; }; }; @@ -44,7 +44,7 @@ i2c22_sleep: i2c22_sleep { group1 { psels = , - ; + ; low-power-enable; }; }; diff --git a/samples/zephyr/subsys/settings/README.txt b/samples/zephyr/subsys/settings/README.txt deleted file mode 100644 index f5833d2631e3..000000000000 --- a/samples/zephyr/subsys/settings/README.txt +++ /dev/null @@ -1,4 +0,0 @@ -This sample extends the same-named Zephyr sample to verify it -with Nordic development kits. - -Source code and basic configuration files can be found in the corresponding folder structure in zephyr/samples/subsys/settings. diff --git a/samples/zephyr/subsys/settings/prj.conf b/samples/zephyr/subsys/settings/prj.conf deleted file mode 100644 index d9ae787141af..000000000000 --- a/samples/zephyr/subsys/settings/prj.conf +++ /dev/null @@ -1,9 +0,0 @@ -CONFIG_STDOUT_CONSOLE=y -CONFIG_FLASH=y -CONFIG_FLASH_MAP=y -CONFIG_SETTINGS=y -CONFIG_SETTINGS_RUNTIME=y -CONFIG_NVS=y -CONFIG_SETTINGS_NVS=y -CONFIG_HEAP_MEM_POOL_SIZE=256 -CONFIG_MPU_ALLOW_FLASH_WRITE=y diff --git a/samples/zephyr/subsys/settings/testcase.yaml b/samples/zephyr/subsys/settings/testcase.yaml deleted file mode 100644 index fd1d4fba73ba..000000000000 --- a/samples/zephyr/subsys/settings/testcase.yaml +++ /dev/null @@ -1,42 +0,0 @@ -sample: - name: Settings Sample - -tests: - nrf.extended.sample.subsys.settings: - integration_platforms: - - nrf54ls05dk/nrf54ls05b/cpuapp - platform_allow: - - nrf54ls05dk@0.0.0/nrf54ls05b/cpuapp - - nrf54ls05dk/nrf54ls05b/cpuapp - tags: - - settings - - ci_samples_zephyr_subsys_settings - timeout: 10 - harness: console - harness_config: - type: multi_line - regex: - - "subtree handler registered: OK" - - "# iteration 0" - - "[.]* value exist in the storage" - - "[.]*Can\\'t to load the value as expected" - - " = 0 \\(default\\)" - - "# iteration 1" - - " = 59" - - "# iteration 2" - - " = 42" - - "# iteration 3" - - " = -3100" - - "# iteration 4" - - " = abcd" - - "# iteration 5" - - " = 5" - - " is not compatible with the application" - - "direct.length = 100" - - "direct.length_1 = 46" - - "direct.length_2 = 54" - - " = 5" - - "The settings destination off the key has got value:\ - \ \"RT\"" - - "String value \"rtos\" was retrieved from the settings destination off the\ - \ key " diff --git a/scripts/ci/license_allow_list.yaml b/scripts/ci/license_allow_list.yaml index dd0dfe3f2bff..3e5e24a375de 100644 --- a/scripts/ci/license_allow_list.yaml +++ b/scripts/ci/license_allow_list.yaml @@ -49,6 +49,7 @@ Apache-2.0: | ^nrf/modules/openthread/ ^nrf/samples/net/http_server/src/main.c ^nrf/tests/benchmarks/kernel_freq_change/src/kernel_context.c + ^nrf/tests/drivers/i2s/i2s_buffer/src/i2s_buffer.c ^nrf/tests/subsys/suit/common/tls_config/user-tls-conf.h ^nrf/subsys/settings/ ^nrf/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt.c diff --git a/scripts/ci/tags.yaml b/scripts/ci/tags.yaml index bbf70d8ee3da..f90224db710b 100644 --- a/scripts/ci/tags.yaml +++ b/scripts/ci/tags.yaml @@ -1580,11 +1580,6 @@ ci_samples_zephyr_sensor_qdec: - nrf/samples/zephyr/sensor/qdec/ - zephyr/samples/sensor/qdec/ -ci_samples_zephyr_subsys_settings: - files: - - nrf/samples/zephyr/subsys/settings/ - - zephyr/samples/subsys/settings/ - ci_samples_zephyr_sysbuild_hello_world: files: - nrf/samples/zephyr/sysbuild/hello_world/ @@ -1865,3 +1860,7 @@ ci_tests_subsys_rtt: ci_tests_subsys_swo: files: - nrf/tests/subsys/swo/ + +ci_tests_drivers_can: + files: + - zephyr/drivers/can/ diff --git a/scripts/nrf_profiler/README.rst b/scripts/nrf_profiler/README.rst index 609f71e1ebdb..5a9d78713c06 100644 --- a/scripts/nrf_profiler/README.rst +++ b/scripts/nrf_profiler/README.rst @@ -3,6 +3,10 @@ nRF Profiler host tools ####################### +.. contents:: + :local: + :depth: 2 + The nRF Profiler host tools is a set of Python scripts that you can use to visualize and analyze the nRF Profiler events received over RTT from an embedded device running the :ref:`nrf_profiler` library. You can use the scripts for both :ref:`app_event_manager` events and custom events. diff --git a/scripts/quarantine.yaml b/scripts/quarantine.yaml index 0b35732b495d..5ce6418b371b 100644 --- a/scripts/quarantine.yaml +++ b/scripts/quarantine.yaml @@ -42,14 +42,6 @@ - thingy53/nrf5340/cpuapp comment: "https://nordicsemi.atlassian.net/browse/NCSDK-35521" -- scenarios: - - applications.machine_learning.zrelease - - applications.machine_learning.zdebug - - applications.machine_learning.zdebug_rtt - platforms: - - thingy53/nrf5340/cpuapp - comment: "https://nordicsemi.atlassian.net/browse/NCSDK-35522,NCSDK-35672" - - scenarios: - benchmarks.multicore.idle_twim.nrf54h20dk_cpuapp_cpurad.s2ram platforms: @@ -114,3 +106,9 @@ platforms: - nrf5340dk/nrf5340/cpuapp comment: "https://nordicsemi.atlassian.net/browse/NRFX-8480" + +- scenarios: + - sample.peripheral.radio_test + platforms: + - nrf54ls05dk@0.0.0/nrf54ls05b/cpuapp + comment: "https://nordicsemi.atlassian.net/browse/NCSDK-36650" diff --git a/scripts/quarantine_zephyr.yaml b/scripts/quarantine_zephyr.yaml index 5ea69b30d338..212991869208 100644 --- a/scripts/quarantine_zephyr.yaml +++ b/scripts/quarantine_zephyr.yaml @@ -595,5 +595,12 @@ comment: "https://nordicsemi.atlassian.net/browse/NRFX-8497" - scenarios: - - examples.nrfx.* - comment: "https://nordicsemi.atlassian.net/browse/NRFX-8588" + - examples.nrfx_spim_spis.advanced_non_blocking + - examples.nrfx_spim_spis.non_blocking + - examples.nrfx_twim_twis.blocking + - examples.nrfx_twim_twis.non_blocking + - examples.nrfx_twim_twis.txrx + - examples.nrfx_twim_twis.txtx + platforms: + - nrf54l15dk/nrf54l15/cpuapp + comment: "https://nordicsemi.atlassian.net/browse/NRFX-8652" diff --git a/snippets/nordic-flpr/README.rst b/snippets/nordic-flpr/README.rst index 187fd4ae6619..a957c22d5aae 100644 --- a/snippets/nordic-flpr/README.rst +++ b/snippets/nordic-flpr/README.rst @@ -3,6 +3,11 @@ Nordic FLPR snippet with execution from SRAM (nordic-flpr) ########################################################## +.. contents:: + :local: + :depth: 2 + + Overview ******** diff --git a/snippets/wifi-p2p/wifi-p2p.conf b/snippets/wifi-p2p/wifi-p2p.conf index a7a4cf6764a2..e28061885ba6 100644 --- a/snippets/wifi-p2p/wifi-p2p.conf +++ b/snippets/wifi-p2p/wifi-p2p.conf @@ -1,7 +1,5 @@ CONFIG_NRF70_P2P_MODE=y CONFIG_NRF70_AP_MODE=y CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P=y -CONFIG_WPA_CLI=y -CONFIG_WIFI_NM_WPA_SUPPLICANT_LOG_LEVEL_INF=y CONFIG_LTO=y CONFIG_ISR_TABLES_LOCAL_DECLARATION=y diff --git a/soc/nordic/nrf54h/Kconfig.defconfig b/soc/nordic/nrf54h/Kconfig.defconfig new file mode 100644 index 000000000000..f116209dec67 --- /dev/null +++ b/soc/nordic/nrf54h/Kconfig.defconfig @@ -0,0 +1,10 @@ +# Nordic Semiconductor nRF54H MCU line + +# Copyright (c) 2025 Nordic Semiconductor ASA +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + +if SOC_NRF54H20_CPURAD + +rsource "Kconfig.defconfig.nrf54h20_cpurad" + +endif # SOC_NRF54H20_CPURAD diff --git a/soc/nordic/nrf54h/Kconfig.defconfig.nrf54h20_cpurad b/soc/nordic/nrf54h/Kconfig.defconfig.nrf54h20_cpurad new file mode 100644 index 000000000000..c3608609326d --- /dev/null +++ b/soc/nordic/nrf54h/Kconfig.defconfig.nrf54h20_cpurad @@ -0,0 +1,16 @@ +# Nordic Semiconductor nRF54H20 Radio MCU + +# Copyright (c) 2025 Nordic Semiconductor ASA +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + +if SOC_NRF54H20_CPURAD + +DT_CHOSEN_Z_CODE = zephyr,code-partition +DT_CHOSEN_Z_SRAM = zephyr,sram + +config BUILD_OUTPUT_ADJUST_LMA + depends on !XIP + default "$(dt_chosen_partition_addr_hex,$(DT_CHOSEN_Z_CODE)) - \ + $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_SRAM))" + +endif # SOC_NRF54H20_CPURAD diff --git a/subsys/bluetooth/rpc/Kconfig b/subsys/bluetooth/rpc/Kconfig index 9b78ec81b4b3..0df3f2295f8b 100644 --- a/subsys/bluetooth/rpc/Kconfig +++ b/subsys/bluetooth/rpc/Kconfig @@ -9,6 +9,7 @@ config BT_RPC default y if BT_RPC_STACK select NRF_RPC select NRF_RPC_CBOR + imply NRF_RPC_INIT select EXPERIMENTAL depends on BT depends on !BT_ISO_UNICAST @@ -48,13 +49,6 @@ config BT_RPC_HOST endchoice -config BT_RPC_INITIALIZE_NRF_RPC - bool "Automatically initialize nRF RPC library" - default y - help - Initialize nRF RPC library during the system startup. Disabling this - option allow user to initialize it in a different way. - config BT_RPC_GATT_SRV_MAX int "Maximum number of GATT services" default 4 diff --git a/subsys/bluetooth/rpc/common/bt_rpc_common.c b/subsys/bluetooth/rpc/common/bt_rpc_common.c index 6af499ac6590..b8ba85fff07a 100644 --- a/subsys/bluetooth/rpc/common/bt_rpc_common.c +++ b/subsys/bluetooth/rpc/common/bt_rpc_common.c @@ -28,34 +28,6 @@ NRF_RPC_IPC_TRANSPORT(bt_rpc_tr, DEVICE_DT_GET(DT_NODELABEL(ipc0)), "bt_rpc_ept" #endif NRF_RPC_GROUP_DEFINE(bt_rpc_grp, "bt_rpc", &bt_rpc_tr, NULL, NULL, NULL); -#if CONFIG_BT_RPC_INITIALIZE_NRF_RPC -static void err_handler(const struct nrf_rpc_err_report *report) -{ - LOG_ERR("nRF RPC error %d ocurred. See nRF RPC logs for more details.", - report->code); - k_oops(); -} - -static int serialization_init(void) -{ - - int err; - - LOG_DBG("Init begin"); - - err = nrf_rpc_init(err_handler); - if (err) { - return -EINVAL; - } - - LOG_DBG("Init done\n"); - - return 0; -} - -SYS_INIT(serialization_init, APPLICATION, CONFIG_APPLICATION_INIT_PRIORITY); -#endif /* CONFIG_BT_RPC_INITIALIZE_NRF_RPC */ - enum { CHECK_ENTRY_FLAGS, CHECK_ENTRY_UINT, diff --git a/subsys/bluetooth/rpc/common/bt_rpc_gatt_common.c b/subsys/bluetooth/rpc/common/bt_rpc_gatt_common.c index 6c369d0c669f..f350735e8980 100644 --- a/subsys/bluetooth/rpc/common/bt_rpc_gatt_common.c +++ b/subsys/bluetooth/rpc/common/bt_rpc_gatt_common.c @@ -81,9 +81,14 @@ const struct bt_gatt_attr *bt_rpc_gatt_index_to_attr(uint32_t index) { uint32_t service_index = index >> ATTR_INDEX_POS; uint32_t attr_index = index & ATTR_INDEX_MASK; - const struct bt_gatt_service *service = svc_cache.services[service_index]; + const struct bt_gatt_service *service; + + if (service_index >= svc_cache.count) { + return NULL; + } - if ((service_index >= svc_cache.count) || (attr_index >= service->attr_count)) { + service = svc_cache.services[service_index]; + if (!service || (attr_index >= service->attr_count)) { return NULL; } @@ -92,7 +97,7 @@ const struct bt_gatt_attr *bt_rpc_gatt_index_to_attr(uint32_t index) const struct bt_gatt_service *bt_rpc_gatt_get_service_by_index(uint16_t svc_index) { - if (svc_index > svc_cache.count) { + if (svc_index >= svc_cache.count) { return NULL; } @@ -203,7 +208,7 @@ void bt_rpc_gatt_foreach_attr_type(uint16_t start_handle, uint16_t end_handle, } for (size_t j = 0; j < svc->attr_count; j++) { - struct bt_gatt_attr *attr = &svc->attrs[j]; + const struct bt_gatt_attr *attr = &svc->attrs[j]; handle = bt_gatt_attr_get_handle(attr); diff --git a/subsys/bluetooth/rpc/host/bt_rpc_gatt_host.c b/subsys/bluetooth/rpc/host/bt_rpc_gatt_host.c index 5721bc82152d..c159970b9aa3 100644 --- a/subsys/bluetooth/rpc/host/bt_rpc_gatt_host.c +++ b/subsys/bluetooth/rpc/host/bt_rpc_gatt_host.c @@ -729,6 +729,7 @@ static void bt_rpc_gatt_service_unregister_rpc_handler(const struct nrf_rpc_grou svc = bt_rpc_gatt_get_service_by_index(svc_index); if (!svc) { + LOG_ERR("Service unregister: Invalid service index %u", svc_index); result = -EINVAL; } diff --git a/subsys/debug/cpu_load/cpu_load.c b/subsys/debug/cpu_load/cpu_load.c index 46e0d3bc149d..8649424fa537 100644 --- a/subsys/debug/cpu_load/cpu_load.c +++ b/subsys/debug/cpu_load/cpu_load.c @@ -83,7 +83,7 @@ static int ppi_setup(uint32_t eep, uint32_t tep) if (err >= 0) { /* It works only on single domain DPPI. */ handle = (nrfx_gppi_handle_t)err; - nrfx_gppi_ep_attach(handle, tep); + nrfx_gppi_ep_attach(tep, handle); return 0; } @@ -99,7 +99,7 @@ static int ppi_setup(uint32_t eep, uint32_t tep) int cpu_load_init_internal(void) { - nrfx_err_t err; + int err; uint32_t base_frequency = NRF_TIMER_BASE_FREQUENCY_GET(timer.p_reg); nrfx_timer_config_t config = NRFX_TIMER_DEFAULT_CONFIG(base_frequency); int ret = 0; @@ -135,7 +135,7 @@ int cpu_load_init_internal(void) } err = nrfx_timer_init(&timer, &config, timer_handler); - if (err != NRFX_SUCCESS) { + if (err != 0) { return -EBUSY; } diff --git a/subsys/esb/esb.c b/subsys/esb/esb.c index 4dda6ca6f03c..9a148554a3bf 100644 --- a/subsys/esb/esb.c +++ b/subsys/esb/esb.c @@ -22,14 +22,12 @@ #include #include #include -#if NRF54H_ERRATA_216_PRESENT -#include -#endif /* NRF54H_ERRATA_216_PRESENT */ #include #include "esb_peripherals.h" #include "esb_ppi_api.h" +#include "esb_workarounds.h" LOG_MODULE_REGISTER(esb, CONFIG_ESB_LOG_LEVEL); @@ -83,25 +81,16 @@ LOG_MODULE_REGISTER(esb, CONFIG_ESB_LOG_LEVEL); /* NRF5340 Radio high voltage gain. */ #define NRF5340_HIGH_VOLTAGE_GAIN 3 -/* Fast switching is available for the nRF54H20 SoC. - * The nRF54H20 is a non-RSSISTOP device. - */ #if defined(RADIO_SHORTS_DISABLED_RSSISTOP_Msk) -#define RADIO_SHORTS_COMMON \ - (NRF_RADIO_SHORT_READY_START_MASK | ESB_SHORT_DISABLE_MASK | \ - NRF_RADIO_SHORT_ADDRESS_RSSISTART_MASK | NRF_RADIO_SHORT_DISABLED_RSSISTOP_MASK) +#define RADIO_RSSI_SHORTS \ + (NRF_RADIO_SHORT_ADDRESS_RSSISTART_MASK | NRF_RADIO_SHORT_DISABLED_RSSISTOP_MASK) #else /* Devices without RSSISTOP task will stop RSSI measurement after specific period. */ -#define RADIO_SHORTS_FAST_SWITCHING_NO_RSSISTOP \ - (NRF_RADIO_SHORT_READY_START_MASK | NRF_RADIO_SHORT_ADDRESS_RSSISTART_MASK) -#define RADIO_SHORTS_NO_FAST_SWITCHING_NO_RSSISTOP \ - (NRF_RADIO_SHORT_READY_START_MASK | ESB_SHORT_DISABLE_MASK | \ - NRF_RADIO_SHORT_ADDRESS_RSSISTART_MASK) +#define RADIO_RSSI_SHORTS (NRF_RADIO_SHORT_ADDRESS_RSSISTART_MASK) +#endif /* !defined(RADIO_SHORTS_DISABLED_RSSISTOP_Msk) */ -#define RADIO_SHORTS_COMMON \ - (IS_ENABLED(CONFIG_ESB_FAST_SWITCHING) ? RADIO_SHORTS_FAST_SWITCHING_NO_RSSISTOP : \ - RADIO_SHORTS_NO_FAST_SWITCHING_NO_RSSISTOP) -#endif /* !defined(RADIO_SHORTS_DISABLED_RSSISTOP_Msk) */ +#define RADIO_NORMAL_SW_SHORTS \ + (RADIO_RSSI_SHORTS | NRF_RADIO_SHORT_READY_START_MASK | ESB_RADIO_SHORT_END_DISABLE) #if defined(CONFIG_SOC_SERIES_NRF54LX) #define RADIO_SHORTS_MONITOR \ @@ -113,6 +102,14 @@ LOG_MODULE_REGISTER(esb, CONFIG_ESB_LOG_LEVEL); NRF_RADIO_SHORT_READY_START_MASK) #endif /* !defined(CONFIG_SOC_SERIES_NRF54LX) */ +/* Define empty shorts for nRF52 devices. These shorts are used only for fast switching. */ +#if !defined(RADIO_SHORTS_TXREADY_START_Msk) +#define NRF_RADIO_SHORT_TXREADY_START_MASK 0 +#endif +#if !defined(RADIO_SHORTS_RXREADY_START_Msk) +#define NRF_RADIO_SHORT_RXREADY_START_MASK 0 +#endif + /* Flag for changing radio channel. */ #define RF_CHANNEL_UPDATE_FLAG 0 @@ -267,13 +264,6 @@ enum { static atomic_t errata_216_status = ATOMIC_INIT(ERRATA_216_DISABLED); static uint32_t errata_216_timer_shorts; -#if NRF54H_ERRATA_216_PRESENT -static const struct mbox_dt_spec on_channel = - MBOX_DT_SPEC_GET(DT_NODELABEL(cpurad_cpusys_errata216_mboxes), on_req); -static const struct mbox_dt_spec off_channel = - MBOX_DT_SPEC_GET(DT_NODELABEL(cpurad_cpusys_errata216_mboxes), off_req); -#endif /* NRF54H_ERRATA_216_PRESENT */ - static esb_event_handler event_handler; static struct esb_payload *current_payload; @@ -298,7 +288,6 @@ static volatile uint32_t retransmits_remaining; static volatile uint32_t last_tx_attempts; static volatile uint32_t wait_for_ack_timeout_us; -static uint32_t radio_shorts_common = RADIO_SHORTS_COMMON; static const bool fast_switching = IS_ENABLED(CONFIG_ESB_FAST_SWITCHING); static const mpsl_fem_event_t rx_event = { @@ -380,39 +369,14 @@ static inline void apply_errata143_workaround(void) * use a unique address 0 since this will avoid the 3dBm penalty * incurred from the workaround. */ - uint32_t base_address_mask = - esb_addr.addr_length == 5 ? 0xFFFF0000 : 0xFF000000; - /* Load the two addresses before comparing them to ensure - * defined ordering of volatile accesses. - */ - uint32_t addr0 = nrf_radio_base0_get(NRF_RADIO) & base_address_mask; - uint32_t addr1 = nrf_radio_base1_get(NRF_RADIO) & base_address_mask; - - if (addr0 == addr1) { - uint32_t radio_prefix0 = nrf_radio_prefix0_get(NRF_RADIO); - uint32_t radio_prefix1 = nrf_radio_prefix1_get(NRF_RADIO); - - uint8_t prefix0 = radio_prefix0 & RADIO_PREFIX0_AP0_Msk; - uint8_t prefix1 = (radio_prefix0 & RADIO_PREFIX0_AP1_Msk) >> RADIO_PREFIX0_AP1_Pos; - uint8_t prefix2 = (radio_prefix0 & RADIO_PREFIX0_AP2_Msk) >> RADIO_PREFIX0_AP2_Pos; - uint8_t prefix3 = (radio_prefix0 & RADIO_PREFIX0_AP3_Msk) >> RADIO_PREFIX0_AP3_Pos; - uint8_t prefix4 = radio_prefix1 & RADIO_PREFIX1_AP4_Msk; - uint8_t prefix5 = (radio_prefix1 & RADIO_PREFIX1_AP5_Msk) >> RADIO_PREFIX1_AP5_Pos; - uint8_t prefix6 = (radio_prefix1 & RADIO_PREFIX1_AP6_Msk) >> RADIO_PREFIX1_AP6_Pos; - uint8_t prefix7 = (radio_prefix1 & RADIO_PREFIX1_AP7_Msk) >> RADIO_PREFIX1_AP7_Pos; - - if ((prefix0 == prefix1) || (prefix0 == prefix2) || - (prefix0 == prefix3) || (prefix0 == prefix4) || - (prefix0 == prefix5) || (prefix0 == prefix6) || - (prefix0 == prefix7)) { - /* This will cause a 3dBm sensitivity loss, - * avoid using such address combinations if possible. - */ - *(volatile uint32_t *)0x40001774 = - ((*(volatile uint32_t *)0x40001774) & 0xfffffffe) | 0x01000000; - } + if (!nrf52_errata_143()) { + return; } + + uint32_t base_address_mask = + esb_addr.addr_length == 5 ? 0xFFFF0000 : 0xFF000000; + esb_apply_nrf52_143(base_address_mask); } static void errata_216_on(void) @@ -421,15 +385,11 @@ static void errata_216_on(void) return; } -#if NRF54H_ERRATA_216_PRESENT - if (mbox_send_dt(&on_channel, NULL) != 0) { - LOG_ERR("Failed to enable Errata 216"); - /* Should not happen. */ - __ASSERT_NO_MSG(false); - } else { - atomic_set(&errata_216_status, ERRATA_216_ENABLED); - } -#endif /* NRF54H_ERRATA_216_PRESENT */ + esb_apply_nrf54h_216(true); + +#if NRF54H_ERRATA_216_ENABLE_WORKAROUND + atomic_set(&errata_216_status, ERRATA_216_ENABLED); +#endif /* NRF54H_ERRATA_216_ENABLE_WORKAROUND */ } static void errata_216_off(void) @@ -438,86 +398,25 @@ static void errata_216_off(void) return; } -#if NRF54H_ERRATA_216_PRESENT - if (mbox_send_dt(&off_channel, NULL) != 0) { - LOG_ERR("Failed to disable Errata 216"); - /* Should not happen. */ - __ASSERT_NO_MSG(false); - } else { - atomic_set(&errata_216_status, ERRATA_216_DISABLED); - } -#endif /* NRF54H_ERRATA_216_PRESENT */ + esb_apply_nrf54h_216(false); + +#if NRF54H_ERRATA_216_ENABLE_WORKAROUND + atomic_set(&errata_216_status, ERRATA_216_DISABLED); +#endif /* NRF54H_ERRATA_216_ENABLE_WORKAROUND */ } static void apply_radio_init_workarounds(void) { if (nrf52_errata_182()) { - /* Check if the device is an nRF52832 Rev. 2. */ - /* Workaround for nRF52832 rev 2 errata 182 */ - *(volatile uint32_t *)0x4000173C |= (1 << 10); - } - -#if defined(CONFIG_SOC_SERIES_NRF54HX) - /* Apply HMPAN-102 workaround for nRF54H series */ - *(volatile uint32_t *)0x5302C7E4 = - (((*((volatile uint32_t *)0x5302C7E4)) & 0xFF000FFF) | 0x0012C000); - - /* Apply HMPAN-18 workaround for nRF54H series - load trim values*/ - if (*(volatile uint32_t *)0x0FFFE458 != TRIM_VALUE_EMPTY) { - *(volatile uint32_t *)0x5302C734 = *(volatile uint32_t *)0x0FFFE458; - } - - if (*(volatile uint32_t *)0x0FFFE45C != TRIM_VALUE_EMPTY) { - *(volatile uint32_t *)0x5302C738 = *(volatile uint32_t *)0x0FFFE45C; + esb_apply_nrf52_182(); } - if (*(volatile uint32_t *)0x0FFFE460 != TRIM_VALUE_EMPTY) { - *(volatile uint32_t *)0x5302C73C = *(volatile uint32_t *)0x0FFFE460; + if (nrf54h_errata_103()) { + esb_apply_nrf54h_103(); } - if (*(volatile uint32_t *)0x0FFFE464 != TRIM_VALUE_EMPTY) { - *(volatile uint32_t *)0x5302C740 = *(volatile uint32_t *)0x0FFFE464; - } - - if (*(volatile uint32_t *)0x0FFFE468 != TRIM_VALUE_EMPTY) { - *(volatile uint32_t *)0x5302C74C = *(volatile uint32_t *)0x0FFFE468; - } - - /* HMPAN-229 provides hardcoded value if the trim value is 0 */ - if ((*(volatile uint32_t *)0x0FFFE46C != TRIM_VALUE_EMPTY) && - (*(volatile uint32_t *)0x0FFFE46C != 0)) { - *(volatile uint32_t *)0x5302C7D8 = *(volatile uint32_t *)0x0FFFE46C; - } else { - *(volatile uint32_t *)0x5302C7D8 = 0x00000004; - } - - if (*(volatile uint32_t *)0x0FFFE470 != TRIM_VALUE_EMPTY) { - *(volatile uint32_t *)0x5302C840 = *(volatile uint32_t *)0x0FFFE470; - } - - if (*(volatile uint32_t *)0x0FFFE474 != TRIM_VALUE_EMPTY) { - *(volatile uint32_t *)0x5302C844 = *(volatile uint32_t *)0x0FFFE474; - } - - if (*(volatile uint32_t *)0x0FFFE478 != TRIM_VALUE_EMPTY) { - *(volatile uint32_t *)0x5302C848 = *(volatile uint32_t *)0x0FFFE478; - } - - if (*(volatile uint32_t *)0x0FFFE47C != TRIM_VALUE_EMPTY) { - *(volatile uint32_t *)0x5302C84C = *(volatile uint32_t *)0x0FFFE47C; - } - - /* Apply HMPAN-103 workaround for nRF54H series*/ - if ((*(volatile uint32_t *)0x5302C8A0 == 0x80000000) || - (*(volatile uint32_t *)0x5302C8A0 == 0x0058120E)) { - *(volatile uint32_t *)0x5302C8A0 = 0x0058090E; - } - - *(volatile uint32_t *)0x5302C8A4 = 0x00F8AA5F; - *(volatile uint32_t *)0x5302C7AC = 0x8672827A; - *(volatile uint32_t *)0x5302C7B0 = 0x7E768672; - *(volatile uint32_t *)0x5302C7B4 = 0x0406007E; -#endif /* (CONFIG_SOC_SERIES_NRF54HX) */ + /* Currently there is no check for this workaround */ + esb_apply_nrf54h_229(); } static void esb_fem_for_tx_set(bool ack) @@ -1241,16 +1140,16 @@ static void esb_timer_handler(nrf_timer_event_t event_type, void *context) static int sys_timer_init(void) { - nrfx_err_t nrfx_err; + int err; const nrfx_timer_config_t config = { .frequency = NRFX_MHZ_TO_HZ(1), .mode = NRF_TIMER_MODE_TIMER, .bit_width = NRF_TIMER_BIT_WIDTH_16, }; - nrfx_err = nrfx_timer_init(&esb_timer, &config, esb_timer_handler); - if (nrfx_err != NRFX_SUCCESS) { - LOG_ERR("Failed to initialize nrfx timer (err %d)", nrfx_err); + err = nrfx_timer_init(&esb_timer, &config, esb_timer_handler); + if (err) { + LOG_ERR("Failed to initialize nrfx timer (err %d)", err); return -EFAULT; } @@ -1281,12 +1180,13 @@ static void start_tx_transaction(void) memcpy(pdu->data, current_payload->data, current_payload->length); if (fast_switching) { - nrf_radio_shorts_set(NRF_RADIO, radio_shorts_common); + nrf_radio_shorts_set(NRF_RADIO, (RADIO_RSSI_SHORTS | + NRF_RADIO_SHORT_TXREADY_START_MASK)); nrf_radio_event_clear(NRF_RADIO, ESB_RADIO_EVENT_END); nrf_radio_int_enable(NRF_RADIO, ESB_RADIO_INT_END_MASK); } else { - nrf_radio_shorts_set(NRF_RADIO, - (radio_shorts_common | NRF_RADIO_SHORT_DISABLED_RXEN_MASK)); + nrf_radio_shorts_set(NRF_RADIO, (RADIO_NORMAL_SW_SHORTS | + NRF_RADIO_SHORT_DISABLED_RXEN_MASK)); } nrf_radio_int_enable(NRF_RADIO, NRF_RADIO_INT_DISABLED_MASK); @@ -1309,12 +1209,15 @@ static void start_tx_transaction(void) /* Handling ack if noack is set to false or if selective auto ack is turned off */ if (ack) { if (fast_switching) { - nrf_radio_shorts_set(NRF_RADIO, radio_shorts_common); + nrf_radio_shorts_set( + NRF_RADIO, + (RADIO_RSSI_SHORTS | NRF_RADIO_SHORT_TXREADY_START_MASK)); nrf_radio_event_clear(NRF_RADIO, ESB_RADIO_EVENT_END); nrf_radio_int_enable(NRF_RADIO, ESB_RADIO_INT_END_MASK); } else { nrf_radio_shorts_set(NRF_RADIO, - (radio_shorts_common | NRF_RADIO_SHORT_DISABLED_RXEN_MASK)); + (RADIO_NORMAL_SW_SHORTS | + NRF_RADIO_SHORT_DISABLED_RXEN_MASK)); } /* Configure the retransmit counter */ @@ -1323,8 +1226,8 @@ static void start_tx_transaction(void) esb_state = ESB_STATE_PTX_TX_ACK; nrf_radio_int_enable(NRF_RADIO, NRF_RADIO_INT_DISABLED_MASK); } else if (IS_ENABLED(CONFIG_ESB_NEVER_DISABLE_TX)) { - nrf_radio_shorts_set(NRF_RADIO, radio_shorts_common & - ~ESB_SHORT_DISABLE_MASK); + nrf_radio_shorts_set( + NRF_RADIO, (RADIO_RSSI_SHORTS | NRF_RADIO_SHORT_READY_START_MASK)); nrf_timer_shorts_set(esb_timer.p_reg, (NRF_TIMER_SHORT_COMPARE1_STOP_MASK | NRF_TIMER_SHORT_COMPARE1_CLEAR_MASK)); @@ -1343,8 +1246,7 @@ static void start_tx_transaction(void) (esb_state == ESB_STATE_PTX_TX)); esb_state = ESB_STATE_PTX_TX; } else { - nrf_radio_shorts_set(NRF_RADIO, radio_shorts_common | - ESB_SHORT_DISABLE_MASK); + nrf_radio_shorts_set(NRF_RADIO, RADIO_NORMAL_SW_SHORTS); on_radio_disabled = on_radio_disabled_tx_noack; esb_state = ESB_STATE_PTX_TX; @@ -1441,7 +1343,7 @@ static void on_radio_disabled_tx(void) /* Remove the DISABLED -> RXEN shortcut, to make sure the radio stays * disabled after the RX window */ - nrf_radio_shorts_set(NRF_RADIO, radio_shorts_common); + nrf_radio_shorts_set(NRF_RADIO, RADIO_NORMAL_SW_SHORTS); /* Make sure the timer is started the next time the radio is ready, * and that it will disable the radio automatically if no packet is @@ -1483,8 +1385,7 @@ static void on_radio_disabled_tx(void) nrf_radio_packetptr_set(NRF_RADIO, rx_payload_buffer); if (fast_switching) { nrf_radio_int_disable(NRF_RADIO, ESB_RADIO_INT_END_MASK); - nrf_radio_shorts_set(NRF_RADIO, (radio_shorts_common | ESB_SHORT_DISABLE_MASK)); - nrf_radio_task_trigger(NRF_RADIO, NRF_RADIO_TASK_RXEN); + nrf_radio_task_trigger(NRF_RADIO, NRF_RADIO_TASK_START); } on_radio_disabled = on_radio_disabled_tx_wait_for_ack; esb_state = ESB_STATE_PTX_RX_ACK; @@ -1519,10 +1420,6 @@ static void on_radio_disabled_tx_wait_for_ack(void) } } - if (fast_switching) { - nrf_radio_shorts_set(NRF_RADIO, radio_shorts_common); - } - if ((atomic_get(&tx_fifo.count) == 0) || (esb_cfg.tx_mode == ESB_TXMODE_MANUAL)) { esb_state = ESB_STATE_IDLE; errata_216_off(); @@ -1555,12 +1452,13 @@ static void on_radio_disabled_tx_wait_for_ack(void) nrf_radio_event_clear(NRF_RADIO, NRF_RADIO_EVENT_READY); if (fast_switching) { - nrf_radio_shorts_set(NRF_RADIO, radio_shorts_common); + nrf_radio_shorts_set(NRF_RADIO, (RADIO_RSSI_SHORTS | + NRF_RADIO_SHORT_TXREADY_START_MASK)); nrf_radio_event_clear(NRF_RADIO, ESB_RADIO_EVENT_END); nrf_radio_int_enable(NRF_RADIO, ESB_RADIO_INT_END_MASK); } else { - nrf_radio_shorts_set(NRF_RADIO, - (radio_shorts_common | NRF_RADIO_SHORT_DISABLED_RXEN_MASK)); + nrf_radio_shorts_set(NRF_RADIO, (RADIO_NORMAL_SW_SHORTS | + NRF_RADIO_SHORT_DISABLED_RXEN_MASK)); } if (esb_cfg.protocol == ESB_PROTOCOL_ESB) { @@ -1625,11 +1523,12 @@ static void start_rx_listening(void) on_radio_disabled = NULL; } else { if (fast_switching) { - nrf_radio_shorts_set(NRF_RADIO, radio_shorts_common); + nrf_radio_shorts_set(NRF_RADIO, (RADIO_RSSI_SHORTS | + NRF_RADIO_SHORT_RXREADY_START_MASK)); nrf_radio_event_clear(NRF_RADIO, ESB_RADIO_EVENT_END); nrf_radio_int_enable(NRF_RADIO, ESB_RADIO_INT_END_MASK); } else { - nrf_radio_shorts_set(NRF_RADIO, (radio_shorts_common | + nrf_radio_shorts_set(NRF_RADIO, (RADIO_NORMAL_SW_SHORTS | NRF_RADIO_SHORT_DISABLED_TXEN_MASK)); } @@ -1662,7 +1561,7 @@ static void clear_events_restart_rx(void) esb_fem_lna_reset(); esb_ppi_for_txrx_clear(true, false); - nrf_radio_shorts_set(NRF_RADIO, radio_shorts_common); + nrf_radio_shorts_set(NRF_RADIO, 0); if (esb_cfg.protocol == ESB_PROTOCOL_ESB) { update_rf_payload_format_esb(0); @@ -1679,7 +1578,13 @@ static void clear_events_restart_rx(void) nrf_radio_event_clear(NRF_RADIO, NRF_RADIO_EVENT_DISABLED); - nrf_radio_shorts_set(NRF_RADIO, (radio_shorts_common | NRF_RADIO_SHORT_DISABLED_TXEN_MASK)); + if (fast_switching) { + nrf_radio_shorts_set(NRF_RADIO, + (RADIO_RSSI_SHORTS | NRF_RADIO_SHORT_RXREADY_START_MASK)); + } else { + nrf_radio_shorts_set(NRF_RADIO, + (RADIO_NORMAL_SW_SHORTS | NRF_RADIO_SHORT_DISABLED_TXEN_MASK)); + } esb_ppi_for_txrx_set(true, false); esb_fem_for_rx_set(); @@ -1787,11 +1692,12 @@ static void on_radio_disabled_rx(void) nrf_radio_packetptr_set(NRF_RADIO, tx_pdu); if (fast_switching) { - nrf_radio_shorts_set(NRF_RADIO, radio_shorts_common); + nrf_radio_shorts_set(NRF_RADIO, (RADIO_RSSI_SHORTS | + NRF_RADIO_SHORT_TXREADY_START_MASK)); nrf_radio_task_trigger(NRF_RADIO, NRF_RADIO_TASK_TXEN); } else { - nrf_radio_shorts_set(NRF_RADIO, - (radio_shorts_common | NRF_RADIO_SHORT_DISABLED_RXEN_MASK)); + nrf_radio_shorts_set(NRF_RADIO, (RADIO_NORMAL_SW_SHORTS | + NRF_RADIO_SHORT_DISABLED_RXEN_MASK)); } on_radio_disabled = on_radio_disabled_rx_send_ack; @@ -1821,11 +1727,12 @@ static void on_radio_disabled_rx_send_ack(void) nrf_radio_packetptr_set(NRF_RADIO, rx_payload_buffer); if (fast_switching) { - nrf_radio_shorts_set(NRF_RADIO, radio_shorts_common); + nrf_radio_shorts_set(NRF_RADIO, + (RADIO_RSSI_SHORTS | NRF_RADIO_SHORT_RXREADY_START_MASK)); nrf_radio_task_trigger(NRF_RADIO, NRF_RADIO_TASK_RXEN); } else { - nrf_radio_shorts_set(NRF_RADIO, (radio_shorts_common | - NRF_RADIO_SHORT_DISABLED_TXEN_MASK)); + nrf_radio_shorts_set(NRF_RADIO, + (RADIO_NORMAL_SW_SHORTS | NRF_RADIO_SHORT_DISABLED_TXEN_MASK)); } on_radio_disabled = on_radio_disabled_rx; diff --git a/subsys/esb/esb_dppi.c b/subsys/esb/esb_dppi.c index 858b1e8750aa..d1923e51d8dd 100644 --- a/subsys/esb/esb_dppi.c +++ b/subsys/esb/esb_dppi.c @@ -53,6 +53,10 @@ void esb_ppi_for_txrx_set(bool rx, bool timer_start) egu_timer_start); } + if (IS_ENABLED(CONFIG_ESB_FAST_SWITCHING) && timer_start && !rx) { + nrf_radio_subscribe_set(NRF_RADIO, NRF_RADIO_TASK_RXEN, disabled_phy_end_egu); + } + channels_mask = (BIT(egu_timer_start) | BIT(egu_ramp_up)); @@ -82,6 +86,10 @@ void esb_ppi_for_txrx_clear(bool rx, bool timer_start) if (timer_start) { nrf_timer_subscribe_clear(ESB_NRF_TIMER_INSTANCE, NRF_TIMER_TASK_START); } + + if (IS_ENABLED(CONFIG_ESB_FAST_SWITCHING) && timer_start && !rx) { + nrf_radio_subscribe_clear(NRF_RADIO, NRF_RADIO_TASK_RXEN); + } } void esb_ppi_for_fem_set(void) diff --git a/subsys/esb/esb_peripherals.h b/subsys/esb/esb_peripherals.h index 66f46806513a..7de10088fc42 100644 --- a/subsys/esb/esb_peripherals.h +++ b/subsys/esb/esb_peripherals.h @@ -34,7 +34,7 @@ extern "C" { /** Use end of packet send/received over the air for nRF54 devices. */ #define ESB_RADIO_EVENT_END NRF_RADIO_EVENT_PHYEND - #define ESB_SHORT_DISABLE_MASK NRF_RADIO_SHORT_PHYEND_DISABLE_MASK + #define ESB_RADIO_SHORT_END_DISABLE NRF_RADIO_SHORT_PHYEND_DISABLE_MASK #define ESB_RADIO_INT_END_MASK NRF_RADIO_INT_PHYEND_MASK @@ -55,7 +55,7 @@ extern "C" { /** Use end of packet send/received over the air for nRF54 devices. */ #define ESB_RADIO_EVENT_END NRF_RADIO_EVENT_PHYEND - #define ESB_SHORT_DISABLE_MASK NRF_RADIO_SHORT_PHYEND_DISABLE_MASK + #define ESB_RADIO_SHORT_END_DISABLE NRF_RADIO_SHORT_PHYEND_DISABLE_MASK #define ESB_RADIO_INT_END_MASK NRF_RADIO_INT_PHYEND_MASK #else @@ -71,7 +71,7 @@ extern "C" { /** nRF52 and nRF53 device has just one kind of end event. */ #define ESB_RADIO_EVENT_END NRF_RADIO_EVENT_END - #define ESB_SHORT_DISABLE_MASK NRF_RADIO_SHORT_END_DISABLE_MASK + #define ESB_RADIO_SHORT_END_DISABLE NRF_RADIO_SHORT_END_DISABLE_MASK #define ESB_RADIO_INT_END_MASK NRF_RADIO_INT_END_MASK diff --git a/subsys/esb/esb_workarounds.h b/subsys/esb/esb_workarounds.h new file mode 100644 index 000000000000..6882fb930794 --- /dev/null +++ b/subsys/esb/esb_workarounds.h @@ -0,0 +1,166 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef ESB_WORKAROUNDS_H__ +#define ESB_WORKAROUNDS_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include + +#include + +#if NRF54H_ERRATA_216_ENABLE_WORKAROUND +#include +#endif /* NRF54H_ERRATA_216_ENABLE_WORKAROUND */ + +/* nRF52 Workaround 182 */ +static void esb_apply_nrf52_182(void); + +/* nRF52 Workaround 143 */ +static void esb_apply_nrf52_143(uint32_t base_address_mask); + +/* nRF54H Workaround 84 */ +/* HMPAN-84 is implemented in the ESB samples in the clocks_start function */ + +/* nRF54H Workaround 103 */ +static void esb_apply_nrf54h_103(void); + +/* nRF54H Workaround 216 */ +static void esb_apply_nrf54h_216(bool on); + +/* nRF54H Workaround 229 */ +static void esb_apply_nrf54h_229(void); + +/* nRF54L Workaround 20 */ +/* MLTPAN-20 is implemented in the ESB samples in the clocks_start function */ + +/* nRF54L Workaround 39 */ +/* MLTPAN-39 is implemented in the ESB samples in the clocks_start function */ + +#if NRF52_ERRATA_143_ENABLE_WORKAROUND +static void esb_apply_nrf52_143(uint32_t base_address_mask) +{ + /* Load the two addresses before comparing them to ensure + * defined ordering of volatile accesses. + */ + uint32_t addr0 = nrf_radio_base0_get(NRF_RADIO) & base_address_mask; + uint32_t addr1 = nrf_radio_base1_get(NRF_RADIO) & base_address_mask; + + if (addr0 == addr1) { + uint32_t radio_prefix0 = nrf_radio_prefix0_get(NRF_RADIO); + uint32_t radio_prefix1 = nrf_radio_prefix1_get(NRF_RADIO); + + uint8_t prefix0 = radio_prefix0 & RADIO_PREFIX0_AP0_Msk; + uint8_t prefix1 = (radio_prefix0 & RADIO_PREFIX0_AP1_Msk) >> RADIO_PREFIX0_AP1_Pos; + uint8_t prefix2 = (radio_prefix0 & RADIO_PREFIX0_AP2_Msk) >> RADIO_PREFIX0_AP2_Pos; + uint8_t prefix3 = (radio_prefix0 & RADIO_PREFIX0_AP3_Msk) >> RADIO_PREFIX0_AP3_Pos; + uint8_t prefix4 = radio_prefix1 & RADIO_PREFIX1_AP4_Msk; + uint8_t prefix5 = (radio_prefix1 & RADIO_PREFIX1_AP5_Msk) >> RADIO_PREFIX1_AP5_Pos; + uint8_t prefix6 = (radio_prefix1 & RADIO_PREFIX1_AP6_Msk) >> RADIO_PREFIX1_AP6_Pos; + uint8_t prefix7 = (radio_prefix1 & RADIO_PREFIX1_AP7_Msk) >> RADIO_PREFIX1_AP7_Pos; + + if ((prefix0 == prefix1) || (prefix0 == prefix2) || + (prefix0 == prefix3) || (prefix0 == prefix4) || + (prefix0 == prefix5) || (prefix0 == prefix6) || + (prefix0 == prefix7)) { + /* This will cause a 3dBm sensitivity loss, + * avoid using such address combinations if possible. + */ + *(volatile uint32_t *)0x40001774 = + ((*(volatile uint32_t *)0x40001774) & 0xfffffffe) | 0x01000000; + } + } +} +#else +static void esb_apply_nrf52_143(uint32_t base_address_mask) +{ + ARG_UNUSED(base_address_mask); +} +#endif /* NRF52_ERRATA_143_ENABLE_WORKAROUND */ + +#if NRF52_ERRATA_182_ENABLE_WORKAROUND +static void esb_apply_nrf52_182(void) +{ + *(volatile uint32_t *)0x4000173C |= (1 << 10); +} +#else +static void esb_apply_nrf52_182(void) +{ + /* No implementation needed */ +} +#endif /* NRF52_ERRATA_182_ENABLE_WORKAROUND */ + +#if NRF54H_ERRATA_103_ENABLE_WORKAROUND +static void esb_apply_nrf54h_103(void) +{ + if ((*(volatile uint32_t *)0x5302C8A0 == 0x80000000) || + (*(volatile uint32_t *)0x5302C8A0 == 0x0058120E)) { + *(volatile uint32_t *)0x5302C8A0 = 0x0058090E; + } + + *(volatile uint32_t *)0x5302C8A4 = 0x00F8AA5F; + *(volatile uint32_t *)0x5302C8A8 = 0x00C00030; + *(volatile uint32_t *)0x5302C8AC = 0x00A80030; + *(volatile uint32_t *)0x5302C7AC = 0x8672827A; + *(volatile uint32_t *)0x5302C7B0 = 0x7E768672; + *(volatile uint32_t *)0x5302C7B4 = 0x0406007E; + *(volatile uint32_t *)0x5302C7E4 = 0x0412C384; +} +#else +static void esb_apply_nrf54h_103(void) +{ + /* No implementation needed */ +} +#endif /* NRF54H_ERRATA_103_ENABLE_WORKAROUND */ + +#if NRF54H_ERRATA_216_ENABLE_WORKAROUND +static inline void esb_apply_nrf54h_216(bool on) +{ + static const struct mbox_dt_spec on_channel = + MBOX_DT_SPEC_GET(DT_NODELABEL(cpurad_cpusys_errata216_mboxes), on_req); + static const struct mbox_dt_spec off_channel = + MBOX_DT_SPEC_GET(DT_NODELABEL(cpurad_cpusys_errata216_mboxes), off_req); + const struct mbox_dt_spec *spec = on ? &on_channel : &off_channel; + + if (!IS_ENABLED(NRF54H_ERRATA_216_ENABLE_WORKAROUND)) { + return; + } + + if (mbox_send_dt(spec, NULL)) { + /* Should not happen. */ + __ASSERT_NO_MSG(false); + } +} +#else +static void esb_apply_nrf54h_216(bool on) +{ + ARG_UNUSED(on); +} +#endif /* NRF54H_ERRATA_216_ENABLE_WORKAROUND*/ + +#if defined(CONFIG_SOC_SERIES_NRF54HX) +static void esb_apply_nrf54h_229(void) +{ + if (*(volatile uint32_t *)0x0FFFE46C == 0x0) { + *(volatile uint32_t *)0x5302C7D8 = 0x00000004; + } +} +#else +static void esb_apply_nrf54h_229(void) +{ + /* No implementation needed */ +} +#endif /* (CONFIG_SOC_SERIES_NRF54HX) */ + +#ifdef __cplusplus +} +#endif + +#endif /* ESB_WORKAROUNDS_H__ */ diff --git a/subsys/mpsl/hwres/mpsl_hwres.c b/subsys/mpsl/hwres/mpsl_hwres.c index d84bfef22b5c..a47b64a121d2 100644 --- a/subsys/mpsl/hwres/mpsl_hwres.c +++ b/subsys/mpsl/hwres/mpsl_hwres.c @@ -35,25 +35,20 @@ bool mpsl_hwres_dppi_channel_alloc(NRF_DPPIC_Type *p_dppic, uint8_t *p_dppi_ch) #include static uint32_t ppib_get_domain(NRF_PPIB_Type *p_ppib) { - switch ((uint32_t)p_ppib) { - case (uint32_t)NRF_PPIB00: - /* fall through */ - case (uint32_t)NRF_PPIB10: + if ((uint32_t)p_ppib == (uint32_t)NRF_PPIB00 || + (uint32_t)p_ppib == (uint32_t)NRF_PPIB10) { return NRFX_GPPI_NODE_PPIB00_10; - case (uint32_t)NRF_PPIB11: - /* fall through */ - case (uint32_t)NRF_PPIB21: + } else if ((uint32_t)p_ppib == (uint32_t)NRF_PPIB11 || + (uint32_t)p_ppib == (uint32_t)NRF_PPIB21) { return NRFX_GPPI_NODE_PPIB11_21; - case (uint32_t)NRF_PPIB01: - /* fall through */ - case (uint32_t)NRF_PPIB20: + } else if ((uint32_t)p_ppib == (uint32_t)NRF_PPIB01 || + (uint32_t)p_ppib == (uint32_t)NRF_PPIB20) { return NRFX_GPPI_NODE_PPIB01_20; - case (uint32_t)NRF_PPIB22: - /* fall through */ - case (uint32_t)NRF_PPIB30: + } else if ((uint32_t)p_ppib == (uint32_t)NRF_PPIB22 || + (uint32_t)p_ppib == (uint32_t)NRF_PPIB30) { return NRFX_GPPI_NODE_PPIB22_30; - default: - __ASSERT_NO_MSG("Unexpected PPIB"); + } else { + __ASSERT(false, "Unexpected PPIB"); return 0; } } diff --git a/subsys/mpsl/pin_debug/mpsl_pin_debug_nrf54.c b/subsys/mpsl/pin_debug/mpsl_pin_debug_nrf54.c index f8ac2915e8fa..825bb7128b5d 100644 --- a/subsys/mpsl/pin_debug/mpsl_pin_debug_nrf54.c +++ b/subsys/mpsl/pin_debug/mpsl_pin_debug_nrf54.c @@ -22,8 +22,8 @@ LOG_MODULE_REGISTER(mpsl_radio_pin_debug, CONFIG_MPSL_LOG_LEVEL); static int m_ppi_config(void) { nrfx_gpiote_t *gpiote = &GPIOTE_NRFX_INST_BY_NODE(GPIOTE_NODE); - uint32_t rad_domain = nrfx_gppi_domain_id_get(NRF_DPPIC10); - uint32_t dst_domain = nrfx_gppi_domain_id_get(gpiote->p_reg); + uint32_t rad_domain = nrfx_gppi_domain_id_get((uint32_t)NRF_DPPIC10); + uint32_t dst_domain = nrfx_gppi_domain_id_get((uint32_t)gpiote->p_reg); nrfx_gppi_resource_t rad_resource; nrfx_gppi_handle_t handle; uint32_t tep[4]; @@ -43,7 +43,7 @@ static int m_ppi_config(void) CONFIG_MPSL_PIN_DEBUG_RADIO_ADDRESS_AND_END_PIN); tep[3] = nrfx_gpiote_clr_task_address_get(gpiote, CONFIG_MPSL_PIN_DEBUG_RADIO_ADDRESS_AND_END_PIN); - rad_resource.rad_domain = nrfx_gppi_domain_id_get(NRF_DPPIC10); + rad_resource.domain_id = nrfx_gppi_domain_id_get((uint32_t)NRF_DPPIC10); for (size_t i = 0; i < ARRAY_SIZE(pub_ch); i++) { rad_resource.channel = pub_ch[i]; @@ -51,7 +51,7 @@ static int m_ppi_config(void) if (err < 0) { return err; } - nrfx_gppi_ep_attach(handle, tep[i]); + nrfx_gppi_ep_attach(tep[i], handle); /* Channel in radio domain is not enabled by this function. */ nrfx_gppi_conn_enable(handle); } diff --git a/subsys/mpsl/pin_debug/mpsl_pin_debug_radio_core.c b/subsys/mpsl/pin_debug/mpsl_pin_debug_radio_core.c index 21ab37940f0e..ff5a61bf17d3 100644 --- a/subsys/mpsl/pin_debug/mpsl_pin_debug_radio_core.c +++ b/subsys/mpsl/pin_debug/mpsl_pin_debug_radio_core.c @@ -49,7 +49,7 @@ static int m_ppi_config(void) #endif for (size_t i = 0; ARRAY_SIZE(tep); i++) { #if defined(DPPI_PRESENT) - nrfx_gppi_ep_attach(handle[i], tep[i]); + nrfx_gppi_ep_attach(tep[i], handle[i]); #else int err = nrfx_gppi_conn_alloc(eep[i], tep[i], &handle[i]); diff --git a/subsys/net/openthread/rpc/Kconfig b/subsys/net/openthread/rpc/Kconfig index d493a7c5817a..9532b6dc5add 100644 --- a/subsys/net/openthread/rpc/Kconfig +++ b/subsys/net/openthread/rpc/Kconfig @@ -96,11 +96,4 @@ config OPENTHREAD_RPC_ERASE_SETTINGS endmenu # "OpenThread over RPC server configuration" -config OPENTHREAD_RPC_INITIALIZE_NRF_RPC - bool "Automatically initialize nRF RPC library" - default n - help - Initialize nRF RPC library during the system startup. Disabling this - option allow user to initialize it in a different way. - endif # OPENTHREAD_RPC diff --git a/subsys/net/openthread/rpc/client/ot_rpc_instance.c b/subsys/net/openthread/rpc/client/ot_rpc_instance.c index 06f4d7f87ac4..7f96af04caaf 100644 --- a/subsys/net/openthread/rpc/client/ot_rpc_instance.c +++ b/subsys/net/openthread/rpc/client/ot_rpc_instance.c @@ -13,18 +13,23 @@ #include +/* + * The actual otInstance object resides on OT RPC server and is only accessed by OT RPC client using + * remote OpenThread API calls. Nevertheless, otInstanceInitSingle() on OT RPC client shall return a + * valid non-null address, so the variable below is defined to represent otInstance object. + */ +static char ot_instance; + otInstance *otInstanceInitSingle(void) { struct nrf_rpc_cbor_ctx ctx; - uintptr_t instance_rep; NRF_RPC_CBOR_ALLOC(&ot_group, ctx, 0); - nrf_rpc_cbor_cmd_rsp_no_err(&ot_group, OT_RPC_CMD_INSTANCE_INIT_SINGLE, &ctx); - nrf_rpc_rsp_decode_uint(&ot_group, &ctx, &instance_rep, sizeof(instance_rep)); - nrf_rpc_cbor_decoding_done(&ot_group, &ctx); + nrf_rpc_cbor_cmd_no_err(&ot_group, OT_RPC_CMD_INSTANCE_INIT_SINGLE, &ctx, + nrf_rpc_rsp_decode_void, NULL); - return (otInstance *)instance_rep; + return (otInstance *)&ot_instance; } uint32_t otInstanceGetId(otInstance *aInstance) @@ -32,9 +37,9 @@ uint32_t otInstanceGetId(otInstance *aInstance) struct nrf_rpc_cbor_ctx ctx; uint32_t id; - NRF_RPC_CBOR_ALLOC(&ot_group, ctx, 1 + sizeof(uintptr_t)); - nrf_rpc_encode_uint(&ctx, (uintptr_t)aInstance); + ARG_UNUSED(aInstance); + NRF_RPC_CBOR_ALLOC(&ot_group, ctx, 0); nrf_rpc_cbor_cmd_no_err(&ot_group, OT_RPC_CMD_INSTANCE_GET_ID, &ctx, nrf_rpc_rsp_decode_u32, &id); @@ -46,9 +51,9 @@ bool otInstanceIsInitialized(otInstance *aInstance) struct nrf_rpc_cbor_ctx ctx; bool initialized; - NRF_RPC_CBOR_ALLOC(&ot_group, ctx, 1 + sizeof(uintptr_t)); - nrf_rpc_encode_uint(&ctx, (uintptr_t)aInstance); + ARG_UNUSED(aInstance); + NRF_RPC_CBOR_ALLOC(&ot_group, ctx, 0); nrf_rpc_cbor_cmd_no_err(&ot_group, OT_RPC_CMD_INSTANCE_IS_INITIALIZED, &ctx, nrf_rpc_rsp_decode_bool, &initialized); @@ -59,9 +64,9 @@ void otInstanceFinalize(otInstance *aInstance) { struct nrf_rpc_cbor_ctx ctx; - NRF_RPC_CBOR_ALLOC(&ot_group, ctx, 1 + sizeof(uintptr_t)); - nrf_rpc_encode_uint(&ctx, (uintptr_t)aInstance); + ARG_UNUSED(aInstance); + NRF_RPC_CBOR_ALLOC(&ot_group, ctx, 0); nrf_rpc_cbor_cmd_no_err(&ot_group, OT_RPC_CMD_INSTANCE_FINALIZE, &ctx, nrf_rpc_rsp_decode_void, NULL); } @@ -71,9 +76,9 @@ otError otInstanceErasePersistentInfo(otInstance *aInstance) struct nrf_rpc_cbor_ctx ctx; otError error; - NRF_RPC_CBOR_ALLOC(&ot_group, ctx, 1 + sizeof(uintptr_t)); - nrf_rpc_encode_uint(&ctx, (uintptr_t)aInstance); + ARG_UNUSED(aInstance); + NRF_RPC_CBOR_ALLOC(&ot_group, ctx, 0); nrf_rpc_cbor_cmd_no_err(&ot_group, OT_RPC_CMD_INSTANCE_ERASE_PERSISTENT_INFO, &ctx, ot_rpc_decode_error, &error); diff --git a/subsys/net/openthread/rpc/common/ot_rpc_group.c b/subsys/net/openthread/rpc/common/ot_rpc_group.c index 1151163e7619..6b90673a54c0 100644 --- a/subsys/net/openthread/rpc/common/ot_rpc_group.c +++ b/subsys/net/openthread/rpc/common/ot_rpc_group.c @@ -24,25 +24,3 @@ NRF_RPC_IPC_TRANSPORT(ot_rpc_tr, DEVICE_DT_GET(DT_NODELABEL(ipc0)), "ot_rpc_ept" #endif NRF_RPC_GROUP_DEFINE(ot_group, "ot", &ot_rpc_tr, NULL, NULL, NULL); LOG_MODULE_REGISTER(ot_rpc, LOG_LEVEL_DBG); - -#ifdef CONFIG_OPENTHREAD_RPC_INITIALIZE_NRF_RPC -static void err_handler(const struct nrf_rpc_err_report *report) -{ - LOG_ERR("nRF RPC error %d ocurred. See nRF RPC logs for more details", report->code); - k_oops(); -} - -static int serialization_init(void) -{ - int err; - - err = nrf_rpc_init(err_handler); - if (err) { - return -EINVAL; - } - - return 0; -} - -SYS_INIT(serialization_init, POST_KERNEL, CONFIG_APPLICATION_INIT_PRIORITY); -#endif /* CONFIG_OPENTHREAD_RPC_INITIALIZE_NRF_RPC */ diff --git a/subsys/net/openthread/rpc/server/ot_rpc_instance.c b/subsys/net/openthread/rpc/server/ot_rpc_instance.c index eb963228d606..aa6c45a5869a 100644 --- a/subsys/net/openthread/rpc/server/ot_rpc_instance.c +++ b/subsys/net/openthread/rpc/server/ot_rpc_instance.c @@ -72,15 +72,13 @@ static ot_rpc_callback_t *ot_rpc_callback_del(uint32_t callback, uint32_t contex static void ot_rpc_cmd_instance_init_single(const struct nrf_rpc_group *group, struct nrf_rpc_cbor_ctx *ctx, void *handler_data) { - otInstance *instance; - nrf_rpc_cbor_decoding_done(group, ctx); ot_rpc_mutex_lock(); - instance = otInstanceInitSingle(); + (void)otInstanceInitSingle(); ot_rpc_mutex_unlock(); - nrf_rpc_rsp_send_uint(group, (uintptr_t)instance); + nrf_rpc_rsp_send_void(group); } NRF_RPC_CBOR_CMD_DECODER(ot_group, ot_rpc_cmd_instance_init_single, OT_RPC_CMD_INSTANCE_INIT_SINGLE, @@ -89,24 +87,12 @@ NRF_RPC_CBOR_CMD_DECODER(ot_group, ot_rpc_cmd_instance_init_single, OT_RPC_CMD_I static void ot_rpc_cmd_instance_get_id(const struct nrf_rpc_group *group, struct nrf_rpc_cbor_ctx *ctx, void *handler_data) { - otInstance *instance; uint32_t instance_id; - instance = (otInstance *)nrf_rpc_decode_uint(ctx); - - if (!nrf_rpc_decoding_done_and_check(group, ctx)) { - ot_rpc_report_cmd_decoding_error(OT_RPC_CMD_INSTANCE_GET_ID); - return; - } - - if (instance != openthread_get_default_instance()) { - /* The instance is unknown to the OT RPC server. */ - ot_rpc_report_cmd_decoding_error(OT_RPC_CMD_INSTANCE_GET_ID); - return; - } + nrf_rpc_cbor_decoding_done(group, ctx); ot_rpc_mutex_lock(); - instance_id = otInstanceGetId(instance); + instance_id = otInstanceGetId(openthread_get_default_instance()); ot_rpc_mutex_unlock(); nrf_rpc_rsp_send_uint(group, instance_id); @@ -118,24 +104,12 @@ NRF_RPC_CBOR_CMD_DECODER(ot_group, ot_rpc_cmd_instance_get_id, OT_RPC_CMD_INSTAN static void ot_rpc_cmd_instance_is_initialized(const struct nrf_rpc_group *group, struct nrf_rpc_cbor_ctx *ctx, void *handler_data) { - otInstance *instance; bool initialized; - instance = (otInstance *)nrf_rpc_decode_uint(ctx); - - if (!nrf_rpc_decoding_done_and_check(group, ctx)) { - ot_rpc_report_cmd_decoding_error(OT_RPC_CMD_INSTANCE_GET_ID); - return; - } - - if (instance != openthread_get_default_instance()) { - /* The instance is unknown to the OT RPC server. */ - ot_rpc_report_cmd_decoding_error(OT_RPC_CMD_INSTANCE_GET_ID); - return; - } + nrf_rpc_cbor_decoding_done(group, ctx); ot_rpc_mutex_lock(); - initialized = otInstanceIsInitialized(instance); + initialized = otInstanceIsInitialized(openthread_get_default_instance()); ot_rpc_mutex_unlock(); nrf_rpc_rsp_send_bool(group, initialized); @@ -148,23 +122,10 @@ NRF_RPC_CBOR_CMD_DECODER(ot_group, ot_rpc_cmd_instance_is_initialized, static void ot_rpc_cmd_instance_finalize(const struct nrf_rpc_group *group, struct nrf_rpc_cbor_ctx *ctx, void *handler_data) { - otInstance *instance; - - instance = (otInstance *)nrf_rpc_decode_uint(ctx); - - if (!nrf_rpc_decoding_done_and_check(group, ctx)) { - ot_rpc_report_cmd_decoding_error(OT_RPC_CMD_INSTANCE_GET_ID); - return; - } - - if (instance != openthread_get_default_instance()) { - /* The instance is unknown to the OT RPC server. */ - ot_rpc_report_cmd_decoding_error(OT_RPC_CMD_INSTANCE_GET_ID); - return; - } + nrf_rpc_cbor_decoding_done(group, ctx); ot_rpc_mutex_lock(); - otInstanceFinalize(instance); + otInstanceFinalize(openthread_get_default_instance()); ot_rpc_mutex_unlock(); nrf_rpc_rsp_send_void(group); @@ -177,24 +138,12 @@ static void ot_rpc_cmd_instance_erase_persistent_info(const struct nrf_rpc_group struct nrf_rpc_cbor_ctx *ctx, void *handler_data) { - otInstance *instance; otError error; - instance = (otInstance *)nrf_rpc_decode_uint(ctx); - - if (!nrf_rpc_decoding_done_and_check(group, ctx)) { - ot_rpc_report_cmd_decoding_error(OT_RPC_CMD_INSTANCE_GET_ID); - return; - } - - if (instance != openthread_get_default_instance()) { - /* The instance is unknown to the OT RPC server. */ - ot_rpc_report_cmd_decoding_error(OT_RPC_CMD_INSTANCE_GET_ID); - return; - } + nrf_rpc_cbor_decoding_done(group, ctx); ot_rpc_mutex_lock(); - error = otInstanceErasePersistentInfo(instance); + error = otInstanceErasePersistentInfo(openthread_get_default_instance()); ot_rpc_mutex_unlock(); nrf_rpc_rsp_send_uint(group, error); diff --git a/subsys/nfc/rpc/common/nfc_rpc_group.c b/subsys/nfc/rpc/common/nfc_rpc_group.c index 4ef393812d14..23cd5c385909 100644 --- a/subsys/nfc/rpc/common/nfc_rpc_group.c +++ b/subsys/nfc/rpc/common/nfc_rpc_group.c @@ -25,25 +25,3 @@ NRF_RPC_IPC_TRANSPORT(nfc_rpc_tr, DEVICE_DT_GET(DT_NODELABEL(ipc0)), "nfc_rpc_ep #endif NRF_RPC_GROUP_DEFINE(nfc_group, "nfc", &nfc_rpc_tr, NULL, NULL, NULL); LOG_MODULE_REGISTER(nfc_rpc, LOG_LEVEL_DBG); - -#ifdef CONFIG_NFC_RPC_INITIALIZE_NRF_RPC -static void err_handler(const struct nrf_rpc_err_report *report) -{ - LOG_ERR("nRF RPC error %d ocurred. See nRF RPC logs for more details", report->code); - k_oops(); -} - -static int serialization_init(void) -{ - int err; - - err = nrf_rpc_init(err_handler); - if (err) { - return -EINVAL; - } - - return 0; -} - -SYS_INIT(serialization_init, POST_KERNEL, CONFIG_APPLICATION_INIT_PRIORITY); -#endif /* CONFIG_NFC_RPC_INITIALIZE_NRF_RPC */ diff --git a/subsys/nrf_rpc/CMakeLists.txt b/subsys/nrf_rpc/CMakeLists.txt index 844bdbb78091..246d3ff9bec9 100644 --- a/subsys/nrf_rpc/CMakeLists.txt +++ b/subsys/nrf_rpc/CMakeLists.txt @@ -18,4 +18,6 @@ zephyr_library_sources_ifdef(CONFIG_NRF_RPC_CALLBACK_PROXY nrf_rpc_cbkproxy.c) zephyr_library_sources_ifdef(CONFIG_NRF_RPC_UART_TRANSPORT nrf_rpc_uart.c) +zephyr_library_sources_ifdef(CONFIG_NRF_RPC_INIT nrf_rpc_init.c) + add_subdirectory_ifdef(CONFIG_NRF_RPC_UTILS rpc_utils) diff --git a/subsys/nrf_rpc/Kconfig b/subsys/nrf_rpc/Kconfig index ed6f68d5aae1..c8db971cc1f7 100644 --- a/subsys/nrf_rpc/Kconfig +++ b/subsys/nrf_rpc/Kconfig @@ -15,6 +15,12 @@ config _NRF_RPC_DUMMY_SELECT default y select THREAD_CUSTOM_DATA +config NRF_RPC_CBOR + select ZCBOR + select ZCBOR_STOP_ON_ERROR + +# End of Zephyr port dependencies selection + choice NRF_RPC_TRANSPORT prompt "NRF RPC transport" default NRF_RPC_IPC_SERVICE @@ -109,13 +115,6 @@ endif # NRF_RPC_UART_RELIABLE endmenu # "nRF RPC over UART configuration" -config NRF_RPC_CBOR - bool - select ZCBOR - select ZCBOR_STOP_ON_ERROR - -# End of Zephyr port dependencies selection - config NRF_RPC_THREAD_STACK_SIZE int "Stack size of thread from thread pool" default 1024 @@ -174,6 +173,11 @@ config NRF_RPC_CBKPROXY_IN_SLOTS endif # NRF_RPC_CALLBACK_PROXY +config NRF_RPC_INIT + bool "Automatically initialize nRF RPC library" + help + Initialize nRF RPC library during the system startup. + module = NRF_RPC module-str = NRF_RPC source "$(ZEPHYR_BASE)/subsys/logging/Kconfig.template.log_config" @@ -194,6 +198,14 @@ source "$(ZEPHYR_BASE)/subsys/logging/Kconfig.template.log_config" endif # NRF_RPC_CBOR +if NRF_RPC_INIT + +module = NRF_RPC_INIT +module-str = NRF_RPC_INIT +source "$(ZEPHYR_BASE)/subsys/logging/Kconfig.template.log_config" + +endif # NRF_RPC_INIT + rsource "rpc_utils/Kconfig" endif # NRF_RPC diff --git a/subsys/nrf_rpc/nrf_rpc_init.c b/subsys/nrf_rpc/nrf_rpc_init.c new file mode 100644 index 000000000000..dae4b54ab4e5 --- /dev/null +++ b/subsys/nrf_rpc/nrf_rpc_init.c @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#define NRF_RPC_LOG_MODULE NRF_RPC_INIT +#include + +#include + +#include + +static void err_handler(const struct nrf_rpc_err_report *report) +{ + LOG_ERR("nRF RPC error %d ocurred. See nRF RPC logs for more details", + report->code); + k_oops(); +} + +static int nrf_rpc_sys_init(void) +{ + int err; + + LOG_DBG("RPC init begin"); + + err = nrf_rpc_init(err_handler); + if (err) { + return -EINVAL; + } + + LOG_DBG("RPC init done"); + + return 0; +} + +SYS_INIT(nrf_rpc_sys_init, APPLICATION, CONFIG_APPLICATION_INIT_PRIORITY); diff --git a/subsys/nrf_security/cmake/psa_crypto_config.cmake b/subsys/nrf_security/cmake/psa_crypto_config.cmake index 9e2c47533362..5e7006bbb0a3 100644 --- a/subsys/nrf_security/cmake/psa_crypto_config.cmake +++ b/subsys/nrf_security/cmake/psa_crypto_config.cmake @@ -57,6 +57,7 @@ kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_PURE_EDDSA_TWISTED_EDWARDS_448 kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_PURE_EDDSA_TWISTED_EDWARDS) kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_RSA_PKCS1V15_SIGN) kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_ED25519PH) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_ED448PH) kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_RSA_PSS) kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_ASYMMETRIC_SIGNATURE_ANY_ECC) kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_ASYMMETRIC_SIGNATURE_ANY_RSA) @@ -74,6 +75,7 @@ kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_SHA3_224) kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_SHA3_256) kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_SHA3_384) kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_SHA3_512) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_SHAKE256_512) kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_HASH_DRIVER) # Key management driver configurations diff --git a/subsys/nrf_security/configs/psa_crypto_config.h.template b/subsys/nrf_security/configs/psa_crypto_config.h.template index 75ed63624a69..b5254fbacd1a 100644 --- a/subsys/nrf_security/configs/psa_crypto_config.h.template +++ b/subsys/nrf_security/configs/psa_crypto_config.h.template @@ -319,6 +319,7 @@ #cmakedefine PSA_NEED_CRACEN_PURE_EDDSA_TWISTED_EDWARDS_448 @PSA_NEED_CRACEN_PURE_EDDSA_TWISTED_EDWARDS_448@ #cmakedefine PSA_NEED_CRACEN_PURE_EDDSA_TWISTED_EDWARDS @PSA_NEED_CRACEN_PURE_EDDSA_TWISTED_EDWARDS@ #cmakedefine PSA_NEED_CRACEN_ED25519PH @PSA_NEED_CRACEN_ED25519PH@ +#cmakedefine PSA_NEED_CRACEN_ED448PH @PSA_NEED_CRACEN_ED448PH@ #cmakedefine PSA_NEED_CRACEN_RSA_PKCS1V15_SIGN @PSA_NEED_CRACEN_RSA_PKCS1V15_SIGN@ #cmakedefine PSA_NEED_CRACEN_RSA_PSS @PSA_NEED_CRACEN_RSA_PSS@ #cmakedefine PSA_NEED_CRACEN_RSA_OAEP @PSA_NEED_CRACEN_RSA_OAEP@ @@ -332,6 +333,7 @@ #cmakedefine PSA_NEED_CRACEN_SHA3_256 @PSA_NEED_CRACEN_SHA3_256@ #cmakedefine PSA_NEED_CRACEN_SHA3_384 @PSA_NEED_CRACEN_SHA3_384@ #cmakedefine PSA_NEED_CRACEN_SHA3_512 @PSA_NEED_CRACEN_SHA3_512@ +#cmakedefine PSA_NEED_CRACEN_SHAKE256_512 @PSA_NEED_CRACEN_SHAKE256_512@ /* Key management driver configurations */ #cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_SECP_R1_224 @PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_SECP_R1_224@ diff --git a/subsys/nrf_security/src/drivers/cracen/cracenpsa/cracenpsa.cmake b/subsys/nrf_security/src/drivers/cracen/cracenpsa/cracenpsa.cmake index 784e8295c4a1..a3b5f1988511 100644 --- a/subsys/nrf_security/src/drivers/cracen/cracenpsa/cracenpsa.cmake +++ b/subsys/nrf_security/src/drivers/cracen/cracenpsa/cracenpsa.cmake @@ -23,6 +23,12 @@ list(APPEND cracen_driver_sources ${CMAKE_CURRENT_LIST_DIR}/src/prng_pool.c ) +if(BUILD_INSIDE_TFM) + list(APPEND cracen_driver_sources + ${CMAKE_CURRENT_LIST_DIR}/src/builtin_key_policy.c + ) +endif() + # Include hardware cipher implementation for all devices except nRF54LM20A # nRF54LM20A uses only cracen_sw if(NOT CONFIG_PSA_NEED_CRACEN_MULTIPART_WORKAROUNDS) @@ -70,6 +76,7 @@ if(CONFIG_PSA_NEED_CRACEN_ASYMMETRIC_SIGNATURE_DRIVER) ${CMAKE_CURRENT_LIST_DIR}/src/ecdsa.c ${CMAKE_CURRENT_LIST_DIR}/src/ecc.c ${CMAKE_CURRENT_LIST_DIR}/src/ed25519.c + ${CMAKE_CURRENT_LIST_DIR}/src/ed448.c ${CMAKE_CURRENT_LIST_DIR}/src/hmac.c ${CMAKE_CURRENT_LIST_DIR}/src/rndinrange.c ) @@ -152,6 +159,7 @@ endif() if(CONFIG_PSA_NEED_CRACEN_KEY_AGREEMENT_DRIVER) list(APPEND cracen_driver_sources ${CMAKE_CURRENT_LIST_DIR}/src/ed25519.c + ${CMAKE_CURRENT_LIST_DIR}/src/ed448.c ${CMAKE_CURRENT_LIST_DIR}/src/montgomery.c ) endif() diff --git a/subsys/nrf_security/src/drivers/cracen/cracenpsa/include/cracen_psa.h b/subsys/nrf_security/src/drivers/cracen/cracenpsa/include/cracen_psa.h index fff3e1dc1c19..e68d849bfd0f 100644 --- a/subsys/nrf_security/src/drivers/cracen/cracenpsa/include/cracen_psa.h +++ b/subsys/nrf_security/src/drivers/cracen/cracenpsa/include/cracen_psa.h @@ -18,10 +18,6 @@ #include "cracen_psa_key_ids.h" #include "sxsymcrypt/keyref.h" -#ifdef __NRF_TFM__ -#include -#endif - /** * See "PSA Cryptography API" for documentation. */ diff --git a/subsys/nrf_security/src/drivers/cracen/cracenpsa/include/cracen_psa_builtin_key_policy.h b/subsys/nrf_security/src/drivers/cracen/cracenpsa/include/cracen_psa_builtin_key_policy.h new file mode 100644 index 000000000000..8dbb368bcd03 --- /dev/null +++ b/subsys/nrf_security/src/drivers/cracen/cracenpsa/include/cracen_psa_builtin_key_policy.h @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef CRACEN_PSA_BUILTIN_KEY_POLICY_H +#define CRACEN_PSA_BUILTIN_KEY_POLICY_H + +#include +#include + +#if defined(__NRF_TFM__) + +typedef struct { + mbedtls_key_owner_id_t owner; + psa_drv_slot_number_t key_slot; +} cracen_builtin_ikg_key_policy_t; + +typedef enum { + KMU_ENTRY_SLOT_SINGLE, + KMU_ENTRY_SLOT_RANGE, +} cracen_kmu_entry_type_t; + +/* When defining a range of KMU slots both the start and end slot numbers are inclusive. */ +typedef struct { + mbedtls_key_owner_id_t owner; + psa_drv_slot_number_t key_slot_start; + psa_drv_slot_number_t key_slot_end; + cracen_kmu_entry_type_t kmu_entry_type; +} cracen_builtin_kmu_key_policy_t; + +bool cracen_builtin_key_user_allowed(const psa_key_attributes_t *attributes); + +#else + +static inline bool cracen_builtin_key_user_allowed(const psa_key_attributes_t *attributes) +{ + (void)attributes; + return true; +} + +#endif /* __NRF_TFM__ */ + +#endif /* CRACEN_PSA_BUILTIN_KEY_POLICY_H */ diff --git a/subsys/nrf_security/src/drivers/cracen/cracenpsa/include/cracen_psa_eddsa.h b/subsys/nrf_security/src/drivers/cracen/cracenpsa/include/cracen_psa_eddsa.h index 4962324a3acf..11fab040ebb5 100644 --- a/subsys/nrf_security/src/drivers/cracen/cracenpsa/include/cracen_psa_eddsa.h +++ b/subsys/nrf_security/src/drivers/cracen/cracenpsa/include/cracen_psa_eddsa.h @@ -25,4 +25,18 @@ int cracen_ed25519ph_verify(const uint8_t *pub_key, const uint8_t *message, size int cracen_ed25519_create_pubkey(const uint8_t *priv_key, uint8_t *pub_key); +int cracen_ed448_sign(const uint8_t *priv_key, uint8_t *signature, const uint8_t *message, + size_t message_length); + +int cracen_ed448_verify(const uint8_t *pub_key, const uint8_t *message, size_t message_length, + const uint8_t *signature); + +int cracen_ed448ph_sign(const uint8_t *priv_key, uint8_t *signature, const uint8_t *message, + size_t message_length, bool is_message); + +int cracen_ed448ph_verify(const uint8_t *pub_key, const uint8_t *message, size_t message_length, + const uint8_t *signature, bool is_message); + +int cracen_ed448_create_pubkey(const uint8_t *priv_key, uint8_t *pub_key); + #endif /* CRACEN_PSA_EDDSA_H */ diff --git a/subsys/nrf_security/src/drivers/cracen/cracenpsa/include/cracen_psa_primitives.h b/subsys/nrf_security/src/drivers/cracen/cracenpsa/include/cracen_psa_primitives.h index 400f7ad05c17..dd00caae0664 100644 --- a/subsys/nrf_security/src/drivers/cracen/cracenpsa/include/cracen_psa_primitives.h +++ b/subsys/nrf_security/src/drivers/cracen/cracenpsa/include/cracen_psa_primitives.h @@ -410,6 +410,12 @@ struct cracen_signature { uint8_t *s; /** Signature element "s". */ }; +struct cracen_const_signature { + size_t sz; /** Total signature size, in bytes. */ + const uint8_t *r; /** Signature element "r". */ + const uint8_t *s; /** Signature element "s". */ +}; + struct cracen_ecc_priv_key { const struct sx_pk_ecurve *curve; const uint8_t *d; /** Private key value d */ diff --git a/subsys/nrf_security/src/drivers/cracen/cracenpsa/include/cracen_psa_rsa_encryption.h b/subsys/nrf_security/src/drivers/cracen/cracenpsa/include/cracen_psa_rsa_encryption.h index 5fdd7ca97149..10adb6cb02ad 100644 --- a/subsys/nrf_security/src/drivers/cracen/cracenpsa/include/cracen_psa_rsa_encryption.h +++ b/subsys/nrf_security/src/drivers/cracen/cracenpsa/include/cracen_psa_rsa_encryption.h @@ -10,12 +10,12 @@ #include "cracen_psa_primitives.h" int cracen_rsa_oaep_encrypt(const struct sxhashalg *hashalg, struct cracen_rsa_key *rsa_key, - struct cracen_crypt_text *text, struct sx_buf *label, uint8_t *output, - size_t *output_length); + struct cracen_crypt_text *text, struct sx_const_buf *label, + uint8_t *output, size_t *output_length); int cracen_rsa_oaep_decrypt(const struct sxhashalg *hashalg, struct cracen_rsa_key *rsa_key, - struct cracen_crypt_text *text, struct sx_buf *label, uint8_t *output, - size_t *output_length); + struct cracen_crypt_text *text, struct sx_const_buf *label, + uint8_t *output, size_t *output_length); int cracen_rsa_pkcs1v15_decrypt(struct cracen_rsa_key *rsa_key, struct cracen_crypt_text *text, uint8_t *output, size_t *output_length); diff --git a/subsys/nrf_security/src/drivers/cracen/cracenpsa/include/cracen_psa_rsa_signature_pkcs1v15.h b/subsys/nrf_security/src/drivers/cracen/cracenpsa/include/cracen_psa_rsa_signature_pkcs1v15.h index 927af56dd90d..17bff4ae2e2e 100644 --- a/subsys/nrf_security/src/drivers/cracen/cracenpsa/include/cracen_psa_rsa_signature_pkcs1v15.h +++ b/subsys/nrf_security/src/drivers/cracen/cracenpsa/include/cracen_psa_rsa_signature_pkcs1v15.h @@ -20,12 +20,12 @@ int cracen_rsa_pkcs1v15_sign_digest(struct cracen_rsa_key *rsa_key, size_t digest_length); int cracen_rsa_pkcs1v15_verify_message(struct cracen_rsa_key *rsa_key, - struct cracen_signature *signature, + struct cracen_const_signature *signature, const struct sxhashalg *hashalg, const uint8_t *message, size_t message_length); int cracen_rsa_pkcs1v15_verify_digest(struct cracen_rsa_key *rsa_key, - struct cracen_signature *signature, + struct cracen_const_signature *signature, const struct sxhashalg *hashalg, const uint8_t *digest, size_t digest_length); diff --git a/subsys/nrf_security/src/drivers/cracen/cracenpsa/include/cracen_psa_rsa_signature_pss.h b/subsys/nrf_security/src/drivers/cracen/cracenpsa/include/cracen_psa_rsa_signature_pss.h index 1dde2ee03700..0e38ded19d0b 100644 --- a/subsys/nrf_security/src/drivers/cracen/cracenpsa/include/cracen_psa_rsa_signature_pss.h +++ b/subsys/nrf_security/src/drivers/cracen/cracenpsa/include/cracen_psa_rsa_signature_pss.h @@ -18,11 +18,12 @@ int cracen_rsa_pss_sign_digest(struct cracen_rsa_key *rsa_key, struct cracen_sig size_t input_length, size_t saltsz); int cracen_rsa_pss_verify_message(struct cracen_rsa_key *rsa_key, - struct cracen_signature *signature, + struct cracen_const_signature *signature, const struct sxhashalg *hashalg, const uint8_t *message, size_t message_length, size_t saltsz); -int cracen_rsa_pss_verify_digest(struct cracen_rsa_key *rsa_key, struct cracen_signature *signature, +int cracen_rsa_pss_verify_digest(struct cracen_rsa_key *rsa_key, + struct cracen_const_signature *signature, const struct sxhashalg *hashalg, const uint8_t *digest, size_t digest_length, size_t saltsz); diff --git a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/asymmetric.c b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/asymmetric.c index 8b57c6c07bf1..bdbdeb1620d5 100644 --- a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/asymmetric.c +++ b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/asymmetric.c @@ -66,7 +66,7 @@ cracen_asymmetric_crypt_internal(const psa_key_attributes_t *attributes, const u return status; } - struct sx_buf label = {salt_length, (uint8_t *)salt}; + struct sx_const_buf label = {salt_length, salt}; if (dir == CRACEN_ENCRYPT) { sx_status = cracen_rsa_oaep_encrypt(hashalg, &pubkey, &text, &label, diff --git a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/builtin_key_policy.c b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/builtin_key_policy.c new file mode 100644 index 000000000000..b5e548c413a0 --- /dev/null +++ b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/builtin_key_policy.c @@ -0,0 +1,129 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include "common.h" + +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#define MAPPED_TZ_NS_AGENT_DEFAULT_CLIENT_ID (-0x3c000000) + +static const cracen_builtin_ikg_key_policy_t g_builtin_ikg_policy[] = { +#ifdef TFM_SP_ITS + {.owner = TFM_SP_ITS, .key_slot = TFM_BUILTIN_KEY_ID_HUK}, +#endif /* TFM_SP_ITS */ +#ifdef TFM_SP_PS + {.owner = TFM_SP_PS, .key_slot = TFM_BUILTIN_KEY_ID_HUK}, +#endif /* TFM_SP_PS */ +#ifdef TFM_SP_INITIAL_ATTESTATION + {.owner = TFM_SP_INITIAL_ATTESTATION, .key_slot = TFM_BUILTIN_KEY_ID_IAK} +#endif /* TFM_SP_INITIAL_ATTESTATION */ +}; + +#ifdef PSA_NEED_CRACEN_KMU_DRIVER + +static const cracen_builtin_kmu_key_policy_t g_builtin_kmu_policy[] = { + /* 0x0 is used by libraries like the hw_unique_key library when manually generating psa + * key_ids. Allow access to all slots for these libraries since they don't have the logic to + * have an owner id and reside inside TF-M. + */ + {.owner = 0x0, + .key_slot_start = 0, + .key_slot_end = 255, + .kmu_entry_type = KMU_ENTRY_SLOT_RANGE}, +#ifdef TFM_SP_ITS + {.owner = TFM_SP_ITS, + .key_slot_start = 0, + .key_slot_end = 255, + .kmu_entry_type = KMU_ENTRY_SLOT_RANGE}, +#endif /* TFM_SP_ITS */ +#ifdef TFM_SP_CRYPTO + {.owner = TFM_SP_CRYPTO, + .key_slot_start = 0, + .key_slot_end = 255, + .kmu_entry_type = KMU_ENTRY_SLOT_RANGE}, +#endif /* TFM_SP_CRYPTO */ + /* The docs have KMU slots >= 180 reserved so don't allow NS users to access them */ + {.owner = MAPPED_TZ_NS_AGENT_DEFAULT_CLIENT_ID, + .key_slot_start = 0, + .key_slot_end = 179, + .kmu_entry_type = KMU_ENTRY_SLOT_RANGE}}; + +static bool cracen_builtin_kmu_user_allowed(mbedtls_key_owner_id_t owner, + psa_drv_slot_number_t slot_number, + const psa_key_attributes_t *attributes) +{ + for (uint32_t i = 0; i < NRFX_ARRAY_SIZE(g_builtin_kmu_policy); i++) { + + switch (g_builtin_kmu_policy[i].kmu_entry_type) { + case KMU_ENTRY_SLOT_SINGLE: + if (g_builtin_kmu_policy[i].owner == owner && + g_builtin_kmu_policy[i].key_slot_start == slot_number) { + return true; + } + break; + case KMU_ENTRY_SLOT_RANGE: + if (g_builtin_kmu_policy[i].owner == owner && + (slot_number >= g_builtin_kmu_policy[i].key_slot_start && + slot_number <= g_builtin_kmu_policy[i].key_slot_end)) { + return true; + } + break; + default: + break; + } + } + + return false; +} +#endif /* PSA_NEED_CRACEN_KMU_DRIVER */ + +static bool cracen_builtin_ikg_user_allowed(mbedtls_key_owner_id_t owner, + psa_drv_slot_number_t slot_number, + const psa_key_attributes_t *attributes) +{ + for (uint32_t i = 0; i < NRFX_ARRAY_SIZE(g_builtin_ikg_policy); i++) { + if (g_builtin_ikg_policy[i].owner == owner && + g_builtin_ikg_policy[i].key_slot == slot_number) { + return true; + } + } + + return false; +} + +bool cracen_builtin_key_user_allowed(const psa_key_attributes_t *attributes) +{ + mbedtls_key_owner_id_t owner = MBEDTLS_SVC_KEY_ID_GET_OWNER_ID(psa_get_key_id(attributes)); + psa_drv_slot_number_t slot_id; + + if (PSA_KEY_LIFETIME_GET_LOCATION(psa_get_key_lifetime(attributes)) == + PSA_KEY_LOCATION_CRACEN) { + + slot_id = MBEDTLS_SVC_KEY_ID_GET_KEY_ID(psa_get_key_id(attributes)); + return cracen_builtin_ikg_user_allowed(owner, slot_id, attributes); + } + +#ifdef PSA_NEED_CRACEN_KMU_DRIVER + if (PSA_KEY_LIFETIME_GET_LOCATION(psa_get_key_lifetime(attributes)) == + PSA_KEY_LOCATION_CRACEN_KMU) { + + slot_id = CRACEN_PSA_GET_KMU_SLOT( + MBEDTLS_SVC_KEY_ID_GET_KEY_ID(psa_get_key_id(attributes))); + return cracen_builtin_kmu_user_allowed(owner, slot_id, attributes); + } +#endif /* PSA_NEED_CRACEN_KMU_DRIVER */ + + return true; +} diff --git a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/common.c b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/common.c index 9d50cbbd642f..ab1326b141d9 100644 --- a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/common.c +++ b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/common.c @@ -126,6 +126,9 @@ hash_get_algo(psa_algorithm_t alg, const struct sxhashalg **sx_hash_algo) case PSA_ALG_SHA3_512: IF_ENABLED(PSA_NEED_CRACEN_SHA3_512, (*sx_hash_algo = &sxhashalg_sha3_512)); break; + case PSA_ALG_SHAKE256_512: + IF_ENABLED(PSA_NEED_CRACEN_SHAKE256_512, (*sx_hash_algo = &sxhashalg_shake256_64)); + break; default: return PSA_ALG_IS_HASH(alg) ? PSA_ERROR_NOT_SUPPORTED : PSA_ERROR_INVALID_ARGUMENT; } @@ -320,8 +323,8 @@ psa_status_t cracen_ecc_reduce_p256(const uint8_t *input, size_t input_size, uin { const uint8_t *order = sx_pk_curve_order(&sx_curve_nistp256); - sx_op modulo = {.sz = CRACEN_P256_KEY_SIZE, .bytes = (uint8_t *)order}; - sx_op operand = {.sz = input_size, .bytes = (uint8_t *)input}; + sx_const_op modulo = {.sz = CRACEN_P256_KEY_SIZE, .bytes = order}; + sx_const_op operand = {.sz = input_size, .bytes = input}; sx_op result = {.sz = output_size, .bytes = output}; /* The nistp256 curve order (n) is prime so we use the ODD variant of the reduce command. */ @@ -332,15 +335,15 @@ psa_status_t cracen_ecc_reduce_p256(const uint8_t *input, size_t input_size, uin } psa_status_t cracen_ecc_check_public_key(const struct sx_pk_ecurve *curve, - const sx_pk_affine_point *in_pnt) + const sx_pk_const_affine_point *in_pnt) { int sx_status; uint8_t char_x[CRACEN_MAC_ECC_PRIVKEY_BYTES]; uint8_t char_y[CRACEN_MAC_ECC_PRIVKEY_BYTES]; /* Get the order of the curve from the parameters */ - struct sx_buf n = {.sz = sx_pk_curve_opsize(curve), - .bytes = (uint8_t *)sx_pk_curve_order(curve)}; + struct sx_const_buf n = {.sz = sx_pk_curve_opsize(curve), + .bytes = sx_pk_curve_order(curve)}; sx_pk_affine_point scratch_pnt = {.x = {.sz = n.sz, .bytes = char_x}, .y = {.sz = n.sz, .bytes = char_y}}; @@ -413,7 +416,7 @@ void cracen_xorbytes(uint8_t *a, const uint8_t *b, size_t sz) } } -static int cracen_asn1_get_len(uint8_t **p, const uint8_t *end, size_t *len) +static int cracen_asn1_get_len(const uint8_t **p, const uint8_t *end, size_t *len) { if ((end - *p) < 1) { return SX_ERR_INVALID_PARAM; @@ -445,7 +448,7 @@ static int cracen_asn1_get_len(uint8_t **p, const uint8_t *end, size_t *len) return 0; } -static int cracen_asn1_get_tag(uint8_t **p, const uint8_t *end, size_t *len, int tag) +static int cracen_asn1_get_tag(const uint8_t **p, const uint8_t *end, size_t *len, int tag) { if ((end - *p) < 1) { return SX_ERR_INVALID_PARAM; @@ -460,7 +463,7 @@ static int cracen_asn1_get_tag(uint8_t **p, const uint8_t *end, size_t *len, int return cracen_asn1_get_len(p, end, len); } -static int cracen_asn1_get_int(uint8_t **p, const uint8_t *end, int *val) +static int cracen_asn1_get_int(const uint8_t **p, const uint8_t *end, int *val) { int ret = SX_ERR_INVALID_PARAM; size_t len; @@ -503,7 +506,7 @@ static int cracen_asn1_get_int(uint8_t **p, const uint8_t *end, int *val) return 0; } -int cracen_signature_asn1_get_operand(uint8_t **p, const uint8_t *end, +int cracen_signature_asn1_get_operand(const uint8_t **p, const uint8_t *end, struct sx_buf *op) { int ret; @@ -539,10 +542,10 @@ int cracen_signature_get_rsa_key(struct cracen_rsa_key *rsa, bool extract_pubkey { int ret, version; size_t len; - uint8_t *parser_ptr; - uint8_t *end; + const uint8_t *parser_ptr; + const uint8_t *end; - parser_ptr = (uint8_t *)key; + parser_ptr = key; end = parser_ptr + keylen; if (!extract_pubkey && !is_key_pair) { @@ -591,7 +594,7 @@ int cracen_signature_get_rsa_key(struct cracen_rsa_key *rsa, bool extract_pubkey } } else { /* Skip algorithm identifier prefix. */ - uint8_t *id_seq = parser_ptr; + const uint8_t *id_seq = parser_ptr; ret = cracen_asn1_get_tag(&id_seq, end, &len, ASN1_CONSTRUCTED | ASN1_SEQUENCE); if (ret == 0) { @@ -717,7 +720,7 @@ static psa_status_t cracen_load_ikg_keyref(const psa_key_attributes_t *attribute }; k->owner_id = MBEDTLS_SVC_KEY_ID_GET_OWNER_ID(psa_get_key_id(attributes)); - k->user_data = (uint8_t *)&k->owner_id; + k->user_data = (const uint8_t *)&k->owner_id; return PSA_SUCCESS; } @@ -745,7 +748,7 @@ psa_status_t cracen_load_keyref(const psa_key_attributes_t *attributes, const ui return PSA_SUCCESS; case CRACEN_KMU_KEY_USAGE_SCHEME_PROTECTED: k->sz = PSA_BITS_TO_BYTES(psa_get_key_bits(attributes)); - k->key = (uint8_t *)CRACEN_PROTECTED_RAM_AES_KEY0; + k->key = (const uint8_t *)CRACEN_PROTECTED_RAM_AES_KEY0; return PSA_SUCCESS; @@ -767,14 +770,14 @@ psa_status_t cracen_load_keyref(const psa_key_attributes_t *attributes, const ui } k->owner_id = MBEDTLS_SVC_KEY_ID_GET_OWNER_ID(psa_get_key_id(attributes)); - k->user_data = (uint8_t *)&k->owner_id; + k->user_data = (const uint8_t *)&k->owner_id; k->prepare_key = NULL; k->clean_key = NULL; switch (MBEDTLS_SVC_KEY_ID_GET_KEY_ID(psa_get_key_id(attributes))) { case CRACEN_PROTECTED_RAM_AES_KEY0_ID: k->sz = 32; - k->key = (uint8_t *)CRACEN_PROTECTED_RAM_AES_KEY0; + k->key = (const uint8_t *)CRACEN_PROTECTED_RAM_AES_KEY0; break; default: if (key_buffer_size == 0) { @@ -930,7 +933,7 @@ int cracen_hash_input_with_context(struct sxhash *hashopctx, const uint8_t *inpu } int cracen_rsa_modexp(struct sx_pk_acq_req *pkreq, struct sx_pk_slot *inputs, - struct cracen_rsa_key *rsa_key, uint8_t *base, size_t basez, int *sizes) + struct cracen_rsa_key *rsa_key, const uint8_t *base, size_t basez, int *sizes) { *pkreq = sx_pk_acquire_req(rsa_key->cmd); if (pkreq->status != SX_OK) { diff --git a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/common.h b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/common.h index d9a579487158..a589e72cf652 100644 --- a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/common.h +++ b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/common.h @@ -117,7 +117,7 @@ static inline size_t cracen_ecc_wstr_expected_pub_key_bytes(size_t priv_key_size * */ psa_status_t cracen_ecc_check_public_key(const struct sx_pk_ecurve *curve, - const sx_pk_affine_point *in_pnt); + const sx_pk_const_affine_point *in_pnt); /** * \brief Tries to extract an RSA key from ASN.1. @@ -148,7 +148,7 @@ int cracen_signature_get_rsa_key(struct cracen_rsa_key *rsa, bool extract_pubkey * \retval SX_OK on success. * \retval SX_ERR_INVALID_PARAM if the ASN.1 integer cannot be extracted. */ -int cracen_signature_asn1_get_operand(uint8_t **p, const uint8_t *end, struct sx_buf *op); +int cracen_signature_asn1_get_operand(const uint8_t **p, const uint8_t *end, struct sx_buf *op); /** * @brief Use cracen_get_random up to generate a random number in the range [1, upperlimit). @@ -314,7 +314,8 @@ psa_status_t cracen_ecc_reduce_p256(const uint8_t *input, size_t input_size, uin * status code. */ int cracen_rsa_modexp(struct sx_pk_acq_req *pkreq, struct sx_pk_slot *inputs, - struct cracen_rsa_key *rsa_key, uint8_t *base, size_t basez, int *sizes); + struct cracen_rsa_key *rsa_key, const uint8_t *base, size_t basez, + int *sizes); #define CRACEN_KEY_INIT_RSA(mod, expon) \ (struct cracen_rsa_key) \ diff --git a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/cracen.c b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/cracen.c index 5b27284d636d..22bd7c42e76c 100644 --- a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/cracen.c +++ b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/cracen.c @@ -16,6 +16,7 @@ #include "common.h" #include "microcode_binary.h" #include +#include #if !defined(CONFIG_BUILD_WITH_TFM) #define LOG_ERR_MSG(msg) LOG_ERR(msg) @@ -60,6 +61,16 @@ void cracen_acquire(void) CRACEN_ENABLE_PKEIKG_Msk); irq_enable(CRACEN_IRQn); LOG_DBG_MSG("Powered on CRACEN."); + +#ifdef CONFIG_CRACEN_HW_VERSION_LITE + /* CRACEN Lite TRNG workaround. Configure TRNG test thresholds after power-on. + * The IKG's internal PRNG directly accesses the TRNG hardware, but these + * registers reset to incorrect default values when CRACEN is powered down. + * We must reconfigure them every time CRACEN powers up to prevent entropy + * errors in IKG operations. + */ + sx_trng_configure_cracen_lite_workaround(); +#endif /* CONFIG_CRACEN_HW_VERSION_LITE */ } nrf_security_mutex_unlock(cracen_mutex); diff --git a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/ec_helpers.c b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/ec_helpers.c index b4fae3d664d2..c18d4ed240de 100644 --- a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/ec_helpers.c +++ b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/ec_helpers.c @@ -21,5 +21,6 @@ void decode_scalar_25519(uint8_t *k) void decode_scalar_448(uint8_t *k) { k[0] &= ~0x03; /* Clear bits 0 and 1. */ + k[56] = 0x00; /* Clear the last byte */ k[55] |= 0x80; /* Set bit 447. */ } diff --git a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/ecdsa.c b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/ecdsa.c index f6df919bce07..1cc716144a26 100644 --- a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/ecdsa.c +++ b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/ecdsa.c @@ -148,7 +148,7 @@ static void ecdsa_write_pk(const uint8_t *pubkey, uint8_t *x, uint8_t *y, size_t sx_wrpkmem(y, pubkey + opsz, opsz); } -static void ecdsa_write_sig(const struct cracen_signature *sig, uint8_t *r, uint8_t *s, +static void ecdsa_write_sig(const struct cracen_const_signature *sig, uint8_t *r, uint8_t *s, size_t opsz) { sx_wrpkmem(r, sig->r, opsz); @@ -524,10 +524,7 @@ int cracen_ecdsa_verify_digest(const uint8_t *pubkey, const uint8_t *digest, con struct sx_pk_acq_req pkreq; struct sx_pk_inops_ecdsa_verify inputs; - struct cracen_signature internal_signature = {0}; - - internal_signature.r = (uint8_t *)signature; - internal_signature.s = (uint8_t *)signature + opsz; + struct cracen_const_signature internal_signature = {.r = signature, .s = signature + opsz}; pkreq = sx_pk_acquire_req(SX_PK_CMD_ECDSA_VER); if (pkreq.status) { diff --git a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/ed448.c b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/ed448.c new file mode 100644 index 000000000000..b2e097418076 --- /dev/null +++ b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/ed448.c @@ -0,0 +1,244 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + * + */ +#include +#include +#include +#include +#include +#include +#include +#include "common.h" +#include "cracen_psa_eddsa.h" + +/* Define SHAKE 256, 64 bit Digest size*/ +#define SHAKE256_64_DGST 64 + +/* Define PHflag byte location in DOM4*/ +#define PHFLAG_BYTE 8 + +#define AREA2_MEM_OFFSET 57 +#define AREA4_MEM_OFFSET 171 + +/* This is the ASCII string with the + * PHflag 1 and context size 0 appended as defined in: + * https://datatracker.ietf.org/doc/html/rfc8032.html#section-2. + * It is used for domain separation between Ed448 and Ed448ph. + * This can not be stored as a const due to hardware limitations + */ +static uint8_t dom4[] = {0x53, 0x69, 0x67, 0x45, 0x64, 0x34, 0x34, 0x38, 0x01, 0x00}; + +static int ed448_calculate_r(uint8_t *workmem, const uint8_t *message, size_t message_length, + bool prehash) +{ + /* update the PHflag in dom4*/ + dom4[PHFLAG_BYTE] = prehash ? 0x01 : 0x00; + uint8_t const *hash_array[] = {dom4, workmem, message}; + size_t hash_array_lengths[] = {sizeof(dom4), SX_ED448_SZ, message_length}; + size_t input_count = 3; + + return cracen_hash_all_inputs(hash_array, hash_array_lengths, input_count, + &sxhashalg_shake256_114, workmem + SX_ED448_DGST_SZ); +} + +static int ed448_calculate_k(uint8_t *workmem, uint8_t *point_r, const uint8_t *message, + size_t message_length, bool prehash) +{ + /* update the PHflag in dom4*/ + dom4[PHFLAG_BYTE] = prehash ? 0x01 : 0x00; + uint8_t const *hash_array[] = {dom4, point_r, workmem, message}; + size_t hash_array_lengths[] = {sizeof(dom4), SX_ED448_SZ, SX_ED448_SZ, message_length}; + size_t input_count = 4; + + return cracen_hash_all_inputs(hash_array, hash_array_lengths, input_count, + &sxhashalg_shake256_114, workmem); +} + +static int ed448_sign_internal(const uint8_t *priv_key, uint8_t *signature, + const uint8_t *message, size_t message_length, bool prehash) +{ + int status; + uint8_t workmem[5 * SX_ED448_SZ]; + uint8_t pnt_r[SX_ED448_DGST_SZ]; + uint8_t *area_1 = workmem; + uint8_t *area_2 = workmem + AREA2_MEM_OFFSET; + uint8_t *area_4 = workmem + AREA4_MEM_OFFSET; + + /* Hash the private key, the digest is stored in the first 114 bytes of workmem*/ + status = cracen_hash_input(priv_key, SX_ED448_SZ, &sxhashalg_shake256_114, area_1); + if (status != SX_OK) { + return status; + } + + /* Obtain r by hashing (prefix || message), where prefix is the second + * half of the private key digest. + */ + status = ed448_calculate_r(area_2, message, message_length, prehash); + if (status != SX_OK) { + return status; + } + + /* Perform point multiplication R = [r]B. This is the encoded point R, + * which is the first part of the signature. + */ + status = sx_ed448_ptmult((const struct sx_ed448_dgst *)area_4, + (struct sx_ed448_pt *)pnt_r); + if (status != SX_OK) { + return status; + } + + /* The secret scalar s is computed in place from the first half of the + * private key digest. + */ + decode_scalar_448(area_1); + + /* Clear second half of private key digest: sx_ed448_ptmult() + * works on an input of SX_ED448_DGST_SZ bytes. + */ + safe_memzero(area_2, SX_ED448_SZ); + + /* Perform point multiplication A = [s]B, + * to obtain the public key A. which is stored in workmem[57:113] + */ + status = sx_ed448_ptmult((const struct sx_ed448_dgst *)area_1, + (struct sx_ed448_pt *)area_2); + + if (status != SX_OK) { + return status; + } + + status = ed448_calculate_k(area_2, pnt_r, message, message_length, prehash); + if (status != SX_OK) { + return status; + } + + /* Compute (r + k * s) mod L. This gives the second part of the + * signature, which is the encoded S which is stored in pnt_r. + */ + status = sx_ed448_sign((const struct sx_ed448_dgst *)area_2, + (const struct sx_ed448_dgst *)area_4, + (const struct sx_ed448_v *)area_1, + (struct sx_ed448_v *)(pnt_r + SX_ED448_PT_SZ)); + if (status != SX_OK) { + return status; + } + + memcpy(signature, pnt_r, SX_ED448_DGST_SZ); + safe_memzero(workmem, sizeof(workmem)); + + return status; +} + +int cracen_ed448_sign(const uint8_t *priv_key, uint8_t *signature, const uint8_t *message, + size_t message_length) +{ + return ed448_sign_internal(priv_key, signature, message, message_length, false); +} + +int cracen_ed448ph_sign(const uint8_t *priv_key, uint8_t *signature, const uint8_t *message, + size_t message_length, bool is_message) +{ + uint8_t hashedmessage[SX_ED448_DGST_SZ]; + int status; + + if (is_message) { + status = cracen_hash_input(message, message_length, &sxhashalg_shake256_64, + hashedmessage); + if (status != SX_OK) { + return status; + } + + return ed448_sign_internal(priv_key, signature, hashedmessage, SHAKE256_64_DGST, + true); + } else { + return ed448_sign_internal(priv_key, signature, message, message_length, true); + } +} + +static int ed448_verify_internal(const uint8_t *pub_key, const uint8_t *message, + size_t message_length, const uint8_t *signature, bool prehash) +{ + /* update the PHflag in dom4*/ + dom4[PHFLAG_BYTE] = prehash ? 0x01 : 0x00; + int status; + uint8_t digest[SX_ED448_DGST_SZ]; + size_t ed448_sz = SX_ED448_SZ; + size_t input_count = 4; + + uint8_t const *hash_array[] = {dom4, signature, pub_key, message}; + size_t hash_array_lengths[] = {sizeof(dom4), ed448_sz, ed448_sz, message_length}; + + status = cracen_hash_all_inputs(hash_array, hash_array_lengths, + input_count, &sxhashalg_shake256_114, digest); + if (status != SX_OK) { + return status; + } + status = + sx_ed448_verify((struct sx_ed448_dgst *)digest, (const struct sx_ed448_pt *)pub_key, + (const struct sx_ed448_v *)(signature + SX_ED448_SZ), + (const struct sx_ed448_pt *)signature); + + return status; +} + +int cracen_ed448_verify(const uint8_t *pub_key, const uint8_t *message, size_t message_length, + const uint8_t *signature) +{ + return ed448_verify_internal(pub_key, message, message_length, signature, false); +} + +int cracen_ed448ph_verify(const uint8_t *pub_key, const uint8_t *message, size_t message_length, + const uint8_t *signature, bool is_message) +{ + int status; + uint8_t message_digest[SX_ED448_DGST_SZ]; + + if (is_message) { + status = cracen_hash_input(message, message_length, &sxhashalg_shake256_64, + message_digest); + if (status != SX_OK) { + return status; + } + + return ed448_verify_internal(pub_key, message_digest, SHAKE256_64_DGST, + signature, true); + } + return ed448_verify_internal(pub_key, message, message_length, signature, true); +} + +int cracen_ed448_create_pubkey(const uint8_t *priv_key, uint8_t *pub_key) +{ + int status; + uint8_t digest[SX_ED448_DGST_SZ]; + uint8_t *pub_key_A = digest + SX_ED448_SZ; + + status = cracen_hash_input(priv_key, SX_ED448_SZ, &sxhashalg_shake256_114, digest); + if (status != SX_OK) { + return status; + } + /* The secret scalar s is computed in place from the first half of the + * private key digest. + */ + decode_scalar_448(digest); + + /* Clear second half of private key digest: ed448_ptmult() + * works on an input of SX_ED448_DGST_SZ bytes. + */ + safe_memzero(pub_key_A, SX_ED448_SZ); + + /* Perform point multiplication A = [s]B, to obtain the public key A. */ + status = sx_ed448_ptmult((const struct sx_ed448_dgst *)digest, + (struct sx_ed448_pt *)pub_key_A); + + if (status != SX_OK) { + return status; + } + + memcpy(pub_key, pub_key_A, SX_ED448_SZ); + safe_memzero(digest, SX_ED448_DGST_SZ); + + return status; +} diff --git a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/jpake.c b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/jpake.c index 09e17882903b..a28fcd943204 100644 --- a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/jpake.c +++ b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/jpake.c @@ -23,10 +23,6 @@ #include #include -#define MAKE_SX_POINT(name, ptr, point_size) \ - sx_pk_affine_point name = {{.bytes = (ptr), .sz = (point_size) / 2}, \ - {.bytes = (ptr) + (point_size) / 2, .sz = (point_size) / 2}}; - /* * This driver supports uncompressed points only. Uncompressed types * are prefixed with the byte 0x04. See 2.3.3.3.3 from "SEC 1: @@ -72,8 +68,8 @@ psa_status_t cracen_jpake_set_password_key(cracen_jpake_operation_t *operation, */ const uint8_t *order = sx_pk_curve_order(operation->curve); - sx_op modulo = {.sz = CRACEN_P256_KEY_SIZE, .bytes = (uint8_t *)order}; - sx_op b = {.sz = password_length, .bytes = (uint8_t *)password}; + sx_const_op modulo = {.sz = CRACEN_P256_KEY_SIZE, .bytes = order}; + sx_const_op b = {.sz = password_length, .bytes = password}; sx_op result = {.sz = sizeof(operation->secret), .bytes = operation->secret}; /* The nistp256 curve order (n) is prime so we use the ODD variant of the reduce command. */ @@ -322,14 +318,14 @@ static psa_status_t cracen_write_key_share(cracen_jpake_operation_t *operation, memcpy(generator, curve_pt, CRACEN_P256_POINT_SIZE); } else if (idx == 2) { /* Second round of J-PAKE: Compute G_a, x2s and A. */ - MAKE_SX_POINT(G4, operation->P[0], CRACEN_P256_POINT_SIZE); - MAKE_SX_POINT(G3, operation->P[1], CRACEN_P256_POINT_SIZE); - MAKE_SX_POINT(G1, operation->X[0], CRACEN_P256_POINT_SIZE); + MAKE_SX_CONST_POINT(G4, operation->P[0], CRACEN_P256_POINT_SIZE); + MAKE_SX_CONST_POINT(G3, operation->P[1], CRACEN_P256_POINT_SIZE); + MAKE_SX_CONST_POINT(G1, operation->X[0], CRACEN_P256_POINT_SIZE); MAKE_SX_POINT(ga, generator, CRACEN_P256_POINT_SIZE); MAKE_SX_POINT(a, operation->X[2], CRACEN_P256_POINT_SIZE); - sx_ecop x2s = {.bytes = operation->x[1], .sz = CRACEN_P256_KEY_SIZE}; - sx_ecop s = {.bytes = operation->secret, .sz = CRACEN_P256_KEY_SIZE}; + sx_const_ecop x2s = {.bytes = operation->x[1], .sz = CRACEN_P256_KEY_SIZE}; + sx_const_ecop s = {.bytes = operation->secret, .sz = CRACEN_P256_KEY_SIZE}; sx_ecop rx2s = {.bytes = operation->x[2], .sz = CRACEN_P256_KEY_SIZE}; sx_status = sx_ecjpake_gen_step_2(operation->curve, &G4, &G3, &G1, &x2s, &s, &a, @@ -362,9 +358,9 @@ static psa_status_t cracen_write_key_share(cracen_jpake_operation_t *operation, return status; } - sx_ecop sx_v = {.bytes = v, .sz = sizeof(v)}; - sx_ecop sx_x = {.bytes = operation->x[idx], .sz = sizeof(operation->x[idx])}; - sx_ecop sx_h = {.bytes = h, .sz = PSA_HASH_LENGTH(PSA_ALG_SHA_256)}; + sx_const_ecop sx_v = {.bytes = v, .sz = sizeof(v)}; + sx_const_ecop sx_x = {.bytes = operation->x[idx], .sz = sizeof(operation->x[idx])}; + sx_const_ecop sx_h = {.bytes = h, .sz = PSA_HASH_LENGTH(PSA_ALG_SHA_256)}; sx_ecop sx_r = {.bytes = operation->r, .sz = sizeof(operation->r)}; sx_status = sx_ecjpake_generate_zkp(operation->curve, &sx_v, &sx_x, &sx_h, &sx_r); @@ -491,9 +487,9 @@ static psa_status_t cracen_read_zk_proof(cracen_jpake_operation_t *operation, co } else if (idx == 2) { /* Second round of J-PAKE: Compute G_B. */ - MAKE_SX_POINT(G1, operation->X[0], CRACEN_P256_POINT_SIZE); - MAKE_SX_POINT(G2, operation->X[1], CRACEN_P256_POINT_SIZE); - MAKE_SX_POINT(G3, operation->P[0], CRACEN_P256_POINT_SIZE); + MAKE_SX_CONST_POINT(G1, operation->X[0], CRACEN_P256_POINT_SIZE); + MAKE_SX_CONST_POINT(G2, operation->X[1], CRACEN_P256_POINT_SIZE); + MAKE_SX_CONST_POINT(G3, operation->P[0], CRACEN_P256_POINT_SIZE); MAKE_SX_POINT(g, generator, CRACEN_P256_POINT_SIZE); int sx_status = sx_ecjpake_3pt_add(operation->curve, &G1, &G2, &G3, &g); @@ -513,12 +509,12 @@ static psa_status_t cracen_read_zk_proof(cracen_jpake_operation_t *operation, co return status; } - MAKE_SX_POINT(sx_v, operation->V, CRACEN_P256_POINT_SIZE); - MAKE_SX_POINT(sx_x, operation->P[idx], CRACEN_P256_POINT_SIZE); - MAKE_SX_POINT(sx_g, generator, CRACEN_P256_POINT_SIZE); + MAKE_SX_CONST_POINT(sx_v, operation->V, CRACEN_P256_POINT_SIZE); + MAKE_SX_CONST_POINT(sx_x, operation->P[idx], CRACEN_P256_POINT_SIZE); + MAKE_SX_CONST_POINT(sx_g, generator, CRACEN_P256_POINT_SIZE); - sx_ecop sx_r = {.bytes = operation->r, .sz = sizeof(operation->r)}; - sx_ecop sx_h = {.bytes = h, .sz = h_len}; + sx_const_ecop sx_r = {.bytes = operation->r, .sz = sizeof(operation->r)}; + sx_const_ecop sx_h = {.bytes = h, .sz = h_len}; int sx_status = sx_ecjpake_verify_zkp(operation->curve, &sx_v, &sx_x, &sx_r, &sx_h, idx == 2 ? &sx_g : SX_PT_CURVE_GENERATOR); @@ -559,10 +555,10 @@ psa_status_t cracen_jpake_get_shared_key(cracen_jpake_operation_t *operation, output[0] = CRACEN_ECC_PUBKEY_UNCOMPRESSED; /* get PMSK */ - MAKE_SX_POINT(x4, operation->P[1], CRACEN_P256_POINT_SIZE); - MAKE_SX_POINT(b, operation->P[2], CRACEN_P256_POINT_SIZE); - sx_ecop x2 = {.bytes = operation->x[1], .sz = CRACEN_P256_KEY_SIZE}; - sx_ecop x2s = {.bytes = operation->x[2], .sz = CRACEN_P256_KEY_SIZE}; + MAKE_SX_CONST_POINT(x4, operation->P[1], CRACEN_P256_POINT_SIZE); + MAKE_SX_CONST_POINT(b, operation->P[2], CRACEN_P256_POINT_SIZE); + sx_const_ecop x2 = {.bytes = operation->x[1], .sz = CRACEN_P256_KEY_SIZE}; + sx_const_ecop x2s = {.bytes = operation->x[2], .sz = CRACEN_P256_KEY_SIZE}; MAKE_SX_POINT(t, output + 1, CRACEN_P256_POINT_SIZE); sx_status = sx_ecjpake_gen_sess_key(operation->curve, &x4, &b, &x2, &x2s, &t); diff --git a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/key_derivation.c b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/key_derivation.c index 379da5597cb9..0e2839bfe80a 100644 --- a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/key_derivation.c +++ b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/key_derivation.c @@ -56,11 +56,11 @@ static psa_status_t cracen_ecdh_wrstr_calc_secret(const struct sx_pk_ecurve *cur uint8_t scratch_char_x[CRACEN_MAC_ECC_PRIVKEY_BYTES]; uint8_t scratch_char_y[CRACEN_MAC_ECC_PRIVKEY_BYTES]; - struct sx_buf priv_key_buff = {.sz = priv_key_size, .bytes = (uint8_t *)priv_key}; + sx_const_ecop priv_key_buff = {.sz = priv_key_size, .bytes = priv_key}; sx_pk_affine_point scratch_pnt = {{.bytes = scratch_char_x, .sz = priv_key_size}, {.bytes = scratch_char_y, .sz = priv_key_size}}; - sx_pk_affine_point publ_key_pnt = {}; + sx_pk_const_affine_point publ_key_pnt = {}; if (publ_key_size != cracen_ecc_wstr_expected_pub_key_bytes(priv_key_size)) { return PSA_ERROR_INVALID_ARGUMENT; @@ -77,10 +77,10 @@ static psa_status_t cracen_ecdh_wrstr_calc_secret(const struct sx_pk_ecurve *cur return PSA_ERROR_BUFFER_TOO_SMALL; } - publ_key_pnt.x.bytes = (uint8_t *)publ_key + 1; + publ_key_pnt.x.bytes = publ_key + 1; publ_key_pnt.x.sz = priv_key_size; - publ_key_pnt.y.bytes = (uint8_t *)publ_key + priv_key_size + 1; + publ_key_pnt.y.bytes = publ_key + priv_key_size + 1; publ_key_pnt.y.sz = priv_key_size; psa_status = cracen_ecc_check_public_key(curve, &publ_key_pnt); @@ -90,8 +90,11 @@ static psa_status_t cracen_ecdh_wrstr_calc_secret(const struct sx_pk_ecurve *cur sx_status = sx_ecp_ptmult(curve, &priv_key_buff, &publ_key_pnt, &scratch_pnt); if (sx_status == SX_OK) { - sx_pk_ecop2mem(&scratch_pnt.x, output, scratch_pnt.x.sz); - *output_length = scratch_pnt.x.sz; + sx_pk_const_affine_point c_scratch_pnt; + + sx_get_const_affine_point(&scratch_pnt, &c_scratch_pnt); + sx_pk_ecop2mem(&c_scratch_pnt.x, output, c_scratch_pnt.x.sz); + *output_length = c_scratch_pnt.x.sz; } safe_memzero(scratch_pnt.x.bytes, scratch_pnt.x.sz); @@ -190,6 +193,15 @@ static psa_status_t start_mac_operation(cracen_key_derivation_operation_t *opera #endif #if defined(PSA_NEED_CRACEN_PBKDF2_HMAC) +static size_t pbkdf2_prf_block_length(psa_algorithm_t alg) +{ + if (alg == PSA_ALG_PBKDF2_AES_CMAC_PRF_128) { + return SX_BLKCIPHER_AES_BLK_SZ; + } else { + return PSA_HASH_BLOCK_LENGTH(PSA_ALG_GET_HASH(alg)); + } +} + static size_t pbkdf2_prf_output_length(psa_algorithm_t alg) { if (alg == PSA_ALG_PBKDF2_AES_CMAC_PRF_128) { @@ -436,15 +448,15 @@ cracen_key_derivation_input_bytes_pbkdf2(cracen_key_derivation_operation_t *oper return PSA_ERROR_BAD_STATE; } - size_t output_length = pbkdf2_prf_output_length(operation->alg); + size_t block_length = pbkdf2_prf_block_length(operation->alg); bool aes_cmac_prf = operation->alg == PSA_ALG_PBKDF2_AES_CMAC_PRF_128; - if (aes_cmac_prf && data_length != output_length) { + if (aes_cmac_prf && data_length != block_length) { /* Password must be 128-bit (AES Key size) */ return PSA_ERROR_INVALID_ARGUMENT; } - if (data_length > output_length) { + if (data_length > block_length) { size_t hash_length = 0; /* Password needs to be hashed. */ psa_status_t status = cracen_hash_compute( @@ -825,7 +837,7 @@ cracen_key_derivation_cmac_ctr_add_core_fixed_input(cracen_key_derivation_operat } /* L_4 */ - return sx_mac_feed(cmac_ctx, (uint8_t *)&operation->cmac_ctr.L, + return sx_mac_feed(cmac_ctx, (const uint8_t *)&operation->cmac_ctr.L, sizeof(operation->cmac_ctr.L)); } @@ -885,7 +897,7 @@ cracen_key_derivation_cmac_ctr_generate_block(cracen_key_derivation_operation_t } counter_be = uint32_to_be(operation->cmac_ctr.counter); - sx_status = sx_mac_feed(&cmac_ctx, (uint8_t *)&counter_be, sizeof(counter_be)); + sx_status = sx_mac_feed(&cmac_ctx, (const uint8_t *)&counter_be, sizeof(counter_be)); if (sx_status) { return silex_statuscodes_to_psa(sx_status); } @@ -999,7 +1011,7 @@ cracen_key_derivation_pbkdf2_generate_block(cracen_key_derivation_operation_t *o if (status != PSA_SUCCESS) { return status; } - status = cracen_mac_update(&operation->mac_op, (uint8_t *)&blk_counter_be, + status = cracen_mac_update(&operation->mac_op, (const uint8_t *)&blk_counter_be, sizeof(blk_counter_be)); if (status != PSA_SUCCESS) { return status; diff --git a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/key_management.c b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/key_management.c index ca5db8dc7ffa..b40df4efbec9 100644 --- a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/key_management.c +++ b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/key_management.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include "ecc.h" #include @@ -81,7 +82,8 @@ static struct { /* Twisted Edwards */ {PSA_ECC_FAMILY_TWISTED_EDWARDS, 255, 32, 32, IS_ENABLED(PSA_NEED_CRACEN_KEY_TYPE_ECC_TWISTED_EDWARDS)}, - {PSA_ECC_FAMILY_TWISTED_EDWARDS, 448, 57, 57, false}, + {PSA_ECC_FAMILY_TWISTED_EDWARDS, 448, 57, 57, + IS_ENABLED(PSA_NEED_CRACEN_KEY_TYPE_ECC_TWISTED_EDWARDS)}, }; static psa_status_t check_ecc_key_attributes(const psa_key_attributes_t *attributes, @@ -119,10 +121,9 @@ static psa_status_t check_ecc_key_attributes(const psa_key_attributes_t *attribu } if (status == PSA_SUCCESS) { - if (curve == PSA_ECC_FAMILY_TWISTED_EDWARDS) { - if (key_alg != PSA_ALG_PURE_EDDSA && key_alg != PSA_ALG_ED25519PH) { - return PSA_ERROR_INVALID_ARGUMENT; - } + if ((curve == PSA_ECC_FAMILY_TWISTED_EDWARDS) && (key_alg != PSA_ALG_PURE_EDDSA && + key_alg != PSA_ALG_ED25519PH && key_alg != PSA_ALG_ED448PH)) { + return PSA_ERROR_INVALID_ARGUMENT; } } @@ -225,12 +226,12 @@ static psa_status_t check_wstr_publ_key_for_ecdh(psa_ecc_family_t curve_family, psa_status_t psa_status; const struct sx_pk_ecurve *curve; - sx_pk_affine_point publ_key_pnt = {}; + sx_pk_const_affine_point publ_key_pnt = {}; - publ_key_pnt.x.bytes = (uint8_t *)&data[1]; + publ_key_pnt.x.bytes = &data[1]; publ_key_pnt.x.sz = priv_key_size; - publ_key_pnt.y.bytes = (uint8_t *)&data[1 + priv_key_size]; + publ_key_pnt.y.bytes = &data[1 + priv_key_size]; publ_key_pnt.y.sz = priv_key_size; psa_status = cracen_ecc_get_ecurve_from_psa(curve_family, curve_bits, &curve); @@ -496,13 +497,13 @@ static psa_status_t export_spake2p_public_key_from_keypair(const psa_key_attribu size_t key_bits_attr = psa_get_key_bits(attributes); psa_ecc_family_t psa_curve = PSA_KEY_TYPE_SPAKE2P_GET_FAMILY(psa_get_key_type(attributes)); const struct sx_pk_ecurve *sx_curve; - uint8_t *w0; - uint8_t *w1; + const uint8_t *w0; + const uint8_t *w1; switch (type) { case PSA_KEY_TYPE_SPAKE2P_KEY_PAIR(PSA_ECC_FAMILY_SECP_R1): - w0 = (uint8_t *)priv_key; - w1 = (uint8_t *)priv_key + CRACEN_P256_KEY_SIZE; + w0 = priv_key; + w1 = priv_key + CRACEN_P256_KEY_SIZE; status = cracen_ecc_get_ecurve_from_psa(psa_curve, key_bits_attr, &sx_curve); if (status != PSA_SUCCESS) { return status; @@ -716,9 +717,8 @@ static psa_status_t handle_curve_family(psa_ecc_family_t psa_curve, size_t key_b cracen_ed25519_create_pubkey(key_buffer, data)); } else if (key_bits_attr == 448 && IS_ENABLED(PSA_NEED_CRACEN_PURE_EDDSA_TWISTED_EDWARDS_448)) { - /* This if-statement is kept to make it easier to add ed448 in the future - * even though it does nothing. - */ + return silex_statuscodes_to_psa( + cracen_ed448_create_pubkey(key_buffer, data)); return PSA_ERROR_NOT_SUPPORTED; } else { return PSA_ERROR_NOT_SUPPORTED; @@ -895,6 +895,10 @@ psa_status_t cracen_export_public_key(const psa_key_attributes_t *attributes, return PSA_ERROR_INVALID_ARGUMENT; } + if (!cracen_builtin_key_user_allowed(attributes)) { + return PSA_ERROR_NOT_PERMITTED; + } + if (IS_ENABLED(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT)) { if (PSA_KEY_TYPE_IS_ECC_KEY_PAIR(key_type)) { return export_ecc_public_key_from_keypair(attributes, key_buffer, @@ -946,6 +950,10 @@ psa_status_t cracen_import_key(const psa_key_attributes_t *attributes, const uin return PSA_ERROR_INVALID_ARGUMENT; } + if (!cracen_builtin_key_user_allowed(attributes)) { + return PSA_ERROR_NOT_PERMITTED; + } + psa_key_location_t location = PSA_KEY_LIFETIME_GET_LOCATION(psa_get_key_lifetime(attributes)); #ifdef PSA_NEED_CRACEN_KMU_DRIVER @@ -1093,7 +1101,14 @@ static psa_status_t generate_rsa_private_key(const psa_key_attributes_t *attribu } /* Generate n and d */ - status = silex_statuscodes_to_psa(sx_rsa_keygen(&p, &q, &e, &n, NULL, &d)); + sx_const_op c_p; + sx_const_op c_q; + sx_const_op c_e; + + sx_get_const_op(&p, &c_p); + sx_get_const_op(&q, &c_q); + sx_get_const_op(&e, &c_e); + status = silex_statuscodes_to_psa(sx_rsa_keygen(&c_p, &c_q, &c_e, &n, NULL, &d)); if (status != PSA_SUCCESS) { goto error_exit; } @@ -1199,6 +1214,10 @@ psa_status_t cracen_generate_key(const psa_key_attributes_t *attributes, uint8_t psa_key_location_t location = PSA_KEY_LIFETIME_GET_LOCATION(psa_get_key_lifetime(attributes)); + if (!cracen_builtin_key_user_allowed(attributes)) { + return PSA_ERROR_NOT_PERMITTED; + } + #ifdef PSA_NEED_CRACEN_KMU_DRIVER if (location == PSA_KEY_LOCATION_CRACEN_KMU) { return generate_key_for_kmu(attributes, key_buffer, key_buffer_size, @@ -1331,6 +1350,11 @@ psa_status_t cracen_get_builtin_key(psa_drv_slot_number_t slot_number, * and the `lifetime` field of the attribute struct. We will fill all the other * attributes, and update the `lifetime` field to be more specific. */ + + if (!cracen_builtin_key_user_allowed(attributes)) { + return PSA_ERROR_NOT_PERMITTED; + } + switch (slot_number) { case CRACEN_BUILTIN_IDENTITY_KEY_ID: case CRACEN_BUILTIN_MKEK_ID: @@ -1388,6 +1412,10 @@ psa_status_t cracen_export_key(const psa_key_attributes_t *attributes, const uin psa_key_location_t location = PSA_KEY_LIFETIME_GET_LOCATION(psa_get_key_lifetime(attributes)); + if (!cracen_builtin_key_user_allowed(attributes)) { + return PSA_ERROR_NOT_PERMITTED; + } + if (location == PSA_KEY_LOCATION_CRACEN_KMU) { /* The keys will already be in the key buffer as they got loaded their by a previous * call to cracen_get_builtin_key or cached in the memory. @@ -1436,6 +1464,10 @@ psa_status_t cracen_copy_key(psa_key_attributes_t *attributes, const uint8_t *so size_t target_key_buffer_size, size_t *target_key_buffer_length) { #ifdef PSA_NEED_CRACEN_KMU_DRIVER + if (!cracen_builtin_key_user_allowed(attributes)) { + return PSA_ERROR_NOT_PERMITTED; + } + psa_key_location_t location = PSA_KEY_LIFETIME_GET_LOCATION(psa_get_key_lifetime(attributes)); @@ -1490,6 +1522,10 @@ psa_status_t cracen_copy_key(psa_key_attributes_t *attributes, const uint8_t *so psa_status_t cracen_destroy_key(const psa_key_attributes_t *attributes) { #ifdef PSA_NEED_CRACEN_KMU_DRIVER + if (!cracen_builtin_key_user_allowed(attributes)) { + return PSA_ERROR_NOT_PERMITTED; + } + return cracen_kmu_destroy_key(attributes); #endif @@ -1502,6 +1538,10 @@ psa_status_t cracen_derive_key(const psa_key_attributes_t *attributes, const uin { psa_key_type_t key_type = psa_get_key_type(attributes); + if (!cracen_builtin_key_user_allowed(attributes)) { + return PSA_ERROR_NOT_PERMITTED; + } + if (PSA_KEY_TYPE_IS_SPAKE2P_KEY_PAIR(key_type) && IS_ENABLED(PSA_NEED_CRACEN_SPAKE2P)) { return cracen_derive_spake2p_key(attributes, input, input_length, key, key_size, key_length); diff --git a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/kmu.c b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/kmu.c index 9ce354e1d521..c491c32ebf6c 100644 --- a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/kmu.c +++ b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/kmu.c @@ -169,7 +169,7 @@ static psa_status_t cracen_kmu_encrypt(const uint8_t *key, size_t key_length, } psa_status = cracen_aead_encrypt(&attr, key_buffer, sizeof(key_buffer), PSA_ALG_GCM, nonce, - 12, (uint8_t *)metadata, sizeof(*metadata), key, + 12, (const uint8_t *)metadata, sizeof(*metadata), key, key_length, encrypted_buffer, encrypted_buffer_size, encrypted_buffer_length); @@ -198,7 +198,7 @@ static psa_status_t cracen_kmu_decrypt(kmu_metadata *metadata, size_t number_of_ size_t outlen = 0; return cracen_aead_decrypt(&attr, key_buffer, sizeof(key_buffer), PSA_ALG_GCM, - kmu_push_area, 12, (uint8_t *)metadata, sizeof(*metadata), + kmu_push_area, 12, (const uint8_t *)metadata, sizeof(*metadata), kmu_push_area + CRACEN_KMU_SLOT_KEY_SIZE, (number_of_slots - 1) * CRACEN_KMU_SLOT_KEY_SIZE, kmu_push_area, sizeof(kmu_push_area), &outlen); diff --git a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/rsa_keygen.c b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/rsa_keygen.c index 90478589b45a..725e57562c75 100644 --- a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/rsa_keygen.c +++ b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/rsa_keygen.c @@ -158,9 +158,9 @@ static int rsagenpriv_crt_finish(struct sx_pk_acq_req *pkreq, size_t keysz, uint int sx_status; uint8_t *wmem = workmem + GENPRIVKEY_WORKMEM_OFST(keysz); size_t primefactorsz = keysz >> 1; - sx_op p; - sx_op q; - sx_op privexp; + sx_const_op p; + sx_const_op q; + sx_const_op privexp; /* p and q come out of the earlier key-gen call in workmem */ p.bytes = wmem; @@ -188,7 +188,7 @@ static int rsagenpriv_crt_finish(struct sx_pk_acq_req *pkreq, size_t keysz, uint return sx_status; } - const uint8_t **outputs = (const uint8_t **)sx_pk_get_output_ops(pkreq->req); + const uint8_t **outputs = sx_pk_get_output_ops(pkreq->req); if (pkreq->status != SX_OK) { sx_pk_release_req(pkreq->req); @@ -247,8 +247,8 @@ static int miller_rabin_get_random(uint8_t *workmem, struct cracen_rsacheckpq *r */ cracen_be_add(workmem, candidatesz, 1); uint8_t *candprime = get_candidate_prime(rsacheckpq); - struct sx_buf random; - struct sx_buf candidate; + struct sx_const_buf random; + struct sx_const_buf candidate; random.bytes = workmem; random.sz = candidatesz; @@ -570,9 +570,9 @@ int cracen_rsa_generate_privkey(uint8_t *pubexp, size_t pubexpsz, size_t keysz, struct sx_pk_acq_req pkreq; size_t primefactorsz = keysz >> 1; - sx_op p; - sx_op q; - sx_op pubexp_struct; + sx_const_op p; + sx_const_op q; + sx_const_op pubexp_struct; p.bytes = wmem; p.sz = primefactorsz; diff --git a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/rsaes_oaep.c b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/rsaes_oaep.c index ad9ff72782a0..1829a2e2c9a8 100644 --- a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/rsaes_oaep.c +++ b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/rsaes_oaep.c @@ -56,8 +56,8 @@ static void rsa_oaep_decrypt_init(struct rsa_oaep_workmem *workmem, size_t diges } int cracen_rsa_oaep_decrypt(const struct sxhashalg *hashalg, struct cracen_rsa_key *rsa_key, - struct cracen_crypt_text *text, struct sx_buf *label, uint8_t *output, - size_t *output_length) + struct cracen_crypt_text *text, struct sx_const_buf *label, + uint8_t *output, size_t *output_length) { int sx_status; size_t digestsz = sx_hash_get_alg_digestsz(hashalg); @@ -171,8 +171,8 @@ static void rsa_oaep_encrypt_init(struct rsa_oaep_workmem *workmem, size_t diges } int cracen_rsa_oaep_encrypt(const struct sxhashalg *hashalg, struct cracen_rsa_key *rsa_key, - struct cracen_crypt_text *text, struct sx_buf *label, uint8_t *output, - size_t *output_length) + struct cracen_crypt_text *text, struct sx_const_buf *label, + uint8_t *output, size_t *output_length) { int sx_status; psa_status_t psa_status = PSA_ERROR_CORRUPTION_DETECTED; diff --git a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/rsapss.c b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/rsapss.c index 96c1cff26384..82672eba9cba 100644 --- a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/rsapss.c +++ b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/rsapss.c @@ -262,7 +262,7 @@ static void rsa_pss_verify_init(struct rsa_pss_workmem *workmem, size_t emsz, si } int cracen_rsa_pss_verify_message(struct cracen_rsa_key *rsa_key, - struct cracen_signature *signature, + struct cracen_const_signature *signature, const struct sxhashalg *hashalg, const uint8_t *message, size_t message_length, size_t saltsz) { @@ -278,7 +278,8 @@ int cracen_rsa_pss_verify_message(struct cracen_rsa_key *rsa_key, return cracen_rsa_pss_verify_digest(rsa_key, signature, hashalg, digest, digestsz, saltsz); } -int cracen_rsa_pss_verify_digest(struct cracen_rsa_key *rsa_key, struct cracen_signature *signature, +int cracen_rsa_pss_verify_digest(struct cracen_rsa_key *rsa_key, + struct cracen_const_signature *signature, const struct sxhashalg *hashalg, const uint8_t *digest, size_t digest_length, size_t saltsz) { diff --git a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/rsassa_pkcs1v15.c b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/rsassa_pkcs1v15.c index b06899d2fb19..e0f6a41f06a7 100644 --- a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/rsassa_pkcs1v15.c +++ b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/rsassa_pkcs1v15.c @@ -196,7 +196,7 @@ int cracen_rsa_pkcs1v15_sign_digest(struct cracen_rsa_key *rsa_key, } int cracen_rsa_pkcs1v15_verify_message(struct cracen_rsa_key *rsa_key, - struct cracen_signature *signature, + struct cracen_const_signature *signature, const struct sxhashalg *hashalg, const uint8_t *message, size_t message_length) { @@ -213,7 +213,7 @@ int cracen_rsa_pkcs1v15_verify_message(struct cracen_rsa_key *rsa_key, } int cracen_rsa_pkcs1v15_verify_digest(struct cracen_rsa_key *rsa_key, - struct cracen_signature *signature, + struct cracen_const_signature *signature, const struct sxhashalg *hashalg, const uint8_t *digest, size_t digest_length) { @@ -288,7 +288,7 @@ int cracen_rsa_pkcs1v15_verify_digest(struct cracen_rsa_key *rsa_key, const uint8_t *const encodedmsgend = encodedmsgstart + modulussz; /* pointer used to walk through the EM */ - uint8_t *encmsg = (uint8_t *)encodedmsgstart; + const uint8_t *encmsg = (const uint8_t *)encodedmsgstart; /* invalid signature if first two bytes of EM are not 0x00 0x01 */ r = (sx_rdpkmem_byte(encmsg) != 0x00); diff --git a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/sign.c b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/sign.c index 1c9e0a552d10..0150a2ee4b47 100644 --- a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/sign.c +++ b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/sign.c @@ -122,6 +122,17 @@ cracen_signature_prepare_ec_pubkey(const uint8_t *key_buffer, size_t key_buffer_ } } + if (IS_ENABLED(PSA_NEED_CRACEN_PURE_EDDSA_TWISTED_EDWARDS_448)) { + if (alg == PSA_ALG_PURE_EDDSA || alg == PSA_ALG_ED448PH) { + if (PSA_KEY_TYPE_IS_ECC_PUBLIC_KEY(psa_get_key_type(attributes))) { + memcpy(pubkey_buffer, key_buffer, key_buffer_size); + return PSA_SUCCESS; + } + sx_status = cracen_ed448_create_pubkey(key_buffer, pubkey_buffer); + return silex_statuscodes_to_psa(sx_status); + } + } + if (IS_ENABLED(PSA_NEED_CRACEN_ECDSA_SECP_R1) || IS_ENABLED(PSA_NEED_CRACEN_ECDSA_SECP_K1) || IS_ENABLED(PSA_NEED_CRACEN_ECDSA_BRAINPOOL_P_R1)) { @@ -152,7 +163,7 @@ static psa_status_t validate_key_attributes(const psa_key_attributes_t *attribut size_t key_buffer_size, const struct sx_pk_ecurve **ecurve) { - if (key_buffer_size != PSA_BITS_TO_BYTES(psa_get_key_bits(attributes))) { + if (key_buffer_size != (*ecurve)->sz) { return PSA_ERROR_BUFFER_TOO_SMALL; } if (!PSA_KEY_TYPE_IS_ECC_KEY_PAIR(psa_get_key_type(attributes))) { @@ -166,7 +177,8 @@ static psa_status_t validate_signing_conditions(bool is_message, psa_algorithm_t const psa_key_attributes_t *attributes, size_t ecurve_sz, size_t signature_size) { - if (!PSA_ALG_IS_ECDSA(alg) && alg != PSA_ALG_PURE_EDDSA && alg != PSA_ALG_ED25519PH) { + if (!PSA_ALG_IS_ECDSA(alg) && alg != PSA_ALG_PURE_EDDSA && alg != PSA_ALG_ED25519PH + && alg != PSA_ALG_ED448PH) { return PSA_ERROR_INVALID_ARGUMENT; } @@ -200,6 +212,14 @@ static psa_status_t handle_eddsa_sign(bool is_message, const psa_key_attributes_ } return silex_statuscodes_to_psa(status); } + if (alg == PSA_ALG_ED448PH && IS_ENABLED(PSA_NEED_CRACEN_ED448PH)) { + status = cracen_ed448ph_sign(key_buffer, signature, input, input_length, + is_message); + if (status == SX_OK) { + *signature_length = 2 * ecurve->sz; + } + return silex_statuscodes_to_psa(status); + } if (alg == PSA_ALG_PURE_EDDSA && psa_get_key_bits(attributes) == 255 && IS_ENABLED(PSA_NEED_CRACEN_PURE_EDDSA_TWISTED_EDWARDS_255)) { status = cracen_ed25519_sign(key_buffer, signature, input, input_length); @@ -208,6 +228,15 @@ static psa_status_t handle_eddsa_sign(bool is_message, const psa_key_attributes_ } return silex_statuscodes_to_psa(status); } + if (alg == PSA_ALG_PURE_EDDSA && psa_get_key_bits(attributes) == 448 && + IS_ENABLED(PSA_NEED_CRACEN_PURE_EDDSA_TWISTED_EDWARDS_448)) { + status = cracen_ed448_sign(key_buffer, signature, input, input_length); + if (status == SX_OK) { + *signature_length = 2 * ecurve->sz; + } + return silex_statuscodes_to_psa(status); + } + return PSA_ERROR_NOT_SUPPORTED; } @@ -327,8 +356,10 @@ static psa_status_t cracen_signature_ecc_sign(bool is_message, } if ((alg == PSA_ALG_PURE_EDDSA && - IS_ENABLED(PSA_NEED_CRACEN_PURE_EDDSA_TWISTED_EDWARDS_255)) || - (alg == PSA_ALG_ED25519PH && IS_ENABLED(PSA_NEED_CRACEN_ED25519PH))) { + (IS_ENABLED(PSA_NEED_CRACEN_PURE_EDDSA_TWISTED_EDWARDS_255) || + IS_ENABLED(PSA_NEED_CRACEN_PURE_EDDSA_TWISTED_EDWARDS_448))) || + (alg == PSA_ALG_ED25519PH && IS_ENABLED(PSA_NEED_CRACEN_ED25519PH)) || + (alg == PSA_ALG_ED448PH && IS_ENABLED(PSA_NEED_CRACEN_ED448PH))) { return handle_eddsa_sign(is_message, attributes, key_buffer, alg, signature, input, input_length, ecurve, signature_length); } else if (PSA_ALG_IS_ECDSA(alg) && (IS_ENABLED(PSA_NEED_CRACEN_ECDSA) || @@ -350,7 +381,7 @@ static psa_status_t validate_ec_signature_inputs(bool is_message, if (!(PSA_ALG_IS_ECDSA(alg) || PSA_ALG_IS_DETERMINISTIC_ECDSA(alg) || alg == PSA_ALG_PURE_EDDSA || alg == PSA_ALG_ED25519PH || - PSA_ALG_IS_HASH_EDDSA(alg))) { + alg == PSA_ALG_ED448PH || PSA_ALG_IS_HASH_EDDSA(alg))) { return PSA_ERROR_NOT_SUPPORTED; } @@ -401,10 +432,19 @@ static psa_status_t cracen_signature_ecc_verify(bool is_message, signature, is_message); } else if (IS_ENABLED(PSA_NEED_CRACEN_PURE_EDDSA_TWISTED_EDWARDS_255) && - alg == PSA_ALG_PURE_EDDSA) { + alg == PSA_ALG_PURE_EDDSA && signature_length == SX_ED25519_DGST_SZ) { sx_status = cracen_ed25519_verify(pubkey_buffer, input, input_length, signature); + } else if (IS_ENABLED(PSA_NEED_CRACEN_ED448PH) && alg == PSA_ALG_ED448PH) { + sx_status = cracen_ed448ph_verify(pubkey_buffer, input, input_length, + signature, is_message); + + } else if (IS_ENABLED(PSA_NEED_CRACEN_PURE_EDDSA_TWISTED_EDWARDS_448) && + alg == PSA_ALG_PURE_EDDSA) { + sx_status = cracen_ed448_verify(pubkey_buffer, input, input_length, + signature); + } else if ((PSA_ALG_IS_ECDSA(alg) && IS_ENABLED(PSA_NEED_CRACEN_ECDSA)) || (IS_ENABLED(PSA_NEED_CRACEN_DETERMINISTIC_ECDSA) && PSA_ALG_IS_DETERMINISTIC_ECDSA(alg))) { @@ -524,7 +564,7 @@ static psa_status_t cracen_signature_rsa_verify(bool is_message, int sx_status; size_t key_bits_attr = psa_get_key_bits(attributes); struct cracen_rsa_key privkey = {0}; - struct cracen_signature sign = {0}; + struct cracen_const_signature sign = {.sz = signature_length, .r = signature}; struct sxhashalg hashalg = {0}; const struct sxhashalg *hashalgpointer = &hashalg; struct sx_buf modulus; @@ -567,8 +607,7 @@ static psa_status_t cracen_signature_rsa_verify(bool is_message, } else { return PSA_ERROR_NOT_SUPPORTED; } - sign.sz = signature_length; - sign.r = (uint8_t *)signature; + if (PSA_ALG_IS_RSA_PSS(alg) && IS_ENABLED(PSA_NEED_CRACEN_RSA_PSS)) { if (is_message) { sx_status = cracen_rsa_pss_verify_message(&privkey, &sign, hashalgpointer, diff --git a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/spake2p.c b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/spake2p.c index d5ab8f215169..69a4d338eca9 100644 --- a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/spake2p.c +++ b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/spake2p.c @@ -25,10 +25,6 @@ #include #include -#define MAKE_SX_POINT(name, ptr, point_size) \ - sx_pk_affine_point name = {{.bytes = (ptr), .sz = (point_size) / 2}, \ - {.bytes = (ptr) + (point_size) / 2, .sz = (point_size) / 2}}; - /* * This driver supports uncompressed points only. Uncompressed types * are prefixed with the byte 0x04. See 2.3.3.3.3 from "SEC 1: @@ -136,8 +132,8 @@ static psa_status_t cracen_get_ZV(cracen_spake2p_operation_t *operation, uint8_t uint8_t w0N[CRACEN_P256_POINT_SIZE]; MAKE_SX_POINT(pt_n_w0N, w0N, CRACEN_P256_POINT_SIZE); - MAKE_SX_POINT(pt_NM, (uint8_t *)operation->NM, CRACEN_P256_POINT_SIZE); - sx_ecop w0 = {.bytes = operation->w0, .sz = sizeof(operation->w0)}; + MAKE_SX_CONST_POINT(pt_NM, operation->NM, CRACEN_P256_POINT_SIZE); + sx_const_ecop w0 = {.bytes = operation->w0, .sz = sizeof(operation->w0)}; /* w0 * N. */ status = sx_ecp_ptmult(operation->curve, &w0, &pt_NM, &pt_n_w0N); @@ -150,41 +146,48 @@ static psa_status_t cracen_get_ZV(cracen_spake2p_operation_t *operation, uint8_t const struct sx_pk_cmd_def *cmd = SX_PK_CMD_MOD_SUB; const uint8_t *field_size = sx_pk_field_size(operation->curve); - sx_op modulo = {.sz = CRACEN_P256_KEY_SIZE, .bytes = (uint8_t *)field_size}; + sx_const_op modulo = {.sz = CRACEN_P256_KEY_SIZE, .bytes = field_size}; uint8_t zeroes[CRACEN_P256_KEY_SIZE] = {0}; - sx_op a = {.sz = CRACEN_P256_KEY_SIZE, .bytes = zeroes}; - sx_op b = {.sz = CRACEN_P256_KEY_SIZE, .bytes = &w0N[CRACEN_P256_KEY_SIZE]}; + sx_const_op a = {.sz = CRACEN_P256_KEY_SIZE, .bytes = zeroes}; + sx_const_op b = {.sz = CRACEN_P256_KEY_SIZE, .bytes = &w0N[CRACEN_P256_KEY_SIZE]}; + sx_op res = {.sz = CRACEN_P256_KEY_SIZE, .bytes = &w0N[CRACEN_P256_KEY_SIZE]}; - status = sx_mod_primitive_cmd(NULL, cmd, &modulo, &a, &b, &b); + status = sx_mod_primitive_cmd(NULL, cmd, &modulo, &a, &b, &res); if (status) { return silex_statuscodes_to_psa(status); } /* Calculate Y + (- w0 * N) */ - MAKE_SX_POINT(pt_Y, operation->YX + 1, CRACEN_P256_POINT_SIZE); - status = sx_ecp_ptadd(operation->curve, &pt_Y, &pt_n_w0N, &pt_n_w0N); + MAKE_SX_CONST_POINT(pt_Y, operation->YX + 1, CRACEN_P256_POINT_SIZE); + sx_pk_const_affine_point c_pt_n_w0N; + + sx_get_const_affine_point(&pt_n_w0N, &c_pt_n_w0N); + status = sx_ecp_ptadd(operation->curve, &pt_Y, &c_pt_n_w0N, &pt_n_w0N); if (status) { return silex_statuscodes_to_psa(status); } /* Calculate Z = x * (previous result) */ - sx_ecop x = {.sz = CRACEN_P256_KEY_SIZE, .bytes = operation->xy}; + sx_const_ecop x = {.sz = CRACEN_P256_KEY_SIZE, .bytes = operation->xy}; + sx_get_const_affine_point(&pt_n_w0N, &c_pt_n_w0N); MAKE_SX_POINT(pt_Z, Z, CRACEN_P256_POINT_SIZE); - status = sx_ecp_ptmult(operation->curve, &x, &pt_n_w0N, &pt_Z); + status = sx_ecp_ptmult(operation->curve, &x, &c_pt_n_w0N, &pt_Z); if (status) { return silex_statuscodes_to_psa(status); } /* Calculate V */ MAKE_SX_POINT(pt_V, V, CRACEN_P256_POINT_SIZE); - MAKE_SX_POINT(pt_L, operation->w1_or_L, CRACEN_P256_POINT_SIZE); - sx_ecop k = {.bytes = operation->role == PSA_PAKE_ROLE_CLIENT ? operation->w1_or_L - : operation->xy, - .sz = CRACEN_P256_KEY_SIZE}; + MAKE_SX_CONST_POINT(pt_L, operation->w1_or_L, CRACEN_P256_POINT_SIZE); + sx_const_ecop k = {.bytes = operation->role == PSA_PAKE_ROLE_CLIENT ? operation->w1_or_L + : operation->xy, + .sz = CRACEN_P256_KEY_SIZE}; + sx_get_const_affine_point(&pt_n_w0N, &c_pt_n_w0N); status = sx_ecp_ptmult(operation->curve, &k, - operation->role == PSA_PAKE_ROLE_SERVER ? &pt_L : &pt_n_w0N, &pt_V); + operation->role == PSA_PAKE_ROLE_SERVER ? &pt_L + : &c_pt_n_w0N, &pt_V); if (status) { return silex_statuscodes_to_psa(status); } @@ -236,7 +239,7 @@ static psa_status_t cracen_get_confirmation_keys(cracen_spake2p_operation_t *ope goto exit; } status = psa_driver_wrapper_key_derivation_input_bytes( - &kdf_op, PSA_KEY_DERIVATION_INPUT_INFO, (uint8_t *)"SharedKey", 9); + &kdf_op, PSA_KEY_DERIVATION_INPUT_INFO, (const uint8_t *)"SharedKey", 9); if (status) { goto exit; } @@ -262,7 +265,7 @@ static psa_status_t cracen_get_confirmation_keys(cracen_spake2p_operation_t *ope goto exit; } status = psa_driver_wrapper_key_derivation_input_bytes( - &kdf_op, PSA_KEY_DERIVATION_INPUT_INFO, (uint8_t *)"ConfirmationKeys", 16); + &kdf_op, PSA_KEY_DERIVATION_INPUT_INFO, (const uint8_t *)"ConfirmationKeys", 16); if (status) { goto exit; } @@ -310,15 +313,16 @@ static psa_status_t cracen_get_confirmation(cracen_spake2p_operation_t *operatio } static psa_status_t cracen_p256_reduce(cracen_spake2p_operation_t *operation, - uint8_t *result_buffer, uint8_t *input, size_t input_length) + uint8_t *result_buffer, const uint8_t *input, + size_t input_length) { if (!input_length) { return PSA_ERROR_BUFFER_TOO_SMALL; } const uint8_t *order = sx_pk_curve_order(operation->curve); - sx_op modulo = {.sz = CRACEN_P256_KEY_SIZE, .bytes = (uint8_t *)order}; - sx_op b = {.sz = input_length, .bytes = input}; + sx_const_op modulo = {.sz = CRACEN_P256_KEY_SIZE, .bytes = order}; + sx_const_op b = {.sz = input_length, .bytes = input}; sx_op result = {.sz = CRACEN_P256_KEY_SIZE, .bytes = result_buffer}; /* The nistp256 curve order (n) is prime so we use the ODD variant of the reduce @@ -397,7 +401,7 @@ static psa_status_t cracen_get_key_share(cracen_spake2p_operation_t *operation) MAKE_SX_POINT(pt_xP, xP, CRACEN_P256_POINT_SIZE); /* Calculate x * P */ - sx_ecop x = {.bytes = operation->xy, .sz = CRACEN_P256_KEY_SIZE}; + sx_const_ecop x = {.bytes = operation->xy, .sz = CRACEN_P256_KEY_SIZE}; status = sx_ecp_ptmult(operation->curve, &x, SX_PTMULT_CURVE_GENERATOR, &pt_xP); if (status != SX_OK) { @@ -405,18 +409,23 @@ static psa_status_t cracen_get_key_share(cracen_spake2p_operation_t *operation) } /* Calculate w0 * M */ - sx_ecop w0 = {.bytes = operation->w0, .sz = sizeof(operation->w0)}; + sx_const_ecop w0 = {.bytes = operation->w0, .sz = sizeof(operation->w0)}; MAKE_SX_POINT(pt_w0M, w0M, CRACEN_P256_POINT_SIZE); - MAKE_SX_POINT(pt_M, (uint8_t *)operation->MN, CRACEN_P256_POINT_SIZE); + MAKE_SX_CONST_POINT(pt_M, operation->MN, CRACEN_P256_POINT_SIZE); status = sx_ecp_ptmult(operation->curve, &w0, &pt_M, &pt_w0M); if (status != SX_OK) { return silex_statuscodes_to_psa(status); } /* Add the two previous results. */ + sx_pk_const_affine_point c_pt_w0M; + sx_pk_const_affine_point c_pt_xP; + + sx_get_const_affine_point(&pt_w0M, &c_pt_w0M); + sx_get_const_affine_point(&pt_xP, &c_pt_xP); MAKE_SX_POINT(pt_XY, operation->XY + 1, CRACEN_P256_POINT_SIZE); - status = sx_ecp_ptadd(operation->curve, &pt_w0M, &pt_xP, &pt_XY); + status = sx_ecp_ptadd(operation->curve, &c_pt_w0M, &c_pt_xP, &pt_XY); if (status != SX_OK) { return silex_statuscodes_to_psa(status); } @@ -501,13 +510,13 @@ static psa_status_t set_password_key(cracen_spake2p_operation_t *operation, /* Compute w0 and w1 according to spec. */ if (password_length == 2 * CRACEN_P256_KEY_SIZE) { /* Password contains: w0 || w1 */ - status = cracen_p256_reduce(operation, operation->w0, (uint8_t *)password, + status = cracen_p256_reduce(operation, operation->w0, password, password_length / 2); if (status != PSA_SUCCESS) { return status; } status = cracen_p256_reduce(operation, operation->w1_or_L, - (uint8_t *)password + password_length / 2, + password + password_length / 2, password_length / 2); if (status != PSA_SUCCESS) { return status; @@ -515,8 +524,12 @@ static psa_status_t set_password_key(cracen_spake2p_operation_t *operation, } else if (password_length == CRACEN_P256_POINT_SIZE + CRACEN_P256_KEY_SIZE + 1) { /* Password contains: w0 || L */ - status = cracen_p256_reduce(operation, operation->w0, (uint8_t *)password, + status = cracen_p256_reduce(operation, operation->w0, password, CRACEN_P256_KEY_SIZE); + if (status != PSA_SUCCESS) { + return status; + } + password += password_length - CRACEN_P256_POINT_SIZE; /* Verify that the L part of password is an uncompressed point. */ @@ -524,7 +537,7 @@ static psa_status_t set_password_key(cracen_spake2p_operation_t *operation, return PSA_ERROR_INVALID_ARGUMENT; } - MAKE_SX_POINT(pt, (uint8_t *)password, CRACEN_P256_POINT_SIZE); + MAKE_SX_CONST_POINT(pt, password, CRACEN_P256_POINT_SIZE); status = cracen_ecc_check_public_key(operation->curve, &pt); if (status != PSA_SUCCESS) { return status; @@ -624,7 +637,7 @@ static psa_status_t cracen_spake2p_get_L_from_w1(cracen_spake2p_operation_t *ope { int sx_status; - struct sx_buf w1 = {.sz = operation->curve->sz, .bytes = w1_buf}; + sx_const_ecop w1 = {.sz = operation->curve->sz, .bytes = w1_buf}; sx_pk_affine_point L_pnt = {.x = {.sz = w1.sz, .bytes = L_buf}, .y = {.sz = w1.sz, .bytes = L_buf + w1.sz}}; diff --git a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/srp.c b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/srp.c index 340dee6a0889..4a1a84699f1c 100644 --- a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/srp.c +++ b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/srp.c @@ -55,9 +55,9 @@ static const uint8_t cracen_G3072[] = {5}; static psa_status_t calculate_v_from_k(const uint8_t *k, size_t k_size, uint8_t *v, size_t v_size) { - sx_op g = {.sz = sizeof(cracen_G3072), .bytes = (uint8_t *)cracen_G3072}; - sx_op a = {.sz = k_size, .bytes = (uint8_t *)k}; - sx_op modulo = {.sz = sizeof(cracen_N3072), .bytes = (uint8_t *)cracen_N3072}; + sx_const_op g = {.sz = sizeof(cracen_G3072), .bytes = cracen_G3072}; + sx_const_op a = {.sz = k_size, .bytes = k}; + sx_const_op modulo = {.sz = sizeof(cracen_N3072), .bytes = cracen_N3072}; sx_op result = {.sz = v_size, .bytes = v}; return silex_statuscodes_to_psa(sx_mod_exp(NULL, &g, &a, &modulo, &result)); @@ -196,9 +196,9 @@ static psa_status_t cracen_srp_calculate_client_key_share(cracen_srp_operation_t } /* g^a mod N */ - sx_op g = {.sz = sizeof(cracen_G3072), .bytes = (uint8_t *)cracen_G3072}; - sx_op a = {.sz = sizeof(operation->ab), .bytes = operation->ab}; - sx_op modulo = {.sz = sizeof(cracen_N3072), .bytes = (uint8_t *)cracen_N3072}; + sx_const_op g = {.sz = sizeof(cracen_G3072), .bytes = cracen_G3072}; + sx_const_op a = {.sz = sizeof(operation->ab), .bytes = operation->ab}; + sx_const_op modulo = {.sz = sizeof(cracen_N3072), .bytes = cracen_N3072}; sx_op result = {.sz = sizeof(operation->A), .bytes = operation->A}; int sx_status = sx_mod_exp(NULL, &g, &a, &modulo, &result); @@ -230,9 +230,9 @@ static psa_status_t cracen_srp_calculate_server_key_share(cracen_srp_operation_t } /* b' = g^b */ - sx_op g = {.sz = sizeof(cracen_G3072), .bytes = (uint8_t *)cracen_G3072}; - sx_op b = {.sz = sizeof(operation->ab), .bytes = operation->ab}; - sx_op modulo = {.sz = sizeof(cracen_N3072), .bytes = (uint8_t *)cracen_N3072}; + sx_const_op g = {.sz = sizeof(cracen_G3072), .bytes = cracen_G3072}; + sx_const_op b = {.sz = sizeof(operation->ab), .bytes = operation->ab}; + sx_const_op modulo = {.sz = sizeof(cracen_N3072), .bytes = cracen_N3072}; sx_op temp_b = {.sz = sizeof(temp_value), .bytes = temp_value}; int sx_status = sx_mod_exp(NULL, &g, &b, &modulo, &temp_b); @@ -254,8 +254,8 @@ static psa_status_t cracen_srp_calculate_server_key_share(cracen_srp_operation_t goto error; } /* kv mod N, using output as temp storage */ - sx_op k = {.sz = CRACEN_SRP_HASH_LENGTH, .bytes = k_value}; - sx_op v = {.sz = sizeof(operation->v), .bytes = operation->v}; + sx_const_op k = {.sz = CRACEN_SRP_HASH_LENGTH, .bytes = k_value}; + sx_const_op v = {.sz = sizeof(operation->v), .bytes = operation->v}; sx_op kv = {.sz = sizeof(temp_value_2), .bytes = temp_value_2}; const struct sx_pk_cmd_def *cmd_mul = SX_PK_CMD_ODD_MOD_MULT; @@ -267,9 +267,14 @@ static psa_status_t cracen_srp_calculate_server_key_share(cracen_srp_operation_t /* B = (kv + b') mod N */ sx_op result = {.sz = sizeof(operation->B), .bytes = operation->B}; + sx_const_op c_temp_b; + sx_const_op c_kv; + + sx_get_const_op(&temp_b, &c_temp_b); + sx_get_const_op(&kv, &c_kv); const struct sx_pk_cmd_def *cmd_add = SX_PK_CMD_MOD_ADD; - sx_status = sx_mod_primitive_cmd(NULL, cmd_add, &modulo, &kv, &temp_b, &result); + sx_status = sx_mod_primitive_cmd(NULL, cmd_add, &modulo, &c_kv, &c_temp_b, &result); status = silex_statuscodes_to_psa(sx_status); if (status != PSA_SUCCESS) { goto error; @@ -330,9 +335,9 @@ static psa_status_t cracen_srp_calculate_client_S(cracen_srp_operation_t *operat } /* g'= g^x mod N; using S as temp storage */ - sx_op g = {.sz = sizeof(cracen_G3072), .bytes = (uint8_t *)cracen_G3072}; - sx_op x = {.sz = sizeof(operation->x), .bytes = operation->x}; - sx_op modulo = {.sz = sizeof(cracen_N3072), .bytes = (uint8_t *)cracen_N3072}; + sx_const_op g = {.sz = sizeof(cracen_G3072), .bytes = cracen_G3072}; + sx_const_op x = {.sz = sizeof(operation->x), .bytes = operation->x}; + sx_const_op modulo = {.sz = sizeof(cracen_N3072), .bytes = cracen_N3072}; sx_op temp_g = {.sz = CRACEN_SRP_FIELD_SIZE, .bytes = S}; int sx_status = sx_mod_exp(NULL, &g, &x, &modulo, &temp_g); @@ -346,31 +351,40 @@ static psa_status_t cracen_srp_calculate_client_S(cracen_srp_operation_t *operat return status; } /* k is only a hash there only using the first bytes of the buffer */ - sx_op k = {.sz = CRACEN_SRP_HASH_LENGTH, .bytes = temp_value_0}; + sx_const_op k = {.sz = CRACEN_SRP_HASH_LENGTH, .bytes = temp_value_0}; sx_op kg = {.sz = sizeof(temp_value_1), .bytes = temp_value_1}; + sx_const_op c_temp_g; const struct sx_pk_cmd_def *cmd_mul = SX_PK_CMD_ODD_MOD_MULT; - sx_status = sx_mod_primitive_cmd(NULL, cmd_mul, &modulo, &k, &temp_g, &kg); + sx_get_const_op(&temp_g, &c_temp_g); + sx_status = sx_mod_primitive_cmd(NULL, cmd_mul, &modulo, &k, &c_temp_g, &kg); status = silex_statuscodes_to_psa(sx_status); if (status != PSA_SUCCESS) { return silex_statuscodes_to_psa(sx_status); } /* B' = (B - kg) mod N */ - sx_op B = {.sz = sizeof(operation->B), .bytes = operation->B}; + sx_const_op B = {.sz = sizeof(operation->B), .bytes = operation->B}; sx_op temp_b = {.sz = CRACEN_SRP_FIELD_SIZE, .bytes = S}; + sx_const_op c_kg; const struct sx_pk_cmd_def *cmd_sub = SX_PK_CMD_MOD_SUB; - sx_status = sx_mod_primitive_cmd(NULL, cmd_sub, &modulo, &B, &kg, &temp_b); + sx_get_const_op(&kg, &c_kg); + sx_status = sx_mod_primitive_cmd(NULL, cmd_sub, &modulo, &B, &c_kg, &temp_b); if (sx_status != SX_OK) { return silex_statuscodes_to_psa(sx_status); } /* t_1 = (B')^a mod N */ - sx_op a = {.sz = sizeof(operation->ab), .bytes = operation->ab}; + sx_const_op c_temp_b; + sx_const_op a = {.sz = sizeof(operation->ab), .bytes = operation->ab}; sx_op temp_1 = {.sz = sizeof(temp_value_1), .bytes = temp_value_1}; - sx_status = sx_mod_exp(NULL, &temp_b, &a, &modulo, &temp_1); + sx_get_const_op(&temp_b, &c_temp_b); + sx_status = sx_mod_exp(NULL, &c_temp_b, &a, &modulo, &temp_1); + if (sx_status != SX_OK) { + return silex_statuscodes_to_psa(sx_status); + } /* get u */ status = cracen_srp_calculate_u(operation, temp_value_0, sizeof(temp_value_0)); @@ -379,26 +393,32 @@ static psa_status_t cracen_srp_calculate_client_S(cracen_srp_operation_t *operat } /* t_2 = (B')^u mod N */ - sx_op u = {.sz = CRACEN_SRP_HASH_LENGTH, .bytes = temp_value_0}; + sx_const_op u = {.sz = CRACEN_SRP_HASH_LENGTH, .bytes = temp_value_0}; sx_op temp_2 = {.sz = CRACEN_SRP_FIELD_SIZE, .bytes = S}; - sx_status = sx_mod_exp(NULL, &temp_b, &u, &modulo, &temp_2); + sx_status = sx_mod_exp(NULL, &c_temp_b, &u, &modulo, &temp_2); if (sx_status != SX_OK) { return silex_statuscodes_to_psa(sx_status); } /* t_3 = (t_2)^x mod N = ((B')^u)^x mod N = (B')^(ux) mod N */ + sx_const_op c_temp_2; sx_op temp_3 = {.sz = sizeof(temp_value_0), .bytes = temp_value_0}; - sx_status = sx_mod_exp(NULL, &temp_2, &x, &modulo, &temp_3); + sx_get_const_op(&temp_2, &c_temp_2); + sx_status = sx_mod_exp(NULL, &c_temp_2, &x, &modulo, &temp_3); if (sx_status != SX_OK) { return silex_statuscodes_to_psa(sx_status); } /* B = t_1 * t_3 mod N */ + sx_const_op c_temp_1; + sx_const_op c_temp_3; sx_op result = {.sz = CRACEN_SRP_FIELD_SIZE, .bytes = S}; - sx_status = sx_mod_primitive_cmd(NULL, cmd_mul, &modulo, &temp_1, &temp_3, &result); + sx_get_const_op(&temp_1, &c_temp_1); + sx_get_const_op(&temp_3, &c_temp_3); + sx_status = sx_mod_primitive_cmd(NULL, cmd_mul, &modulo, &c_temp_1, &c_temp_3, &result); return silex_statuscodes_to_psa(sx_status); } @@ -421,9 +441,9 @@ static psa_status_t cracen_srp_calculate_server_S(cracen_srp_operation_t *operat } /* t_1 = v^u mod N */ - sx_op v = {.sz = sizeof(operation->v), .bytes = operation->v}; - sx_op u = {.sz = sizeof(u_buffer), .bytes = u_buffer}; - sx_op modulo = {.sz = sizeof(cracen_N3072), .bytes = (uint8_t *)cracen_N3072}; + sx_const_op v = {.sz = sizeof(operation->v), .bytes = operation->v}; + sx_const_op u = {.sz = sizeof(u_buffer), .bytes = u_buffer}; + sx_const_op modulo = {.sz = sizeof(cracen_N3072), .bytes = cracen_N3072}; sx_op temp_1 = {.sz = CRACEN_SRP_FIELD_SIZE, .bytes = S}; int sx_status = sx_mod_exp(NULL, &v, &u, &modulo, &temp_1); @@ -433,19 +453,23 @@ static psa_status_t cracen_srp_calculate_server_S(cracen_srp_operation_t *operat /* t_2 = A * t_1 mod N = (Av^u) mod N */ sx_op temp_2 = {.sz = sizeof(temp_value), .bytes = temp_value}; - sx_op A = {.sz = sizeof(operation->A), .bytes = operation->A}; + sx_const_op A = {.sz = sizeof(operation->A), .bytes = operation->A}; + sx_const_op c_temp_1; const struct sx_pk_cmd_def *cmd_mul = SX_PK_CMD_ODD_MOD_MULT; - sx_status = sx_mod_primitive_cmd(NULL, cmd_mul, &modulo, &A, &temp_1, &temp_2); + sx_get_const_op(&temp_1, &c_temp_1); + sx_status = sx_mod_primitive_cmd(NULL, cmd_mul, &modulo, &A, &c_temp_1, &temp_2); if (sx_status != SX_OK) { return silex_statuscodes_to_psa(sx_status); } /* t_2^b mod N = (Av^u)^b mod N = S */ - sx_op b = {.sz = sizeof(operation->ab), .bytes = operation->ab}; + sx_const_op b = {.sz = sizeof(operation->ab), .bytes = operation->ab}; sx_op result = {.sz = CRACEN_SRP_FIELD_SIZE, .bytes = S}; + sx_const_op c_temp_2; - sx_status = sx_mod_exp(NULL, &temp_2, &b, &modulo, &result); + sx_get_const_op(&temp_2, &c_temp_2); + sx_status = sx_mod_exp(NULL, &c_temp_2, &b, &modulo, &result); return silex_statuscodes_to_psa(sx_status); } diff --git a/subsys/nrf_security/src/drivers/cracen/psa_driver.Kconfig b/subsys/nrf_security/src/drivers/cracen/psa_driver.Kconfig index 6ba84c8bb33e..cd51c7f923a4 100644 --- a/subsys/nrf_security/src/drivers/cracen/psa_driver.Kconfig +++ b/subsys/nrf_security/src/drivers/cracen/psa_driver.Kconfig @@ -356,6 +356,14 @@ config PSA_NEED_CRACEN_ED25519PH depends on PSA_WANT_ECC_TWISTED_EDWARDS_255 depends on PSA_USE_CRACEN_ASYMMETRIC_SIGNATURE_DRIVER +config PSA_NEED_CRACEN_ED448PH + bool + default y + select PSA_ACCEL_ED448PH + depends on PSA_WANT_ALG_ED448PH + depends on PSA_WANT_ECC_TWISTED_EDWARDS_448 + depends on PSA_USE_CRACEN_ASYMMETRIC_SIGNATURE_DRIVER + config PSA_NEED_CRACEN_PURE_EDDSA_TWISTED_EDWARDS bool default y @@ -368,7 +376,8 @@ config PSA_NEED_CRACEN_ASYMMETRIC_SIGNATURE_ANY_ECC depends on PSA_NEED_CRACEN_ECDSA_BRAINPOOL_P_R1 || \ PSA_NEED_CRACEN_ECDSA_SECP_R1 || \ PSA_NEED_CRACEN_ECDSA_SECP_K1 || \ - PSA_NEED_CRACEN_ED25519PH || \ + PSA_NEED_CRACEN_ED25519PH || \ + PSA_NEED_CRACEN_ED448PH || \ PSA_NEED_CRACEN_PURE_EDDSA_TWISTED_EDWARDS config PSA_NEED_CRACEN_RSA_PKCS1V15_SIGN @@ -513,12 +522,14 @@ config PSA_NEED_CRACEN_SHA_512 select PSA_ACCEL_SHA_512 depends on PSA_WANT_ALG_SHA_512 depends on PSA_USE_CRACEN_HASH_DRIVER + config PSA_NEED_CRACEN_SHA3_224 bool default y select PSA_ACCEL_SHA3_224 depends on PSA_WANT_ALG_SHA3_224 depends on PSA_USE_CRACEN_HASH_DRIVER + config PSA_NEED_CRACEN_SHA3_256 bool default y @@ -540,6 +551,13 @@ config PSA_NEED_CRACEN_SHA3_512 depends on PSA_WANT_ALG_SHA3_512 depends on PSA_USE_CRACEN_HASH_DRIVER +config PSA_NEED_CRACEN_SHAKE256_512 + bool + default y + select PSA_ACCEL_SHAKE256_512 + depends on PSA_WANT_ALG_SHAKE256_512 + depends on PSA_USE_CRACEN_HASH_DRIVER + config PSA_NEED_CRACEN_HASH_DRIVER bool default y @@ -551,7 +569,8 @@ config PSA_NEED_CRACEN_HASH_DRIVER PSA_NEED_CRACEN_SHA3_224 || \ PSA_NEED_CRACEN_SHA3_256 || \ PSA_NEED_CRACEN_SHA3_384 || \ - PSA_NEED_CRACEN_SHA3_512 + PSA_NEED_CRACEN_SHA3_512 || \ + PSA_NEED_CRACEN_SHAKE256_512 # CRACEN Key Generation Driver diff --git a/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/sxbuf/sxbufop.h b/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/sxbuf/sxbufop.h index dc8fb911963a..3dbaea8033bb 100644 --- a/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/sxbuf/sxbufop.h +++ b/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/sxbuf/sxbufop.h @@ -13,6 +13,16 @@ #include #include +#define PREPARE_SX_POINT(type, name, ptr, point_size) \ + type name = {{.bytes = (ptr), .sz = (point_size) / 2}, \ + {.bytes = (ptr) + (point_size) / 2, .sz = (point_size) / 2}} + +#define MAKE_SX_POINT(name, ptr, point_size) \ + PREPARE_SX_POINT(sx_pk_affine_point, name, ptr, point_size) + +#define MAKE_SX_CONST_POINT(name, ptr, point_size) \ + PREPARE_SX_POINT(sx_pk_const_affine_point, name, ptr, point_size) + /** Basic operand representation **/ struct sx_buf { /** Size in bytes of operand **/ @@ -20,11 +30,20 @@ struct sx_buf { /** Memory of operand bytes in big endian **/ uint8_t *bytes; }; -/** Simple "sxops" implementation based on sx_buf**/ + +struct sx_const_buf { + /** Size in bytes of operand **/ + size_t sz; + /** Memory of operand bytes in big endian **/ + const uint8_t *bytes; +}; +/** Simple "sxops" implementation based on sx_buf and sx_const_buf**/ typedef struct sx_buf sx_op; +typedef struct sx_const_buf sx_const_op; /** Simple Elliptic Curve operand implementation based on sx_buf**/ typedef struct sx_buf sx_ecop; +typedef struct sx_const_buf sx_const_ecop; /** Affine point for ECC **/ typedef struct sx_pk_affine_point { @@ -34,4 +53,37 @@ typedef struct sx_pk_affine_point { sx_ecop y; } sx_pk_affine_point; +typedef struct sx_pk_const_affine_point { + /** x-coordinate of const affine point */ + sx_const_ecop x; + /** y-coordinate of const affine point */ + sx_const_ecop y; +} sx_pk_const_affine_point; + +/** Initializes sx_const_op with values from provided sx_op + * + * @param[in] source_op Source sx operand + * @param[out] dest_op Destination operand initialized from source + */ +static inline void sx_get_const_op(const sx_op *source_op, sx_const_op *dest_op) +{ + dest_op->sz = source_op->sz; + dest_op->bytes = source_op->bytes; +} + +/** Initializes sx_pk_const_affine_point with values from provided sx_pk_affine_point + * + * @param[in] source_point Source affine point + * @param[out] dest_point Destination affine point initialized from source + */ +static inline void sx_get_const_affine_point(const sx_pk_affine_point *source_point, + sx_pk_const_affine_point *dest_point) +{ + dest_point->x.sz = source_point->x.sz; + dest_point->x.bytes = source_point->x.bytes; + + dest_point->y.sz = source_point->y.sz; + dest_point->y.bytes = source_point->y.bytes; +} + #endif diff --git a/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/sxops/adapter.h b/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/sxops/adapter.h index 8ccbea5f9187..703d7225e865 100644 --- a/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/sxops/adapter.h +++ b/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/sxops/adapter.h @@ -19,14 +19,14 @@ * @param[in] mem Memory address to write the operand to * @param[in] sz Size in bytes of the operand */ -void sx_pk_ecop2mem(const sx_ecop *op, uint8_t *mem, int sz); +void sx_pk_ecop2mem(const sx_const_ecop *op, uint8_t *mem, int sz); /** Write the operand into memory which has the exact size needed * * @param[in] op Operand written to memory. Data should be in big endian * @param[in] mem Memory address to write the operand to */ -void sx_pk_op2vmem(const sx_op *op, uint8_t *mem); +void sx_pk_op2vmem(const sx_const_op *op, uint8_t *mem); /** Convert raw bytes to operand * @@ -65,7 +65,7 @@ void sx_pk_mem2affpt(const uint8_t *mem_x, const uint8_t *mem_y, int sz, sx_pk_a * @param[in] mem_y Memory address to write the y-coordinate of the operand to * @param[in] sz Size in bytes of a single coordinate */ -void sx_pk_affpt2mem(const sx_pk_affine_point *op, uint8_t *mem_x, uint8_t *mem_y, int sz); +void sx_pk_affpt2mem(const sx_pk_const_affine_point *op, uint8_t *mem_x, uint8_t *mem_y, int sz); /** Return the size in bytes of the operand. * @@ -74,4 +74,11 @@ void sx_pk_affpt2mem(const sx_pk_affine_point *op, uint8_t *mem_x, uint8_t *mem_ */ int sx_op_size(const sx_op *op); +/** Return the size in bytes of the const operand. + * + * @param[in] op Const operand + * @return Operand size in bytes + */ +int sx_const_op_size(const sx_const_op *op); + #endif diff --git a/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/sxops/dsa.h b/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/sxops/dsa.h index 7b50063619f1..45e77a128540 100644 --- a/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/sxops/dsa.h +++ b/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/sxops/dsa.h @@ -61,10 +61,11 @@ struct sx_pk_cmd_def; * * @see sx_dsa_sign() for a synchronous version */ -static inline struct sx_pk_acq_req sx_async_dsa_sign_go(struct sx_pk_cnx *cnx, const sx_op *p, - const sx_op *q, const sx_op *g, - const sx_op *k, const sx_op *privkey, - const sx_op *h) +static inline struct sx_pk_acq_req sx_async_dsa_sign_go(struct sx_pk_cnx *cnx, const sx_const_op *p, + const sx_const_op *q, const sx_const_op *g, + const sx_const_op *k, + const sx_const_op *privkey, + const sx_const_op *h) { struct sx_pk_acq_req pkreq; struct sx_pk_inops_dsa_sign inputs; @@ -76,8 +77,8 @@ static inline struct sx_pk_acq_req sx_async_dsa_sign_go(struct sx_pk_cnx *cnx, c /* convert and transfer operands */ int sizes[] = { - sx_op_size(p), sx_op_size(q), sx_op_size(g), - sx_op_size(k), sx_op_size(privkey), sx_op_size(h), + sx_const_op_size(p), sx_const_op_size(q), sx_const_op_size(g), + sx_const_op_size(k), sx_const_op_size(privkey), sx_const_op_size(h), }; pkreq.status = sx_pk_list_gfp_inslots(pkreq.req, sizes, (struct sx_pk_slot *)&inputs); if (pkreq.status) { @@ -173,10 +174,11 @@ int sx_dsa_sign(struct sx_pk_cnx *cnx, const sx_op *p, const sx_op *q, const sx_ * * @see sx_dsa_ver() for a synchronous version */ -static inline struct sx_pk_acq_req sx_async_dsa_ver_go(struct sx_pk_cnx *cnx, const sx_op *p, - const sx_op *q, const sx_op *g, - const sx_op *pubkey, const sx_op *h, - const sx_op *r, const sx_op *s) +static inline struct sx_pk_acq_req sx_async_dsa_ver_go(struct sx_pk_cnx *cnx, const sx_const_op *p, + const sx_const_op *q, const sx_const_op *g, + const sx_const_op *pubkey, + const sx_const_op *h, const sx_const_op *r, + const sx_const_op *s) { struct sx_pk_acq_req pkreq; struct sx_pk_inops_dsa_ver inputs; @@ -188,8 +190,9 @@ static inline struct sx_pk_acq_req sx_async_dsa_ver_go(struct sx_pk_cnx *cnx, co /* convert and transfer operands */ int sizes[] = { - sx_op_size(p), sx_op_size(q), sx_op_size(g), sx_op_size(pubkey), - sx_op_size(h), sx_op_size(r), sx_op_size(s), + sx_const_op_size(p), sx_const_op_size(q), sx_const_op_size(g), + sx_const_op_size(pubkey), sx_const_op_size(h), sx_const_op_size(r), + sx_const_op_size(s), }; pkreq.status = sx_pk_list_gfp_inslots(pkreq.req, sizes, (struct sx_pk_slot *)&inputs); if (pkreq.status) { diff --git a/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/sxops/eccweierstrass.h b/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/sxops/eccweierstrass.h index 5dfb937a4334..fbf91499e030 100644 --- a/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/sxops/eccweierstrass.h +++ b/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/sxops/eccweierstrass.h @@ -79,8 +79,9 @@ struct sx_pk_ecurve; * @return Acquired acceleration request for this operation */ static inline struct sx_pk_acq_req sx_async_ecdsa_generate_go(const struct sx_pk_ecurve *curve, - const sx_ecop *d, const sx_ecop *k, - const sx_ecop *h) + const sx_const_op *d, + const sx_const_op *k, + const sx_const_op *h) { struct sx_pk_acq_req pkreq; struct sx_pk_inops_ecdsa_generate inputs; @@ -160,8 +161,9 @@ static inline void sx_async_ecdsa_generate_end(sx_pk_req *req, sx_ecop *r, sx_ec * @see sx_async_ecdsa_generate_go(), sx_async_ecdsa_generate_end() for * an asynchronous version */ -static inline int sx_ecdsa_generate(const struct sx_pk_ecurve *curve, const sx_ecop *d, - const sx_ecop *k, const sx_ecop *h, sx_ecop *r, sx_ecop *s) +static inline int sx_ecdsa_generate(const struct sx_pk_ecurve *curve, const sx_const_ecop *d, + const sx_const_ecop *k, const sx_const_ecop *h, sx_ecop *r, + sx_ecop *s) { uint32_t status; struct sx_pk_acq_req pkreq; @@ -203,10 +205,9 @@ static inline int sx_ecdsa_generate(const struct sx_pk_ecurve *curve, const sx_e * * @return Acquired acceleration request for this operation */ -static inline struct sx_pk_acq_req sx_async_ecdsa_verify_go(const struct sx_pk_ecurve *curve, - const sx_pk_affine_point *q, - const sx_ecop *r, const sx_ecop *s, - const sx_ecop *h) +static inline struct sx_pk_acq_req +sx_async_ecdsa_verify_go(const struct sx_pk_ecurve *curve, const sx_pk_const_affine_point *q, + const sx_const_ecop *r, const sx_const_ecop *s, const sx_const_ecop *h) { struct sx_pk_acq_req pkreq; struct sx_pk_inops_ecdsa_verify inputs; @@ -269,8 +270,9 @@ static inline struct sx_pk_acq_req sx_async_ecdsa_verify_go(const struct sx_pk_e * * @see sx_async_ecdsa_verify_go() for an asynchronous version */ -static inline int sx_ecdsa_verify(const struct sx_pk_ecurve *curve, const sx_pk_affine_point *q, - const sx_ecop *r, const sx_ecop *s, const sx_ecop *h) +static inline int sx_ecdsa_verify(const struct sx_pk_ecurve *curve, + const sx_pk_const_affine_point *q, const sx_const_ecop *r, + const sx_const_ecop *s, const sx_const_ecop *h) { uint32_t status; struct sx_pk_acq_req pkreq; @@ -317,8 +319,8 @@ static inline int sx_ecdsa_verify(const struct sx_pk_ecurve *curve, const sx_pk_ * @return Acquired acceleration request for this operation */ static inline struct sx_pk_acq_req sx_async_ecp_mult_go(const struct sx_pk_ecurve *curve, - const sx_ecop *k, - const sx_pk_affine_point *p) + const sx_const_ecop *k, + const sx_pk_const_affine_point *p) { struct sx_pk_acq_req pkreq; @@ -389,8 +391,8 @@ static inline void sx_async_ecp_mult_end(sx_pk_req *req, sx_pk_affine_point *r) * @see sx_async_ecp_mult_go(), sx_async_ecp_mult_end() * for an asynchronous versions */ -static inline int sx_ecp_ptmult(const struct sx_pk_ecurve *curve, const sx_ecop *k, - const sx_pk_affine_point *p, sx_pk_affine_point *r) +static inline int sx_ecp_ptmult(const struct sx_pk_ecurve *curve, const sx_const_ecop *k, + const sx_pk_const_affine_point *p, sx_pk_affine_point *r) { int status; struct sx_pk_acq_req pkreq; @@ -430,7 +432,7 @@ static inline int sx_ecp_ptmult(const struct sx_pk_ecurve *curve, const sx_ecop * @return Acquired acceleration request for this operation */ static inline struct sx_pk_acq_req sx_async_ecp_double_go(const struct sx_pk_ecurve *curve, - const sx_pk_affine_point *p) + const sx_pk_const_affine_point *p) { struct sx_pk_acq_req pkreq; @@ -496,7 +498,7 @@ static inline void sx_async_ecp_double_end(sx_pk_req *req, sx_pk_affine_point *r * @see sx_async_ecp_double_go(), sx_async_ecp_double_end() * for an asynchronous verion */ -static inline int sx_ecp_double(const struct sx_pk_ecurve *curve, const sx_pk_affine_point *p, +static inline int sx_ecp_double(const struct sx_pk_ecurve *curve, const sx_pk_const_affine_point *p, sx_pk_affine_point *r) { int status; @@ -528,7 +530,7 @@ static inline int sx_ecp_double(const struct sx_pk_ecurve *curve, const sx_pk_af * @return Acquired acceleration request for this operation */ static inline struct sx_pk_acq_req sx_async_ec_ptoncurve_go(const struct sx_pk_ecurve *curve, - const sx_pk_affine_point *p) + const sx_pk_const_affine_point *p) { struct sx_pk_acq_req pkreq; @@ -581,7 +583,8 @@ static inline struct sx_pk_acq_req sx_async_ec_ptoncurve_go(const struct sx_pk_e * @return ::SX_ERR_EXPIRED * @return ::SX_ERR_PK_RETRY */ -static inline int sx_ec_ptoncurve(const struct sx_pk_ecurve *curve, const sx_pk_affine_point *p) +static inline int sx_ec_ptoncurve(const struct sx_pk_ecurve *curve, + const sx_pk_const_affine_point *p) { int status; struct sx_pk_acq_req pkreq; @@ -612,8 +615,9 @@ static inline int sx_ec_ptoncurve(const struct sx_pk_ecurve *curve, const sx_pk_ * * @return Acquired acceleration request for this operation */ -static inline struct sx_pk_acq_req -sx_async_ec_pt_decompression_go(const struct sx_pk_ecurve *curve, const sx_ecop *x, const int y_lsb) +static inline struct sx_pk_acq_req sx_async_ec_pt_decompression_go(const struct sx_pk_ecurve *curve, + const sx_const_ecop *x, + const int y_lsb) { struct sx_pk_acq_req pkreq; @@ -682,7 +686,7 @@ static inline void sx_async_ec_pt_decompression_end(sx_pk_req *req, sx_ecop *y) * @return ::SX_ERR_EXPIRED * @return ::SX_ERR_PK_RETRY */ -static inline int sx_ec_pt_decompression(const struct sx_pk_ecurve *curve, const sx_ecop *x, +static inline int sx_ec_pt_decompression(const struct sx_pk_ecurve *curve, const sx_const_ecop *x, const int y_lsb, sx_ecop *y) { int status; @@ -728,7 +732,7 @@ static inline int sx_ec_pt_decompression(const struct sx_pk_ecurve *curve, const * @return Acquired acceleration request for this operation */ static inline struct sx_pk_acq_req -sx_async_eckcdsa_pubkey_generate_go(const struct sx_pk_ecurve *curve, const sx_ecop *d) +sx_async_eckcdsa_pubkey_generate_go(const struct sx_pk_ecurve *curve, const sx_const_ecop *d) { struct sx_pk_acq_req pkreq; struct sx_pk_inops_eckcdsa_generate inputs; @@ -796,8 +800,8 @@ static inline void sx_async_eckcdsa_pubkey_generate_end(sx_pk_req *req, sx_pk_af * @see sx_async_eckcdsa_pubkey_generate_go(), * sx_async_eckcdsa_pubkey_generate_end() for an asynchronous verion */ -static inline int sx_eckcdsa_pubkey_generate(const struct sx_pk_ecurve *curve, const sx_op *d, - sx_pk_affine_point *q) +static inline int sx_eckcdsa_pubkey_generate(const struct sx_pk_ecurve *curve, + const sx_const_ecop *d, sx_pk_affine_point *q) { uint32_t status; struct sx_pk_acq_req pkreq; @@ -841,9 +845,9 @@ static inline int sx_eckcdsa_pubkey_generate(const struct sx_pk_ecurve *curve, c * * @return Acquired acceleration request for this operation */ -static inline struct sx_pk_acq_req sx_async_eckcdsa_sign_go(const struct sx_pk_ecurve *curve, - const sx_ecop *d, const sx_ecop *k, - const sx_ecop *h, const sx_ecop *r) +static inline struct sx_pk_acq_req +sx_async_eckcdsa_sign_go(const struct sx_pk_ecurve *curve, const sx_const_ecop *d, + const sx_const_ecop *k, const sx_const_ecop *h, const sx_const_ecop *r) { struct sx_pk_acq_req pkreq; struct sx_pk_inops_eckcdsa_sign inputs; @@ -921,8 +925,9 @@ static inline void sx_async_eckcdsa_sign_end(sx_pk_req *req, sx_ecop *s) * @see sx_async_eckcdsa_sign_go(), sx_async_eckcdsa_sign_end() * for an asynchronous verion */ -static inline int sx_eckcdsa_sign(const struct sx_pk_ecurve *curve, const sx_ecop *d, - const sx_ecop *k, const sx_ecop *h, const sx_ecop *r, sx_ecop *s) +static inline int sx_eckcdsa_sign(const struct sx_pk_ecurve *curve, const sx_const_ecop *d, + const sx_const_ecop *k, const sx_const_ecop *h, + const sx_const_ecop *r, sx_ecop *s) { uint32_t status; struct sx_pk_acq_req pkreq; @@ -955,10 +960,9 @@ static inline int sx_eckcdsa_sign(const struct sx_pk_ecurve *curve, const sx_eco * * @return Acquired acceleration request for this operation */ -static inline struct sx_pk_acq_req sx_async_eckcdsa_verify_go(const struct sx_pk_ecurve *curve, - const sx_pk_affine_point *q, - const sx_ecop *r, const sx_ecop *s, - const sx_ecop *h) +static inline struct sx_pk_acq_req +sx_async_eckcdsa_verify_go(const struct sx_pk_ecurve *curve, const sx_pk_const_affine_point *q, + const sx_const_ecop *r, const sx_const_ecop *s, const sx_const_ecop *h) { struct sx_pk_acq_req pkreq; struct sx_pk_inops_ecdsa_verify inputs; @@ -1040,8 +1044,9 @@ static inline void sx_async_eckcdsa_verify_end(sx_pk_req *req, sx_pk_affine_poin * @see sx_async_eckcdsa_verify_go(), sx_async_eckcdsa_verify_end() * for an asynchronous version */ -static inline int sx_eckcdsa_verify(const struct sx_pk_ecurve *curve, const sx_pk_affine_point *q, - const sx_ecop *r, const sx_ecop *s, const sx_ecop *h, +static inline int sx_eckcdsa_verify(const struct sx_pk_ecurve *curve, + const sx_pk_const_affine_point *q, const sx_const_ecop *r, + const sx_const_ecop *s, const sx_const_ecop *h, sx_pk_affine_point *w) { uint32_t status; @@ -1080,8 +1085,8 @@ static inline int sx_eckcdsa_verify(const struct sx_pk_ecurve *curve, const sx_p * @return Acquired acceleration request for this operation */ static inline struct sx_pk_acq_req sx_async_ecp_add_go(const struct sx_pk_ecurve *curve, - const sx_pk_affine_point *p1, - const sx_pk_affine_point *p2) + const sx_pk_const_affine_point *p1, + const sx_pk_const_affine_point *p2) { struct sx_pk_acq_req pkreq; @@ -1153,8 +1158,8 @@ static inline void sx_async_ecp_add_end(sx_pk_req *req, sx_pk_affine_point *r) * @remark Use point doubling operation for the addition of equal points * @see sx_ecp_double() */ -static inline int sx_ecp_ptadd(const struct sx_pk_ecurve *curve, const sx_pk_affine_point *p1, - const sx_pk_affine_point *p2, sx_pk_affine_point *r) +static inline int sx_ecp_ptadd(const struct sx_pk_ecurve *curve, const sx_pk_const_affine_point *p1, + const sx_pk_const_affine_point *p2, sx_pk_affine_point *r) { int status; struct sx_pk_acq_req pkreq; @@ -1185,7 +1190,7 @@ static inline int sx_ecp_ptadd(const struct sx_pk_ecurve *curve, const sx_pk_aff * @return Acquired acceleration request for this operation */ static inline struct sx_pk_acq_req sx_async_ecp_check_order_go(const struct sx_pk_ecurve *curve, - const sx_pk_affine_point *p) + const sx_pk_const_affine_point *p) { struct sx_pk_acq_req pkreq; @@ -1242,8 +1247,9 @@ static inline struct sx_pk_acq_req sx_async_ecp_check_order_go(const struct sx_p * @return Acquired acceleration request for this operation */ static inline struct sx_pk_acq_req sx_async_sm2_generate_go(const struct sx_pk_ecurve *curve, - const sx_ecop *d, const sx_ecop *k, - const sx_ecop *h) + const sx_const_ecop *d, + const sx_const_ecop *k, + const sx_const_ecop *h) { struct sx_pk_acq_req pkreq; struct sx_pk_inops_ecdsa_generate inputs; @@ -1321,8 +1327,9 @@ static inline void sx_async_sm2_generate_end(sx_pk_req *req, sx_ecop *r, sx_ecop * @return ::SX_ERR_EXPIRED * @return ::SX_ERR_PK_RETRY */ -static inline int sx_sm2_generate(const struct sx_pk_ecurve *curve, const sx_ecop *d, - const sx_ecop *k, const sx_ecop *h, sx_ecop *r, sx_ecop *s) +static inline int sx_sm2_generate(const struct sx_pk_ecurve *curve, const sx_const_ecop *d, + const sx_const_ecop *k, const sx_const_ecop *h, sx_ecop *r, + sx_ecop *s) { uint32_t status; struct sx_pk_acq_req pkreq; @@ -1364,10 +1371,9 @@ static inline int sx_sm2_generate(const struct sx_pk_ecurve *curve, const sx_eco * * @return Acquired acceleration request for this operation */ -static inline struct sx_pk_acq_req sx_async_sm2_verify_go(const struct sx_pk_ecurve *curve, - const sx_pk_affine_point *q, - const sx_ecop *r, const sx_ecop *s, - const sx_ecop *h) +static inline struct sx_pk_acq_req +sx_async_sm2_verify_go(const struct sx_pk_ecurve *curve, const sx_pk_const_affine_point *q, + const sx_const_ecop *r, const sx_const_ecop *s, const sx_const_ecop *h) { struct sx_pk_acq_req pkreq; struct sx_pk_inops_ecdsa_verify inputs; @@ -1425,8 +1431,9 @@ static inline struct sx_pk_acq_req sx_async_sm2_verify_go(const struct sx_pk_ecu * @return ::SX_ERR_EXPIRED * @return ::SX_ERR_PK_RETRY */ -static inline int sx_sm2_verify(const struct sx_pk_ecurve *curve, const sx_pk_affine_point *q, - const sx_ecop *r, const sx_ecop *s, const sx_ecop *h) +static inline int sx_sm2_verify(const struct sx_pk_ecurve *curve, const sx_pk_const_affine_point *q, + const sx_const_ecop *r, const sx_const_ecop *s, + const sx_const_ecop *h) { uint32_t status; struct sx_pk_acq_req pkreq; @@ -1467,9 +1474,10 @@ static inline int sx_sm2_verify(const struct sx_pk_ecurve *curve, const sx_pk_af * @see sx_async_sm2_exchange_end() */ static inline struct sx_pk_acq_req -sx_async_sm2_exchange_go(const struct sx_pk_ecurve *curve, const sx_ecop *d, const sx_ecop *k, - const sx_pk_affine_point *q, const sx_pk_affine_point *rb, - const sx_ecop *cof, const sx_ecop *rax, const sx_ecop *exp2_w) +sx_async_sm2_exchange_go(const struct sx_pk_ecurve *curve, const sx_const_ecop *d, + const sx_const_ecop *k, const sx_pk_const_affine_point *q, + const sx_pk_const_affine_point *rb, const sx_const_ecop *cof, + const sx_const_ecop *rax, const sx_const_ecop *exp2_w) { struct sx_pk_acq_req pkreq; struct sx_pk_inops_sm2_exchange inputs; @@ -1555,10 +1563,11 @@ static inline void sx_async_sm2_exchange_end(sx_pk_req *req, sx_pk_affine_point * @return ::SX_ERR_EXPIRED * @return ::SX_ERR_PK_RETRY */ -static inline int sx_sm2_exchange(const struct sx_pk_ecurve *curve, const sx_ecop *d, - const sx_ecop *k, const sx_pk_affine_point *q, - const sx_pk_affine_point *rb, const sx_ecop *cof, - const sx_ecop *rax, const sx_ecop *exp2_w, sx_pk_affine_point *u) +static inline int sx_sm2_exchange(const struct sx_pk_ecurve *curve, const sx_const_ecop *d, + const sx_const_ecop *k, const sx_pk_const_affine_point *q, + const sx_pk_const_affine_point *rb, const sx_const_ecop *cof, + const sx_const_ecop *rax, const sx_const_ecop *exp2_w, + sx_pk_affine_point *u) { uint32_t status; struct sx_pk_acq_req pkreq; diff --git a/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/sxops/ecjpake.h b/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/sxops/ecjpake.h index 3fdaeab57d8d..d6018d40f43d 100644 --- a/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/sxops/ecjpake.h +++ b/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/sxops/ecjpake.h @@ -67,8 +67,9 @@ struct sx_pk_ecurve; * @return Acquired acceleration request for this operation */ static inline struct sx_pk_acq_req sx_ecjpake_generate_zkp_go(const struct sx_pk_ecurve *curve, - const sx_ecop *v, const sx_ecop *x, - const sx_ecop *h) + const sx_const_ecop *v, + const sx_const_ecop *x, + const sx_const_ecop *h) { struct sx_pk_acq_req pkreq; struct sx_pk_inops_ecjpake_generate_zkp inputs; @@ -139,8 +140,9 @@ static inline void sx_ecjpake_generate_zkp_end(sx_pk_req *req, sx_ecop *r) * @see sx_async_ecjpake_generate_zkp_go(), sx_async_ecjpake_generate_zkp_end() * for an asynchronous version */ -static inline int sx_ecjpake_generate_zkp(const struct sx_pk_ecurve *curve, const sx_ecop *v, - const sx_ecop *x, const sx_ecop *h, sx_ecop *r) +static inline int sx_ecjpake_generate_zkp(const struct sx_pk_ecurve *curve, const sx_const_ecop *v, + const sx_const_ecop *x, const sx_const_ecop *h, + sx_ecop *r) { uint32_t status; struct sx_pk_acq_req pkreq; @@ -177,11 +179,10 @@ static inline int sx_ecjpake_generate_zkp(const struct sx_pk_ecurve *curve, cons * * @return Acquired acceleration request for this operation */ -static inline struct sx_pk_acq_req sx_ecjpake_verify_zkp_go(const struct sx_pk_ecurve *curve, - const sx_pk_affine_point *v, - const sx_pk_affine_point *x, - const sx_ecop *r, const sx_ecop *h, - const sx_pk_affine_point *g) +static inline struct sx_pk_acq_req +sx_ecjpake_verify_zkp_go(const struct sx_pk_ecurve *curve, const sx_pk_const_affine_point *v, + const sx_pk_const_affine_point *x, const sx_const_ecop *r, + const sx_const_ecop *h, const sx_pk_const_affine_point *g) { struct sx_pk_acq_req pkreq; struct sx_pk_inops_ecjpake_verify_zkp inputs; @@ -271,9 +272,9 @@ static inline void sx_ecjpake_verify_zkp_end(sx_pk_req *req) * an asynchronous version */ static inline int sx_ecjpake_verify_zkp(const struct sx_pk_ecurve *curve, - const sx_pk_affine_point *v, const sx_pk_affine_point *x, - const sx_ecop *r, const sx_ecop *h, - const sx_pk_affine_point *g) + const sx_pk_const_affine_point *v, + const sx_pk_const_affine_point *x, const sx_const_ecop *r, + const sx_const_ecop *h, const sx_pk_const_affine_point *g) { uint32_t status; struct sx_pk_acq_req pkreq; @@ -309,9 +310,9 @@ static inline int sx_ecjpake_verify_zkp(const struct sx_pk_ecurve *curve, * */ static inline struct sx_pk_acq_req sx_ecjpake_3pt_add_go(const struct sx_pk_ecurve *curve, - const sx_pk_affine_point *a, - const sx_pk_affine_point *b, - const sx_pk_affine_point *c) + const sx_pk_const_affine_point *a, + const sx_pk_const_affine_point *b, + const sx_pk_const_affine_point *c) { struct sx_pk_acq_req pkreq; struct sx_pk_inops_ecjpake_3pt_add inputs; @@ -389,9 +390,10 @@ static inline void sx_ecjpake_3pt_add_end(sx_pk_req *req, sx_pk_affine_point *gb * @see sx_async_ecjpake_verify_zkp_go(), sx_async_ecjpake_verify_zkp_end() for * an asynchronous version */ -static inline int sx_ecjpake_3pt_add(const struct sx_pk_ecurve *curve, const sx_pk_affine_point *a, - const sx_pk_affine_point *b, const sx_pk_affine_point *c, - sx_pk_affine_point *gb) +static inline int sx_ecjpake_3pt_add(const struct sx_pk_ecurve *curve, + const sx_pk_const_affine_point *a, + const sx_pk_const_affine_point *b, + const sx_pk_const_affine_point *c, sx_pk_affine_point *gb) { uint32_t status; struct sx_pk_acq_req pkreq; @@ -427,9 +429,10 @@ static inline int sx_ecjpake_3pt_add(const struct sx_pk_ecurve *curve, const sx_ * @return Acquired acceleration request for this operation */ static inline struct sx_pk_acq_req sx_ecjpake_gen_sess_key_go(const struct sx_pk_ecurve *curve, - const sx_pk_affine_point *x4, - const sx_pk_affine_point *b, - const sx_ecop *x2, const sx_ecop *x2s) + const sx_pk_const_affine_point *x4, + const sx_pk_const_affine_point *b, + const sx_const_ecop *x2, + const sx_const_ecop *x2s) { struct sx_pk_acq_req pkreq; struct sx_pk_inops_ecjpake_gen_sess_key inputs; @@ -510,8 +513,9 @@ static inline void sx_ecjpake_gen_sess_key_end(sx_pk_req *req, sx_pk_affine_poin * for an asynchronous version */ static inline int sx_ecjpake_gen_sess_key(const struct sx_pk_ecurve *curve, - const sx_pk_affine_point *x4, const sx_pk_affine_point *b, - const sx_ecop *x2, const sx_ecop *x2s, + const sx_pk_const_affine_point *x4, + const sx_pk_const_affine_point *b, + const sx_const_ecop *x2, const sx_const_ecop *x2s, sx_pk_affine_point *t) { uint32_t status; @@ -548,11 +552,10 @@ static inline int sx_ecjpake_gen_sess_key(const struct sx_pk_ecurve *curve, * * @return Acquired acceleration request for this operation */ -static inline struct sx_pk_acq_req sx_ecjpake_gen_step_2_go(const struct sx_pk_ecurve *curve, - const sx_pk_affine_point *x4, - const sx_pk_affine_point *x3, - const sx_pk_affine_point *x1, - const sx_ecop *x2, const sx_ecop *s) +static inline struct sx_pk_acq_req +sx_ecjpake_gen_step_2_go(const struct sx_pk_ecurve *curve, const sx_pk_const_affine_point *x4, + const sx_pk_const_affine_point *x3, const sx_pk_const_affine_point *x1, + const sx_const_ecop *x2, const sx_const_ecop *s) { struct sx_pk_acq_req pkreq; struct sx_pk_inops_ecjpake_gen_step_2 inputs; @@ -645,9 +648,10 @@ static inline void sx_ecjpake_gen_step_2_end(sx_pk_req *req, sx_pk_affine_point * an asynchronous version */ static inline int sx_ecjpake_gen_step_2(const struct sx_pk_ecurve *curve, - const sx_pk_affine_point *x4, const sx_pk_affine_point *x3, - const sx_pk_affine_point *x1, const sx_ecop *x2, - const sx_ecop *s, sx_pk_affine_point *a, sx_ecop *x2s, + const sx_pk_const_affine_point *x4, + const sx_pk_const_affine_point *x3, + const sx_pk_const_affine_point *x1, const sx_const_ecop *x2, + const sx_const_ecop *s, sx_pk_affine_point *a, sx_ecop *x2s, sx_pk_affine_point *ga) { uint32_t status; diff --git a/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/sxops/rsa.h b/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/sxops/rsa.h index 7973a25f5fe6..0b48b5b4cb71 100644 --- a/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/sxops/rsa.h +++ b/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/sxops/rsa.h @@ -61,8 +61,9 @@ struct sx_pk_cmd_def; * * @return Acquired acceleration request for this operation */ -static inline struct sx_pk_acq_req -sx_async_mod_single_op_cmd_go(const struct sx_pk_cmd_def *cmd, const sx_op *modulo, const sx_op *b) +static inline struct sx_pk_acq_req sx_async_mod_single_op_cmd_go(const struct sx_pk_cmd_def *cmd, + const sx_const_op *modulo, + const sx_const_op *b) { struct sx_pk_acq_req pkreq; struct sx_pk_inops_mod_single_op_cmd inputs; @@ -74,8 +75,8 @@ sx_async_mod_single_op_cmd_go(const struct sx_pk_cmd_def *cmd, const sx_op *modu /* convert and transfer operands */ int sizes[] = { - sx_op_size(modulo), - sx_op_size(b), + sx_const_op_size(modulo), + sx_const_op_size(b), }; pkreq.status = sx_pk_list_gfp_inslots(pkreq.req, sizes, (struct sx_pk_slot *)&inputs); if (pkreq.status) { @@ -123,8 +124,8 @@ sx_async_mod_single_op_cmd_go(const struct sx_pk_cmd_def *cmd, const sx_op *modu * @see sx_async_mod_single_op_cmd_go() and sx_async_finish_single() * for an asynchronous version */ -static inline int sx_mod_single_op_cmd(const struct sx_pk_cmd_def *cmd, const sx_op *modulo, - const sx_op *b, sx_op *result) +static inline int sx_mod_single_op_cmd(const struct sx_pk_cmd_def *cmd, const sx_const_op *modulo, + const sx_const_op *b, sx_op *result) { struct sx_pk_acq_req pkreq; int status; @@ -164,8 +165,8 @@ static inline int sx_mod_single_op_cmd(const struct sx_pk_cmd_def *cmd, const sx */ static inline struct sx_pk_acq_req sx_async_mod_cmd_go(struct sx_pk_cnx *cnx, const struct sx_pk_cmd_def *cmd, - const sx_op *modulo, const sx_op *a, - const sx_op *b) + const sx_const_op *modulo, + const sx_const_op *a, const sx_const_op *b) { struct sx_pk_acq_req pkreq; struct sx_pk_inops_mod_cmd inputs; @@ -177,9 +178,9 @@ static inline struct sx_pk_acq_req sx_async_mod_cmd_go(struct sx_pk_cnx *cnx, /* convert and transfer operands */ int sizes[] = { - sx_op_size(modulo), - sx_op_size(a), - sx_op_size(b), + sx_const_op_size(modulo), + sx_const_op_size(a), + sx_const_op_size(b), }; pkreq.status = sx_pk_list_gfp_inslots(pkreq.req, sizes, (struct sx_pk_slot *)&inputs); if (pkreq.status) { @@ -228,8 +229,8 @@ static inline struct sx_pk_acq_req sx_async_mod_cmd_go(struct sx_pk_cnx *cnx, * for an asynchronous version */ static inline int sx_mod_primitive_cmd(struct sx_pk_cnx *cnx, const struct sx_pk_cmd_def *cmd, - const sx_op *modulo, const sx_op *a, const sx_op *b, - sx_op *result) + const sx_const_op *modulo, const sx_const_op *a, + const sx_const_op *b, sx_op *result) { struct sx_pk_acq_req pkreq; int status; @@ -262,8 +263,8 @@ static inline int sx_mod_primitive_cmd(struct sx_pk_cnx *cnx, const struct sx_pk * * @see sx_async_finish_single(), sx_mod_inv() */ -static inline struct sx_pk_acq_req sx_async_mod_inv_go(struct sx_pk_cnx *cnx, const sx_op *modulo, - const sx_op *b) +static inline struct sx_pk_acq_req +sx_async_mod_inv_go(struct sx_pk_cnx *cnx, const sx_const_op *modulo, const sx_const_op *b) { return sx_async_mod_single_op_cmd_go(SX_PK_CMD_ODD_MOD_INV, modulo, b); } @@ -291,7 +292,7 @@ static inline struct sx_pk_acq_req sx_async_mod_inv_go(struct sx_pk_cnx *cnx, co * * @see sx_async_mod_inv_go() for an asynchronous verion */ -static inline int sx_mod_inv(struct sx_pk_cnx *cnx, const sx_op *modulo, const sx_op *b, +static inline int sx_mod_inv(struct sx_pk_cnx *cnx, const sx_const_op *modulo, const sx_const_op *b, sx_op *result) { struct sx_pk_acq_req pkreq; @@ -327,8 +328,9 @@ static inline int sx_mod_inv(struct sx_pk_cnx *cnx, const sx_op *modulo, const s * * @see sx_mod_exp() for the synchronous version */ -static inline struct sx_pk_acq_req sx_async_mod_exp_go(struct sx_pk_cnx *cnx, const sx_op *input, - const sx_op *e, const sx_op *m) +static inline struct sx_pk_acq_req sx_async_mod_exp_go(struct sx_pk_cnx *cnx, + const sx_const_op *input, + const sx_const_op *e, const sx_const_op *m) { return sx_async_mod_cmd_go(cnx, SX_PK_CMD_MOD_EXP, m, input, e); } @@ -376,8 +378,8 @@ static inline void sx_async_mod_exp_end(sx_pk_req *req, sx_op *result) * @see sx_async_mod_exp_go(), sx_async_mod_exp_end() * for an asynchronous version */ -static inline int sx_mod_exp(struct sx_pk_cnx *cnx, const sx_op *input, const sx_op *e, - const sx_op *m, sx_op *result) +static inline int sx_mod_exp(struct sx_pk_cnx *cnx, const sx_const_op *input, const sx_const_op *e, + const sx_const_op *m, sx_op *result) { struct sx_pk_acq_req pkreq; int status; @@ -421,10 +423,10 @@ static inline int sx_mod_exp(struct sx_pk_cnx *cnx, const sx_op *input, const sx * * @see sx_async_crt_mod_exp_end() */ -static inline struct sx_pk_acq_req sx_async_crt_mod_exp_go(struct sx_pk_cnx *cnx, const sx_op *in, - const sx_op *p, const sx_op *q, - const sx_op *dp, const sx_op *dq, - const sx_op *qinv) +static inline struct sx_pk_acq_req +sx_async_crt_mod_exp_go(struct sx_pk_cnx *cnx, const sx_const_op *in, const sx_const_op *p, + const sx_const_op *q, const sx_const_op *dp, const sx_const_op *dq, + const sx_const_op *qinv) { struct sx_pk_acq_req pkreq; struct sx_pk_inops_crt_mod_exp inputs; @@ -435,8 +437,8 @@ static inline struct sx_pk_acq_req sx_async_crt_mod_exp_go(struct sx_pk_cnx *cnx } /* convert and transfer operands */ - int sizes[] = {sx_op_size(p), sx_op_size(q), sx_op_size(in), - sx_op_size(dp), sx_op_size(dq), sx_op_size(qinv)}; + int sizes[] = {sx_const_op_size(p), sx_const_op_size(q), sx_const_op_size(in), + sx_const_op_size(dp), sx_const_op_size(dq), sx_const_op_size(qinv)}; pkreq.status = sx_pk_list_gfp_inslots(pkreq.req, sizes, (struct sx_pk_slot *)&inputs); if (pkreq.status) { return pkreq; @@ -504,9 +506,9 @@ static inline void sx_async_crt_mod_exp_end(sx_pk_req *req, sx_op *result) * @see sx_async_crt_mod_exp_go(), sx_async_crt_mod_exp_end() * for an asynchronous version */ -static inline int sx_crt_mod_exp(struct sx_pk_cnx *cnx, const sx_op *in, const sx_op *p, - const sx_op *q, const sx_op *dp, const sx_op *dq, - const sx_op *qinv, sx_op *result) +static inline int sx_crt_mod_exp(struct sx_pk_cnx *cnx, const sx_const_op *in, const sx_const_op *p, + const sx_const_op *q, const sx_const_op *dp, const sx_const_op *dq, + const sx_const_op *qinv, sx_op *result) { struct sx_pk_acq_req pkreq; int status; @@ -535,8 +537,9 @@ static inline int sx_crt_mod_exp(struct sx_pk_cnx *cnx, const sx_op *in, const s * @return Acquired acceleration request for this operation */ -static inline struct sx_pk_acq_req sx_async_rsa_keygen_go(const sx_op *p, const sx_op *q, - const sx_op *public_expo) +static inline struct sx_pk_acq_req sx_async_rsa_keygen_go(const sx_const_op *p, + const sx_const_op *q, + const sx_const_op *public_expo) { struct sx_pk_acq_req pkreq; struct sx_pk_inops_rsa_keygen inputs; @@ -547,7 +550,7 @@ static inline struct sx_pk_acq_req sx_async_rsa_keygen_go(const sx_op *p, const } /* convert and transfer operands */ - int sizes[] = {sx_op_size(p), sx_op_size(q), sx_op_size(public_expo)}; + int sizes[] = {sx_const_op_size(p), sx_const_op_size(q), sx_const_op_size(public_expo)}; pkreq.status = sx_pk_list_gfp_inslots(pkreq.req, sizes, (struct sx_pk_slot *)&inputs); if (pkreq.status) { @@ -621,8 +624,9 @@ static inline void sx_async_rsa_keygen_end(sx_pk_req *req, sx_op *n, sx_op *lamb * @see sx_async_rsa_keygen_go(), sx_async_rsa_keygen_end() * for an asynchronous version */ -static inline int sx_rsa_keygen(const sx_op *p, const sx_op *q, const sx_op *public_expo, sx_op *n, - sx_op *lambda_n, sx_op *privkey) +static inline int sx_rsa_keygen(const sx_const_op *p, const sx_const_op *q, + const sx_const_op *public_expo, sx_op *n, sx_op *lambda_n, + sx_op *privkey) { struct sx_pk_acq_req pkreq; int status; @@ -655,8 +659,9 @@ static inline int sx_rsa_keygen(const sx_op *p, const sx_op *q, const sx_op *pub * * @see sx_async_rsa_crt_keyparams_end() and sx_async_rsa_crt_keyparams() */ -static inline struct sx_pk_acq_req sx_async_rsa_crt_keyparams_go(const sx_op *p, const sx_op *q, - const sx_op *privkey) +static inline struct sx_pk_acq_req sx_async_rsa_crt_keyparams_go(const sx_const_op *p, + const sx_const_op *q, + const sx_const_op *privkey) { struct sx_pk_acq_req pkreq; struct sx_pk_inops_rsa_crt_keyparams inputs; @@ -667,7 +672,7 @@ static inline struct sx_pk_acq_req sx_async_rsa_crt_keyparams_go(const sx_op *p, } /* convert and transfer operands */ - int sizes[] = {sx_op_size(p), sx_op_size(q), sx_op_size(privkey)}; + int sizes[] = {sx_const_op_size(p), sx_const_op_size(q), sx_const_op_size(privkey)}; pkreq.status = sx_pk_list_gfp_inslots(pkreq.req, sizes, (struct sx_pk_slot *)&inputs); if (pkreq.status) { @@ -741,8 +746,9 @@ static inline void sx_async_rsa_crt_keyparams_end(sx_pk_req *req, sx_op *dp, sx_ * @see sx_async_rsa_crt_keyparams_go(), sx_async_rsa_crt_keyparams_end() * for an asynchronous version */ -static inline int sx_rsa_crt_keyparams(const sx_op *p, const sx_op *q, const sx_op *privkey, - sx_op *dp, sx_op *dq, sx_op *qinv) +static inline int sx_rsa_crt_keyparams(const sx_const_op *p, const sx_const_op *q, + const sx_const_op *privkey, sx_op *dp, sx_op *dq, + sx_op *qinv) { struct sx_pk_acq_req pkreq; int status; @@ -782,7 +788,8 @@ static inline int sx_rsa_crt_keyparams(const sx_op *p, const sx_op *q, const sx_ * * @see sx_miller_rabin() for a synchronous version */ -static inline struct sx_pk_acq_req sx_async_miller_rabin_go(const sx_op *n, const sx_op *a) +static inline struct sx_pk_acq_req sx_async_miller_rabin_go(const sx_const_op *n, + const sx_const_op *a) { struct sx_pk_acq_req pkreq; struct sx_pk_inops_miller_rabin inputs; @@ -793,7 +800,7 @@ static inline struct sx_pk_acq_req sx_async_miller_rabin_go(const sx_op *n, cons } /* convert and transfer operands */ - int sizes[] = {sx_op_size(n), sx_op_size(a)}; + int sizes[] = {sx_const_op_size(n), sx_const_op_size(a)}; pkreq.status = sx_pk_list_gfp_inslots(pkreq.req, sizes, (struct sx_pk_slot *)&inputs); if (pkreq.status) { @@ -833,7 +840,7 @@ static inline struct sx_pk_acq_req sx_async_miller_rabin_go(const sx_op *n, cons * @see sx_async_miller_rabin_go() for an asynchronous version */ -static inline int sx_miller_rabin(const sx_op *n, const sx_op *a) +static inline int sx_miller_rabin(const sx_const_op *n, const sx_const_op *a) { struct sx_pk_acq_req pkreq; uint32_t status; diff --git a/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/sxops/sm9.h b/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/sxops/sm9.h index 6e43f985989d..8c3b9c245f07 100644 --- a/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/sxops/sm9.h +++ b/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/sxops/sm9.h @@ -98,7 +98,7 @@ static const uint8_t sm9_f[32] = "\x3f\x23\xea\x58\xe5\x72\x0b\xdb\x84\x3c\x6c\x * @return Acquired acceleration request for this operation */ static inline struct sx_pk_acq_req -sx_async_sm9_exp_go(struct sx_pk_cnx *cnx, const struct sx_pk_ef_12 *g, const sx_ecop *h) +sx_async_sm9_exp_go(struct sx_pk_cnx *cnx, const struct sx_pk_ef_12 *g, const sx_const_ecop *h) { struct sx_pk_acq_req pkreq; struct sx_pk_inops_sm9_exp inputs; @@ -171,8 +171,8 @@ static inline void sx_async_sm9_exp_end(sx_pk_req *req, struct sx_pk_ef_12 *r) * @see sx_async_sm9_exp_go(), sx_async_sm9_exp_end() for * an asynchronous version */ -static inline int sx_sm9_exp(struct sx_pk_cnx *cnx, const struct sx_pk_ef_12 *g, const sx_ecop *h, - struct sx_pk_ef_12 *z) +static inline int sx_sm9_exp(struct sx_pk_cnx *cnx, const struct sx_pk_ef_12 *g, + const sx_const_ecop *h, struct sx_pk_ef_12 *z) { uint32_t status; struct sx_pk_acq_req pkreq; @@ -206,7 +206,7 @@ static inline int sx_sm9_exp(struct sx_pk_cnx *cnx, const struct sx_pk_ef_12 *g, * @return Acquired acceleration request for this operation */ static inline struct sx_pk_acq_req -sx_async_sm9_pmulg1_go(struct sx_pk_cnx *cnx, const struct sx_pk_point *p1, const sx_ecop *ke) +sx_async_sm9_pmulg1_go(struct sx_pk_cnx *cnx, const struct sx_pk_point *p1, const sx_const_ecop *ke) { struct sx_pk_acq_req pkreq; struct sx_pk_inops_sm9_pmulg1 inputs; @@ -281,7 +281,7 @@ static inline void sx_async_sm9_pmulg1_end(sx_pk_req *req, struct sx_pk_point *r * an asynchronous version */ static inline int sx_sm9_pmulg1(struct sx_pk_cnx *cnx, const struct sx_pk_point *p1, - const sx_ecop *ke, struct sx_pk_point *ppube) + const sx_const_ecop *ke, struct sx_pk_point *ppube) { uint32_t status; struct sx_pk_acq_req pkreq; @@ -315,7 +315,7 @@ static inline int sx_sm9_pmulg1(struct sx_pk_cnx *cnx, const struct sx_pk_point * @return Acquired acceleration request for this operation */ static inline struct sx_pk_acq_req -sx_async_sm9_pmulg2_go(struct sx_pk_cnx *cnx, const struct sx_pk_ef_4 *p2, const sx_ecop *ke) +sx_async_sm9_pmulg2_go(struct sx_pk_cnx *cnx, const struct sx_pk_ef_4 *p2, const sx_const_ecop *ke) { struct sx_pk_acq_req pkreq; struct sx_pk_inops_sm9_pmulg2 inputs; @@ -393,7 +393,7 @@ static inline void sx_async_sm9_pmulg2_end(sx_pk_req *req, struct sx_pk_ef_4 *r) * an asynchronous version */ static inline int sx_sm9_pmulg2(struct sx_pk_cnx *cnx, const struct sx_pk_ef_4 *p2, - const sx_ecop *ke, struct sx_pk_ef_4 *ppubs) + const sx_const_ecop *ke, struct sx_pk_ef_4 *ppubs) { uint32_t status; struct sx_pk_acq_req pkreq; @@ -539,7 +539,7 @@ static inline int sx_sm9_pair(struct sx_pk_cnx *cnx, const struct sx_pk_point *p */ static inline struct sx_pk_acq_req sx_async_sm9_generate_signature_private_key_go(struct sx_pk_cnx *cnx, const struct sx_pk_point *p1, - const sx_ecop *h, const sx_ecop *ks) + const sx_const_ecop *h, const sx_const_ecop *ks) { struct sx_pk_acq_req pkreq; struct sx_pk_inops_sm9_sigpkgen inputs; @@ -622,7 +622,8 @@ static inline void sx_async_sm9_generate_signature_private_key_end(sx_pk_req *re */ static inline int sx_sm9_generate_signature_private_key(struct sx_pk_cnx *cnx, const struct sx_pk_point *p1, - const sx_ecop *h, const sx_ecop *ks, + const sx_const_ecop *h, + const sx_const_ecop *ks, struct sx_pk_point *ds) { uint32_t status; @@ -659,7 +660,8 @@ static inline int sx_sm9_generate_signature_private_key(struct sx_pk_cnx *cnx, */ static inline struct sx_pk_acq_req sx_async_sm9_sign_go(struct sx_pk_cnx *cnx, const struct sx_pk_point *ds, - const sx_ecop *h, const sx_ecop *r) + const sx_const_ecop *h, + const sx_const_ecop *r) { struct sx_pk_acq_req pkreq; struct sx_pk_inops_sm9_signaturegen inputs; @@ -736,8 +738,9 @@ static inline void sx_async_sm9_sign_end(sx_pk_req *req, struct sx_pk_point *s) * @see sx_async_sm9_sign_go(), sx_async_sm9_sign_end() for * an asynchronous version */ -static inline int sx_sm9_sign(struct sx_pk_cnx *cnx, const struct sx_pk_point *ds, const sx_ecop *h, - const sx_ecop *r, struct sx_pk_point *s) +static inline int sx_sm9_sign(struct sx_pk_cnx *cnx, const struct sx_pk_point *ds, + const sx_const_ecop *h, const sx_const_ecop *r, + struct sx_pk_point *s) { uint32_t status; struct sx_pk_acq_req pkreq; @@ -775,9 +778,9 @@ static inline int sx_sm9_sign(struct sx_pk_cnx *cnx, const struct sx_pk_point *d * @return Acquired acceleration request for this operation */ static inline struct sx_pk_acq_req -sx_async_sm9_signature_verify_go(struct sx_pk_cnx *cnx, const sx_ecop *h1, +sx_async_sm9_signature_verify_go(struct sx_pk_cnx *cnx, const sx_const_ecop *h1, const struct sx_pk_ef_4 *p2, const struct sx_pk_ef_4 *ppubs, - const struct sx_pk_point *s, const sx_ecop *h, + const struct sx_pk_point *s, const sx_const_ecop *h, const struct sx_pk_ef_12 *g) { struct sx_pk_acq_req pkreq; @@ -874,10 +877,10 @@ static inline void sx_async_sm9_signature_verify_end(sx_pk_req *req, struct sx_p * Truncation or padding should be done by user application * */ -static inline int sx_sm9_signature_verify(struct sx_pk_cnx *cnx, const sx_ecop *h1, +static inline int sx_sm9_signature_verify(struct sx_pk_cnx *cnx, const sx_const_ecop *h1, const struct sx_pk_ef_4 *p2, const struct sx_pk_ef_4 *ppubs, - const struct sx_pk_point *s, const sx_ecop *h, + const struct sx_pk_point *s, const sx_const_ecop *h, const struct sx_pk_ef_12 *g, struct sx_pk_ef_12 *w) { uint32_t status; @@ -914,7 +917,7 @@ static inline int sx_sm9_signature_verify(struct sx_pk_cnx *cnx, const sx_ecop * */ static inline struct sx_pk_acq_req sx_async_sm9_generate_encryption_private_key_go(struct sx_pk_cnx *cnx, const struct sx_pk_ef_4 *p2, - const sx_ecop *h, const sx_ecop *ke) + const sx_const_ecop *h, const sx_const_ecop *ke) { struct sx_pk_acq_req pkreq; struct sx_pk_inops_sm9_privencrkeygen inputs; @@ -1001,7 +1004,8 @@ static inline void sx_async_sm9_generate_encryption_private_key_end(sx_pk_req *r */ static inline int sx_sm9_generate_encryption_private_key(struct sx_pk_cnx *cnx, const struct sx_pk_ef_4 *p2, - const sx_ecop *h, const sx_ecop *ke, + const sx_const_ecop *h, + const sx_const_ecop *ke, struct sx_pk_ef_4 *de) { uint32_t status; @@ -1041,7 +1045,8 @@ static inline int sx_sm9_generate_encryption_private_key(struct sx_pk_cnx *cnx, static inline struct sx_pk_acq_req sx_async_sm9_send_key_go(struct sx_pk_cnx *cnx, const struct sx_pk_point *p1, const struct sx_pk_point *ppube, - const sx_ecop *h, const sx_ecop *r) + const sx_const_ecop *h, + const sx_const_ecop *r) { struct sx_pk_acq_req pkreq; struct sx_pk_inops_sm9_sendkey inputs; @@ -1121,8 +1126,8 @@ static inline void sx_async_sm9_send_key_end(sx_pk_req *req, struct sx_pk_point * an asynchronous version */ static inline int sx_sm9_send_key(struct sx_pk_cnx *cnx, const struct sx_pk_point *p1, - const struct sx_pk_point *ppube, const sx_ecop *h, - const sx_ecop *r, struct sx_pk_point *rx) + const struct sx_pk_point *ppube, const sx_const_ecop *h, + const sx_const_ecop *r, struct sx_pk_point *rx) { uint32_t status; struct sx_pk_acq_req pkreq; @@ -1154,7 +1159,8 @@ static inline int sx_sm9_send_key(struct sx_pk_cnx *cnx, const struct sx_pk_poin * * @return Acquired acceleration request for this operation */ -static inline struct sx_pk_acq_req sx_async_sm9_reduce_h_go(struct sx_pk_cnx *cnx, const sx_op *h) +static inline struct sx_pk_acq_req sx_async_sm9_reduce_h_go(struct sx_pk_cnx *cnx, + const sx_const_op *h) { struct sx_pk_acq_req pkreq; struct sx_pk_inops_sm9_reduceh inputs; @@ -1164,7 +1170,7 @@ static inline struct sx_pk_acq_req sx_async_sm9_reduce_h_go(struct sx_pk_cnx *cn return pkreq; } - int sizes[] = {sx_op_size(h), sizeof(sm9_t)}; + int sizes[] = {sx_const_op_size(h), sizeof(sm9_t)}; pkreq.status = sx_pk_list_gfp_inslots(pkreq.req, sizes, (struct sx_pk_slot *)&inputs); if (pkreq.status) { @@ -1219,7 +1225,7 @@ static inline void sx_async_sm9_reduce_h_end(sx_pk_req *req, sx_ecop *rh) * @see sx_async_sm9_reduce_h_go(), sx_async_sm9_reduce_h_end() for * an asynchronous version */ -static inline int sx_sm9_reduce_h(struct sx_pk_cnx *cnx, const sx_ecop *h, sx_ecop *rh) +static inline int sx_sm9_reduce_h(struct sx_pk_cnx *cnx, const sx_const_ecop *h, sx_ecop *rh) { uint32_t status; struct sx_pk_acq_req pkreq; diff --git a/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/sxops/srp.h b/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/sxops/srp.h index c46dcd0c6142..66e5507d90a1 100644 --- a/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/sxops/srp.h +++ b/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/sxops/srp.h @@ -61,8 +61,9 @@ struct sx_pk_cmd_def; * */ static inline struct sx_pk_acq_req -sx_async_srp_user_keygen_go(struct sx_pk_cnx *cnx, const sx_op *n, const sx_op *g, const sx_op *a, - const sx_op *b, const sx_op *x, const sx_op *k, const sx_op *u) +sx_async_srp_user_keygen_go(struct sx_pk_cnx *cnx, const sx_const_op *n, const sx_const_op *g, + const sx_const_op *a, const sx_const_op *b, const sx_const_op *x, + const sx_const_op *k, const sx_const_op *u) { struct sx_pk_acq_req pkreq; struct sx_pk_inops_srp_user_keyparams inputs; @@ -73,8 +74,9 @@ sx_async_srp_user_keygen_go(struct sx_pk_cnx *cnx, const sx_op *n, const sx_op * } /* convert and transfer operands */ - int sizes[] = {sx_op_size(n), sx_op_size(g), sx_op_size(a), sx_op_size(b), - sx_op_size(x), sx_op_size(k), sx_op_size(u)}; + int sizes[] = {sx_const_op_size(n), sx_const_op_size(g), sx_const_op_size(a), + sx_const_op_size(b), sx_const_op_size(x), sx_const_op_size(k), + sx_const_op_size(u)}; pkreq.status = sx_pk_list_gfp_inslots(pkreq.req, sizes, (struct sx_pk_slot *)&inputs); if (pkreq.status) { return pkreq; @@ -185,8 +187,9 @@ static inline int sx_srp_user_keygen(struct sx_pk_cnx *cnx, const sx_op *n, cons * @return Acquired acceleration request for this operation */ static inline struct sx_pk_acq_req -sx_async_srp_server_public_key_gen_go(struct sx_pk_cnx *cnx, const sx_op *n, const sx_op *g, - const sx_op *k, const sx_op *v, const sx_op *b) +sx_async_srp_server_public_key_gen_go(struct sx_pk_cnx *cnx, const sx_const_op *n, + const sx_const_op *g, const sx_const_op *k, + const sx_const_op *v, const sx_const_op *b) { struct sx_pk_acq_req pkreq; struct sx_pk_inops_srp_server_public_key_gen inputs; @@ -196,7 +199,8 @@ sx_async_srp_server_public_key_gen_go(struct sx_pk_cnx *cnx, const sx_op *n, con return pkreq; } - int sizes[] = {sx_op_size(n), sx_op_size(g), sx_op_size(k), sx_op_size(v), sx_op_size(b)}; + int sizes[] = {sx_const_op_size(n), sx_const_op_size(g), sx_const_op_size(k), + sx_const_op_size(v), sx_const_op_size(b)}; pkreq.status = sx_pk_list_gfp_inslots(pkreq.req, sizes, (struct sx_pk_slot *)&inputs); if (pkreq.status) { @@ -298,8 +302,9 @@ static inline int sx_srp_server_public_key_gen(struct sx_pk_cnx *cnx, const sx_o * @return Acquired acceleration request for this operation */ static inline struct sx_pk_acq_req -sx_async_srp_server_session_key_gen_go(struct sx_pk_cnx *cnx, const sx_op *n, const sx_op *a, - const sx_op *u, const sx_op *v, const sx_op *b) +sx_async_srp_server_session_key_gen_go(struct sx_pk_cnx *cnx, const sx_const_op *n, + const sx_const_op *a, const sx_const_op *u, + const sx_const_op *v, const sx_const_op *b) { struct sx_pk_acq_req pkreq; struct sx_pk_inops_srp_server_session_key_gen inputs; @@ -309,7 +314,8 @@ sx_async_srp_server_session_key_gen_go(struct sx_pk_cnx *cnx, const sx_op *n, co return pkreq; } - int sizes[] = {sx_op_size(n), sx_op_size(a), sx_op_size(u), sx_op_size(v), sx_op_size(b)}; + int sizes[] = {sx_const_op_size(n), sx_const_op_size(a), sx_const_op_size(u), + sx_const_op_size(v), sx_const_op_size(b)}; pkreq.status = sx_pk_list_gfp_inslots(pkreq.req, sizes, (struct sx_pk_slot *)&inputs); if (pkreq.status) { diff --git a/subsys/nrf_security/src/drivers/cracen/silexpk/interface/sxbuf/sxbufops.c b/subsys/nrf_security/src/drivers/cracen/silexpk/interface/sxbuf/sxbufops.c index 9ab2dc8f0283..ac7a1b176356 100644 --- a/subsys/nrf_security/src/drivers/cracen/silexpk/interface/sxbuf/sxbufops.c +++ b/subsys/nrf_security/src/drivers/cracen/silexpk/interface/sxbuf/sxbufops.c @@ -16,7 +16,7 @@ #endif /** Little endian function of sx_pk_ecop2mem() */ -void sx_pk_ecop2mem_le(const sx_ecop *op, uint8_t *mem, int sz) +void sx_pk_ecop2mem_le(const sx_const_ecop *op, uint8_t *mem, int sz) { int cursz = op->sz; int diff = sz - cursz; @@ -25,7 +25,7 @@ void sx_pk_ecop2mem_le(const sx_ecop *op, uint8_t *mem, int sz) sx_clrpkmem(mem + cursz, diff); uint8_t buf[SX_PK_MAX_OP_SZ]; - uint8_t *ptr = op->bytes; + const uint8_t *ptr = op->bytes; assert(cursz <= SX_PK_MAX_OP_SZ); for (int i = 0; i < cursz; i += 1) { @@ -35,7 +35,7 @@ void sx_pk_ecop2mem_le(const sx_ecop *op, uint8_t *mem, int sz) } /** Big endian function of sx_pk_ecop2mem() */ -void sx_pk_ecop2mem_be(const sx_ecop *op, uint8_t *mem, int sz) +void sx_pk_ecop2mem_be(const sx_const_ecop *op, uint8_t *mem, int sz) { int cursz = op->sz; int diff = sz - cursz; @@ -46,7 +46,7 @@ void sx_pk_ecop2mem_be(const sx_ecop *op, uint8_t *mem, int sz) sx_wrpkmem(mem + diff, op->bytes, cursz); } -void sx_pk_ecop2mem(const sx_ecop *op, uint8_t *mem, int sz) +void sx_pk_ecop2mem(const sx_const_ecop *op, uint8_t *mem, int sz) { sx_pk_ecop2mem_be(op, mem, sz); } @@ -66,12 +66,12 @@ void sx_pk_op2vmem_le(const sx_op *op, uint8_t *mem) } /** Big endian function of sx_pk_op2vmem() */ -void sx_pk_op2vmem_be(const sx_op *op, uint8_t *mem) +void sx_pk_op2vmem_be(const sx_const_op *op, uint8_t *mem) { sx_wrpkmem(mem, op->bytes, op->sz); } -void sx_pk_op2vmem(const sx_op *op, uint8_t *mem) +void sx_pk_op2vmem(const sx_const_op *op, uint8_t *mem) { sx_pk_op2vmem_be(op, mem); } @@ -81,6 +81,11 @@ int sx_op_size(sx_op *op) return op->sz; } +int sx_const_op_size(sx_const_op *op) +{ + return op->sz; +} + /** Big endian function of sx_pk_mem2op() */ void sx_pk_mem2op_be(const uint8_t *mem, int sz, sx_op *op) { @@ -111,7 +116,7 @@ void sx_pk_mem2affpt(const uint8_t *mem_x, const uint8_t *mem_y, int sz, sx_pk_a sx_pk_mem2ecop(mem_y, sz, &op->y); } -void sx_pk_affpt2mem(const sx_pk_affine_point *op, uint8_t *mem_x, uint8_t *mem_y, int sz) +void sx_pk_affpt2mem(const sx_pk_const_affine_point *op, uint8_t *mem_x, uint8_t *mem_y, int sz) { sx_pk_ecop2mem(&op->x, mem_x, sz); sx_pk_ecop2mem(&op->y, mem_y, sz); diff --git a/subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ik/ikhardware.c b/subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ik/ikhardware.c index 8353e4c5ef69..8fdfbf2a11f8 100644 --- a/subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ik/ikhardware.c +++ b/subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ik/ikhardware.c @@ -62,7 +62,7 @@ int sx_pk_list_ik_inslots(sx_pk_req *req, unsigned int key, struct sx_pk_slot *i req->ik_mode = 0; } else { if (!req->ik_mode) { - int status = cracen_prepare_ik_key((uint8_t *)&key); + int status = cracen_prepare_ik_key((const uint8_t *)&key); if (status != SX_OK) { sx_pk_release_req(req); return SX_ERR_INVALID_PARAM; diff --git a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/hashdefs.h b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/hashdefs.h index 539dc57fdf27..926ff7e10ad4 100644 --- a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/hashdefs.h +++ b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/hashdefs.h @@ -39,8 +39,7 @@ */ #if defined(PSA_NEED_CRACEN_SHA3_224) #define SX_HASH_MAX_ENABLED_BLOCK_SIZE SX_HASH_BLOCKSZ_SHA3_224 -#elif defined(PSA_NEED_CRACEN_SHA3_256) -/* SHAKE256 has the same size but doesn't have a PSA_NEED yet */ +#elif defined(PSA_NEED_CRACEN_SHA3_256) || defined(PSA_NEED_CRACEN_SHAKE256_512) #define SX_HASH_MAX_ENABLED_BLOCK_SIZE SX_HASH_BLOCKSZ_SHA3_256 #elif defined(PSA_NEED_CRACEN_SHA_512) || defined(PSA_NEED_CRACEN_SHA_384) #define SX_HASH_MAX_ENABLED_BLOCK_SIZE SX_HASH_BLOCKSZ_SHA2_512 @@ -67,8 +66,7 @@ */ #if defined(PSA_NEED_CRACEN_SHA3_224) #define SX_HASH_OPERATION_CONTEXT_SZ 344 -#elif defined(PSA_NEED_CRACEN_SHA3_256) -/* SHAKE256 has the same size but doesn't have a PSA_NEED yet */ +#elif defined(PSA_NEED_CRACEN_SHA3_256) || defined(PSA_NEED_CRACEN_SHAKE256_512) #define SX_HASH_OPERATION_CONTEXT_SZ 336 #elif defined(PSA_NEED_CRACEN_SHA3_384) #define SX_HASH_OPERATION_CONTEXT_SZ 304 @@ -172,6 +170,7 @@ extern const struct sxhashalg sxhashalg_sha3_512; /** Hash algorithm SHAKE256, with output size fixed to 114 bytes (for Ed448). */ extern const struct sxhashalg sxhashalg_shake256_114; +extern const struct sxhashalg sxhashalg_shake256_64; /** GM/T 0004-2012: SM3 cryptographic hash algorithm */ extern const struct sxhashalg sxhashalg_sm3; diff --git a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/trng.h b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/trng.h index e03e4a65aeee..f2db7ca4c026 100644 --- a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/trng.h +++ b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/trng.h @@ -208,6 +208,21 @@ int sx_trng_restore_state(struct sx_trng *ctx, const struct sx_trng_config *conf */ void sx_trng_restart(struct sx_trng *ctx); +#if defined(CONFIG_CRACEN_HW_VERSION_LITE) +/** Configure CRACEN Lite TRNG test threshold registers + * + * This function configures the TRNG REPEATTHRESHOLD and PROPTHRESHOLD registers + * with values that work around incorrect hardware defaults on CRACEN Lite. + * + * This must be called after CRACEN is powered on to ensure the IKG's internal + * CTR-DRBG can access the TRNG without entropy errors. The registers are lost + * when CRACEN powers down and must be reconfigured on every power-up. + * + * This function is safe to call even when the TRNG is not yet enabled. + */ +void sx_trng_configure_cracen_lite_workaround(void); +#endif + #ifdef __cplusplus } #endif diff --git a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/sha3.c b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/sha3.c index df23a4cc4d0b..427ad489453c 100644 --- a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/sha3.c +++ b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/sha3.c @@ -150,3 +150,8 @@ const struct sxhashalg sxhashalg_shake256_114 = { SHA3_MODE_SHAKE(7, 114), SHA3_SW_PAD, SHA3_SAVE_CONTEXT, 114, SX_HASH_BLOCKSZ_SHA3_256, 200, 136, sx_hash_create_ba418_shake256 }; + +const struct sxhashalg sxhashalg_shake256_64 = { + SHA3_MODE_SHAKE(7, 64), SHA3_SW_PAD, SHA3_SAVE_CONTEXT, 64, + SX_HASH_BLOCKSZ_SHA3_256, 200, 136, sx_hash_create_ba418_shake256 +}; diff --git a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/trng.c b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/trng.c index c9ff3ce5edc4..7836d1236ffc 100644 --- a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/trng.c +++ b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/trng.c @@ -30,7 +30,13 @@ #if defined(CONFIG_CRACEN_HW_VERSION_LITE) #define RNG_REPEATTHRESHOLD_VAL (21) #define RNG_PROPTESTCUTOFF_VAL (311) -#endif + +void sx_trng_configure_cracen_lite_workaround(void) +{ + sx_wr_trng(BA431_REG_REPEATTHRESHOLD, RNG_REPEATTHRESHOLD_VAL); + sx_wr_trng(BA431_REG_PROPTHRESHOLD, RNG_PROPTESTCUTOFF_VAL); +} +#endif /* CONFIG_CRACEN_HW_VERSION_LITE */ static int ba431_check_state(void) { @@ -120,12 +126,10 @@ int sx_trng_open(struct sx_trng *ctx, const struct sx_trng_config *config) sx_wr_trng(BA431_REG_ClkDiv_OFST, rng_clkdiv); sx_wr_trng(BA431_REG_InitWaitVal_OFST, rng_init_wait_val); - /* CRACEN Lite has incorrect values for the TRNG tests. We update these here as a workaround + /* Note that CRACEN Lite TRNG test threshold registers (REPEATTHRESHOLD and PROPTHRESHOLD) + * are configured in cracen_acquire() to ensure they're set correctly on every power-up, + * including for IKG operations that access the TRNG hardware directly. */ -#if defined(CONFIG_CRACEN_HW_VERSION_LITE) - sx_wr_trng(BA431_REG_REPEATTHRESHOLD, RNG_REPEATTHRESHOLD_VAL); - sx_wr_trng(BA431_REG_PROPTHRESHOLD, RNG_PROPTESTCUTOFF_VAL); -#endif /* CONFIG_CRACEN_HW_VERSION_LITE */ /* Configure the control register and set the enable bit */ control = (RNG_NB_128BIT_BLOCKS << BA431_FLD_Control_Nb128BitBlocks_LSB); diff --git a/subsys/nrf_security/src/drivers/nrf_oberon/cracen_trng/cracen_trng.c b/subsys/nrf_security/src/drivers/nrf_oberon/cracen_trng/cracen_trng.c index 29e33c1bb6a2..e18c66560db0 100644 --- a/subsys/nrf_security/src/drivers/nrf_oberon/cracen_trng/cracen_trng.c +++ b/subsys/nrf_security/src/drivers/nrf_oberon/cracen_trng/cracen_trng.c @@ -13,13 +13,13 @@ static psa_status_t cracen_trng_init(void) { - nrfx_err_t nrfx_error; + int nrfx_error; /* This is TRNG even though the naming states otherwise. * On devices that don't support hardware crypto it will default to trng */ nrfx_error = nrfx_cracen_ctr_drbg_init(); - if (nrfx_error != NRFX_SUCCESS) { + if (nrfx_error != 0) { return PSA_ERROR_HARDWARE_FAILURE; } @@ -31,7 +31,7 @@ psa_status_t cracen_trng_get_entropy(uint32_t flags, size_t *estimate_bits, { uint16_t request_len = MIN(UINT16_MAX, output_size); psa_status_t status; - nrfx_err_t nrfx_error; + int nrfx_error; /* Ignore flags as CRACEN TRNG doesn't support entropy generation flags */ (void)flags; @@ -49,7 +49,7 @@ psa_status_t cracen_trng_get_entropy(uint32_t flags, size_t *estimate_bits, * On devices that don't support hardware crypto it will default to trng */ nrfx_error = nrfx_cracen_ctr_drbg_random_get(output, request_len); - if (nrfx_error != NRFX_SUCCESS) { + if (nrfx_error != 0) { return PSA_ERROR_HARDWARE_FAILURE; } diff --git a/subsys/nrf_security/src/psa_crypto_driver_wrappers.c b/subsys/nrf_security/src/psa_crypto_driver_wrappers.c index 166b608cbfea..5b33c73af36b 100644 --- a/subsys/nrf_security/src/psa_crypto_driver_wrappers.c +++ b/subsys/nrf_security/src/psa_crypto_driver_wrappers.c @@ -184,10 +184,7 @@ psa_status_t psa_driver_wrapper_init(void) #endif /* PSA_CRYPTO_DRIVER_TFM_BUILTIN_KEY_LOADER */ #if defined(CONFIG_HW_UNIQUE_KEY_WRITE_ON_CRYPTO_INIT) - status = hw_unique_key_provisioning(); - if (status != PSA_SUCCESS) { - return status; - } + return hw_unique_key_provisioning(); #endif /* CONFIG_HW_UNIQUE_KEY_WRITE_ON_CRYPTO_INIT */ return PSA_SUCCESS; @@ -363,12 +360,8 @@ psa_status_t psa_driver_wrapper_sign_hash(const psa_key_attributes_t *attributes } #endif /* PSA_NEED_CC3XX_ASYMMETRIC_SIGNATURE_DRIVER */ #if defined(PSA_NEED_OBERON_ASYMMETRIC_SIGNATURE_DRIVER) - status = oberon_sign_hash(attributes, key_buffer, key_buffer_size, alg, hash, + return oberon_sign_hash(attributes, key_buffer, key_buffer_size, alg, hash, hash_length, signature, signature_size, signature_length); - /* Declared with fallback == true */ - if (status != PSA_ERROR_NOT_SUPPORTED) { - return status; - } #endif /* PSA_NEED_OBERON_ASYMMETRIC_SIGNATURE_DRIVER */ /* Fell through, meaning nothing supports this operation */ (void)attributes; @@ -431,13 +424,8 @@ psa_status_t psa_driver_wrapper_verify_hash(const psa_key_attributes_t *attribut } #endif /* PSA_NEED_CC3XX_ASYMMETRIC_SIGNATURE_DRIVER */ #if defined(PSA_NEED_OBERON_ASYMMETRIC_SIGNATURE_DRIVER) - status = oberon_verify_hash(attributes, key_buffer, key_buffer_size, alg, hash, + return oberon_verify_hash(attributes, key_buffer, key_buffer_size, alg, hash, hash_length, signature, signature_length); - - /* Declared with fallback == true */ - if (status != PSA_ERROR_NOT_SUPPORTED) { - return status; - } #endif /* PSA_NEED_OBERON_ASYMMETRIC_SIGNATURE_DRIVER */ /* Fell through, meaning nothing supports this operation */ (void)attributes; @@ -596,9 +584,8 @@ psa_status_t psa_driver_wrapper_generate_key(const psa_key_attributes_t *attribu #if defined(PSA_NEED_CRACEN_KMU_DRIVER) case PSA_KEY_LOCATION_CRACEN_KMU: - status = cracen_generate_key(attributes, key_buffer, key_buffer_size, + return cracen_generate_key(attributes, key_buffer, key_buffer_size, key_buffer_length); - return status; #endif default: @@ -670,9 +657,8 @@ psa_status_t psa_driver_wrapper_import_key(const psa_key_attributes_t *attribute #if defined(PSA_NEED_CRACEN_KMU_DRIVER) case PSA_KEY_LOCATION_CRACEN: case PSA_KEY_LOCATION_CRACEN_KMU: - status = cracen_import_key(attributes, data, data_length, key_buffer, + return cracen_import_key(attributes, data, data_length, key_buffer, key_buffer_size, key_buffer_length, bits); - return status; #endif default: @@ -810,7 +796,6 @@ psa_status_t psa_driver_wrapper_copy_key(psa_key_attributes_t *attributes, uint8_t *target_key_buffer, size_t target_key_buffer_size, size_t *target_key_buffer_length) { - psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; psa_key_location_t location = PSA_KEY_LIFETIME_GET_LOCATION(attributes->lifetime); switch (location) { @@ -831,9 +816,8 @@ psa_status_t psa_driver_wrapper_copy_key(psa_key_attributes_t *attributes, (void)target_key_buffer; (void)target_key_buffer_size; (void)target_key_buffer_length; - status = PSA_ERROR_INVALID_ARGUMENT; + return PSA_ERROR_INVALID_ARGUMENT; } - return status; } psa_status_t psa_driver_wrapper_derive_key(const psa_key_attributes_t *attributes, @@ -865,12 +849,8 @@ psa_status_t psa_driver_wrapper_derive_key(const psa_key_attributes_t *attribute #endif /* PSA_NEED_CRACEN_KEY_MANAGEMENT_DRIVER */ #ifdef PSA_NEED_OBERON_KEY_MANAGEMENT_DRIVER - status = oberon_derive_key(attributes, input, input_length, key_buffer, + return oberon_derive_key(attributes, input, input_length, key_buffer, key_buffer_size, key_buffer_length); - - if (status != PSA_ERROR_NOT_SUPPORTED) { - return status; - } #endif /* PSA_NEED_OBERON_KEY_MANAGEMENT_DRIVER */ break; @@ -933,14 +913,9 @@ psa_status_t psa_driver_wrapper_cipher_encrypt(const psa_key_attributes_t *attri } #endif /* PSA_NEED_CC3XX_CIPHER_DRIVER */ #if defined(PSA_NEED_OBERON_CIPHER_DRIVER) - status = oberon_cipher_encrypt(attributes, key_buffer, key_buffer_size, alg, iv, + return oberon_cipher_encrypt(attributes, key_buffer, key_buffer_size, alg, iv, iv_length, input, input_length, output, output_size, output_length); - - /* Declared with fallback == true */ - if (status != PSA_ERROR_NOT_SUPPORTED) { - return status; - } #endif /* PSA_NEED_OBERON_CIPHER_DRIVER */ (void)attributes; (void)key_buffer; @@ -1012,12 +987,8 @@ psa_status_t psa_driver_wrapper_cipher_decrypt(const psa_key_attributes_t *attri } #endif /* PSA_NEED_CC3XX_CIPHER_DRIVER */ #if defined(PSA_NEED_OBERON_CIPHER_DRIVER) - status = oberon_cipher_decrypt(attributes, key_buffer, key_buffer_size, alg, input, + return oberon_cipher_decrypt(attributes, key_buffer, key_buffer_size, alg, input, input_length, output, output_size, output_length); - /* Declared with fallback == true */ - if (status != PSA_ERROR_NOT_SUPPORTED) { - return status; - } #endif /* PSA_NEED_OBERON_CIPHER_DRIVER */ return PSA_ERROR_NOT_SUPPORTED; default: @@ -1085,10 +1056,7 @@ psa_status_t psa_driver_wrapper_cipher_encrypt_setup(psa_cipher_operation_t *ope if (status == PSA_SUCCESS) { operation->id = PSA_CRYPTO_OBERON_DRIVER_ID; } - - if (status != PSA_ERROR_NOT_SUPPORTED) { - return status; - } + return status; #endif /* PSA_NEED_OBERON_CIPHER_DRIVER */ return PSA_ERROR_NOT_SUPPORTED; default: @@ -1151,10 +1119,7 @@ psa_status_t psa_driver_wrapper_cipher_decrypt_setup(psa_cipher_operation_t *ope if (status == PSA_SUCCESS) { operation->id = PSA_CRYPTO_OBERON_DRIVER_ID; } - - if (status != PSA_ERROR_NOT_SUPPORTED) { - return status; - } + return status; #endif /* PSA_NEED_OBERON_CIPHER_DRIVER */ return PSA_ERROR_NOT_SUPPORTED; default: @@ -1312,10 +1277,7 @@ psa_status_t psa_driver_wrapper_hash_compute(psa_algorithm_t alg, const uint8_t } #endif /* PSA_NEED_CC3XX_HASH_DRIVER */ #if defined(PSA_NEED_OBERON_HASH_DRIVER) - status = oberon_hash_compute(alg, input, input_length, hash, hash_size, hash_length); - if (status != PSA_ERROR_NOT_SUPPORTED) { - return status; - } + return oberon_hash_compute(alg, input, input_length, hash, hash_size, hash_length); #endif /* PSA_NEED_OBERON_HASH_DRIVER */ (void)status; @@ -1365,10 +1327,7 @@ psa_status_t psa_driver_wrapper_hash_setup(psa_hash_operation_t *operation, psa_ if (status == PSA_SUCCESS) { operation->id = PSA_CRYPTO_OBERON_DRIVER_ID; } - - if (status != PSA_ERROR_NOT_SUPPORTED) { - return status; - } + return status; #endif /* PSA_NEED_OBERON_HASH_DRIVER */ /* Nothing left to try if we fall through here */ @@ -1521,14 +1480,10 @@ psa_status_t psa_driver_wrapper_aead_encrypt(const psa_key_attributes_t *attribu } #endif /* PSA_NEED_CC3XX_AEAD_DRIVER */ #if defined(PSA_NEED_OBERON_AEAD_DRIVER) - status = oberon_aead_encrypt(attributes, key_buffer, key_buffer_size, alg, nonce, + return oberon_aead_encrypt(attributes, key_buffer, key_buffer_size, alg, nonce, nonce_length, additional_data, additional_data_length, plaintext, plaintext_length, ciphertext, ciphertext_size, ciphertext_length); - - if (status != PSA_ERROR_NOT_SUPPORTED) { - return status; - } #endif /* PSA_NEED_OBERON_AEAD_DRIVER */ (void)attributes; (void)key_buffer; @@ -1598,14 +1553,10 @@ psa_status_t psa_driver_wrapper_aead_decrypt(const psa_key_attributes_t *attribu } #endif /* PSA_NEED_CC3XX_AEAD_DRIVER */ #if defined(PSA_NEED_OBERON_AEAD_DRIVER) - status = oberon_aead_decrypt(attributes, key_buffer, key_buffer_size, alg, nonce, + return oberon_aead_decrypt(attributes, key_buffer, key_buffer_size, alg, nonce, nonce_length, additional_data, additional_data_length, ciphertext, ciphertext_length, plaintext, plaintext_size, plaintext_length); - - if (status != PSA_ERROR_NOT_SUPPORTED) { - return status; - } #endif /* PSA_NEED_OBERON_AEAD_DRIVER */ (void)attributes; @@ -1678,10 +1629,7 @@ psa_status_t psa_driver_wrapper_aead_encrypt_setup(psa_aead_operation_t *operati operation->id = PSA_CRYPTO_OBERON_DRIVER_ID; } - /* Declared with fallback == true */ - if (status != PSA_ERROR_NOT_SUPPORTED) { - return status; - } + return status; #endif /* PSA_NEED_OBERON_AEAD_DRIVER*/ (void)operation; @@ -1744,10 +1692,7 @@ psa_status_t psa_driver_wrapper_aead_decrypt_setup(psa_aead_operation_t *operati operation->id = PSA_CRYPTO_OBERON_DRIVER_ID; } - /* Declared with fallback == true */ - if (status != PSA_ERROR_NOT_SUPPORTED) { - return status; - } + return status; #endif /* PSA_NEED_OBERON_AEAD_DRIVER */ (void)operation; @@ -2008,12 +1953,8 @@ psa_status_t psa_driver_wrapper_mac_compute(const psa_key_attributes_t *attribut } #endif /* PSA_NEED_CC3XX_MAC_DRIVER */ #if defined(PSA_NEED_OBERON_MAC_DRIVER) - status = oberon_mac_compute(attributes, key_buffer, key_buffer_size, alg, input, + return oberon_mac_compute(attributes, key_buffer, key_buffer_size, alg, input, input_length, mac, mac_size, mac_length); - /* Declared with fallback == true */ - if (status != PSA_ERROR_NOT_SUPPORTED) { - return status; - } #endif /* PSA_NEED_OBERON_MAC_DRIVER */ return PSA_ERROR_NOT_SUPPORTED; default: @@ -2082,9 +2023,7 @@ psa_status_t psa_driver_wrapper_mac_sign_setup(psa_mac_operation_t *operation, if (status == PSA_SUCCESS) { operation->id = PSA_CRYPTO_OBERON_DRIVER_ID; } - if (status != PSA_ERROR_NOT_SUPPORTED) { - return status; - } + return status; #endif /* PSA_NEED_OBERON_MAC_DRIVER */ return PSA_ERROR_NOT_SUPPORTED; @@ -2149,9 +2088,7 @@ psa_status_t psa_driver_wrapper_mac_verify_setup(psa_mac_operation_t *operation, if (status == PSA_SUCCESS) { operation->id = PSA_CRYPTO_OBERON_DRIVER_ID; } - if (status != PSA_ERROR_NOT_SUPPORTED) { - return status; - } + return status; #endif /* PSA_NEED_OBERON_MAC_DRIVER */ return PSA_ERROR_NOT_SUPPORTED; default: @@ -2488,11 +2425,8 @@ psa_status_t psa_driver_wrapper_key_agreement(const psa_key_attributes_t *attrib } #endif /* PSA_NEED_CC3XX_KEY_AGREEMENT_DRIVER */ #if defined(PSA_NEED_OBERON_KEY_AGREEMENT_DRIVER) - status = oberon_key_agreement(attributes, priv_key, priv_key_size, alg, publ_key, + return oberon_key_agreement(attributes, priv_key, priv_key_size, alg, publ_key, publ_key_size, output, output_size, output_length); - if (status != PSA_ERROR_NOT_SUPPORTED) { - return status; - } #endif /* PSA_NEED_OBERON_KEY_AGREEMENT_DRIVER */ (void)status; return PSA_ERROR_NOT_SUPPORTED; @@ -2920,12 +2854,9 @@ psa_status_t psa_driver_wrapper_asymmetric_encrypt( } #endif /* PSA_NEED_CC3XX_ASYMMETRIC_ENCRYPTION_DRIVER */ #if defined(PSA_NEED_OBERON_ASYMMETRIC_ENCRYPTION_DRIVER) - status = oberon_asymmetric_encrypt(attributes, key_buffer, key_buffer_size, alg, + return oberon_asymmetric_encrypt(attributes, key_buffer, key_buffer_size, alg, input, input_length, salt, salt_length, output, output_size, output_length); - if (status != PSA_ERROR_NOT_SUPPORTED) { - return status; - } #endif /* PSA_NEED_OBERON_ASYMMETRIC_ENCRYPTION_DRIVER */ (void)status; return PSA_ERROR_NOT_SUPPORTED; @@ -2980,12 +2911,9 @@ psa_status_t psa_driver_wrapper_asymmetric_decrypt( } #endif /* PSA_NEED_CC3XX_ASYMMETRIC_ENCRYPTION_DRIVER */ #if defined(PSA_NEED_OBERON_ASYMMETRIC_ENCRYPTION_DRIVER) - status = oberon_asymmetric_decrypt(attributes, key_buffer, key_buffer_size, alg, + return oberon_asymmetric_decrypt(attributes, key_buffer, key_buffer_size, alg, input, input_length, salt, salt_length, output, output_size, output_length); - if (status != PSA_ERROR_NOT_SUPPORTED) { - return status; - } #endif /* PSA_NEED_OBERON_ASYMMETRIC_ENCRYPTION_DRIVER */ (void)status; return PSA_ERROR_NOT_SUPPORTED; diff --git a/sysbuild/CMakeLists.txt b/sysbuild/CMakeLists.txt index 37b7c6842d82..b9fef9991106 100644 --- a/sysbuild/CMakeLists.txt +++ b/sysbuild/CMakeLists.txt @@ -1055,6 +1055,7 @@ include(${CMAKE_CURRENT_LIST_DIR}/appcore.cmake) include(${CMAKE_CURRENT_LIST_DIR}/netcore.cmake) include(${CMAKE_CURRENT_LIST_DIR}/flprcore.cmake) include(${CMAKE_CURRENT_LIST_DIR}/pprcore.cmake) +include(${CMAKE_CURRENT_LIST_DIR}/radio_loader.cmake) include(${CMAKE_CURRENT_LIST_DIR}/secureboot.cmake) include(${CMAKE_CURRENT_LIST_DIR}/mcuboot.cmake) include(${CMAKE_CURRENT_LIST_DIR}/firmware_loader_radio.cmake) diff --git a/sysbuild/Kconfig.mcuboot b/sysbuild/Kconfig.mcuboot index 896d37065064..5e603a916600 100644 --- a/sysbuild/Kconfig.mcuboot +++ b/sysbuild/Kconfig.mcuboot @@ -135,6 +135,7 @@ config MCUBOOT_MIN_UPDATEABLE_IMAGES config MCUBOOT_MIN_ADDITIONAL_UPDATEABLE_IMAGES int default 1 if SECURE_BOOT_APPCORE + default 1 if NRF_RADIO_LOADER && !MCUBOOT_SIGN_MERGED_BINARY default 0 config MCUBOOT_UPDATEABLE_IMAGES diff --git a/sysbuild/Kconfig.radio_loader b/sysbuild/Kconfig.radio_loader new file mode 100644 index 000000000000..fccf0dc78885 --- /dev/null +++ b/sysbuild/Kconfig.radio_loader @@ -0,0 +1,30 @@ +# +# Copyright (c) 2025 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +config NRF_RADIO_LOADER + bool "Radio Core Firmware Loader [EXPERIMENTAL]" + depends on SOC_NRF54H20 + select EXPERIMENTAL + help + Enable the radio loader that copies firmware from MRAM to TCM + (Tightly Coupled Memory) at boot time. + + The loader runs from MRAM and: + - Copies firmware from MRAM partition to TCM + - Jumps to the loaded firmware in TCM for optimal performance + + Requires devicetree memory map configuration with partitions + and chosen nodes defined in the project's overlay files. + +if NRF_RADIO_LOADER + +config NRF_RADIO_LOADER_BOARD + string + default "$(BOARD)/nrf54h20/cpurad" + help + Target board for the radio loader application. + +endif # NRF_RADIO_LOADER diff --git a/sysbuild/Kconfig.sysbuild b/sysbuild/Kconfig.sysbuild index cd1893bb275a..f7f2a8ef667a 100644 --- a/sysbuild/Kconfig.sysbuild +++ b/sysbuild/Kconfig.sysbuild @@ -81,6 +81,7 @@ rsource "Kconfig.appcore" rsource "Kconfig.flprcore" rsource "Kconfig.netcore" rsource "Kconfig.pprcore" +rsource "Kconfig.radio_loader" rsource "Kconfig.secureboot" rsource "Kconfig.mcuboot" rsource "Kconfig.dfu" diff --git a/sysbuild/radio_loader.cmake b/sysbuild/radio_loader.cmake new file mode 100644 index 000000000000..7c119a22171c --- /dev/null +++ b/sysbuild/radio_loader.cmake @@ -0,0 +1,27 @@ +# +# Copyright (c) 2025 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# Radio Loader sysbuild integration +# This file handles automatic integration of the radio_loader application + +if(SB_CONFIG_NRF_RADIO_LOADER) + # Add radio_loader as an external Zephyr project + ExternalZephyrProject_Add( + APPLICATION radio_loader + SOURCE_DIR "${ZEPHYR_NRF_MODULE_DIR}/samples/nrf54h20/radio_loader" + BOARD ${SB_CONFIG_NRF_RADIO_LOADER_BOARD} + BOARD_REVISION ${BOARD_REVISION} + ) + + set_target_properties(radio_loader PROPERTIES + IMAGE_CONF_SCRIPT ${ZEPHYR_BASE}/share/sysbuild/image_configurations/MAIN_image_default.cmake + ) + + UpdateableImage_Add(APPLICATION radio_loader) + # Note: Memory map configuration should be provided by the user project + # at the project level in sysbuild directory. + # This overlay should define partitions and nodelabels for the loader +endif() diff --git a/tests/benchmarks/current_consumption/system_off/boards/nrf54lv10dk_nrf54lv10a_cpuapp_ns.conf b/tests/benchmarks/current_consumption/system_off/boards/nrf54lv10dk_nrf54lv10a_cpuapp_ns.conf new file mode 100644 index 000000000000..6cd2bff57223 --- /dev/null +++ b/tests/benchmarks/current_consumption/system_off/boards/nrf54lv10dk_nrf54lv10a_cpuapp_ns.conf @@ -0,0 +1,2 @@ +CONFIG_TFM_SFN=y +CONFIG_TFM_NRF_SYSTEM_OFF_SERVICE=y diff --git a/tests/benchmarks/i2c_endless/boards/nrf5340dk_nrf5340_cpuapp.overlay b/tests/benchmarks/i2c_endless/boards/nrf5340dk_nrf5340_cpuapp.overlay index 6fdf59f55e1f..0bdf192fd510 100644 --- a/tests/benchmarks/i2c_endless/boards/nrf5340dk_nrf5340_cpuapp.overlay +++ b/tests/benchmarks/i2c_endless/boards/nrf5340dk_nrf5340_cpuapp.overlay @@ -56,6 +56,7 @@ &i2c2 { compatible = "nordic,nrf-twis"; + status = "okay"; pinctrl-0 = <&i2c2_default_alt>; pinctrl-1 = <&i2c2_sleep_alt>; pinctrl-names = "default", "sleep"; diff --git a/tests/benchmarks/i2c_endless/src/main.c b/tests/benchmarks/i2c_endless/src/main.c index b6ac2f9631be..0d377ac05915 100644 --- a/tests/benchmarks/i2c_endless/src/main.c +++ b/tests/benchmarks/i2c_endless/src/main.c @@ -121,7 +121,7 @@ void twis_setup(void) int ret; ret = nrfx_twis_init(&twis, &config, i2s_slave_handler); - if (ret != NRFX_SUCCESS) { + if (ret != 0) { LOG_ERR("nrfx_twis_init returned %d", ret); } diff --git a/tests/benchmarks/multicore/idle_adc/CMakeLists.txt b/tests/benchmarks/multicore/idle_adc/CMakeLists.txt index 0100ac93f32f..d15347259150 100644 --- a/tests/benchmarks/multicore/idle_adc/CMakeLists.txt +++ b/tests/benchmarks/multicore/idle_adc/CMakeLists.txt @@ -17,3 +17,8 @@ endif() project(idle_adc) target_sources(app PRIVATE src/main.c) + +if(CONFIG_SOC_NRF54H20_CPUPPR) + message(DEBUG "Power Mode handler for RISC V is included.") + target_sources(app PRIVATE ${ZEPHYR_NRF_MODULE_DIR}/tests/benchmarks/multicore/common/power_off.c) +endif() diff --git a/tests/benchmarks/multicore/idle_adc/Kconfig b/tests/benchmarks/multicore/idle_adc/Kconfig new file mode 100644 index 000000000000..19cf124251ce --- /dev/null +++ b/tests/benchmarks/multicore/idle_adc/Kconfig @@ -0,0 +1,10 @@ +# +# Copyright (c) 2025 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +config SOC_NRF54H20_CPUPPR + select HAS_PM + select HAS_POWEROFF + +source "Kconfig.zephyr" diff --git a/tests/benchmarks/multicore/idle_adc/Kconfig.sysbuild b/tests/benchmarks/multicore/idle_adc/Kconfig.sysbuild index 7bddf157b0dc..582707d921cd 100644 --- a/tests/benchmarks/multicore/idle_adc/Kconfig.sysbuild +++ b/tests/benchmarks/multicore/idle_adc/Kconfig.sysbuild @@ -19,3 +19,9 @@ config NETCORE_IMAGE_NAME config NETCORE_IMAGE_PATH default "${ZEPHYR_NRF_MODULE_DIR}/tests/benchmarks/power_consumption/common/remote_sleep_forever" if NETCORE_REMOTE_SLEEP_FOREVER + +config SUPPORT_NETCORE + default y if (SOC_NRF54H20_CPUPPR || SOC_NRF54H20_CPUAPP) + +config NETCORE_REMOTE_BOARD_TARGET_CPUCLUSTER + default "cpurad" if (SOC_NRF54H20_CPUPPR || SOC_NRF54H20_CPUAPP) diff --git a/tests/benchmarks/multicore/idle_adc/boards/nrf54h20dk_nrf54h20_cpuppr.conf b/tests/benchmarks/multicore/idle_adc/boards/nrf54h20dk_nrf54h20_cpuppr.conf new file mode 100644 index 000000000000..9083e9e65197 --- /dev/null +++ b/tests/benchmarks/multicore/idle_adc/boards/nrf54h20dk_nrf54h20_cpuppr.conf @@ -0,0 +1,2 @@ +CONFIG_NCS_BOOT_BANNER=n +CONFIG_EARLY_CONSOLE=n diff --git a/tests/benchmarks/multicore/idle_adc/boards/nrf54h20dk_nrf54h20_cpuppr.overlay b/tests/benchmarks/multicore/idle_adc/boards/nrf54h20dk_nrf54h20_cpuppr.overlay new file mode 100644 index 000000000000..5cc381c06cb9 --- /dev/null +++ b/tests/benchmarks/multicore/idle_adc/boards/nrf54h20dk_nrf54h20_cpuppr.overlay @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/* Required GPIO loopback: P1.02 - P1.03 */ +/ { + aliases { + adc0 = &adc; + sw = &loopback; + led = &led0; + }; + + buttons { + compatible = "gpio-keys"; + + loopback: loopback { + gpios = <&gpio1 3 GPIO_ACTIVE_HIGH>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led0: led_0 { + gpios = < &gpio9 0x0 0x0 >; + }; + }; + + cpus { + power-states { + wait: wait { + compatible = "zephyr,power-state"; + power-state-name = "standby"; + substate-id = <0>; + min-residency-us = <20000>; + }; + + hibernate: hibernate { + compatible = "zephyr,power-state"; + power-state-name = "suspend-to-ram"; + substate-id = <0>; + min-residency-us = <400000>; + }; + }; + }; +}; + +&adc { + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + + channel@0 { + reg = <0>; + zephyr,gain = "ADC_GAIN_1"; + zephyr,reference = "ADC_REF_INTERNAL"; + zephyr,acquisition-time = ; + zephyr,input-positive = ; + }; +}; + +&cpu { + cpu-power-states = <&wait &hibernate>; +}; + +&gpio1 { + status = "okay"; +}; + +&gpio9 { + status = "okay"; +}; + +&gpiote130 { + status = "okay"; +}; diff --git a/tests/benchmarks/multicore/idle_adc/sysbuild/vpr_launcher/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/benchmarks/multicore/idle_adc/sysbuild/vpr_launcher/boards/nrf54h20dk_nrf54h20_cpuapp.overlay new file mode 100644 index 000000000000..eb215286fc3a --- /dev/null +++ b/tests/benchmarks/multicore/idle_adc/sysbuild/vpr_launcher/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/ { + aliases { + /delete-property/ led0; + /delete-property/ led1; + /delete-property/ mcuboot-led0; + }; +}; + +/delete-node/ &led0; +/delete-node/ &led1; + +&adc { + status = "reserved"; + interrupt-parent = <&cpuppr_clic>; +}; diff --git a/tests/benchmarks/multicore/idle_wdt/prj_s2ram.conf b/tests/benchmarks/multicore/idle_adc/sysbuild/vpr_launcher/prj.conf similarity index 74% rename from tests/benchmarks/multicore/idle_wdt/prj_s2ram.conf rename to tests/benchmarks/multicore/idle_adc/sysbuild/vpr_launcher/prj.conf index acdff9696441..d9385ec50a42 100644 --- a/tests/benchmarks/multicore/idle_wdt/prj_s2ram.conf +++ b/tests/benchmarks/multicore/idle_adc/sysbuild/vpr_launcher/prj.conf @@ -1,10 +1,10 @@ CONFIG_PM=y -CONFIG_POWEROFF=y - CONFIG_PM_DEVICE=y CONFIG_PM_DEVICE_RUNTIME=y +CONFIG_POWEROFF=y + +CONFIG_SOC_NRF54H20_CPURAD_ENABLE=y -# Enable for debugging purposes only CONFIG_BOOT_BANNER=n CONFIG_NCS_BOOT_BANNER=n CONFIG_PRINTK=n @@ -12,6 +12,3 @@ CONFIG_LOG=n CONFIG_CONSOLE=n CONFIG_UART_CONSOLE=n CONFIG_SERIAL=n - -CONFIG_WATCHDOG=y -CONFIG_ASSERT=y diff --git a/tests/benchmarks/multicore/idle_adc/testcase.yaml b/tests/benchmarks/multicore/idle_adc/testcase.yaml index 0ae7b3e2638c..c1165fb32844 100644 --- a/tests/benchmarks/multicore/idle_adc/testcase.yaml +++ b/tests/benchmarks/multicore/idle_adc/testcase.yaml @@ -21,6 +21,21 @@ tests: pytest_root: - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_power_consumption_adc" + benchmarks.multicore.idle_adc.nrf54h20dk_cpuppr.s2ram: + tags: + - ci_build + - ci_tests_benchmarks_multicore + - ppk_power_measure + harness: pytest + platform_allow: + - nrf54h20dk/nrf54h20/cpuppr + integration_platforms: + - nrf54h20dk/nrf54h20/cpuppr + harness_config: + fixture: gpio_loopback + pytest_root: + - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_power_consumption_adc_ppr" + benchmarks.multicore.idle_adc.nrf54h20dk_cpuapp_cpurad.s2ram.mcuboot: tags: - ci_build diff --git a/tests/benchmarks/multicore/idle_wdt/Kconfig b/tests/benchmarks/multicore/idle_wdt/Kconfig index c007d899b124..2a74d48573ef 100644 --- a/tests/benchmarks/multicore/idle_wdt/Kconfig +++ b/tests/benchmarks/multicore/idle_wdt/Kconfig @@ -12,4 +12,9 @@ config TEST_SLEEP_DURATION_MS Based on the value of 'min-residency-us' specified for each power state defined in the DTS, core enters the lowest possible power state. +config TEST_SYNCHRONIZE_CORES + bool "Synchronization with other core" + help + When set to 'y' core will synchronize code execution with the other core. + source "Kconfig.zephyr" diff --git a/tests/benchmarks/multicore/idle_wdt/Kconfig.sysbuild b/tests/benchmarks/multicore/idle_wdt/Kconfig.sysbuild index d5238c072470..9ad3d69497ac 100644 --- a/tests/benchmarks/multicore/idle_wdt/Kconfig.sysbuild +++ b/tests/benchmarks/multicore/idle_wdt/Kconfig.sysbuild @@ -4,8 +4,47 @@ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # -source "share/sysbuild/Kconfig" +choice NETCORE + default NETCORE_REMOTE + +config NETCORE_REMOTE + bool "Remote image" + +config NETCORE_REMOTE_SLEEP_FOREVER + bool "Remote sleep forever image" + +endchoice + +config NETCORE_IMAGE_NAME + default "remote" if NETCORE_REMOTE + default "remote_sleep_forever" if NETCORE_REMOTE_SLEEP_FOREVER + +config NETCORE_IMAGE_PATH + default "${ZEPHYR_NRF_MODULE_DIR}/tests/benchmarks/multicore/idle_wdt/remote" if NETCORE_REMOTE + default "${ZEPHYR_NRF_MODULE_DIR}/tests/benchmarks/power_consumption/common/remote_sleep_forever" if NETCORE_REMOTE_SLEEP_FOREVER + +choice APPCORE + default APPCORE_REMOTE_SLEEP_FOREVER -config REMOTE_BOARD - string - default "$(BOARD)/nrf54h20/cpurad" if SOC_NRF54H20_CPUAPP +config APPCORE_REMOTE_SLEEP_FOREVER + bool "Remote sleep forever image" + +endchoice + +config APPCORE_IMAGE_NAME + default "remote_sleep_forever" if APPCORE_REMOTE_SLEEP_FOREVER + +config APPCORE_IMAGE_PATH + default "${ZEPHYR_NRF_MODULE_DIR}/tests/benchmarks/power_consumption/common/remote_sleep_forever" if APPCORE_REMOTE_SLEEP_FOREVER + +config TEST_SYNCHRONIZE_CORES + bool "Synchronize both cores" + depends on NETCORE_REMOTE + default y + help + When set to 'y' both cores will synchronize just before entering the main loop. + This requires test code to be compiled for both Application and Radio cores. + When one of the cores is flashed with remote_sleep_forever it will not confirm its readines. + In such case, the other core will wait forever for event that never happens. + +source "share/sysbuild/Kconfig" diff --git a/tests/benchmarks/multicore/idle_wdt/boards/nrf54h20dk_nrf54h20_cpuapp.conf b/tests/benchmarks/multicore/idle_wdt/boards/nrf54h20dk_nrf54h20_cpuapp.conf new file mode 100644 index 000000000000..cc10b7737d12 --- /dev/null +++ b/tests/benchmarks/multicore/idle_wdt/boards/nrf54h20dk_nrf54h20_cpuapp.conf @@ -0,0 +1,7 @@ +# +# Copyright (c) 2025 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_SOC_NRF54H20_CPURAD_ENABLE=y diff --git a/tests/benchmarks/multicore/idle_wdt/boards/nrf54h20dk_nrf54h20_cpurad.overlay b/tests/benchmarks/multicore/idle_wdt/boards/nrf54h20dk_nrf54h20_cpurad.overlay new file mode 100644 index 000000000000..6e2cb6259627 --- /dev/null +++ b/tests/benchmarks/multicore/idle_wdt/boards/nrf54h20dk_nrf54h20_cpurad.overlay @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/ { + aliases { + led = &led1; + watchdog0 = &wdt010; + }; + + leds { + compatible = "gpio-leds"; + + led1: led_1 { + gpios = <&gpio9 1 GPIO_ACTIVE_HIGH>; + label = "Green LED 1"; + }; + }; +}; + +&gpio9 { + status = "okay"; +}; + +&gpiote130 { + status = "okay"; +}; + +&wdt010 { + status = "okay"; +}; diff --git a/tests/benchmarks/multicore/idle_wdt/enable_logs.conf b/tests/benchmarks/multicore/idle_wdt/enable_logs.conf new file mode 100644 index 000000000000..518a3ffeca6f --- /dev/null +++ b/tests/benchmarks/multicore/idle_wdt/enable_logs.conf @@ -0,0 +1,15 @@ +# +# Copyright (c) 2025 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_PM=n +CONFIG_PM_DEVICE=n +CONFIG_PM_DEVICE_RUNTIME=n + +CONFIG_PRINTK=y +CONFIG_LOG=y +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y +CONFIG_SERIAL=y diff --git a/tests/benchmarks/multicore/idle_wdt/prj.conf b/tests/benchmarks/multicore/idle_wdt/prj.conf index a0f56f9968a2..93ecc023b4ff 100644 --- a/tests/benchmarks/multicore/idle_wdt/prj.conf +++ b/tests/benchmarks/multicore/idle_wdt/prj.conf @@ -1,5 +1,18 @@ -CONFIG_PRINTK=y -CONFIG_LOG=y -CONFIG_LOG_MODE_IMMEDIATE=y -CONFIG_ASSERT=y CONFIG_WATCHDOG=y +CONFIG_GPIO=y + +CONFIG_PM=y +CONFIG_POWEROFF=y +CONFIG_PM_DEVICE=y +CONFIG_PM_DEVICE_RUNTIME=y + +CONFIG_BOOT_BANNER=n +CONFIG_NCS_BOOT_BANNER=n +CONFIG_ASSERT=y + +# Enable for debugging purposes only +CONFIG_PRINTK=n +CONFIG_LOG=n +CONFIG_CONSOLE=n +CONFIG_UART_CONSOLE=n +CONFIG_SERIAL=n diff --git a/tests/benchmarks/multicore/idle_wdt/remote/Kconfig b/tests/benchmarks/multicore/idle_wdt/remote/Kconfig index e145863ab494..93463968c5cb 100644 --- a/tests/benchmarks/multicore/idle_wdt/remote/Kconfig +++ b/tests/benchmarks/multicore/idle_wdt/remote/Kconfig @@ -19,4 +19,9 @@ config TEST_ROLE_REMOTE KConfig used in synchronization phase. Set TEST_ROLE_REMOTE=y on core that shall synchronize with the Host core. +config TEST_SYNCHRONIZE_CORES + bool "Synchronization with other core" + help + When set to 'y' core will synchronize code execution with the other core. + source "Kconfig.zephyr" diff --git a/tests/benchmarks/multicore/idle_wdt/remote/prj.conf b/tests/benchmarks/multicore/idle_wdt/remote/prj.conf index 05a94cf19d44..93ecc023b4ff 100644 --- a/tests/benchmarks/multicore/idle_wdt/remote/prj.conf +++ b/tests/benchmarks/multicore/idle_wdt/remote/prj.conf @@ -1,6 +1,18 @@ -CONFIG_PRINTK=y -CONFIG_LOG=y -CONFIG_LOG_MODE_IMMEDIATE=y -CONFIG_ASSERT=y CONFIG_WATCHDOG=y CONFIG_GPIO=y + +CONFIG_PM=y +CONFIG_POWEROFF=y +CONFIG_PM_DEVICE=y +CONFIG_PM_DEVICE_RUNTIME=y + +CONFIG_BOOT_BANNER=n +CONFIG_NCS_BOOT_BANNER=n +CONFIG_ASSERT=y + +# Enable for debugging purposes only +CONFIG_PRINTK=n +CONFIG_LOG=n +CONFIG_CONSOLE=n +CONFIG_UART_CONSOLE=n +CONFIG_SERIAL=n diff --git a/tests/benchmarks/multicore/idle_wdt/remote/prj_s2ram.conf b/tests/benchmarks/multicore/idle_wdt/remote/prj_s2ram.conf deleted file mode 100644 index b5dbb63af6ca..000000000000 --- a/tests/benchmarks/multicore/idle_wdt/remote/prj_s2ram.conf +++ /dev/null @@ -1,11 +0,0 @@ -CONFIG_PM=y -CONFIG_POWEROFF=y - -CONFIG_CONSOLE=n -CONFIG_UART_CONSOLE=n -CONFIG_SERIAL=n -CONFIG_BOOT_BANNER=n -CONFIG_NCS_BOOT_BANNER=n - -CONFIG_WATCHDOG=y -CONFIG_GPIO=y diff --git a/tests/benchmarks/multicore/idle_wdt/src/main.c b/tests/benchmarks/multicore/idle_wdt/src/main.c index 86a3fcda8321..4cfc0e870166 100644 --- a/tests/benchmarks/multicore/idle_wdt/src/main.c +++ b/tests/benchmarks/multicore/idle_wdt/src/main.c @@ -104,6 +104,7 @@ int main(void) __ASSERT(false, "wdt_install_timeout() returned %d\n", my_wdt_channel); } +#if defined(CONFIG_TEST_SYNCHRONIZE_CORES) /* Synchronize Remote core with Host core */ #if !defined(CONFIG_TEST_ROLE_REMOTE) LOG_DBG("HOST starts"); @@ -115,8 +116,8 @@ int main(void) sys_cache_data_invd_range((void *) shared_var, sizeof(*shared_var)); LOG_DBG("shared_var is: %u", *shared_var); } - LOG_DBG("HOST continues"); -#else + LOG_INF("HOST continues"); +#else /* !defined(CONFIG_TEST_ROLE_REMOTE) */ LOG_DBG("REMOTE starts"); while (*shared_var != HOST_IS_READY) { k_msleep(1); @@ -127,8 +128,9 @@ int main(void) *shared_var = REMOTE_IS_READY; sys_cache_data_flush_range((void *) shared_var, sizeof(*shared_var)); LOG_DBG("REMOTE wrote REMOTE_IS_READY: %u", *shared_var); - LOG_DBG("REMOTE continues"); -#endif + LOG_INF("REMOTE continues"); +#endif /* !defined(CONFIG_TEST_ROLE_REMOTE) */ +#endif /* defined(CONFIG_TEST_SYNCHRONIZE_CORES) */ /* Start Watchdog */ ret = wdt_setup(my_wdt_device, WDT_OPT_PAUSE_HALTED_BY_DBG | WDT_OPT_PAUSE_IN_SLEEP); diff --git a/tests/benchmarks/multicore/idle_wdt/sysbuild.cmake b/tests/benchmarks/multicore/idle_wdt/sysbuild.cmake index 80f51bddea6d..03795f67b8f9 100644 --- a/tests/benchmarks/multicore/idle_wdt/sysbuild.cmake +++ b/tests/benchmarks/multicore/idle_wdt/sysbuild.cmake @@ -4,14 +4,13 @@ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # -if("${SB_CONFIG_REMOTE_BOARD}" STREQUAL "") - message(FATAL_ERROR "REMOTE_BOARD must be set to a valid board name") -endif() +if(SB_CONFIG_TEST_SYNCHRONIZE_CORES) + set_config_bool(${DEFAULT_IMAGE} CONFIG_TEST_SYNCHRONIZE_CORES y) + set_config_bool(${SB_CONFIG_NETCORE_IMAGE_NAME} CONFIG_TEST_SYNCHRONIZE_CORES y) +else() + set_config_bool(${DEFAULT_IMAGE} CONFIG_TEST_SYNCHRONIZE_CORES n) -# Add remote project -ExternalZephyrProject_Add( - APPLICATION remote - SOURCE_DIR ${APP_DIR}/remote - BOARD ${SB_CONFIG_REMOTE_BOARD} - BOARD_REVISION ${BOARD_REVISION} -) + if(SB_CONFIG_NETCORE_REMOTE) + set_config_bool(${SB_CONFIG_NETCORE_IMAGE_NAME} CONFIG_TEST_SYNCHRONIZE_CORES n) + endif() +endif() diff --git a/tests/benchmarks/multicore/idle_wdt/testcase.yaml b/tests/benchmarks/multicore/idle_wdt/testcase.yaml index 8aa3caa4a058..6009c434c3a4 100644 --- a/tests/benchmarks/multicore/idle_wdt/testcase.yaml +++ b/tests/benchmarks/multicore/idle_wdt/testcase.yaml @@ -3,14 +3,10 @@ common: tags: - ci_build - ci_tests_benchmarks_multicore - platform_allow: - - nrf54h20dk/nrf54h20/cpuapp - integration_platforms: - - nrf54h20dk/nrf54h20/cpuapp - extra_args: - - CONFIG_SOC_NRF54H20_CPURAD_ENABLE=y tests: + # cpuapp - idle_wdt test with logging + # cpurad - idle_wdt test with logging benchmarks.multicore.idle_wdt.nrf54h20dk_cpuapp_cpurad.no_sleep: harness: console harness_config: @@ -20,12 +16,19 @@ tests: - "Multicore idle_wdt test on" - "Run 0" - "Run 1" + extra_args: + - idle_wdt_EXTRA_CONF_FILE=enable_logs.conf + - remote_EXTRA_CONF_FILE=../enable_logs.conf + platform_allow: + - nrf54h20dk/nrf54h20/cpuapp + integration_platforms: + - nrf54h20dk/nrf54h20/cpuapp + # cpuapp - idle_wdt test (idle_retained) + # cpurad - idle_wdt test (idle) benchmarks.multicore.idle_wdt.nrf54h20dk_cpuapp_cpurad.idle_retained: tags: ppk_power_measure extra_args: - - idle_wdt_CONF_FILE=prj_s2ram.conf - - remote_CONF_FILE=prj_s2ram.conf - idle_wdt_CONFIG_TEST_SLEEP_DURATION_MS=500 - remote_CONFIG_TEST_SLEEP_DURATION_MS=500 - idle_wdt_EXTRA_DTC_OVERLAY_FILE="${ZEPHYR_NRF_MODULE_DIR}/tests/benchmarks/multicore/common/workaround_idle_retained.overlay" @@ -34,12 +37,16 @@ tests: fixture: ppk_power_measure pytest_root: - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_pwm_and_idle" + platform_allow: + - nrf54h20dk/nrf54h20/cpuapp + integration_platforms: + - nrf54h20dk/nrf54h20/cpuapp + # cpuapp - idle_wdt test (idle) + # cpurad - idle_wdt test (idle) benchmarks.multicore.idle_wdt.nrf54h20dk_cpuapp_cpurad.idle: tags: ppk_power_measure extra_args: - - idle_wdt_CONF_FILE=prj_s2ram.conf - - remote_CONF_FILE=prj_s2ram.conf - idle_wdt_CONFIG_TEST_SLEEP_DURATION_MS=500 - remote_CONFIG_TEST_SLEEP_DURATION_MS=500 - idle_wdt_EXTRA_DTC_OVERLAY_FILE="${ZEPHYR_NRF_MODULE_DIR}/tests/benchmarks/multicore/common/workaround_idle.overlay" @@ -48,14 +55,54 @@ tests: fixture: ppk_power_measure pytest_root: - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_pwm_and_idle" + platform_allow: + - nrf54h20dk/nrf54h20/cpuapp + integration_platforms: + - nrf54h20dk/nrf54h20/cpuapp + # cpuapp - idle_wdt test (s2ram) + # cpurad - idle_wdt test (idle) benchmarks.multicore.idle_wdt.nrf54h20dk_cpuapp_cpurad.s2ram: + tags: ppk_power_measure + harness: pytest + harness_config: + fixture: ppk_power_measure + pytest_root: + - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_wdt_and_s2ram" + platform_allow: + - nrf54h20dk/nrf54h20/cpuapp + integration_platforms: + - nrf54h20dk/nrf54h20/cpuapp + + # cpuapp - idle_wdt test (s2ram) + # cpurad - remote_sleep_forever (idle) + benchmarks.multicore.idle_wdt.nrf54h20dk_cpuapp.s2ram: + tags: ppk_power_measure + extra_args: + - SB_CONFIG_NETCORE_REMOTE_SLEEP_FOREVER=y + harness: pytest + harness_config: + fixture: ppk_power_measure + pytest_root: + - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_wdt_and_s2ram" + platform_allow: + - nrf54h20dk/nrf54h20/cpuapp + integration_platforms: + - nrf54h20dk/nrf54h20/cpuapp + + # cpuapp - empty_app_core (s2ram) + # cpurad - idle_wdt test (idle) + benchmarks.multicore.idle_wdt.nrf54h20dk_cpurad.s2ram: tags: ppk_power_measure extra_args: - - idle_wdt_CONF_FILE=prj_s2ram.conf - - remote_CONF_FILE=prj_s2ram.conf + - SB_CONFIG_APPCORE_REMOTE_SLEEP_FOREVER=y + - remote_sleep_forever_CONFIG_SOC_NRF54H20_CPURAD_ENABLE=y harness: pytest harness_config: fixture: ppk_power_measure pytest_root: - - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_pwm_and_s2ram" + - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_wdt_and_s2ram" + platform_allow: + - nrf54h20dk/nrf54h20/cpurad + integration_platforms: + - nrf54h20dk/nrf54h20/cpurad diff --git a/tests/drivers/audio/pdm_loopback/src/main.c b/tests/drivers/audio/pdm_loopback/src/main.c index 83d5b3aca154..d89ceb0189f0 100644 --- a/tests/drivers/audio/pdm_loopback/src/main.c +++ b/tests/drivers/audio/pdm_loopback/src/main.c @@ -249,10 +249,10 @@ ZTEST(pdm_loopback, test_pdm_clk_frequency) { int ret; uint8_t gpiote_channel; - nrfx_gpiote_t *gpiote_instance = - &GPIOTE_NRFX_INST_BY_NODE(NRF_DT_GPIOTE_NODE(DT_NODELABEL(pulse_counter), gpios)); + nrfx_gpiote_t gpiote_instance = + GPIOTE_NRFX_INST_BY_NODE(NRF_DT_GPIOTE_NODE(DT_NODELABEL(pulse_counter), gpios)); - ret = nrfx_gpiote_channel_alloc(gpiote_instance, &gpiote_channel); + ret = nrfx_gpiote_channel_alloc(&gpiote_instance, &gpiote_channel); zassert_true(ret == 0, "GPIOTE channel allocation failed, return code = %d", ret); nrfx_gpiote_trigger_config_t trigger_cfg = { @@ -267,10 +267,10 @@ ZTEST(pdm_loopback, test_pdm_clk_frequency) .p_trigger_config = &trigger_cfg, }; - ret = nrfx_gpiote_input_configure(gpiote_instance, CLOCK_INPUT_PIN, &gpiote_cfg); + ret = nrfx_gpiote_input_configure(&gpiote_instance, CLOCK_INPUT_PIN, &gpiote_cfg); zassert_true(ret == 0, "GPIOTE input configuration failed, return code = %d", ret); - nrfx_gpiote_trigger_enable(gpiote_instance, CLOCK_INPUT_PIN, false); + nrfx_gpiote_trigger_enable(&gpiote_instance, CLOCK_INPUT_PIN, false); nrfx_timer_config_t timer_config = NRFX_TIMER_DEFAULT_CONFIG( NRFX_TIMER_BASE_FREQUENCY_GET(&timer_instance)); @@ -284,7 +284,7 @@ ZTEST(pdm_loopback, test_pdm_clk_frequency) nrfx_timer_enable(&timer_instance); nrfx_gppi_handle_t gppi_handle; - uint32_t eep = nrfx_gpiote_in_event_address_get(gpiote_instance, CLOCK_INPUT_PIN); + uint32_t eep = nrfx_gpiote_in_event_address_get(&gpiote_instance, CLOCK_INPUT_PIN); uint32_t tep = nrfx_timer_task_address_get(&timer_instance, NRF_TIMER_TASK_COUNT); ret = nrfx_gppi_conn_alloc(eep, tep, &gppi_handle); @@ -300,6 +300,21 @@ ZTEST(pdm_loopback, test_pdm_clk_frequency) PDM_EXPECTED_FREQ * SAMPLING_RATIO / 30, "Captured incorrect frequency Hz. Captured pulses = %lu, expected = %lu", pulses, PDM_EXPECTED_FREQ * SAMPLING_RATIO); + + /* Remove GPPI configuration. */ + nrfx_gppi_conn_disable(gppi_handle); + nrfx_gppi_conn_free(eep, tep, gppi_handle); + + /* Remove GPIOTE configuration. */ + ret = nrfx_gpiote_pin_uninit(&gpiote_instance, CLOCK_INPUT_PIN); + zexpect_true(ret == 0, "nrfx_gpiote_pin_uninit() ret %d", ret); + nrfx_gpiote_trigger_disable(&gpiote_instance, CLOCK_INPUT_PIN); + ret = nrfx_gpiote_channel_free(&gpiote_instance, gpiote_channel); + zexpect_true(ret == 0, "nrfx_gpiote_channel_free() ret %d", ret); + + /* Remove NRFX Timer configuration. */ + nrfx_timer_disable(&timer_instance); + nrfx_timer_uninit(&timer_instance); } ZTEST_SUITE(pdm_loopback, NULL, device_setup, setup, teardown, NULL); diff --git a/tests/drivers/audio/pdm_prescaler/CMakeLists.txt b/tests/drivers/audio/pdm_prescaler/CMakeLists.txt new file mode 100644 index 000000000000..c51317a84832 --- /dev/null +++ b/tests/drivers/audio/pdm_prescaler/CMakeLists.txt @@ -0,0 +1,12 @@ +# +# Copyright (c) 2025 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +cmake_minimum_required(VERSION 3.20.0) + +find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) +project(pdm_prescaler) + +target_sources(app PRIVATE src/main.c) diff --git a/tests/drivers/audio/pdm_prescaler/Kconfig b/tests/drivers/audio/pdm_prescaler/Kconfig new file mode 100644 index 000000000000..10927e523d40 --- /dev/null +++ b/tests/drivers/audio/pdm_prescaler/Kconfig @@ -0,0 +1,28 @@ +# +# Copyright (c) 2025 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +source "Kconfig.zephyr" + +config TEST_PDM_SAMPLING_RATE + int "PDM sample rate in Hz" + default 10000 + help + The test will use it to define frequency of PDM sampling and + calculate the size of the buffer. + +config TEST_PDM_EXPECTED_FREQUENCY + int "Expected PDM_CLK frequency in Hz" + default 1000000 + help + The test will use it to confirm that the captured PDM_CLK + frequency in correct. + +config TEST_PDM_SAMPLING_TIME + int "PDM sampling time for one block in ms" + default 100 + help + The test will use it to calculate the size of data block and + determine the period of capturing timer. diff --git a/tests/drivers/audio/pdm_prescaler/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/tests/drivers/audio/pdm_prescaler/boards/nrf54l15dk_nrf54l15_cpuapp.overlay new file mode 100644 index 000000000000..135e6c64fc35 --- /dev/null +++ b/tests/drivers/audio/pdm_prescaler/boards/nrf54l15dk_nrf54l15_cpuapp.overlay @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/ { + gpio_test { + compatible = "gpio-leds"; + + pulse_counter: pulse_counter { + gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&pinctrl { + pdm20_default_alt: pdm20_default_alt { + group1 { + psels = , + ; + }; + }; +}; + +pdm_dev: &pdm20 { + status = "okay"; + pinctrl-0 = <&pdm20_default_alt>; + pinctrl-names = "default"; + clock-source = "PCLK32M"; +}; + +&gpio1 { + status = "okay"; +}; + +&timer00 { + status = "okay"; +}; diff --git a/tests/drivers/audio/pdm_prescaler/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay b/tests/drivers/audio/pdm_prescaler/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay new file mode 100644 index 000000000000..135e6c64fc35 --- /dev/null +++ b/tests/drivers/audio/pdm_prescaler/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/ { + gpio_test { + compatible = "gpio-leds"; + + pulse_counter: pulse_counter { + gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&pinctrl { + pdm20_default_alt: pdm20_default_alt { + group1 { + psels = , + ; + }; + }; +}; + +pdm_dev: &pdm20 { + status = "okay"; + pinctrl-0 = <&pdm20_default_alt>; + pinctrl-names = "default"; + clock-source = "PCLK32M"; +}; + +&gpio1 { + status = "okay"; +}; + +&timer00 { + status = "okay"; +}; diff --git a/tests/drivers/audio/pdm_prescaler/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/drivers/audio/pdm_prescaler/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay new file mode 100644 index 000000000000..e1e069693cdd --- /dev/null +++ b/tests/drivers/audio/pdm_prescaler/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/* Test requires loopback between P1.23 and P1.24. + * For best performance, PDM_CLK shall be on 'Clock pin'. + */ + +/ { + gpio_test { + compatible = "gpio-leds"; + + pulse_counter: pulse_counter { + gpios = <&gpio1 24 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&pinctrl { + pdm20_default_alt: pdm20_default_alt { + group1 { + psels = , + ; + }; + }; +}; + +pdm_dev: &pdm20 { + status = "okay"; + pinctrl-0 = <&pdm20_default_alt>; + pinctrl-names = "default"; + clock-source = "PCLK32M"; +}; + +&gpio1 { + status = "okay"; +}; + +&timer00 { + status = "okay"; +}; diff --git a/tests/drivers/audio/pdm_prescaler/nrf54l_aclk.overlay b/tests/drivers/audio/pdm_prescaler/nrf54l_aclk.overlay new file mode 100644 index 000000000000..63bdf726bf7a --- /dev/null +++ b/tests/drivers/audio/pdm_prescaler/nrf54l_aclk.overlay @@ -0,0 +1,9 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +&pdm_dev { + clock-source = "ACLK"; +}; diff --git a/tests/drivers/audio/pdm_prescaler/prj.conf b/tests/drivers/audio/pdm_prescaler/prj.conf new file mode 100644 index 000000000000..53b60711d65c --- /dev/null +++ b/tests/drivers/audio/pdm_prescaler/prj.conf @@ -0,0 +1,14 @@ +# +# Copyright (c) 2025 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_ZTEST=y +CONFIG_TEST_USERSPACE=y + +CONFIG_AUDIO=y +CONFIG_AUDIO_DMIC=y +CONFIG_GPIO=y +CONFIG_NRFX_GPPI=y +CONFIG_NRFX_TIMER=y diff --git a/tests/drivers/audio/pdm_prescaler/src/main.c b/tests/drivers/audio/pdm_prescaler/src/main.c new file mode 100644 index 000000000000..c02ebd87e839 --- /dev/null +++ b/tests/drivers/audio/pdm_prescaler/src/main.c @@ -0,0 +1,217 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define PDM_SAMPLING_RATE CONFIG_TEST_PDM_SAMPLING_RATE +#define PDM_EXPECTED_FREQ CONFIG_TEST_PDM_EXPECTED_FREQUENCY +#define PDM_SAMPLING_TIME CONFIG_TEST_PDM_SAMPLING_TIME +#define PDM_READ_TIMEOUT 1000 + +#define SAMPLE_BIT_WIDTH 16 +#define BYTES_PER_SAMPLE sizeof(int16_t) + +#define BLOCK_SIZE(_sample_rate, _number_of_channels) \ + (BYTES_PER_SAMPLE * (_sample_rate * PDM_SAMPLING_TIME / 1000) * _number_of_channels) + +#define MAX_BLOCK_SIZE BLOCK_SIZE(PDM_SAMPLING_RATE, 1) +#define BLOCK_COUNT 4 +#define SAMPLING_RATIO PDM_SAMPLING_TIME / 1000 * BLOCK_COUNT / 2 + +K_MEM_SLAB_DEFINE_STATIC(mem_slab, MAX_BLOCK_SIZE, BLOCK_COUNT, 4); + +#define CLOCK_INPUT_PIN NRF_DT_GPIOS_TO_PSEL(DT_NODELABEL(pulse_counter), gpios) + +volatile NRF_PDM_Type *p_reg = (NRF_PDM_Type *)DT_REG_ADDR(DT_NODELABEL(pdm_dev)); + +static const struct device *const pdm_dev = DEVICE_DT_GET(DT_NODELABEL(pdm_dev)); +static struct pcm_stream_cfg stream_config; +static struct dmic_cfg pdm_cfg; + +#if defined(NRF_TIMER00) +static nrfx_timer_t timer_instance = NRFX_TIMER_INSTANCE(NRF_TIMER00); +#elif defined(NRF_TIMER130) +static nrfx_timer_t timer_instance = NRFX_TIMER_INSTANCE(NRF_TIMER130); +#else +#error "No timer instance found" +#endif + +static bool pdm_enabled; + +static void *device_setup(void) +{ + int ret; + + ret = device_is_ready(pdm_dev); + zassert_true(ret, "PDM device is not ready, return code = %d", ret); + + return NULL; +} + +static void setup(void *unused) +{ + ARG_UNUSED(unused); + + stream_config.pcm_width = SAMPLE_BIT_WIDTH; + stream_config.pcm_rate = PDM_SAMPLING_RATE; + stream_config.mem_slab = &mem_slab; + stream_config.block_size = BLOCK_SIZE(PDM_SAMPLING_RATE, 1); + + pdm_cfg.io.min_pdm_clk_freq = 1000000; + pdm_cfg.io.max_pdm_clk_freq = 2000000; + pdm_cfg.io.min_pdm_clk_dc = 40; + pdm_cfg.io.max_pdm_clk_dc = 60; + pdm_cfg.streams = &stream_config, + pdm_cfg.channel.req_num_streams = 1; + pdm_cfg.channel.req_num_chan = 1; + pdm_cfg.channel.req_chan_map_lo = dmic_build_channel_map(0, 0, PDM_CHAN_LEFT); +} + +static void teardown(void *unused) +{ + ARG_UNUSED(unused); + + int ret; + + ret = dmic_trigger(pdm_dev, DMIC_TRIGGER_STOP); + zassert_true(ret >= 0, "dmic_trigger() failed, ret = %d", ret); +} + +static void capture_callback(struct k_timer *timer) +{ + ARG_UNUSED(timer); + nrfx_timer_capture(&timer_instance, NRF_TIMER_CC_CHANNEL0); + pdm_enabled = false; +} + +K_TIMER_DEFINE(capture_timer, capture_callback, NULL); + +ZTEST(pdm_prescaler, test_prescaler_not_affected_by_stop_start) +{ + int ret; + uint32_t prescaler_1; /* Prescaler value after applying test configuration. */ + uint32_t prescaler_temp; + const uint32_t ITERATIONS = 5; + + uint8_t gpiote_channel; + nrfx_gpiote_t gpiote_instance = + GPIOTE_NRFX_INST_BY_NODE(NRF_DT_GPIOTE_NODE(DT_NODELABEL(pulse_counter), gpios)); + + void *buffer; + uint32_t size; + + ret = nrfx_gpiote_channel_alloc(&gpiote_instance, &gpiote_channel); + zassert_true(ret == 0, "GPIOTE channel allocation failed, return code = %d", ret); + + nrfx_gpiote_trigger_config_t trigger_cfg = { + .p_in_channel = &gpiote_channel, + .trigger = NRFX_GPIOTE_TRIGGER_LOTOHI, + }; + + nrf_gpio_pin_pull_t pull_cfg = NRFX_GPIOTE_DEFAULT_PULL_CONFIG; + + nrfx_gpiote_input_pin_config_t gpiote_cfg = { + .p_pull_config = &pull_cfg, + .p_trigger_config = &trigger_cfg, + }; + + ret = nrfx_gpiote_input_configure(&gpiote_instance, CLOCK_INPUT_PIN, &gpiote_cfg); + zassert_true(ret == 0, "GPIOTE input configuration failed, return code = %d", ret); + + nrfx_gpiote_trigger_enable(&gpiote_instance, CLOCK_INPUT_PIN, false); + + nrfx_timer_config_t timer_config = NRFX_TIMER_DEFAULT_CONFIG( + NRFX_TIMER_BASE_FREQUENCY_GET(&timer_instance)); + timer_config.bit_width = NRF_TIMER_BIT_WIDTH_32; + timer_config.mode = NRF_TIMER_MODE_COUNTER; + + ret = nrfx_timer_init(&timer_instance, &timer_config, NULL); + zassert_true(ret == 0, "nrfx_timer_init() failed, ret = 0x%08X", ret); + + nrfx_timer_enable(&timer_instance); + + nrfx_gppi_handle_t gppi_handle; + uint32_t eep = nrfx_gpiote_in_event_address_get(&gpiote_instance, CLOCK_INPUT_PIN); + uint32_t tep = nrfx_timer_task_address_get(&timer_instance, NRF_TIMER_TASK_COUNT); + + ret = nrfx_gppi_conn_alloc(eep, tep, &gppi_handle); + zassert_equal(ret, 0, "GPPI channel allocation failed, return code = %d", ret); + nrfx_gppi_conn_enable(gppi_handle); + + ret = dmic_configure(pdm_dev, &pdm_cfg); + zassert_true(ret >= 0, "dmic_configure() failed, ret = %d", ret); + + prescaler_1 = p_reg->PRESCALER; + TC_PRINT("Prescaler after device configuration: %u\n", prescaler_1); + zassert_not_equal(prescaler_1, PDM_PRESCALER_ResetValue, + "Selected configuration sets identical PRESCALER to the default value"); + + for (int i = 1; i <= ITERATIONS; i++) { + TC_PRINT("Iteration %u\n", i); + + /* Clear clock cycles counter */ + nrfx_timer_clear(&timer_instance); + + /* When kerel timer expires: + * - NRFX timer counter value is stored; + * - pdm_enabled is set to false. + */ + pdm_enabled = true; + k_timer_start(&capture_timer, K_SECONDS(1), K_NO_WAIT); + + ret = dmic_trigger(pdm_dev, DMIC_TRIGGER_START); + zassert_true(ret >= 0, "PDM start trigger failed, return code = %d", ret); + + while (pdm_enabled) { + ret = dmic_read(pdm_dev, 0, &buffer, &size, PDM_READ_TIMEOUT); + zassert_true(ret >= 0, "PDM read failed, return code = %d", ret); + + k_mem_slab_free(&mem_slab, buffer); + } + + ret = dmic_trigger(pdm_dev, DMIC_TRIGGER_STOP); + zassert_true(ret >= 0, "PDM stop trigger failed, return code = %d", ret); + + /* Get number of PDM_CLK edges. */ + uint32_t pulses = nrfx_timer_capture_get(&timer_instance, NRF_TIMER_CC_CHANNEL0); + + /* Assert that captured frequency is within 3% margin of expected one. */ + TC_PRINT("NRFX Timer counted to %u\n", pulses); + zassert_within(pulses, PDM_EXPECTED_FREQ, PDM_EXPECTED_FREQ / 30, + "Captured incorrect frequency Hz. Captured pulses = %lu, expected = %lu", + pulses, PDM_EXPECTED_FREQ); + + /* Check PRESCALER value */ + prescaler_temp = p_reg->PRESCALER; + TC_PRINT("Prescaler after transmission: %u\n", prescaler_temp); + zassert_equal(prescaler_1, prescaler_temp, "PRESCALER has changed"); + } + + /* Remove GPPI configuration. */ + nrfx_gppi_conn_disable(gppi_handle); + nrfx_gppi_conn_free(eep, tep, gppi_handle); + + /* Remove GPIOTE configuration. */ + ret = nrfx_gpiote_pin_uninit(&gpiote_instance, CLOCK_INPUT_PIN); + zexpect_true(ret == 0, "nrfx_gpiote_pin_uninit() ret %d", ret); + nrfx_gpiote_trigger_disable(&gpiote_instance, CLOCK_INPUT_PIN); + ret = nrfx_gpiote_channel_free(&gpiote_instance, gpiote_channel); + zexpect_true(ret == 0, "nrfx_gpiote_channel_free() ret %d", ret); + + /* Remove NRFX Timer configuration. */ + nrfx_timer_disable(&timer_instance); + nrfx_timer_uninit(&timer_instance); +} + +ZTEST_SUITE(pdm_prescaler, NULL, device_setup, setup, teardown, NULL); diff --git a/tests/drivers/audio/pdm_prescaler/testcase.yaml b/tests/drivers/audio/pdm_prescaler/testcase.yaml new file mode 100644 index 000000000000..0768d5c454b0 --- /dev/null +++ b/tests/drivers/audio/pdm_prescaler/testcase.yaml @@ -0,0 +1,65 @@ +common: + tags: + - drivers + - ci_tests_drivers_audio + harness: ztest + harness_config: + fixture: gpio_loopback + timeout: 20 + platform_exclude: + - nrf54h20dk/nrf54h20/cpuapp + # On nrf54H20 there is no PRESCALER register + +tests: + drivers.audio.pdm_prescaler.nrf54l.1000khz: + platform_allow: + - nrf54l15dk/nrf54l15/cpuapp + - nrf54l15dk/nrf54l15/cpuapp/ns + - nrf54lm20dk/nrf54lm20a/cpuapp + integration_platforms: + - nrf54lm20dk/nrf54lm20a/cpuapp + drivers.audio.pdm_prescaler.nrf54lm20.1000khz: + platform_allow: + - nrf54lm20dk/nrf54lm20a/cpuapp + extra_args: + - CONFIG_TEST_PDM_SAMPLING_RATE=20000 + drivers.audio.pdm_prescaler.nrf54l.1280khz: + platform_allow: + - nrf54l15dk/nrf54l15/cpuapp + - nrf54l15dk/nrf54l15/cpuapp/ns + - nrf54lm20dk/nrf54lm20a/cpuapp + integration_platforms: + - nrf54lm20dk/nrf54lm20a/cpuapp + extra_args: + - CONFIG_TEST_PDM_SAMPLING_RATE=16000 + - CONFIG_TEST_PDM_EXPECTED_FREQUENCY=1280000 + drivers.audio.pdm_prescaler.nrf54l.1600khz: + platform_allow: + - nrf54l15dk/nrf54l15/cpuapp + - nrf54l15dk/nrf54l15/cpuapp/ns + - nrf54lm20dk/nrf54lm20a/cpuapp + integration_platforms: + - nrf54lm20dk/nrf54lm20a/cpuapp + extra_args: + - CONFIG_TEST_PDM_SAMPLING_RATE=32000 + - CONFIG_TEST_PDM_EXPECTED_FREQUENCY=1600000 + drivers.audio.pdm_prescaler.nrf54lm20.aclk.1000khz: + platform_allow: + - nrf54lm20dk/nrf54lm20a/cpuapp + extra_args: + - CONFIG_TEST_PDM_SAMPLING_RATE=20000 + - EXTRA_DTC_OVERLAY_FILE="nrf54l_aclk.overlay" + drivers.audio.pdm_prescaler.nrf54lm20.aclk.1280khz: + platform_allow: + - nrf54lm20dk/nrf54lm20a/cpuapp + extra_args: + - CONFIG_TEST_PDM_SAMPLING_RATE=16000 + - CONFIG_TEST_PDM_EXPECTED_FREQUENCY=1280000 + - EXTRA_DTC_OVERLAY_FILE="nrf54l_aclk.overlay" + drivers.audio.pdm_prescaler.nrf54lm20.aclk.1600khz: + platform_allow: + - nrf54lm20dk/nrf54lm20a/cpuapp + extra_args: + - CONFIG_TEST_PDM_SAMPLING_RATE=32000 + - CONFIG_TEST_PDM_EXPECTED_FREQUENCY=1600000 + - EXTRA_DTC_OVERLAY_FILE="nrf54l_aclk.overlay" diff --git a/tests/drivers/can/can_stats_init/CMakeLists.txt b/tests/drivers/can/can_stats_init/CMakeLists.txt new file mode 100644 index 000000000000..b5119664448b --- /dev/null +++ b/tests/drivers/can/can_stats_init/CMakeLists.txt @@ -0,0 +1,13 @@ +# +# Copyright (c) 2025 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +cmake_minimum_required(VERSION 3.20.0) + +find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) +project(can_stats_init) + +FILE(GLOB app_sources src/*.c) +target_sources(app PRIVATE ${app_sources}) diff --git a/tests/drivers/can/can_stats_init/prj.conf b/tests/drivers/can/can_stats_init/prj.conf new file mode 100644 index 000000000000..dc6615086d49 --- /dev/null +++ b/tests/drivers/can/can_stats_init/prj.conf @@ -0,0 +1,4 @@ +CONFIG_CAN=y +CONFIG_STATS=y +CONFIG_CAN_STATS=y +CONFIG_ZTEST=y diff --git a/tests/drivers/can/can_stats_init/src/can_stats_init.c b/tests/drivers/can/can_stats_init/src/can_stats_init.c new file mode 100644 index 000000000000..7a045fb09614 --- /dev/null +++ b/tests/drivers/can/can_stats_init/src/can_stats_init.c @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include + +#include + +#define EXPECTED 0 + +static const struct device *const can_dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_canbus)); + +/* Test that CAN statistics are cleared during driver initialization. + * + * Since CAN start/stop will clear CAN stats, it's crucial this test + * is executed immediately after CAN driver initialization. + */ +ZTEST_USER(can_stats_init, test_can_stats_cleared_during_driver_init) +{ + uint32_t val; + + val = can_stats_get_bit_errors(can_dev); + zassert_true(val == EXPECTED, "CAN bit errors are too high (%u)", val); + val = can_stats_get_bit0_errors(can_dev); + zassert_true(val == EXPECTED, "CAN bit0 errors are too high (%u)", val); + val = can_stats_get_bit1_errors(can_dev); + zassert_true(val == EXPECTED, "CAN bit1 errors are too high (%u)", val); + val = can_stats_get_stuff_errors(can_dev); + zassert_true(val == EXPECTED, "CAN stuff errors are too high (%u)", val); + val = can_stats_get_crc_errors(can_dev); + zassert_true(val == EXPECTED, "CAN crc errors are too high (%u)", val); + val = can_stats_get_form_errors(can_dev); + zassert_true(val == EXPECTED, "CAN form errors are too high (%u)", val); + val = can_stats_get_ack_errors(can_dev); + zassert_true(val == EXPECTED, "CAN ack errors are too high (%u)", val); + val = can_stats_get_rx_overruns(can_dev); + zassert_true(val == EXPECTED, "CAN rx overruns are too high (%u)", val); +} + +void *suite_setup(void) +{ + zassert_true(device_is_ready(can_dev), "CAN device not ready"); + + return NULL; +} + +ZTEST_SUITE(can_stats_init, NULL, suite_setup, NULL, NULL, NULL); diff --git a/tests/drivers/can/can_stats_init/testcase.yaml b/tests/drivers/can/can_stats_init/testcase.yaml new file mode 100644 index 000000000000..98bdf5764222 --- /dev/null +++ b/tests/drivers/can/can_stats_init/testcase.yaml @@ -0,0 +1,12 @@ +common: + tags: + - drivers + - can + - ci_tests_drivers_can + platform_allow: + - nrf54h20dk/nrf54h20/cpuapp + integration_platforms: + - nrf54h20dk/nrf54h20/cpuapp + +tests: + drivers.can.can_stats_init: {} diff --git a/tests/drivers/gpio/gpio_nfct/boards/nrf7120pdk_nrf7120_cpuapp.overlay b/tests/drivers/gpio/gpio_nfct/boards/nrf7120pdk_nrf7120_cpuapp.overlay index 3c666009ff1d..46e4da08639b 100644 --- a/tests/drivers/gpio/gpio_nfct/boards/nrf7120pdk_nrf7120_cpuapp.overlay +++ b/tests/drivers/gpio/gpio_nfct/boards/nrf7120pdk_nrf7120_cpuapp.overlay @@ -6,18 +6,18 @@ / { /* Test requirements: - * P1.00 shorted with P1.01; - * P1.02 shorted with P1.03. - * (NFC pins are P1.01 and P1.02) + * P0.00 shorted with P0.03; + * P0.12 shorted with P0.04. + * (NFC pins are P0.03 and P0.04) */ test_gpios { compatible = "gpio-leds"; out_gpios: out_gpios { - gpios = <&gpio1 0 GPIO_ACTIVE_HIGH>, <&gpio1 2 GPIO_ACTIVE_HIGH>; + gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>, <&gpio0 12 GPIO_ACTIVE_HIGH>; }; in_gpios: in_gpios { - gpios = <&gpio1 1 GPIO_ACTIVE_HIGH>, <&gpio1 3 GPIO_ACTIVE_HIGH>; + gpios = <&gpio0 3 GPIO_ACTIVE_HIGH>, <&gpio0 4 GPIO_ACTIVE_HIGH>; }; }; }; @@ -30,6 +30,6 @@ status = "okay"; }; -&gpio1 { +&gpio0 { status = "okay"; }; diff --git a/tests/drivers/gpio/gpio_swd/boards/nrf54ls05dk_nrf54ls05b_cpuapp.overlay b/tests/drivers/gpio/gpio_swd/boards/nrf54ls05dk_nrf54ls05b_cpuapp.overlay index 9cf9d56dd8a8..47ba1cd629da 100644 --- a/tests/drivers/gpio/gpio_swd/boards/nrf54ls05dk_nrf54ls05b_cpuapp.overlay +++ b/tests/drivers/gpio/gpio_swd/boards/nrf54ls05dk_nrf54ls05b_cpuapp.overlay @@ -9,7 +9,7 @@ * No other driver on out-gpios[n] */ zephyr,user { - out-gpios = <&gpio1 0 GPIO_ACTIVE_HIGH>, <&gpio1 31 GPIO_ACTIVE_HIGH>, + out-gpios = <&gpio1 28 GPIO_ACTIVE_HIGH>, <&gpio1 31 GPIO_ACTIVE_HIGH>, <&gpio1 29 GPIO_ACTIVE_HIGH>, <&gpio1 30 GPIO_ACTIVE_HIGH>; }; }; @@ -17,3 +17,7 @@ &gpio1 { status = "okay"; }; + +&tampc { + swd-pins-as-gpios; +}; diff --git a/tests/drivers/i2c/i2c_pan/CMakeLists.txt b/tests/drivers/i2c/i2c_pan/CMakeLists.txt new file mode 100644 index 000000000000..9fe4ffde808b --- /dev/null +++ b/tests/drivers/i2c/i2c_pan/CMakeLists.txt @@ -0,0 +1,13 @@ +# +# Copyright (c) 2025 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +cmake_minimum_required(VERSION 3.20.0) + +find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) + +project(i2c_pan) + +target_sources(app PRIVATE src/main.c) diff --git a/tests/drivers/i2c/i2c_pan/boards/nrf52840dk_nrf52840.overlay b/tests/drivers/i2c/i2c_pan/boards/nrf52840dk_nrf52840.overlay new file mode 100644 index 000000000000..f681c5fd6177 --- /dev/null +++ b/tests/drivers/i2c/i2c_pan/boards/nrf52840dk_nrf52840.overlay @@ -0,0 +1,59 @@ +/ { + aliases { + i2c-slave = &i2c1; + }; +}; + +&pinctrl { + i2c0_default_alt: i2c0_default_alt { + group1 { + psels = , + ; + }; + }; + + i2c0_sleep_alt: i2c0_sleep_alt { + group1 { + psels = , + ; + low-power-enable; + }; + }; + + i2c1_default_alt: i2c1_default_alt { + group1 { + psels = , + ; + bias-pull-up; + }; + }; + + i2c1_sleep_alt: i2c1_sleep_alt { + group1 { + psels = , + ; + low-power-enable; + }; + }; +}; + +dut_twim: &i2c0 { + compatible = "nordic,nrf-twim"; + status = "okay"; + pinctrl-0 = <&i2c0_default_alt>; + pinctrl-1 = <&i2c0_sleep_alt>; + pinctrl-names = "default", "sleep"; + + sensor: sensor@54 { + reg = <0x54>; + }; +}; + + +dut_twis: &i2c1 { + compatible = "nordic,nrf-twis"; + status = "okay"; + pinctrl-0 = <&i2c1_default_alt>; + pinctrl-1 = <&i2c1_sleep_alt>; + pinctrl-names = "default", "sleep"; +}; diff --git a/tests/drivers/i2c/i2c_pan/boards/nrf5340dk_nrf5340_cpuapp.overlay b/tests/drivers/i2c/i2c_pan/boards/nrf5340dk_nrf5340_cpuapp.overlay new file mode 100644 index 000000000000..8cabd53a7afd --- /dev/null +++ b/tests/drivers/i2c/i2c_pan/boards/nrf5340dk_nrf5340_cpuapp.overlay @@ -0,0 +1,57 @@ +/ { + aliases { + i2c-slave = &i2c2; + }; +}; + +&pinctrl { + i2c1_default_alt: i2c1_default_alt { + group1 { + psels = , + ; + }; + }; + + i2c1_sleep_alt: i2c1_sleep_alt { + group1 { + psels = , + ; + low-power-enable; + }; + }; + + i2c2_default_alt: i2c2_default_alt { + group1 { + psels = , + ; + bias-pull-up; + }; + }; + + i2c2_sleep_alt: i2c2_sleep_alt { + group1 { + psels = , + ; + low-power-enable; + }; + }; +}; + +dut_twim: &i2c1 { + compatible = "nordic,nrf-twim"; + status = "okay"; + pinctrl-0 = <&i2c1_default_alt>; + pinctrl-1 = <&i2c1_sleep_alt>; + pinctrl-names = "default", "sleep"; + + sensor: sensor@54 { + reg = <0x54>; + }; +}; + +dut_twis: &i2c2 { + compatible = "nordic,nrf-twis"; + pinctrl-0 = <&i2c2_default_alt>; + pinctrl-1 = <&i2c2_sleep_alt>; + pinctrl-names = "default", "sleep"; +}; diff --git a/tests/drivers/i2c/i2c_pan/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/drivers/i2c/i2c_pan/boards/nrf54h20dk_nrf54h20_cpuapp.overlay new file mode 100644 index 000000000000..24e46f9f2df8 --- /dev/null +++ b/tests/drivers/i2c/i2c_pan/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -0,0 +1,61 @@ +/ { + aliases { + i2c-slave = &i2c131; + }; +}; + +&pinctrl { + i2c130_default_alt: i2c130_default_alt { + group1 { + psels = , + ; + }; + }; + + i2c130_sleep_alt: i2c130_sleep_alt { + group1 { + psels = , + ; + low-power-enable; + }; + }; + + i2c131_default_alt: i2c131_default_alt { + group1 { + psels = , + ; + bias-pull-up; + }; + }; + + i2c131_sleep_alt: i2c131_sleep_alt { + group1 { + psels = , + ; + low-power-enable; + }; + }; +}; + +dut_twim: &i2c130 { + compatible = "nordic,nrf-twim"; + status = "okay"; + pinctrl-0 = <&i2c130_default_alt>; + pinctrl-1 = <&i2c130_sleep_alt>; + pinctrl-names = "default", "sleep"; + memory-regions = <&cpuapp_dma_region>; + zephyr,concat-buf-size = <512>; + + sensor: sensor@54 { + reg = <0x54>; + }; +}; + +dut_twis: &i2c131 { + compatible = "nordic,nrf-twis"; + status = "okay"; + pinctrl-0 = <&i2c131_default_alt>; + pinctrl-1 = <&i2c131_sleep_alt>; + pinctrl-names = "default", "sleep"; + memory-regions = <&cpuapp_dma_region>; +}; diff --git a/tests/drivers/i2c/i2c_pan/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/tests/drivers/i2c/i2c_pan/boards/nrf54l15dk_nrf54l15_cpuapp.overlay new file mode 100644 index 000000000000..288973409f33 --- /dev/null +++ b/tests/drivers/i2c/i2c_pan/boards/nrf54l15dk_nrf54l15_cpuapp.overlay @@ -0,0 +1,58 @@ +/ { + aliases { + i2c-slave = &i2c22; + }; +}; + +&pinctrl { + i2c21_default_alt: i2c21_default_alt { + group1 { + psels = , + ; + }; + }; + + i2c21_sleep_alt: i2c21_sleep_alt { + group1 { + psels = , + ; + low-power-enable; + }; + }; + + i2c22_default_alt: i2c22_default_alt { + group1 { + psels = , + ; + bias-pull-up; + }; + }; + + i2c22_sleep_alt: i2c22_sleep_alt { + group1 { + psels = , + ; + low-power-enable; + }; + }; +}; + +dut_twim: &i2c21 { + compatible = "nordic,nrf-twim"; + status = "okay"; + pinctrl-0 = <&i2c21_default_alt>; + pinctrl-1 = <&i2c21_sleep_alt>; + pinctrl-names = "default", "sleep"; + + sensor: sensor@54 { + reg = <0x54>; + }; +}; + +dut_twis: &i2c22 { + compatible = "nordic,nrf-twis"; + status = "okay"; + pinctrl-0 = <&i2c22_default_alt>; + pinctrl-1 = <&i2c22_sleep_alt>; + pinctrl-names = "default", "sleep"; +}; diff --git a/tests/drivers/i2c/i2c_pan/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/drivers/i2c/i2c_pan/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay new file mode 100644 index 000000000000..288973409f33 --- /dev/null +++ b/tests/drivers/i2c/i2c_pan/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay @@ -0,0 +1,58 @@ +/ { + aliases { + i2c-slave = &i2c22; + }; +}; + +&pinctrl { + i2c21_default_alt: i2c21_default_alt { + group1 { + psels = , + ; + }; + }; + + i2c21_sleep_alt: i2c21_sleep_alt { + group1 { + psels = , + ; + low-power-enable; + }; + }; + + i2c22_default_alt: i2c22_default_alt { + group1 { + psels = , + ; + bias-pull-up; + }; + }; + + i2c22_sleep_alt: i2c22_sleep_alt { + group1 { + psels = , + ; + low-power-enable; + }; + }; +}; + +dut_twim: &i2c21 { + compatible = "nordic,nrf-twim"; + status = "okay"; + pinctrl-0 = <&i2c21_default_alt>; + pinctrl-1 = <&i2c21_sleep_alt>; + pinctrl-names = "default", "sleep"; + + sensor: sensor@54 { + reg = <0x54>; + }; +}; + +dut_twis: &i2c22 { + compatible = "nordic,nrf-twis"; + status = "okay"; + pinctrl-0 = <&i2c22_default_alt>; + pinctrl-1 = <&i2c22_sleep_alt>; + pinctrl-names = "default", "sleep"; +}; diff --git a/tests/drivers/i2c/i2c_pan/boards/nrf54lv10dk_nrf54lv10a_cpuapp.overlay b/tests/drivers/i2c/i2c_pan/boards/nrf54lv10dk_nrf54lv10a_cpuapp.overlay new file mode 100644 index 000000000000..af3344679308 --- /dev/null +++ b/tests/drivers/i2c/i2c_pan/boards/nrf54lv10dk_nrf54lv10a_cpuapp.overlay @@ -0,0 +1,58 @@ +/ { + aliases { + i2c-slave = &i2c21; + }; +}; + +&pinctrl { + i2c20_default_alt: i2c20_default_alt { + group1 { + psels = , + ; + }; + }; + + i2c20_sleep_alt: i2c20_sleep_alt { + group1 { + psels = , + ; + low-power-enable; + }; + }; + + i2c21_default_alt: i2c21_default_alt { + group1 { + psels = , + ; + bias-pull-up; + }; + }; + + i2c21_sleep_alt: i2c21_sleep_alt { + group1 { + psels = , + ; + low-power-enable; + }; + }; +}; + +dut_twim: &i2c20 { + compatible = "nordic,nrf-twim"; + status = "okay"; + pinctrl-0 = <&i2c20_default_alt>; + pinctrl-1 = <&i2c20_sleep_alt>; + pinctrl-names = "default", "sleep"; + + sensor: sensor@54 { + reg = <0x54>; + }; +}; + +dut_twis: &i2c21 { + compatible = "nordic,nrf-twis"; + status = "okay"; + pinctrl-0 = <&i2c21_default_alt>; + pinctrl-1 = <&i2c21_sleep_alt>; + pinctrl-names = "default", "sleep"; +}; diff --git a/tests/drivers/i2c/i2c_pan/prj.conf b/tests/drivers/i2c/i2c_pan/prj.conf new file mode 100644 index 000000000000..b7da57b303b1 --- /dev/null +++ b/tests/drivers/i2c/i2c_pan/prj.conf @@ -0,0 +1,4 @@ +CONFIG_I2C=y +CONFIG_NRFX_TWIS=y + +CONFIG_ZTEST=y diff --git a/tests/drivers/i2c/i2c_pan/src/main.c b/tests/drivers/i2c/i2c_pan/src/main.c new file mode 100644 index 000000000000..46fe1d40b708 --- /dev/null +++ b/tests/drivers/i2c/i2c_pan/src/main.c @@ -0,0 +1,154 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include +#include + +#include +#include + +#include + +#define NODE_TWIM DT_NODELABEL(sensor) +#define NODE_TWIS DT_ALIAS(i2c_slave) +#define MEASUREMENT_REPEATS 10 + +#define TWIS_MEMORY_SECTION \ + COND_CODE_1(DT_NODE_HAS_PROP(NODE_TWIS, memory_regions), \ + (__attribute__((__section__( \ + LINKER_DT_NODE_REGION_NAME(DT_PHANDLE(NODE_TWIS, memory_regions)))))), \ + ()) + +#define TEST_BUFFER_SIZE 128 + +static nrfx_twis_t twis = {.p_reg = (NRF_TWIS_Type *)DT_REG_ADDR(NODE_TWIS)}; +static uint8_t i2c_slave_buffer[TEST_BUFFER_SIZE] TWIS_MEMORY_SECTION; +static uint8_t i2c_master_buffer[TEST_BUFFER_SIZE]; + +struct i2c_api_twis_fixture { + const struct device *dev; + uint8_t addr; + uint8_t *const master_buffer; + uint8_t *const slave_buffer; +}; + +static struct i2c_api_twis_fixture fixture = { + .dev = DEVICE_DT_GET(DT_BUS(NODE_TWIM)), + .addr = DT_REG_ADDR(NODE_TWIM), + .master_buffer = i2c_master_buffer, + .slave_buffer = i2c_slave_buffer, +}; + +static void i2s_slave_handler(nrfx_twis_event_t const *p_event) +{ + switch (p_event->type) { + case NRFX_TWIS_EVT_READ_REQ: + nrfx_twis_tx_prepare(&twis, i2c_slave_buffer, TEST_BUFFER_SIZE); + break; + case NRFX_TWIS_EVT_READ_DONE: + break; + case NRFX_TWIS_EVT_WRITE_REQ: + nrfx_twis_rx_prepare(&twis, i2c_slave_buffer, TEST_BUFFER_SIZE); + break; + case NRFX_TWIS_EVT_WRITE_DONE: + break; + default: + break; + } +} + +static void *test_setup(void) +{ + const nrfx_twis_config_t config = { + .addr = {fixture.addr, 0}, + .skip_gpio_cfg = true, + .skip_psel_cfg = true, + }; + int ret; + + zassert_true(device_is_ready(fixture.dev), "TWIM device is not ready"); + zassert_equal(0, nrfx_twis_init(&twis, &config, i2s_slave_handler), + "TWIS initialization failed"); + + PINCTRL_DT_DEFINE(NODE_TWIS); + ret = pinctrl_apply_state(PINCTRL_DT_DEV_CONFIG_GET(NODE_TWIS), PINCTRL_STATE_DEFAULT); + zassert_ok(ret); + + IRQ_CONNECT(DT_IRQN(NODE_TWIS), DT_IRQ(NODE_TWIS, priority), nrfx_twis_irq_handler, &twis, + 0); + + nrfx_twis_enable(&twis); + + return NULL; +} + +static void prepare_test_data(uint8_t *const buffer) +{ + for (size_t counter = 0; counter < TEST_BUFFER_SIZE; counter++) { + buffer[counter] = counter; + } +} + +static void cleanup_buffers(void *nullp) +{ + memset(fixture.slave_buffer, 0, TEST_BUFFER_SIZE); + memset(fixture.master_buffer, 0, TEST_BUFFER_SIZE); +} + +static void configure_twim(void) +{ + uint32_t i2c_config = I2C_SPEED_SET(I2C_SPEED_STANDARD) | I2C_MODE_CONTROLLER; + + zassert_ok(i2c_configure(fixture.dev, i2c_config)); +} + +/* + * MLTPAN-105 + * During I2C transaction, TWIM SCL is 0 either before or after disabling TWIM. + */ +ZTEST(i2c_pan, test_mltpan_105_workaround) +{ + int ret; + uint32_t scl_pin; + + configure_twim(); + prepare_test_data(fixture.master_buffer); + memset(fixture.slave_buffer, 0, TEST_BUFFER_SIZE); + + TC_PRINT("STEP 1: TWIM - TWIS transmission with valid configuration\n"); + scl_pin = nrf_twis_scl_pin_get(twis.p_reg); + TC_PRINT("TWIS SCL pin: 0x%x\n", scl_pin); + ret = i2c_read(fixture.dev, fixture.master_buffer, TEST_BUFFER_SIZE, fixture.addr); + zassert_ok(ret, "i2c_read failed: %d\n", ret); + zassert_mem_equal(fixture.master_buffer, fixture.slave_buffer, TEST_BUFFER_SIZE); + + TC_PRINT("STEP 2: TWIM - TWIS transmission with SCL pulled low (EIO error is expected)\n"); + /* Pull TWIS SCL pin low */ + nrf_twis_scl_pin_set(twis.p_reg, 1 << 31); + nrf_gpio_cfg_output(scl_pin); + nrf_gpio_pin_clear(scl_pin); + TC_PRINT("TWIS SCL pin (disconnected): 0x%x\n", nrf_twis_scl_pin_get(twis.p_reg)); + memset(fixture.slave_buffer, 0, TEST_BUFFER_SIZE); + ret = i2c_read(fixture.dev, fixture.master_buffer, TEST_BUFFER_SIZE, fixture.addr); + zassert_equal(ret, -EIO, "i2c_read failed with different error than expeced (EIO) %d\n", + ret); + + TC_PRINT("STEP 3: TWIM - TWIS transmission after TWIS pin reconfiguration\n"); + /* Restore original TWIS pin configuration */ + PINCTRL_DT_DEFINE(NODE_TWIS); + ret = pinctrl_apply_state(PINCTRL_DT_DEV_CONFIG_GET(NODE_TWIS), PINCTRL_STATE_DEFAULT); + zassert_ok(ret); + TC_PRINT("TWIS SCL pin (reconfigured): 0x%x\n", nrf_twis_scl_pin_get(twis.p_reg)); + + ret = i2c_read(fixture.dev, fixture.master_buffer, TEST_BUFFER_SIZE, fixture.addr); + zassert_ok(ret, "i2c_read failed (after SCL release): %d\n", ret); + zassert_mem_equal(fixture.master_buffer, fixture.slave_buffer, TEST_BUFFER_SIZE); +} + +ZTEST_SUITE(i2c_pan, NULL, test_setup, NULL, cleanup_buffers, NULL); diff --git a/tests/drivers/i2c/i2c_pan/testcase.yaml b/tests/drivers/i2c/i2c_pan/testcase.yaml new file mode 100644 index 000000000000..3e7c4a4824a9 --- /dev/null +++ b/tests/drivers/i2c/i2c_pan/testcase.yaml @@ -0,0 +1,22 @@ +common: + sysbuild: true + depends_on: gpio + harness: ztest + harness_config: + fixture: gpio_loopback + tags: + - drivers + - i2c + - ci_tests_zephyr_drivers_i2c + platform_allow: + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf54h20dk/nrf54h20/cpuapp + - nrf54l15dk/nrf54l15/cpuapp + - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54lv10dk/nrf54lv10a/cpuapp + integration_platforms: + - nrf54l15dk/nrf54l15/cpuapp + +tests: + drivers.i2c.i2c_pan: {} diff --git a/tests/drivers/i2s/i2s_buffer/CMakeLists.txt b/tests/drivers/i2s/i2s_buffer/CMakeLists.txt new file mode 100644 index 000000000000..987c2cb463a9 --- /dev/null +++ b/tests/drivers/i2s/i2s_buffer/CMakeLists.txt @@ -0,0 +1,13 @@ +# +# Copyright (c) 2025 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +cmake_minimum_required(VERSION 3.20.0) + +find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) +project(i2s_buffer) + +FILE(GLOB app_sources src/*.c) +target_sources(app PRIVATE ${app_sources}) diff --git a/tests/drivers/i2s/i2s_buffer/Kconfig b/tests/drivers/i2s/i2s_buffer/Kconfig new file mode 100644 index 000000000000..70733e705d42 --- /dev/null +++ b/tests/drivers/i2s/i2s_buffer/Kconfig @@ -0,0 +1,43 @@ +# +# Copyright (c) 2025 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +mainmenu "I2S Buffer Test" + +config I2S_TEST_ALLOWED_DATA_OFFSET + int "Allowed offset in received data" + default 2 if DT_HAS_NORDIC_NRF_I2S_ENABLED + default 0 + help + Maximum allowed offset between sent and received samples. + Value is in "full" audio samples. + Offset of 1 "full" audio sample is: + - 1 byte for mono 8 bit word size. + - 2 bytes for stereo 8 bit word size. + - 2 bytes for mono 16 bit word size. + - 4 bytes for stereo 16 bit word size. + - 4 bytes for mono 32 bit word size. + - 8 bytes for stereo 32 bit word size. + +config I2S_TEST_BUFFER_SIZE + int "Number of bytes send in one transaction" + default 16 + help + Value has to be a multiple of 8 bytes. Test supports up to 32 bytes. + +config I2S_TEST_WORD_SIZE_32_BIT_UNSUPPORTED + bool "32 bit word size is not supported by the driver" + help + When set to 'y' testing 32 bit word size is skipped. + +config I2S_TEST_BLOCK_SIZE_8_UNSUPPORTED + bool "Block_size of 8 bytes is not supported by the driver" + default y if DT_HAS_NORDIC_NRF_TDM_ENABLED + help + When set to 'y', test that use 8 bytes of data check if + i2s_configure() returns -EINVAL. + When set to 'n', test will do the I2S transmission. + +source "Kconfig.zephyr" diff --git a/tests/drivers/i2s/i2s_buffer/boards/nrf52840dk_nrf52840.conf b/tests/drivers/i2s/i2s_buffer/boards/nrf52840dk_nrf52840.conf new file mode 100644 index 000000000000..8ed6ee234db2 --- /dev/null +++ b/tests/drivers/i2s/i2s_buffer/boards/nrf52840dk_nrf52840.conf @@ -0,0 +1 @@ +CONFIG_I2S_TEST_WORD_SIZE_32_BIT_UNSUPPORTED=y diff --git a/tests/drivers/i2s/i2s_buffer/boards/nrf52840dk_nrf52840.overlay b/tests/drivers/i2s/i2s_buffer/boards/nrf52840dk_nrf52840.overlay new file mode 100644 index 000000000000..a1e700fe9f6e --- /dev/null +++ b/tests/drivers/i2s/i2s_buffer/boards/nrf52840dk_nrf52840.overlay @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/* Test requires GPIO loopback: + * P1.01 - P1.02 + */ + +/ { + aliases { + i2s-node0 = &i2s0; + }; +}; + +&pinctrl { + i2s0_default_alt: i2s0_default_alt { + group1 { + psels = , + , + , + ; + }; + }; +}; + +&i2s0 { + status = "okay"; + pinctrl-0 = <&i2s0_default_alt>; + pinctrl-names = "default"; +}; diff --git a/tests/drivers/i2s/i2s_buffer/boards/nrf5340dk_nrf5340_cpuapp.overlay b/tests/drivers/i2s/i2s_buffer/boards/nrf5340dk_nrf5340_cpuapp.overlay new file mode 100644 index 000000000000..25599f281af7 --- /dev/null +++ b/tests/drivers/i2s/i2s_buffer/boards/nrf5340dk_nrf5340_cpuapp.overlay @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/* Test requires GPIO loopback: + * P0.04 - P0.05 + */ + +/ { + aliases { + i2s-node0 = &i2s0; + }; +}; + +&pinctrl { + i2s0_default_alt: i2s0_default_alt { + group1 { + psels = , + , + , + ; + }; + }; +}; + +&uart1 { + status = "disabled"; +}; + +&i2s0 { + status = "okay"; + pinctrl-0 = <&i2s0_default_alt>; + pinctrl-names = "default"; +}; diff --git a/tests/drivers/i2s/i2s_buffer/boards/nrf5340dk_nrf5340_cpuapp_aclk.overlay b/tests/drivers/i2s/i2s_buffer/boards/nrf5340dk_nrf5340_cpuapp_aclk.overlay new file mode 100644 index 000000000000..e262ca8d8a87 --- /dev/null +++ b/tests/drivers/i2s/i2s_buffer/boards/nrf5340dk_nrf5340_cpuapp_aclk.overlay @@ -0,0 +1,9 @@ +/* Drive i2s peripheral from ACLK. */ + +&clock { + hfclkaudio-frequency = <11289600>; +}; + +&i2s0 { + clock-source = "ACLK"; +}; diff --git a/tests/drivers/i2s/i2s_buffer/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/drivers/i2s/i2s_buffer/boards/nrf54h20dk_nrf54h20_cpuapp.overlay new file mode 100644 index 000000000000..4feb84e02e6a --- /dev/null +++ b/tests/drivers/i2s/i2s_buffer/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/* Test requires GPIO loopback: + * P1.04 - P1.05 + */ + +/ { + aliases { + i2s-node0 = &tdm130; + }; +}; + +&pinctrl { + tdm130_default_alt: tdm130_default_alt { + group1 { + psels = , + , + , + ; + }; + }; +}; + +&tdm130 { + status = "okay"; + pinctrl-0 = <&tdm130_default_alt>; + pinctrl-names = "default"; + memory-regions = <&cpuapp_dma_region>; +}; diff --git a/tests/drivers/i2s/i2s_buffer/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/tests/drivers/i2s/i2s_buffer/boards/nrf54l15dk_nrf54l15_cpuapp.overlay new file mode 100644 index 000000000000..f4ab0bef2852 --- /dev/null +++ b/tests/drivers/i2s/i2s_buffer/boards/nrf54l15dk_nrf54l15_cpuapp.overlay @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/* Test requires GPIO loopback: + * P1.08 - P1.09 + */ + +/ { + aliases { + i2s-node0 = &i2s20; + }; +}; + +&pinctrl { + i2s20_default_alt: i2s20_default_alt { + group1 { + psels = , + , + , + ; + }; + }; +}; + +&i2s20 { + status = "okay"; + pinctrl-0 = <&i2s20_default_alt>; + pinctrl-names = "default"; +}; diff --git a/tests/drivers/i2s/i2s_buffer/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/drivers/i2s/i2s_buffer/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay new file mode 100644 index 000000000000..98e6b7e76a50 --- /dev/null +++ b/tests/drivers/i2s/i2s_buffer/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/* Test requires GPIO loopback: + * P1.30 - P1.31 + */ + +/ { + aliases { + i2s-node0 = &tdm; + }; +}; + +&pinctrl { + tdm_default_alt: tdm_default_alt { + group1 { + psels = , + , + , + ; + }; + }; +}; + +&tdm { + status = "okay"; + pinctrl-0 = <&tdm_default_alt>; + pinctrl-names = "default"; +}; diff --git a/tests/drivers/i2s/i2s_buffer/prj.conf b/tests/drivers/i2s/i2s_buffer/prj.conf new file mode 100644 index 000000000000..b6870d663559 --- /dev/null +++ b/tests/drivers/i2s/i2s_buffer/prj.conf @@ -0,0 +1,4 @@ +CONFIG_I2S=y +CONFIG_ZTEST=y + +CONFIG_SPEED_OPTIMIZATIONS=y diff --git a/tests/drivers/i2s/i2s_buffer/src/i2s_buffer.c b/tests/drivers/i2s/i2s_buffer/src/i2s_buffer.c new file mode 100644 index 000000000000..dd9609e4faf8 --- /dev/null +++ b/tests/drivers/i2s/i2s_buffer/src/i2s_buffer.c @@ -0,0 +1,759 @@ +/* + * Copyright (c) 2017 comsuisse AG + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include +#include + +#define I2S_DEV_NODE DT_ALIAS(i2s_node0) + +#define BLOCK_SIZE CONFIG_I2S_TEST_BUFFER_SIZE + +#define NUM_BLOCKS 4 +#define TIMEOUT 2000 + +#ifdef CONFIG_NOCACHE_MEMORY + #define MEM_SLAB_CACHE_ATTR __nocache +#else + #define MEM_SLAB_CACHE_ATTR +#endif /* CONFIG_NOCACHE_MEMORY */ + +/* Random data with no meaning. */ +static uint8_t data[] = { + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, + 0x10, 0x20, 0x40, 0x80, 0xAA, 0x55, 0x55, 0xAA, + 0xfe, 0xef, 0xfe, 0xee, 0x00, 0x01, 0x02, 0x04, + 0x0e, 0x12, 0x01, 0x80, 0x81, 0x18, 0xAA, 0x55, +}; + +/* + * NUM_BLOCKS is the number of blocks used by the test. Some of the drivers, + * permanently keep ownership of a few RX buffers. Add a two more + * RX blocks to satisfy this requirement + */ +static char MEM_SLAB_CACHE_ATTR __aligned(WB_UP(32)) + _k_mem_slab_buf_rx_0_mem_slab[(NUM_BLOCKS + 2) * WB_UP(BLOCK_SIZE)]; +STRUCT_SECTION_ITERABLE(k_mem_slab, rx_0_mem_slab) = + Z_MEM_SLAB_INITIALIZER(rx_0_mem_slab, _k_mem_slab_buf_rx_0_mem_slab, + WB_UP(BLOCK_SIZE), NUM_BLOCKS + 2); + +static char MEM_SLAB_CACHE_ATTR __aligned(WB_UP(32)) + _k_mem_slab_buf_tx_0_mem_slab[(NUM_BLOCKS) * WB_UP(BLOCK_SIZE)]; +STRUCT_SECTION_ITERABLE(k_mem_slab, tx_0_mem_slab) = + Z_MEM_SLAB_INITIALIZER(tx_0_mem_slab, _k_mem_slab_buf_tx_0_mem_slab, + WB_UP(BLOCK_SIZE), NUM_BLOCKS); + +static const struct device *dev_i2s = DEVICE_DT_GET_OR_NULL(I2S_DEV_NODE); + +static const struct i2s_config default_i2s_cfg = { + .word_size = 16U, + .channels = 2U, + .format = I2S_FMT_DATA_FORMAT_I2S, + .frame_clk_freq = 44100U, + .block_size = BLOCK_SIZE, + .timeout = TIMEOUT, + .options = I2S_OPT_FRAME_CLK_MASTER | I2S_OPT_BIT_CLK_MASTER, + .mem_slab = &tx_0_mem_slab, +}; + +#if (CONFIG_I2S_TEST_ALLOWED_DATA_OFFSET > 0) +/* Data offset may differ from test to test if + * number of audio channels or word size has changed. + */ +static int offset; +#endif + +static void fill_buf(uint8_t *tx_block, uint8_t val) +{ + for (int i = 0; i < BLOCK_SIZE; i++) { + tx_block[i] = data[i] + val; + } +} + +static int verify_buf(uint8_t *rx_block, uint8_t val, uint32_t offset_in_bytes) +{ + int sample_no = BLOCK_SIZE; + bool data_match = true; + +#if (CONFIG_I2S_TEST_ALLOWED_DATA_OFFSET > 0) + /* Offset -1 means that offset has to be detected. */ + if (offset < 0) { + do { + ++offset; + if (offset > offset_in_bytes) { + TC_PRINT("Allowed data offset exceeded\n"); + return -TC_FAIL; + } + } while (rx_block[offset] != data[0] + val); + + TC_PRINT("Using data offset: %d bytes\n", offset); + } + + rx_block += offset; + sample_no -= offset; +#else + ARG_UNUSED(offset_in_bytes); +#endif + + for (int i = 0; i < sample_no; i++) { + if (rx_block[i] != (uint8_t) (data[i] + val)) { + data_match = false; + break; + } + } + + /* Workaround for issue resulting from limited performance when buffer is small. + * When new write buffer is not delivered on time, previous buffer is retransmitted. + * + * (In the test, each buffer is contens of `data` with each byte incresed by `val`. + * `val` is equal to TX block number = 0, 1, 2,...) + */ + if (!data_match) { + TC_PRINT("%u RX block: Compare with data sent earlier (workaround).\n", val); + data_match = true; + for (int i = 0; i < sample_no; i++) { + if (rx_block[i] != (uint8_t) (data[i] + val - 1)) { + data_match = false; + break; + } + } + } + + if (!data_match) { + TC_PRINT("Index: Expected | Received\n"); + for (int i = 0; i < sample_no; i++) { + TC_PRINT("%u: 0x%02X | 0x%02X\n", + i, (uint8_t) (data[i] + val), rx_block[i]); + } + return -TC_FAIL; + } + + return TC_PASS; +} + +static int configure_stream(const struct device *dev, enum i2s_dir dir, + struct i2s_config *i2s_cfg) +{ + int ret; + + if (dir == I2S_DIR_TX) { + /* Configure the Transmit port as Master */ + i2s_cfg->options = I2S_OPT_FRAME_CLK_MASTER | I2S_OPT_BIT_CLK_MASTER; + } else if (dir == I2S_DIR_RX) { + /* Configure the Receive port as Slave */ + i2s_cfg->options = I2S_OPT_FRAME_CLK_SLAVE | I2S_OPT_BIT_CLK_SLAVE; + } else { /* dir == I2S_DIR_BOTH */ + i2s_cfg->options = I2S_OPT_FRAME_CLK_MASTER | I2S_OPT_BIT_CLK_MASTER; + } + + if (dir == I2S_DIR_TX || dir == I2S_DIR_BOTH) { + i2s_cfg->mem_slab = &tx_0_mem_slab; + ret = i2s_configure(dev, I2S_DIR_TX, i2s_cfg); + if (ret < 0) { + TC_PRINT("Failed to configure I2S TX stream (%d)\n", ret); + return ret; + } + } + + if (dir == I2S_DIR_RX || dir == I2S_DIR_BOTH) { + i2s_cfg->mem_slab = &rx_0_mem_slab; + ret = i2s_configure(dev, I2S_DIR_RX, i2s_cfg); + if (ret < 0) { + TC_PRINT("Failed to configure I2S RX stream (%d)\n", ret); + return ret; + } + } + + return TC_PASS; +} + +static void i2s_dir_both_transfer_long(struct i2s_config *i2s_cfg, uint32_t offset_in_bytes) +{ + void *rx_block[NUM_BLOCKS]; + void *tx_block[NUM_BLOCKS]; + size_t rx_size; + int tx_idx; + int rx_idx = 0; + int num_verified; + int ret; + + /* Configure I2S Dir Both transfer. */ + ret = configure_stream(dev_i2s, I2S_DIR_BOTH, i2s_cfg); +#if defined(CONFIG_I2S_TEST_BLOCK_SIZE_8_UNSUPPORTED) && (CONFIG_I2S_TEST_BUFFER_SIZE == 8) + zassert_equal(ret, -EINVAL, "Unexpected result %d", ret); + TC_PRINT("No communication check due to unsupported buffer size.\n"); + return; +#else + zassert_equal(ret, TC_PASS); +#endif + + /* Prepare TX data blocks */ + for (tx_idx = 0; tx_idx < NUM_BLOCKS; tx_idx++) { + ret = k_mem_slab_alloc(&tx_0_mem_slab, &tx_block[tx_idx], K_FOREVER); + zassert_equal(ret, 0); + fill_buf((uint8_t *)tx_block[tx_idx], tx_idx); + } + + tx_idx = 0; + + /* Prefill TX queue */ + ret = i2s_write(dev_i2s, tx_block[tx_idx++], BLOCK_SIZE); + zassert_equal(ret, 0); + + ret = i2s_write(dev_i2s, tx_block[tx_idx++], BLOCK_SIZE); + zassert_equal(ret, 0); + + ret = i2s_trigger(dev_i2s, I2S_DIR_BOTH, I2S_TRIGGER_START); + zassert_equal(ret, 0, "RX/TX START trigger failed\n"); + + while (tx_idx < NUM_BLOCKS) { + ret = i2s_write(dev_i2s, tx_block[tx_idx++], BLOCK_SIZE); + zassert_equal(ret, 0); + + ret = i2s_read(dev_i2s, &rx_block[rx_idx++], &rx_size); + zassert_equal(ret, 0, "Got unexpected %d", ret); + zassert_equal(rx_size, BLOCK_SIZE); + } + + /* All data written, drain TX queue and stop both streams. */ + ret = i2s_trigger(dev_i2s, I2S_DIR_BOTH, I2S_TRIGGER_DRAIN); + zassert_equal(ret, 0, "RX/TX DRAIN trigger failed"); + + ret = i2s_read(dev_i2s, &rx_block[rx_idx++], &rx_size); + zassert_equal(ret, 0); + zassert_equal(rx_size, BLOCK_SIZE); + + ret = i2s_read(dev_i2s, &rx_block[rx_idx++], &rx_size); + zassert_equal(ret, 0); + zassert_equal(rx_size, BLOCK_SIZE); + + TC_PRINT("%d TX blocks sent\n", tx_idx); + TC_PRINT("%d RX blocks received\n", rx_idx); + + /* Verify received data */ + num_verified = 0; + for (rx_idx = 0; rx_idx < NUM_BLOCKS; rx_idx++) { + ret = verify_buf((uint8_t *)rx_block[rx_idx], rx_idx, offset_in_bytes); + if (ret != 0) { + TC_PRINT("Validation failed for %d RX block\n", rx_idx); + } else { + num_verified++; + } + k_mem_slab_free(&rx_0_mem_slab, rx_block[rx_idx]); + } + zassert_equal(num_verified, NUM_BLOCKS, "Invalid RX blocks received"); +} + +static uint32_t check_test_configuration(struct i2s_config *i2s_cfg) +{ + /* Convert max allowed offset in audio samples to bytes of data. */ + uint32_t offset_in_bytes = CONFIG_I2S_TEST_ALLOWED_DATA_OFFSET * i2s_cfg->channels + * (i2s_cfg->word_size / 8); + + /* Skip test if allowed offset is same or larger than the buffer. */ + if (offset_in_bytes >= CONFIG_I2S_TEST_BUFFER_SIZE) { + TC_PRINT("Allowed data offset is to big for this test.\n"); + ztest_test_skip(); + } + + return offset_in_bytes; +} + +/* + * 1 audio channel, 8 bit word + */ +ZTEST(i2s_buffer, test_1ch_08bit_at_08000) +{ + struct i2s_config i2s_cfg = default_i2s_cfg; + uint32_t offset_in_bytes; + + i2s_cfg.channels = 1U; + i2s_cfg.word_size = 8U; + i2s_cfg.frame_clk_freq = 8000; + + offset_in_bytes = check_test_configuration(&i2s_cfg); + + i2s_dir_both_transfer_long(&i2s_cfg, offset_in_bytes); +} + +ZTEST(i2s_buffer, test_1ch_08bit_at_16000) +{ + struct i2s_config i2s_cfg = default_i2s_cfg; + uint32_t offset_in_bytes; + + i2s_cfg.channels = 1U; + i2s_cfg.word_size = 8U; + i2s_cfg.frame_clk_freq = 16000; + + offset_in_bytes = check_test_configuration(&i2s_cfg); + + i2s_dir_both_transfer_long(&i2s_cfg, offset_in_bytes); +} + +ZTEST(i2s_buffer, test_1ch_08bit_at_32000) +{ + struct i2s_config i2s_cfg = default_i2s_cfg; + uint32_t offset_in_bytes; + + i2s_cfg.channels = 1U; + i2s_cfg.word_size = 8U; + i2s_cfg.frame_clk_freq = 32000; + + offset_in_bytes = check_test_configuration(&i2s_cfg); + + i2s_dir_both_transfer_long(&i2s_cfg, offset_in_bytes); +} + +ZTEST(i2s_buffer, test_1ch_08bit_at_44100) +{ + struct i2s_config i2s_cfg = default_i2s_cfg; + uint32_t offset_in_bytes; + + i2s_cfg.channels = 1U; + i2s_cfg.word_size = 8U; + i2s_cfg.frame_clk_freq = 44100; + + offset_in_bytes = check_test_configuration(&i2s_cfg); + + i2s_dir_both_transfer_long(&i2s_cfg, offset_in_bytes); +} + +ZTEST(i2s_buffer, test_1ch_08bit_at_48000) +{ + struct i2s_config i2s_cfg = default_i2s_cfg; + uint32_t offset_in_bytes; + + i2s_cfg.channels = 1U; + i2s_cfg.word_size = 8U; + i2s_cfg.frame_clk_freq = 48000; + + offset_in_bytes = check_test_configuration(&i2s_cfg); + + i2s_dir_both_transfer_long(&i2s_cfg, offset_in_bytes); +} + + +/* + * 2 audio channels, 8 bit word + */ +ZTEST(i2s_buffer, test_2ch_08bit_at_08000) +{ + struct i2s_config i2s_cfg = default_i2s_cfg; + uint32_t offset_in_bytes; + + i2s_cfg.channels = 2U; + i2s_cfg.word_size = 8U; + i2s_cfg.frame_clk_freq = 8000; + + offset_in_bytes = check_test_configuration(&i2s_cfg); + + i2s_dir_both_transfer_long(&i2s_cfg, offset_in_bytes); +} + +ZTEST(i2s_buffer, test_2ch_08bit_at_16000) +{ + struct i2s_config i2s_cfg = default_i2s_cfg; + uint32_t offset_in_bytes; + + i2s_cfg.channels = 2U; + i2s_cfg.word_size = 8U; + i2s_cfg.frame_clk_freq = 16000; + + offset_in_bytes = check_test_configuration(&i2s_cfg); + + i2s_dir_both_transfer_long(&i2s_cfg, offset_in_bytes); +} + +ZTEST(i2s_buffer, test_2ch_08bit_at_32000) +{ + struct i2s_config i2s_cfg = default_i2s_cfg; + uint32_t offset_in_bytes; + + i2s_cfg.channels = 2U; + i2s_cfg.word_size = 8U; + i2s_cfg.frame_clk_freq = 32000; + + offset_in_bytes = check_test_configuration(&i2s_cfg); + + i2s_dir_both_transfer_long(&i2s_cfg, offset_in_bytes); +} + +ZTEST(i2s_buffer, test_2ch_08bit_at_44100) +{ + struct i2s_config i2s_cfg = default_i2s_cfg; + uint32_t offset_in_bytes; + + i2s_cfg.channels = 2U; + i2s_cfg.word_size = 8U; + i2s_cfg.frame_clk_freq = 44100; + + offset_in_bytes = check_test_configuration(&i2s_cfg); + + i2s_dir_both_transfer_long(&i2s_cfg, offset_in_bytes); +} + +ZTEST(i2s_buffer, test_2ch_08bit_at_48000) +{ + struct i2s_config i2s_cfg = default_i2s_cfg; + uint32_t offset_in_bytes; + + i2s_cfg.channels = 2U; + i2s_cfg.word_size = 8U; + i2s_cfg.frame_clk_freq = 48000; + + offset_in_bytes = check_test_configuration(&i2s_cfg); + + i2s_dir_both_transfer_long(&i2s_cfg, offset_in_bytes); +} + + +/* + * 1 audio channel, 16 bit word + */ +ZTEST(i2s_buffer, test_1ch_16bit_at_08000) +{ + struct i2s_config i2s_cfg = default_i2s_cfg; + uint32_t offset_in_bytes; + + i2s_cfg.channels = 1U; + i2s_cfg.word_size = 16U; + i2s_cfg.frame_clk_freq = 8000; + + offset_in_bytes = check_test_configuration(&i2s_cfg); + + i2s_dir_both_transfer_long(&i2s_cfg, offset_in_bytes); +} + +ZTEST(i2s_buffer, test_1ch_16bit_at_16000) +{ + struct i2s_config i2s_cfg = default_i2s_cfg; + uint32_t offset_in_bytes; + + i2s_cfg.channels = 1U; + i2s_cfg.word_size = 16U; + i2s_cfg.frame_clk_freq = 16000; + + offset_in_bytes = check_test_configuration(&i2s_cfg); + + i2s_dir_both_transfer_long(&i2s_cfg, offset_in_bytes); +} + +ZTEST(i2s_buffer, test_1ch_16bit_at_32000) +{ + struct i2s_config i2s_cfg = default_i2s_cfg; + uint32_t offset_in_bytes; + + i2s_cfg.channels = 1U; + i2s_cfg.word_size = 16U; + i2s_cfg.frame_clk_freq = 32000; + + offset_in_bytes = check_test_configuration(&i2s_cfg); + + i2s_dir_both_transfer_long(&i2s_cfg, offset_in_bytes); +} + +ZTEST(i2s_buffer, test_1ch_16bit_at_44100) +{ + struct i2s_config i2s_cfg = default_i2s_cfg; + uint32_t offset_in_bytes; + + i2s_cfg.channels = 1U; + i2s_cfg.word_size = 16U; + i2s_cfg.frame_clk_freq = 44100; + + offset_in_bytes = check_test_configuration(&i2s_cfg); + + i2s_dir_both_transfer_long(&i2s_cfg, offset_in_bytes); +} + +ZTEST(i2s_buffer, test_1ch_16bit_at_48000) +{ + struct i2s_config i2s_cfg = default_i2s_cfg; + uint32_t offset_in_bytes; + + i2s_cfg.channels = 1U; + i2s_cfg.word_size = 16U; + i2s_cfg.frame_clk_freq = 48000; + + offset_in_bytes = check_test_configuration(&i2s_cfg); + + i2s_dir_both_transfer_long(&i2s_cfg, offset_in_bytes); +} + + +/* + * 2 audio channels, 16 bit word + */ +ZTEST(i2s_buffer, test_2ch_16bit_at_08000) +{ + struct i2s_config i2s_cfg = default_i2s_cfg; + uint32_t offset_in_bytes; + + i2s_cfg.channels = 2U; + i2s_cfg.word_size = 16U; + i2s_cfg.frame_clk_freq = 8000; + + offset_in_bytes = check_test_configuration(&i2s_cfg); + + i2s_dir_both_transfer_long(&i2s_cfg, offset_in_bytes); +} + +ZTEST(i2s_buffer, test_2ch_16bit_at_16000) +{ + struct i2s_config i2s_cfg = default_i2s_cfg; + uint32_t offset_in_bytes; + + i2s_cfg.channels = 2U; + i2s_cfg.word_size = 16U; + i2s_cfg.frame_clk_freq = 16000; + + offset_in_bytes = check_test_configuration(&i2s_cfg); + + i2s_dir_both_transfer_long(&i2s_cfg, offset_in_bytes); +} + +ZTEST(i2s_buffer, test_2ch_16bit_at_32000) +{ + struct i2s_config i2s_cfg = default_i2s_cfg; + uint32_t offset_in_bytes; + + i2s_cfg.channels = 2U; + i2s_cfg.word_size = 16U; + i2s_cfg.frame_clk_freq = 32000; + + offset_in_bytes = check_test_configuration(&i2s_cfg); + + i2s_dir_both_transfer_long(&i2s_cfg, offset_in_bytes); +} + +ZTEST(i2s_buffer, test_2ch_16bit_at_44100) +{ + struct i2s_config i2s_cfg = default_i2s_cfg; + uint32_t offset_in_bytes; + + i2s_cfg.channels = 2U; + i2s_cfg.word_size = 16U; + i2s_cfg.frame_clk_freq = 44100; + + offset_in_bytes = check_test_configuration(&i2s_cfg); + + i2s_dir_both_transfer_long(&i2s_cfg, offset_in_bytes); +} + +ZTEST(i2s_buffer, test_2ch_16bit_at_48000) +{ + struct i2s_config i2s_cfg = default_i2s_cfg; + uint32_t offset_in_bytes; + + i2s_cfg.channels = 2U; + i2s_cfg.word_size = 16U; + i2s_cfg.frame_clk_freq = 48000; + + offset_in_bytes = check_test_configuration(&i2s_cfg); + + i2s_dir_both_transfer_long(&i2s_cfg, offset_in_bytes); +} + + +/* + * 1 audio channel, 32 bit word + */ +ZTEST(i2s_buffer, test_1ch_32bit_at_08000) +{ + Z_TEST_SKIP_IFDEF(CONFIG_I2S_TEST_WORD_SIZE_32_BIT_UNSUPPORTED); + + struct i2s_config i2s_cfg = default_i2s_cfg; + uint32_t offset_in_bytes; + + i2s_cfg.channels = 1U; + i2s_cfg.word_size = 32U; + i2s_cfg.frame_clk_freq = 8000; + + offset_in_bytes = check_test_configuration(&i2s_cfg); + + i2s_dir_both_transfer_long(&i2s_cfg, offset_in_bytes); +} + +ZTEST(i2s_buffer, test_1ch_32bit_at_16000) +{ + Z_TEST_SKIP_IFDEF(CONFIG_I2S_TEST_WORD_SIZE_32_BIT_UNSUPPORTED); + + struct i2s_config i2s_cfg = default_i2s_cfg; + uint32_t offset_in_bytes; + + i2s_cfg.channels = 1U; + i2s_cfg.word_size = 32U; + i2s_cfg.frame_clk_freq = 16000; + + offset_in_bytes = check_test_configuration(&i2s_cfg); + + i2s_dir_both_transfer_long(&i2s_cfg, offset_in_bytes); +} + +ZTEST(i2s_buffer, test_1ch_32bit_at_32000) +{ + Z_TEST_SKIP_IFDEF(CONFIG_I2S_TEST_WORD_SIZE_32_BIT_UNSUPPORTED); + + struct i2s_config i2s_cfg = default_i2s_cfg; + uint32_t offset_in_bytes; + + i2s_cfg.channels = 1U; + i2s_cfg.word_size = 32U; + i2s_cfg.frame_clk_freq = 32000; + + offset_in_bytes = check_test_configuration(&i2s_cfg); + + i2s_dir_both_transfer_long(&i2s_cfg, offset_in_bytes); +} + +ZTEST(i2s_buffer, test_1ch_32bit_at_44100) +{ + Z_TEST_SKIP_IFDEF(CONFIG_I2S_TEST_WORD_SIZE_32_BIT_UNSUPPORTED); + + struct i2s_config i2s_cfg = default_i2s_cfg; + uint32_t offset_in_bytes; + + i2s_cfg.channels = 1U; + i2s_cfg.word_size = 32U; + i2s_cfg.frame_clk_freq = 44100; + + offset_in_bytes = check_test_configuration(&i2s_cfg); + + i2s_dir_both_transfer_long(&i2s_cfg, offset_in_bytes); +} + +ZTEST(i2s_buffer, test_1ch_32bit_at_48000) +{ + Z_TEST_SKIP_IFDEF(CONFIG_I2S_TEST_WORD_SIZE_32_BIT_UNSUPPORTED); + + struct i2s_config i2s_cfg = default_i2s_cfg; + uint32_t offset_in_bytes; + + i2s_cfg.channels = 1U; + i2s_cfg.word_size = 32U; + i2s_cfg.frame_clk_freq = 48000; + + offset_in_bytes = check_test_configuration(&i2s_cfg); + + i2s_dir_both_transfer_long(&i2s_cfg, offset_in_bytes); +} + + +/* + * 2 audio channels, 32 bit word + */ +ZTEST(i2s_buffer, test_2ch_32bit_at_08000) +{ + Z_TEST_SKIP_IFDEF(CONFIG_I2S_TEST_WORD_SIZE_32_BIT_UNSUPPORTED); + + struct i2s_config i2s_cfg = default_i2s_cfg; + uint32_t offset_in_bytes; + + i2s_cfg.channels = 2U; + i2s_cfg.word_size = 32U; + i2s_cfg.frame_clk_freq = 8000; + + offset_in_bytes = check_test_configuration(&i2s_cfg); + + i2s_dir_both_transfer_long(&i2s_cfg, offset_in_bytes); +} + +ZTEST(i2s_buffer, test_2ch_32bit_at_16000) +{ + Z_TEST_SKIP_IFDEF(CONFIG_I2S_TEST_WORD_SIZE_32_BIT_UNSUPPORTED); + + struct i2s_config i2s_cfg = default_i2s_cfg; + uint32_t offset_in_bytes; + + i2s_cfg.channels = 2U; + i2s_cfg.word_size = 32U; + i2s_cfg.frame_clk_freq = 16000; + + offset_in_bytes = check_test_configuration(&i2s_cfg); + + i2s_dir_both_transfer_long(&i2s_cfg, offset_in_bytes); +} + +ZTEST(i2s_buffer, test_2ch_32bit_at_32000) +{ + Z_TEST_SKIP_IFDEF(CONFIG_I2S_TEST_WORD_SIZE_32_BIT_UNSUPPORTED); + + struct i2s_config i2s_cfg = default_i2s_cfg; + uint32_t offset_in_bytes; + + i2s_cfg.channels = 2U; + i2s_cfg.word_size = 32U; + i2s_cfg.frame_clk_freq = 32000; + + offset_in_bytes = check_test_configuration(&i2s_cfg); + + i2s_dir_both_transfer_long(&i2s_cfg, offset_in_bytes); +} + +ZTEST(i2s_buffer, test_2ch_32bit_at_44100) +{ + Z_TEST_SKIP_IFDEF(CONFIG_I2S_TEST_WORD_SIZE_32_BIT_UNSUPPORTED); + + struct i2s_config i2s_cfg = default_i2s_cfg; + uint32_t offset_in_bytes; + + i2s_cfg.channels = 2U; + i2s_cfg.word_size = 32U; + i2s_cfg.frame_clk_freq = 44100; + + offset_in_bytes = check_test_configuration(&i2s_cfg); + + i2s_dir_both_transfer_long(&i2s_cfg, offset_in_bytes); +} + +ZTEST(i2s_buffer, test_2ch_32bit_at_48000) +{ + Z_TEST_SKIP_IFDEF(CONFIG_I2S_TEST_WORD_SIZE_32_BIT_UNSUPPORTED); + + struct i2s_config i2s_cfg = default_i2s_cfg; + uint32_t offset_in_bytes; + + i2s_cfg.channels = 2U; + i2s_cfg.word_size = 32U; + i2s_cfg.frame_clk_freq = 48000; + + offset_in_bytes = check_test_configuration(&i2s_cfg); + + i2s_dir_both_transfer_long(&i2s_cfg, offset_in_bytes); +} + + +static void *suite_setup(void) +{ + TC_PRINT("I2S buffer size test on %s\n", CONFIG_BOARD_TARGET); + TC_PRINT("Testing I2S device %s\n", dev_i2s->name); + TC_PRINT("BUFFER_SIZE = %d\n", CONFIG_I2S_TEST_BUFFER_SIZE); + + /* Check I2S Device. */ + zassert_not_null(dev_i2s, "I2S device not found"); + zassert(device_is_ready(dev_i2s), "I2S device not ready"); + + TC_PRINT("===================================================================\n"); + + return 0; +} + +static void before(void *not_used) +{ + ARG_UNUSED(not_used); + +#if (CONFIG_I2S_TEST_ALLOWED_DATA_OFFSET > 0) + /* Data offset may differ when test uses I2S + * with different configuration. + * Force offset callculation for every test. + */ + offset = -1; +#endif +} + +ZTEST_SUITE(i2s_buffer, NULL, suite_setup, before, NULL, NULL); diff --git a/tests/drivers/i2s/i2s_buffer/testcase.yaml b/tests/drivers/i2s/i2s_buffer/testcase.yaml new file mode 100644 index 000000000000..d1d2b3bb55fb --- /dev/null +++ b/tests/drivers/i2s/i2s_buffer/testcase.yaml @@ -0,0 +1,104 @@ +common: + tags: + - drivers + - i2s + - ci_tests_zephyr_drivers_i2s + depends_on: + - i2s + - gpio + harness: ztest + +tests: + # buffer of 8 bytes + drivers.i2s.i2s_buffer.8bytes: + harness_config: + fixture: gpio_loopback + extra_args: + - CONFIG_I2S_TEST_BUFFER_SIZE=8 + platform_allow: + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf54l15dk/nrf54l15/cpuapp + - nrf54lm20dk/nrf54lm20a/cpuapp + integration_platforms: + - nrf54l15dk/nrf54l15/cpuapp + drivers.i2s.i2s_buffer.8bytes.aclk: + harness_config: + fixture: gpio_loopback + extra_args: + - EXTRA_DTC_OVERLAY_FILE="boards/nrf5340dk_nrf5340_cpuapp_aclk.overlay" + - CONFIG_I2S_TEST_BUFFER_SIZE=8 + platform_allow: + - nrf5340dk/nrf5340/cpuapp + integration_platforms: + - nrf5340dk/nrf5340/cpuapp + drivers.i2s.i2s_buffer.8bytes.nrf54h: + harness_config: + fixture: i2s_loopback + extra_args: + - CONFIG_I2S_TEST_BUFFER_SIZE=8 + platform_allow: + - nrf54h20dk/nrf54h20/cpuapp + integration_platforms: + - nrf54h20dk/nrf54h20/cpuapp + + # buffer of 16 bytes + drivers.i2s.i2s_buffer.16bytes: + harness_config: + fixture: gpio_loopback + platform_allow: + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf54l15dk/nrf54l15/cpuapp + - nrf54lm20dk/nrf54lm20a/cpuapp + integration_platforms: + - nrf54l15dk/nrf54l15/cpuapp + drivers.i2s.i2s_buffer.16bytes.aclk: + harness_config: + fixture: gpio_loopback + extra_args: + - EXTRA_DTC_OVERLAY_FILE="boards/nrf5340dk_nrf5340_cpuapp_aclk.overlay" + platform_allow: + - nrf5340dk/nrf5340/cpuapp + integration_platforms: + - nrf5340dk/nrf5340/cpuapp + drivers.i2s.i2s_buffer.16bytes.nrf54h: + harness_config: + fixture: i2s_loopback + platform_allow: + - nrf54h20dk/nrf54h20/cpuapp + integration_platforms: + - nrf54h20dk/nrf54h20/cpuapp + + # buffer of 24 bytes + drivers.i2s.i2s_buffer.24bytes: + harness_config: + fixture: gpio_loopback + extra_args: + - CONFIG_I2S_TEST_BUFFER_SIZE=24 + platform_allow: + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf54l15dk/nrf54l15/cpuapp + - nrf54lm20dk/nrf54lm20a/cpuapp + integration_platforms: + - nrf54l15dk/nrf54l15/cpuapp + drivers.i2s.i2s_buffer.24bytes.aclk: + harness_config: + fixture: gpio_loopback + extra_args: + - EXTRA_DTC_OVERLAY_FILE="boards/nrf5340dk_nrf5340_cpuapp_aclk.overlay" + - CONFIG_I2S_TEST_BUFFER_SIZE=24 + platform_allow: + - nrf5340dk/nrf5340/cpuapp + integration_platforms: + - nrf5340dk/nrf5340/cpuapp + drivers.i2s.i2s_buffer.24bytes.nrf54h: + harness_config: + fixture: i2s_loopback + extra_args: + - CONFIG_I2S_TEST_BUFFER_SIZE=24 + platform_allow: + - nrf54h20dk/nrf54h20/cpuapp + integration_platforms: + - nrf54h20dk/nrf54h20/cpuapp diff --git a/tests/drivers/i2s/i2s_instances/boards/nrf7120pdk_nrf7120_cpuapp.overlay b/tests/drivers/i2s/i2s_instances/boards/nrf7120pdk_nrf7120_cpuapp.overlay new file mode 100644 index 000000000000..5c7c0e4b7b25 --- /dev/null +++ b/tests/drivers/i2s/i2s_instances/boards/nrf7120pdk_nrf7120_cpuapp.overlay @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +&pinctrl { + tdm_default_test: tdm_default_test { + group1 { + psels = , + , + , + ; + }; + }; +}; + +&tdm { + status = "okay"; + pinctrl-0 = <&tdm_default_test>; + pinctrl-names = "default"; + sck-clock-source = "ACLK"; +}; diff --git a/tests/drivers/i2s/i2s_instances/testcase.yaml b/tests/drivers/i2s/i2s_instances/testcase.yaml index a8aabe610313..80b4c92c4e4f 100644 --- a/tests/drivers/i2s/i2s_instances/testcase.yaml +++ b/tests/drivers/i2s/i2s_instances/testcase.yaml @@ -11,5 +11,6 @@ tests: - nrf54h20dk/nrf54h20/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf7120pdk/nrf7120/cpuapp integration_platforms: - nrf54h20dk/nrf54h20/cpuapp diff --git a/tests/drivers/i2s/i2s_latency/boards/nrf7120pdk_nrf7120_cpuapp.overlay b/tests/drivers/i2s/i2s_latency/boards/nrf7120pdk_nrf7120_cpuapp.overlay new file mode 100644 index 000000000000..2d5409b1195f --- /dev/null +++ b/tests/drivers/i2s/i2s_latency/boards/nrf7120pdk_nrf7120_cpuapp.overlay @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/ { + aliases { + tst-timer = &timer20; + }; +}; + +&pinctrl { + tdm20_default_test: tdm20_default_test { + group1 { + psels = , + , + , + ; + }; + }; +}; + +i2s_dut: &tdm { + status = "okay"; + pinctrl-0 = <&tdm20_default_test>; + pinctrl-names = "default"; +}; + +&timer20 { + status = "okay"; +}; diff --git a/tests/drivers/i2s/i2s_latency/testcase.yaml b/tests/drivers/i2s/i2s_latency/testcase.yaml index 1524ee8a98e7..50364ada6779 100644 --- a/tests/drivers/i2s/i2s_latency/testcase.yaml +++ b/tests/drivers/i2s/i2s_latency/testcase.yaml @@ -9,6 +9,7 @@ tests: - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp - nrf54l15dk/nrf54l15/cpuapp + - nrf7120pdk/nrf7120/cpuapp integration_platforms: - nrf54l15dk/nrf54l15/cpuapp harness: ztest @@ -21,6 +22,7 @@ tests: - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp - nrf54l15dk/nrf54l15/cpuapp + - nrf7120pdk/nrf7120/cpuapp integration_platforms: - nrf54l15dk/nrf54l15/cpuapp harness: ztest @@ -32,6 +34,7 @@ tests: platform_allow: - nrf5340dk/nrf5340/cpuapp - nrf54l15dk/nrf54l15/cpuapp + - nrf7120pdk/nrf7120/cpuapp integration_platforms: - nrf54l15dk/nrf54l15/cpuapp harness: ztest diff --git a/tests/drivers/i2s/i2s_mclk/boards/nrf7120pdk_nrf7120_cpuapp.conf b/tests/drivers/i2s/i2s_mclk/boards/nrf7120pdk_nrf7120_cpuapp.conf new file mode 100644 index 000000000000..b21efebbc862 --- /dev/null +++ b/tests/drivers/i2s/i2s_mclk/boards/nrf7120pdk_nrf7120_cpuapp.conf @@ -0,0 +1 @@ +CONFIG_I2S_TEST_SKIP_I2S_DIR_RX=y diff --git a/tests/drivers/i2s/i2s_mclk/boards/nrf7120pdk_nrf7120_cpuapp.overlay b/tests/drivers/i2s/i2s_mclk/boards/nrf7120pdk_nrf7120_cpuapp.overlay new file mode 100644 index 000000000000..1e2e7fe14769 --- /dev/null +++ b/tests/drivers/i2s/i2s_mclk/boards/nrf7120pdk_nrf7120_cpuapp.overlay @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/* i2s-node0 is the transmitter/receiver */ + +/ { + aliases { + i2s-node0 = &tdm; + }; + + zephyr,user { + gpios = <&gpio1 0 GPIO_ACTIVE_HIGH>, /* Connect with TDM_MCK */ + <&gpio1 11 GPIO_ACTIVE_HIGH>; /* Connect with TDM_FSYNC_M */ + }; +}; + +&gpio1 { + status = "okay"; +}; + +&gpiote20 { + status = "okay"; +}; + +&pinctrl { + tdm_default_alt: tdm_default_alt { + group1 { + psels = , + , + , + , /* TDM_SDOUT shorted to TDM_SDIN */ + ; + }; + }; +}; + +&tdm { + status = "okay"; + pinctrl-0 = <&tdm_default_alt>; + pinctrl-names = "default"; + mck-frequency = <64000>; +}; diff --git a/tests/drivers/i2s/i2s_mclk/boards/tdm_mck_audio_auxpll.overlay b/tests/drivers/i2s/i2s_mclk/boards/tdm_mck_audio_auxpll.overlay new file mode 100644 index 000000000000..c4012dc5fe87 --- /dev/null +++ b/tests/drivers/i2s/i2s_mclk/boards/tdm_mck_audio_auxpll.overlay @@ -0,0 +1,13 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +&tdm { + mck-clock-source = "ACLK"; +}; + +&audio_auxpll { + status = "okay"; +}; diff --git a/tests/drivers/i2s/i2s_mclk/boards/tdm_sck_audio_auxpll.overlay b/tests/drivers/i2s/i2s_mclk/boards/tdm_sck_audio_auxpll.overlay new file mode 100644 index 000000000000..92ea4373f57d --- /dev/null +++ b/tests/drivers/i2s/i2s_mclk/boards/tdm_sck_audio_auxpll.overlay @@ -0,0 +1,13 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +&tdm { + sck-clock-source = "ACLK"; +}; + +&audio_auxpll { + status = "okay"; +}; diff --git a/tests/drivers/i2s/i2s_mclk/testcase.yaml b/tests/drivers/i2s/i2s_mclk/testcase.yaml index 8fc4c701b544..0671dddb31bd 100644 --- a/tests/drivers/i2s/i2s_mclk/testcase.yaml +++ b/tests/drivers/i2s/i2s_mclk/testcase.yaml @@ -17,8 +17,10 @@ tests: - nrf52840dk/nrf52840 - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf7120pdk/nrf7120/cpuapp integration_platforms: - nrf54lm20dk/nrf54lm20a/cpuapp + drivers.i2s.i2s_mclk.gpio_loopback.2ch.54h: harness_config: fixture: i2s_loopback @@ -27,6 +29,17 @@ tests: integration_platforms: - nrf54h20dk/nrf54h20/cpuapp + drivers.i2s.i2s_mclk.gpio_loopback.4ch: + harness_config: + fixture: gpio_loopback + extra_args: + - CONFIG_I2S_TEST_NUMBER_OF_CHANNELS=4 + platform_allow: + - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf7120pdk/nrf7120/cpuapp + integration_platforms: + - nrf54lm20dk/nrf54lm20a/cpuapp + drivers.i2s.i2s_mclk.gpio_loopback.4ch.54h: harness_config: fixture: i2s_loopback @@ -37,13 +50,16 @@ tests: integration_platforms: - nrf54h20dk/nrf54h20/cpuapp - drivers.i2s.i2s_mclk.gpio_loopback.4ch.54lm: + drivers.i2s.i2s_mclk.gpio_loopback.8ch: harness_config: fixture: gpio_loopback extra_args: - - CONFIG_I2S_TEST_NUMBER_OF_CHANNELS=4 + - CONFIG_I2S_TEST_NUMBER_OF_CHANNELS=8 platform_allow: - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf7120pdk/nrf7120/cpuapp + integration_platforms: + - nrf54lm20dk/nrf54lm20a/cpuapp drivers.i2s.i2s_mclk.gpio_loopback.8ch.54h: harness_config: @@ -55,25 +71,27 @@ tests: integration_platforms: - nrf54h20dk/nrf54h20/cpuapp - drivers.i2s.i2s_mclk.gpio_loopback.8ch.54lm: + drivers.i2s.i2s_mclk.gpio_loopback.2ch.aclk_sck: harness_config: fixture: gpio_loopback - extra_args: - - CONFIG_I2S_TEST_NUMBER_OF_CHANNELS=8 platform_allow: - - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf7120pdk/nrf7120/cpuapp + integration_platforms: + - nrf7120pdk/nrf7120/cpuapp + extra_args: + - EXTRA_DTC_OVERLAY_FILE="boards/tdm_sck_audio_auxpll.overlay" - drivers.i2s.i2s_mclk.gpio_loopback.2ch.54h.aclk_sck: + drivers.i2s.i2s_mclk.gpio_loopback.2ch.aclk_sck.54h: harness_config: fixture: i2s_loopback - extra_args: - - EXTRA_DTC_OVERLAY_FILE="boards/tdm_sck_audiopll.overlay" platform_allow: - nrf54h20dk/nrf54h20/cpuapp integration_platforms: - nrf54h20dk/nrf54h20/cpuapp + extra_args: + - EXTRA_DTC_OVERLAY_FILE="boards/tdm_sck_audiopll.overlay" - drivers.i2s.i2s_mclk.gpio_loopback.2ch.54h.aclk_mck: + drivers.i2s.i2s_mclk.gpio_loopback.2ch.aclk_mck.54h: harness_config: fixture: i2s_loopback extra_args: @@ -83,12 +101,23 @@ tests: integration_platforms: - nrf54h20dk/nrf54h20/cpuapp - drivers.i2s.i2s_mclk.gpio_loopback.2ch.54h.aclk_mck_sck: + drivers.i2s.i2s_mclk.gpio_loopback.2ch.aclk_mck_sck: harness_config: - fixture: i2s_loopback + fixture: gpio_loopback + platform_allow: + - nrf7120pdk/nrf7120/cpuapp + integration_platforms: + - nrf7120pdk/nrf7120/cpuapp extra_args: - - EXTRA_DTC_OVERLAY_FILE="boards/tdm_mck_audiopll.overlay boards/tdm_sck_audiopll.overlay" + - EXTRA_DTC_OVERLAY_FILE="boards/tdm_mck_audio_auxpll.overlay + boards/tdm_sck_audio_auxpll.overlay" + + drivers.i2s.i2s_mclk.gpio_loopback.2ch.aclk_mck_sck.54h: + harness_config: + fixture: i2s_loopback platform_allow: - nrf54h20dk/nrf54h20/cpuapp integration_platforms: - nrf54h20dk/nrf54h20/cpuapp + extra_args: + - EXTRA_DTC_OVERLAY_FILE="boards/tdm_mck_audiopll.overlay boards/tdm_sck_audiopll.overlay" diff --git a/tests/drivers/pwm/pwm_events/CMakeLists.txt b/tests/drivers/pwm/pwm_events/CMakeLists.txt new file mode 100644 index 000000000000..9f95b160c6fc --- /dev/null +++ b/tests/drivers/pwm/pwm_events/CMakeLists.txt @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + +cmake_minimum_required(VERSION 3.20.0) + +find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) +project(pwm_events) + +target_sources(app PRIVATE src/main.c) diff --git a/tests/drivers/pwm/pwm_events/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/drivers/pwm/pwm_events/boards/nrf54h20dk_nrf54h20_cpuapp.overlay new file mode 100644 index 000000000000..1d534946b507 --- /dev/null +++ b/tests/drivers/pwm/pwm_events/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +dut_pwm: &pwm130 { + status = "okay"; +}; + +tst_timer: &timer131 { + status = "okay"; +}; + +&dppic133 { + owned-channels = <1>; + sink-channels = <1>; + status = "okay"; +}; + +pwm_led: &led3 { + status = "okay"; +}; + +debug_pin: &led1 { + status = "okay"; +}; diff --git a/tests/drivers/pwm/pwm_events/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/tests/drivers/pwm/pwm_events/boards/nrf54l15dk_nrf54l15_cpuapp.overlay new file mode 100644 index 000000000000..c3ad86a33111 --- /dev/null +++ b/tests/drivers/pwm/pwm_events/boards/nrf54l15dk_nrf54l15_cpuapp.overlay @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +dut_pwm: &pwm20 { + status = "okay"; +}; + +tst_timer: &timer20 { + status = "okay"; +}; + +&dppic20 { + status = "okay"; +}; + +pwm_led: &led3 { + status = "okay"; +}; + +debug_pin: &led1 { + status = "okay"; +}; diff --git a/tests/drivers/pwm/pwm_events/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/drivers/pwm/pwm_events/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay new file mode 100644 index 000000000000..c3ad86a33111 --- /dev/null +++ b/tests/drivers/pwm/pwm_events/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +dut_pwm: &pwm20 { + status = "okay"; +}; + +tst_timer: &timer20 { + status = "okay"; +}; + +&dppic20 { + status = "okay"; +}; + +pwm_led: &led3 { + status = "okay"; +}; + +debug_pin: &led1 { + status = "okay"; +}; diff --git a/tests/drivers/pwm/pwm_events/boards/nrf54ls05dk_nrf54ls05b_cpuapp.overlay b/tests/drivers/pwm/pwm_events/boards/nrf54ls05dk_nrf54ls05b_cpuapp.overlay new file mode 100644 index 000000000000..72670ffbfb3b --- /dev/null +++ b/tests/drivers/pwm/pwm_events/boards/nrf54ls05dk_nrf54ls05b_cpuapp.overlay @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +dut_pwm: &pwm20 { + status = "okay"; +}; + +tst_timer: &timer20 { + status = "okay"; +}; + +&dppic20 { + status = "okay"; +}; + +pwm_led: &led0 { + status = "okay"; +}; + +debug_pin: &led1 { + status = "okay"; +}; diff --git a/tests/drivers/pwm/pwm_events/prj.conf b/tests/drivers/pwm/pwm_events/prj.conf new file mode 100644 index 000000000000..84730bb7a104 --- /dev/null +++ b/tests/drivers/pwm/pwm_events/prj.conf @@ -0,0 +1,8 @@ +CONFIG_NRFX_PWM=y +CONFIG_NRFX_TIMER=y +CONFIG_NRFX_GPPI=y + +CONFIG_ZTEST=y + +# Enable for debugging purposes only +CONFIG_PPI_TRACE=n diff --git a/tests/drivers/pwm/pwm_events/src/main.c b/tests/drivers/pwm/pwm_events/src/main.c new file mode 100644 index 000000000000..102728946390 --- /dev/null +++ b/tests/drivers/pwm/pwm_events/src/main.c @@ -0,0 +1,175 @@ +/* + * Copyright (c) 2025, Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include +#include +#include + +#define PWM_OUTPUT_PIN NRF_DT_GPIOS_TO_PSEL(DT_NODELABEL(pwm_led), gpios) + +#if defined(CONFIG_PPI_TRACE) +#define DEBUG_PIN NRF_DT_GPIOS_TO_PSEL(DT_NODELABEL(debug_pin), gpios) +#endif + +#define SLEEP_TIME_MS 500 + +struct pwm_events_fixture { + nrfx_pwm_t *pwm; + nrf_pwm_sequence_t *pwm_sequence; + nrfx_timer_t *test_timer; + uint32_t timer_task_address; + uint32_t domain_id; + nrfx_gppi_handle_t gppi_handle; +}; + +static void configure_pwm(nrfx_pwm_t *pwm) +{ + nrfx_pwm_config_t pwm_config = + NRFX_PWM_DEFAULT_CONFIG(PWM_OUTPUT_PIN, NRF_PWM_PIN_NOT_CONNECTED, + NRF_PWM_PIN_NOT_CONNECTED, NRF_PWM_PIN_NOT_CONNECTED); + + pwm_config.count_mode = NRF_PWM_MODE_UP_AND_DOWN; + pwm_config.top_value = 0x1000; + + zassert_ok(nrfx_pwm_init(pwm, &pwm_config, NULL, NULL), "NRFX PWM init failed\n"); +} + +static uint32_t configure_test_timer(nrfx_timer_t *timer) +{ + uint32_t base_frequency = NRF_TIMER_BASE_FREQUENCY_GET(timer->p_reg); + nrfx_timer_config_t timer_config = NRFX_TIMER_DEFAULT_CONFIG(base_frequency); + + timer_config.bit_width = NRF_TIMER_BIT_WIDTH_16; + timer_config.mode = NRF_TIMER_MODE_COUNTER; + + TC_PRINT("Timer base frequency: %d Hz\n", base_frequency); + + zassert_ok(nrfx_timer_init(timer, &timer_config, NULL), "Timer init failed\n"); + nrfx_timer_enable(timer); + + return nrfx_timer_task_address_get(timer, NRF_TIMER_TASK_COUNT); +} + +static void setup_dppi_connection(nrfx_gppi_handle_t *gppi_handle, uint32_t domain_id, + uint32_t timer_task_address, uint32_t pwm_event_address) +{ + zassert_ok(nrfx_gppi_conn_alloc(pwm_event_address, timer_task_address, gppi_handle), + "Failed to allocate DPPI connection\n"); + nrfx_gppi_conn_enable(*gppi_handle); +} + +static void clear_dppi_connection(nrfx_gppi_handle_t *gppi_handle, uint32_t domain_id, + uint32_t timer_task_address, uint32_t pwm_event_address) +{ + nrfx_gppi_conn_disable(*gppi_handle); + nrfx_gppi_conn_free(pwm_event_address, timer_task_address, *gppi_handle); +} + +static void run_pwm_event_test_case(struct pwm_events_fixture *fixture, + nrf_pwm_event_t tested_pwm_event, + uint32_t expected_triggers_count, char *event_name) +{ + uint32_t pwm_event_address; + uint32_t timer_cc_before, timer_cc_after; + +#if defined(CONFIG_PPI_TRACE) + void *handle; +#endif + + pwm_event_address = nrf_pwm_event_address_get(fixture->pwm->p_reg, tested_pwm_event); + setup_dppi_connection(&fixture->gppi_handle, fixture->domain_id, + fixture->timer_task_address, pwm_event_address); + nrf_pwm_event_clear(fixture->pwm->p_reg, tested_pwm_event); + +#if defined(CONFIG_PPI_TRACE) + /* + * Note that configuring PPI trace + * will break DPPI connection to the timer. + * Timer will not count events + */ + handle = ppi_trace_config(DEBUG_PIN, pwm_event_address); + zassert_not_null(handle, "PPI trace configuration failed\n"); + ppi_trace_enable(handle); +#endif + + + timer_cc_before = nrfx_timer_capture(fixture->test_timer, NRF_TIMER_CC_CHANNEL0); + nrfx_pwm_simple_playback(fixture->pwm, fixture->pwm_sequence, 1, NRFX_PWM_FLAG_STOP); + k_msleep(SLEEP_TIME_MS); + timer_cc_after = nrfx_timer_capture(fixture->test_timer, NRF_TIMER_CC_CHANNEL0); + + TC_PRINT("PWM %s events count: %d\n", event_name, timer_cc_after - timer_cc_before); + zassert_equal(timer_cc_after - timer_cc_before, expected_triggers_count, + "PWM %s event triggered count != %u\n", event_name, expected_triggers_count); + + nrf_pwm_event_clear(fixture->pwm->p_reg, tested_pwm_event); + clear_dppi_connection(&fixture->gppi_handle, fixture->domain_id, + fixture->timer_task_address, pwm_event_address); + +#if defined(CONFIG_PPI_TRACE) + ppi_trace_disable(handle); +#endif +} + +ZTEST_F(pwm_events, test_pwm_stop_event) +{ + run_pwm_event_test_case(fixture, NRF_PWM_EVENT_STOPPED, 1, "STOP"); +} + +ZTEST_F(pwm_events, test_pwm_seqstarted_event) +{ + run_pwm_event_test_case(fixture, NRF_PWM_EVENT_SEQSTARTED1, 1, "SEQSTARTED1"); +} + +ZTEST_F(pwm_events, test_pwm_seqend_event) +{ + run_pwm_event_test_case(fixture, NRF_PWM_EVENT_SEQEND1, 1, "SEQEND1"); +} + +ZTEST_F(pwm_events, test_pwm_periodend_event) +{ + run_pwm_event_test_case(fixture, NRF_PWM_EVENT_PWMPERIODEND, fixture->pwm_sequence->length, + "PWMPERIODEND"); +} + +ZTEST_F(pwm_events, test_pwm_loopsdone_event) +{ + run_pwm_event_test_case(fixture, NRF_PWM_EVENT_LOOPSDONE, 1, "LOOPSDONE"); +} + +ZTEST_F(pwm_events, test_pwm_comparematch_event) +{ + run_pwm_event_test_case(fixture, offsetof(NRF_PWM_Type, EVENTS_COMPAREMATCH[0]), + fixture->pwm_sequence->length * 2, "COMPAREMATCH"); +} + +static void *test_setup(void) +{ + static struct pwm_events_fixture fixture; + static nrfx_timer_t test_timer = NRFX_TIMER_INSTANCE(DT_REG_ADDR(DT_NODELABEL(tst_timer))); + static nrfx_pwm_t pwm = NRFX_PWM_INSTANCE(DT_REG_ADDR(DT_NODELABEL(dut_pwm))); + static nrf_pwm_values_common_t pwm_duty_cycle_values[] = {0x500, 0x600, 0x500, 0x600}; + static nrf_pwm_sequence_t pwm_sequence = {.values = {pwm_duty_cycle_values}, + .length = ARRAY_SIZE(pwm_duty_cycle_values), + .repeats = 0, + .end_delay = 0}; + + fixture.pwm = &pwm; + fixture.pwm_sequence = &pwm_sequence; + configure_pwm(&pwm); + + fixture.test_timer = &test_timer; + fixture.timer_task_address = configure_test_timer(&test_timer); + + fixture.domain_id = nrfx_gppi_domain_id_get((uint32_t)test_timer.p_reg); + + return &fixture; +} + +ZTEST_SUITE(pwm_events, NULL, test_setup, NULL, NULL, NULL); diff --git a/tests/drivers/pwm/pwm_events/testcase.yaml b/tests/drivers/pwm/pwm_events/testcase.yaml new file mode 100644 index 000000000000..f3d498767ad5 --- /dev/null +++ b/tests/drivers/pwm/pwm_events/testcase.yaml @@ -0,0 +1,16 @@ +common: + tags: + - drivers + - ci_tests_drivers_pwm + harness: ztest + timeout: 20 + +tests: + drivers.pwm.pwm_events: + platform_allow: + - nrf54h20dk/nrf54h20/cpuapp + - nrf54l15dk/nrf54l15/cpuapp + - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54ls05dk/nrf54ls05b/cpuapp + integration_platforms: + - nrf54l15dk/nrf54l15/cpuapp diff --git a/tests/drivers/spi/spim_pan/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/drivers/spi/spim_pan/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index 4f000ae90a99..ebf833ee8afc 100644 --- a/tests/drivers/spi/spim_pan/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/tests/drivers/spi/spim_pan/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -41,10 +41,20 @@ dut_spi: &spi130 { dut_spi_dt: test-spi-dev@0 { compatible = "vnd,spi-device"; reg = <0>; - spi-max-frequency = ; + spi-max-frequency = ; }; }; &exmif { status = "disabled"; }; + +tst_timer: &timer131 { + status = "okay"; +}; + +&dppic133 { + owned-channels = <1>; + sink-channels = <1>; + status = "okay"; +}; diff --git a/tests/drivers/spi/spim_pan/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/tests/drivers/spi/spim_pan/boards/nrf54l15dk_nrf54l15_cpuapp.overlay index 4d44f1b97039..b3b8b57096a8 100644 --- a/tests/drivers/spi/spim_pan/boards/nrf54l15dk_nrf54l15_cpuapp.overlay +++ b/tests/drivers/spi/spim_pan/boards/nrf54l15dk_nrf54l15_cpuapp.overlay @@ -40,10 +40,18 @@ dut_spi: &spi21 { dut_spi_dt: test-spi-dev@0 { compatible = "vnd,spi-device"; reg = <0>; - spi-max-frequency = ; + spi-max-frequency = ; }; }; &gpio1 { status = "okay"; }; + +tst_timer: &timer20 { + status = "okay"; +}; + +&dppic20 { + status = "okay"; +}; diff --git a/tests/drivers/spi/spim_pan/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/drivers/spi/spim_pan/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay index f53d97531b47..e8996c45b817 100644 --- a/tests/drivers/spi/spim_pan/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ b/tests/drivers/spi/spim_pan/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay @@ -40,10 +40,18 @@ dut_spi: &spi21 { dut_spi_dt: test-spi-dev@0 { compatible = "vnd,spi-device"; reg = <0>; - spi-max-frequency = ; + spi-max-frequency = ; }; }; &gpio1 { status = "okay"; }; + +tst_timer: &timer20 { + status = "okay"; +}; + +&dppic20 { + status = "okay"; +}; diff --git a/tests/drivers/spi/spim_pan/boards/nrf54ls05dk_nrf54ls05b_cpuapp.overlay b/tests/drivers/spi/spim_pan/boards/nrf54ls05dk_nrf54ls05b_cpuapp.overlay index 93ce94a4d86e..04f3533fc633 100644 --- a/tests/drivers/spi/spim_pan/boards/nrf54ls05dk_nrf54ls05b_cpuapp.overlay +++ b/tests/drivers/spi/spim_pan/boards/nrf54ls05dk_nrf54ls05b_cpuapp.overlay @@ -40,10 +40,18 @@ dut_spi: &spi21 { dut_spi_dt: test-spi-dev@0 { compatible = "vnd,spi-device"; reg = <0>; - spi-max-frequency = ; + spi-max-frequency = ; }; }; &gpio1 { status = "okay"; }; + +tst_timer: &timer20 { + status = "okay"; +}; + +&dppic20 { + status = "okay"; +}; diff --git a/tests/drivers/spi/spim_pan/boards/nrf54lv10dk_nrf54lv10a_cpuapp.overlay b/tests/drivers/spi/spim_pan/boards/nrf54lv10dk_nrf54lv10a_cpuapp.overlay index 93ce94a4d86e..04f3533fc633 100644 --- a/tests/drivers/spi/spim_pan/boards/nrf54lv10dk_nrf54lv10a_cpuapp.overlay +++ b/tests/drivers/spi/spim_pan/boards/nrf54lv10dk_nrf54lv10a_cpuapp.overlay @@ -40,10 +40,18 @@ dut_spi: &spi21 { dut_spi_dt: test-spi-dev@0 { compatible = "vnd,spi-device"; reg = <0>; - spi-max-frequency = ; + spi-max-frequency = ; }; }; &gpio1 { status = "okay"; }; + +tst_timer: &timer20 { + status = "okay"; +}; + +&dppic20 { + status = "okay"; +}; diff --git a/tests/drivers/spi/spim_pan/boards/nrf54lxx_cpuapp_fast.overlay b/tests/drivers/spi/spim_pan/boards/nrf54lxx_cpuapp_fast.overlay new file mode 100644 index 000000000000..c7451a416ee0 --- /dev/null +++ b/tests/drivers/spi/spim_pan/boards/nrf54lxx_cpuapp_fast.overlay @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +&pinctrl { + dut_spi_default: dut_spi_default { + group1 { + psels = , + , + ; + }; + }; + + dut_spi_sleep: dut_spi_sleep { + group1 { + psels = , + , + ; + low-power-enable; + }; + }; +}; + +dut_spi_fast: &spi00 { + compatible = "nordic,nrf-spim"; + status = "okay"; + pinctrl-0 = <&dut_spi_default>; + pinctrl-1 = <&dut_spi_sleep>; + pinctrl-names = "default", "sleep"; + overrun-character = <0x00>; + zephyr,pm-device-runtime-auto; + cs-gpios = <&gpio2 5 GPIO_ACTIVE_LOW>; + + dut_spi_dt: test-spi-dev@0 { + compatible = "vnd,spi-device"; + reg = <0>; + spi-max-frequency = ; + }; +}; + +&gpio2 { + status = "okay"; +}; + +tst_timer: &timer20 { + status = "okay"; +}; + +&dppic20 { + status = "okay"; +}; + +&mx25r64 { + status = "disabled"; +}; diff --git a/tests/drivers/spi/spim_pan/prj.conf b/tests/drivers/spi/spim_pan/prj.conf index 2358254598b3..5e49c0fe6f2b 100644 --- a/tests/drivers/spi/spim_pan/prj.conf +++ b/tests/drivers/spi/spim_pan/prj.conf @@ -1,3 +1,6 @@ CONFIG_SPI=y CONFIG_ZTEST=y + +CONFIG_NRFX_TIMER=y +CONFIG_NRFX_GPPI=y diff --git a/tests/drivers/spi/spim_pan/src/main.c b/tests/drivers/spi/spim_pan/src/main.c index 68689e228d63..a6653ca71231 100644 --- a/tests/drivers/spi/spim_pan/src/main.c +++ b/tests/drivers/spi/spim_pan/src/main.c @@ -8,14 +8,33 @@ #include #include #include +#include #include +#include +#include + +/* SPI MODE 0 */ #define SPI_MODE (SPI_OP_MODE_MASTER | SPI_WORD_SET(8) | SPI_LINES_SINGLE | SPI_TRANSFER_MSB) -#define TEST_BUFFER_SIZE 8 +#if DT_NODE_EXISTS(DT_NODELABEL(dut_spi_fast)) +#define DUT_SPI_NODE DT_NODELABEL(dut_spi_fast) +#define DUT_SPI_FAST 1 +#define TEST_BUFFER_SIZE 4 +#define MX25R64_RDID 0x9F +#define MX25R64_MFG_ID 0xC2 +#define MX25R64_MEM_TYPE 0x28 +#define MX25R64_MEM_DENSITY 0x17 +#define MAX_READ_REPEATS 10 +#else +#define DUT_SPI_NODE DT_NODELABEL(dut_spi) +#define TEST_BUFFER_SIZE 64 +#endif static struct spi_dt_spec spim_spec = SPI_DT_SPEC_GET(DT_NODELABEL(dut_spi_dt), SPI_MODE, 0); -NRF_SPIM_Type *spim_reg = (NRF_SPIM_Type *)DT_REG_ADDR(DT_NODELABEL(dut_spi)); +NRF_SPIM_Type *spim_reg = (NRF_SPIM_Type *)DT_REG_ADDR(DUT_SPI_NODE); + +static nrfx_timer_t test_timer = NRFX_TIMER_INSTANCE(DT_REG_ADDR(DT_NODELABEL(tst_timer))); #define MEMORY_SECTION(node) \ COND_CODE_1(DT_NODE_HAS_PROP(node, memory_regions), \ @@ -39,16 +58,34 @@ static void set_buffers(void) memset(rx_buffer, 0xFF, TEST_BUFFER_SIZE); } +static uint32_t configure_test_timer(nrfx_timer_t *timer) +{ + uint32_t base_frequency = NRF_TIMER_BASE_FREQUENCY_GET(timer->p_reg); + nrfx_timer_config_t timer_config = NRFX_TIMER_DEFAULT_CONFIG(base_frequency); + + timer_config.bit_width = NRF_TIMER_BIT_WIDTH_16; + timer_config.mode = NRF_TIMER_MODE_COUNTER; + + TC_PRINT("Timer base frequency: %d Hz\n", base_frequency); + + zassert_ok(nrfx_timer_init(timer, &timer_config, NULL), "Timer init failed\n"); + nrfx_timer_enable(timer); + + return nrfx_timer_task_address_get(timer, NRF_TIMER_TASK_COUNT); +} + /* * Reference: MLTPAN-8 * Requirements to trigger the PAN workaround * CPHA = 0 (configured in SPI_MODE) - * PRESCALER > 2 (16 for 1MHz) + * PRESCALER > 2 (4 for 4MHz) * First transmitted bit is 1 (0x8B, MSB) */ -ZTEST(spim_pan, test_spim_pan_workaround) +ZTEST(spim_pan, test_spim_mltpan_8_workaround) { + Z_TEST_SKIP_IFDEF(DUT_SPI_FAST); + int err; struct spi_buf tx_spi_buf = {.buf = tx_buffer, .len = TEST_BUFFER_SIZE}; @@ -59,13 +96,143 @@ ZTEST(spim_pan, test_spim_pan_workaround) set_buffers(); + err = spi_transceive_dt(&spim_spec, &tx_spi_buf_set, &rx_spi_buf_set); TC_PRINT("SPIM prescaler: %u\n", spim_reg->PRESCALER); zassert_true(spim_reg->PRESCALER > 2, "SPIM prescaler is not greater than 2\n"); + zassert_ok(err, "SPI transceive failed: %d\n", err); + zassert_mem_equal(tx_buffer, rx_buffer, TEST_BUFFER_SIZE, "TX buffer != RX buffer\n"); +} + +/* + * Reference: MLTPAN-55 + * Requirements to trigger the PAN workaround + * MODE 0 or MODE 2 (CPHA = 0) + * PRESCALER = 4 (4 MHz) for SPIM2x and SPIM3x + * RX.MAXCNT lower than TX.MAXCNT + */ + +ZTEST(spim_pan, test_spim_mltpan_55_workaround) +{ + Z_TEST_SKIP_IFDEF(DUT_SPI_FAST); + + int err; + + uint8_t ppi_channel; + + uint32_t domain_id; + nrfx_gppi_handle_t gppi_handle; + + uint32_t timer_cc_before, timer_cc_after; + + uint32_t timer_task; + uint32_t spim_event; + + struct spi_buf tx_spi_buf = {.buf = tx_buffer, .len = TEST_BUFFER_SIZE}; + struct spi_buf_set tx_spi_buf_set = {.buffers = &tx_spi_buf, .count = 1}; + + struct spi_buf rx_spi_buf = {.buf = rx_buffer, .len = TEST_BUFFER_SIZE - 1}; + struct spi_buf_set rx_spi_buf_set = {.buffers = &rx_spi_buf, .count = 1}; + + set_buffers(); + + domain_id = nrfx_gppi_domain_id_get((uint32_t)test_timer.p_reg); + ppi_channel = nrfx_gppi_channel_alloc(domain_id); + zassert_true(ppi_channel > 0, "Failed to allocate GPPI channel"); + + timer_task = configure_test_timer(&test_timer); + spim_event = nrf_spim_event_address_get(spim_reg, NRF_SPIM_EVENT_END); + + zassert_ok(nrfx_gppi_conn_alloc(spim_event, timer_task, &gppi_handle), + "Failed to allocate DPPI connection\n"); + nrfx_gppi_conn_enable(gppi_handle); + + timer_cc_before = nrfx_timer_capture(&test_timer, NRF_TIMER_CC_CHANNEL0); err = spi_transceive_dt(&spim_spec, &tx_spi_buf_set, &rx_spi_buf_set); zassert_ok(err, "SPI transceive failed: %d\n", err); + timer_cc_after = nrfx_timer_capture(&test_timer, NRF_TIMER_CC_CHANNEL0); - zassert_mem_equal(tx_buffer, rx_buffer, TEST_BUFFER_SIZE, "TX buffer != RX buffer\n"); + TC_PRINT("Timer count before: %u, timer count after: %u\n", timer_cc_before, + timer_cc_after); + + zassert_true((timer_cc_after - timer_cc_before) > 0, + "NRF_SPIM_EVENT_END did not trigger\n"); + zassert_mem_equal(tx_buffer, rx_buffer, TEST_BUFFER_SIZE - 1, "TX buffer != RX buffer\n"); +} + +/* + * Reference: MLTPAN-57 + * SPIM00 does not operate as expected + * SPIM00 is the fast SPIM instance + * Requires workaround + */ + +ZTEST(spim_pan, test_spim_mltpan_57_workaround) +{ + Z_TEST_SKIP_IFNDEF(DUT_SPI_FAST); +#if defined(DUT_SPI_FAST) + int err; + + uint8_t ppi_channel; + + uint32_t domain_id; + nrfx_gppi_handle_t gppi_handle; + + uint32_t timer_cc_before, timer_cc_after, tx_amount; + + uint32_t timer_task; + uint32_t spim_event; + + memset(tx_buffer, 0xFF, TEST_BUFFER_SIZE); + tx_buffer[0] = MX25R64_RDID; + + domain_id = nrfx_gppi_domain_id_get((uint32_t)test_timer.p_reg); + ppi_channel = nrfx_gppi_channel_alloc(domain_id); + zassert_true(ppi_channel > 0, "Failed to allocate GPPI channel"); + + timer_task = configure_test_timer(&test_timer); + spim_event = nrf_spim_event_address_get(spim_reg, NRF_SPIM_EVENT_END); + + zassert_ok(nrfx_gppi_conn_alloc(spim_event, timer_task, &gppi_handle), + "Failed to allocate DPPI connection\n"); + nrfx_gppi_conn_enable(gppi_handle); + + struct spi_buf tx_spi_buf = {.buf = tx_buffer, .len = TEST_BUFFER_SIZE}; + struct spi_buf_set tx_spi_buf_set = {.buffers = &tx_spi_buf, .count = 1}; + + struct spi_buf rx_spi_buf = {.buf = rx_buffer, .len = TEST_BUFFER_SIZE}; + struct spi_buf_set rx_spi_buf_set = {.buffers = &rx_spi_buf, .count = 1}; + + for (int i = 0; i < MAX_READ_REPEATS; i++) { + TC_PRINT("RDID attempt %u\n", i + 1); + + timer_cc_before = nrfx_timer_capture(&test_timer, NRF_TIMER_CC_CHANNEL0); + err = spi_transceive_dt(&spim_spec, &tx_spi_buf_set, &rx_spi_buf_set); + timer_cc_after = nrfx_timer_capture(&test_timer, NRF_TIMER_CC_CHANNEL0); + TC_PRINT("SPIM prescaler: %u\n", spim_reg->PRESCALER); + zassert_ok(err, "SPI transceive failed: %d\n", err); + + tx_amount = nrf_spim_tx_amount_get(spim_reg); + TC_PRINT("END events count: %u\n", timer_cc_after - timer_cc_before); + TC_PRINT("TX.AMOUNT: %u\n", tx_amount); + + zassert_equal(timer_cc_after - timer_cc_before, 1, + "END event has not been generated\n"); + zassert_equal(tx_amount, ARRAY_SIZE(tx_buffer), "TX.AMOUNT != TX Buffer size\n"); + + for (int i = 0; i < ARRAY_SIZE(rx_buffer); i++) { + TC_PRINT("rx_buffer[%d] = 0x%x\n", i, rx_buffer[i]); + } + + /* First RX byte is dummy */ + zassert_equal(rx_buffer[1], MX25R64_MFG_ID, + "Read MX25R64 device ID is different than expected\n"); + zassert_equal(rx_buffer[2], MX25R64_MEM_TYPE, + "Read MX25R64 memory type is different than expected\n"); + zassert_equal(rx_buffer[3], MX25R64_MEM_DENSITY, + "Read MX25R64 memory density is different than expected\n"); + } +#endif } ZTEST_SUITE(spim_pan, NULL, test_setup, NULL, NULL, NULL); diff --git a/tests/drivers/spi/spim_pan/testcase.yaml b/tests/drivers/spi/spim_pan/testcase.yaml index 19fcb33900f7..453800519a3c 100644 --- a/tests/drivers/spi/spim_pan/testcase.yaml +++ b/tests/drivers/spi/spim_pan/testcase.yaml @@ -2,20 +2,31 @@ common: sysbuild: true depends_on: gpio harness: ztest - harness_config: - fixture: gpio_loopback tags: - drivers - spim - ci_tests_drivers_spi - platform_allow: - - nrf54h20dk/nrf54h20/cpuapp - - nrf54l15dk/nrf54l15/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf54ls05dk/nrf54ls05b/cpuapp - - nrf54lv10dk/nrf54lv10a/cpuapp - integration_platforms: - - nrf54l15dk/nrf54l15/cpuapp tests: - drivers.spim_pan: {} + drivers.spim_pan: + platform_allow: + - nrf54h20dk/nrf54h20/cpuapp + - nrf54l15dk/nrf54l15/cpuapp + - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54ls05dk/nrf54ls05b/cpuapp + - nrf54lv10dk/nrf54lv10a/cpuapp + integration_platforms: + - nrf54l15dk/nrf54l15/cpuapp + harness_config: + fixture: gpio_loopback + + drivers.spim_pan.fast: + platform_allow: + - nrf54l15dk/nrf54l15/cpuapp + - nrf54lm20dk/nrf54lm20a/cpuapp + integration_platforms: + - nrf54lm20dk/nrf54lm20a/cpuapp + extra_args: + - DTC_OVERLAY_FILE='boards/nrf54lxx_cpuapp_fast.overlay' + harness_config: + fixture: external_flash diff --git a/tests/drivers/watchdog/uicr_wdtstart/sysbuild/uicr.conf b/tests/drivers/watchdog/uicr_wdtstart/sysbuild/uicr.conf index 2c8705776e1d..1474f4d72718 100644 --- a/tests/drivers/watchdog/uicr_wdtstart/sysbuild/uicr.conf +++ b/tests/drivers/watchdog/uicr_wdtstart/sysbuild/uicr.conf @@ -1,6 +1,8 @@ # Copyright (c) 2025 Nordic Semiconductor ASA # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +CONFIG_IS_GEN_UICR_IMAGE=y + # Allow Ironside to configure and start WDT CONFIG_GEN_UICR_WDTSTART=y diff --git a/tests/lib/hw_id/src/kconfig_override_ble.h b/tests/lib/hw_id/src/kconfig_override_ble.h index 54c64e29d47f..d5a7bf3a04ae 100644 --- a/tests/lib/hw_id/src/kconfig_override_ble.h +++ b/tests/lib/hw_id/src/kconfig_override_ble.h @@ -4,4 +4,4 @@ * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause */ -#define CONFIG_HW_ID_LIBRARY_SOURCE_BLE_MAC y +#define CONFIG_HW_ID_LIBRARY_SOURCE_BT_DEVICE_ADDRESS y diff --git a/tests/lib/location/CMakeLists.txt b/tests/lib/location/CMakeLists.txt index 0aa8ff5b6ca7..6faec8e9dc0e 100644 --- a/tests/lib/location/CMakeLists.txt +++ b/tests/lib/location/CMakeLists.txt @@ -56,6 +56,8 @@ cmock_handle(${ZEPHYR_BASE}/include/zephyr/net/wifi_mgmt.h FUNC_EXCLUDE "NET_MGMT_DEFINE_REQUEST_HANDLER" FUNC_EXCLUDE "BUILD_ASSERT" FUNC_EXCLUDE "offsetof" + FUNC_EXCLUDE ".*wifi_mgmt_raise_p2p_device_found_event" + WORD_EXCLUDE ".*wifi_mgmt_raise_p2p_device_found_event.*" ) cmock_handle(${ZEPHYR_BASE}/include/zephyr/device.h FUNC_EXCLUDE ".*DEVICE_DT_NAME_GET" diff --git a/tests/lib/lte_lc_pdn/src/main.c b/tests/lib/lte_lc_pdn/src/main.c index 925fe0033809..965ef296d753 100644 --- a/tests/lib/lte_lc_pdn/src/main.c +++ b/tests/lib/lte_lc_pdn/src/main.c @@ -943,6 +943,8 @@ static void lte_lc_event_handler(const struct lte_lc_evt *const evt) case LTE_LC_EVT_PDN_DEACTIVATED: case LTE_LC_EVT_PDN_IPV6_UP: case LTE_LC_EVT_PDN_IPV6_DOWN: + case LTE_LC_EVT_PDN_SUSPENDED: + case LTE_LC_EVT_PDN_RESUMED: case LTE_LC_EVT_PDN_NETWORK_DETACH: case LTE_LC_EVT_PDN_APN_RATE_CONTROL_ON: case LTE_LC_EVT_PDN_APN_RATE_CONTROL_OFF: @@ -1388,6 +1390,22 @@ void test_lte_lc_pdn_deactivate(void) TEST_ASSERT_EQUAL(LTE_LC_EVT_PDN_DEACTIVATED, pdn_evt.pdn.type); } +void test_lte_lc_pdn_suspended(void) +{ + on_cgev("+CGEV: ME PDN SUSPENDED " STRINGIFY(CID_0) "\r\n"); + TEST_ASSERT_EQUAL(LTE_LC_EVT_PDN, pdn_evt.type); + TEST_ASSERT_EQUAL(LTE_LC_EVT_PDN_SUSPENDED, pdn_evt.pdn.type); + TEST_ASSERT_EQUAL(CID_0, pdn_evt.pdn.cid); +} + +void test_lte_lc_pdn_resumed(void) +{ + on_cgev("+CGEV: ME PDN RESUMED " STRINGIFY(CID_1) "\r\n"); + TEST_ASSERT_EQUAL(LTE_LC_EVT_PDN, pdn_evt.type); + TEST_ASSERT_EQUAL(LTE_LC_EVT_PDN_RESUMED, pdn_evt.pdn.type); + TEST_ASSERT_EQUAL(CID_1, pdn_evt.pdn.cid); +} + void test_lte_lc_pdn_detach(void) { on_cgev("+CGEV: NW DETACH\r\n"); diff --git a/tests/subsys/bluetooth/rpc_gatt_service/CMakeLists.txt b/tests/subsys/bluetooth/rpc_gatt_service/CMakeLists.txt new file mode 100644 index 000000000000..2ac48cfd6e84 --- /dev/null +++ b/tests/subsys/bluetooth/rpc_gatt_service/CMakeLists.txt @@ -0,0 +1,29 @@ +# +# Copyright (c) 2025 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +cmake_minimum_required(VERSION 3.20.0) + +find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) +project(bluetooth_rpc_gatt_service_test) + +FILE(GLOB app_sources src/*.c) + +target_include_directories(app PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/src + ${ZEPHYR_NRF_MODULE_DIR}/subsys/bluetooth/rpc/common +) + +# Include the source file directly for unit testing +target_sources(app PRIVATE + ${app_sources} + ${ZEPHYR_NRF_MODULE_DIR}/subsys/bluetooth/rpc/common/bt_rpc_gatt_common.c +) + +# Include test config header before compilation to define config values +# that aren't available via Kconfig without CONFIG_BT_RPC +target_compile_options(app PRIVATE + -include ${CMAKE_CURRENT_SOURCE_DIR}/src/test_config.h +) diff --git a/tests/subsys/bluetooth/rpc_gatt_service/prj.conf b/tests/subsys/bluetooth/rpc_gatt_service/prj.conf new file mode 100644 index 000000000000..6788ff2194a3 --- /dev/null +++ b/tests/subsys/bluetooth/rpc_gatt_service/prj.conf @@ -0,0 +1,10 @@ +CONFIG_ZTEST=y + + + +# Minimal configuration for testing service cache only +# Note: CONFIG_BT_RPC_GATT_SRV_MAX and CONFIG_BT_RPC_LOG_LEVEL are defined +# via compile definitions in CMakeLists.txt since they require CONFIG_BT_RPC + +# Logging (minimal) +CONFIG_LOG=y diff --git a/tests/subsys/bluetooth/rpc_gatt_service/src/log_stub.c b/tests/subsys/bluetooth/rpc_gatt_service/src/log_stub.c new file mode 100644 index 000000000000..f8d6d81e10b2 --- /dev/null +++ b/tests/subsys/bluetooth/rpc_gatt_service/src/log_stub.c @@ -0,0 +1,13 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + * + * Stub implementation for logging module to avoid linker errors + * when testing without full BT RPC stack + */ + +#include + +/* Stub the log constant structure that's normally generated */ +LOG_MODULE_REGISTER(BT_RPC, 4); diff --git a/tests/subsys/bluetooth/rpc_gatt_service/src/main.c b/tests/subsys/bluetooth/rpc_gatt_service/src/main.c new file mode 100644 index 000000000000..367fd619b7a0 --- /dev/null +++ b/tests/subsys/bluetooth/rpc_gatt_service/src/main.c @@ -0,0 +1,414 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include + + +#include + +/* Test helper: Get service count by checking until NULL */ +static size_t get_service_count(void) +{ + size_t count = 0; + + while (bt_rpc_gatt_get_service_by_index(count) != NULL) { + count++; + } + + return count; +} + +/* Test helper: Check if buffer is empty by verifying no services exist */ +static bool is_buffer_empty(void) +{ + return get_service_count() == 0; +} + +/* Test UUIDs - minimal structure for testing */ +static struct bt_uuid test_uuid_1 = {.type = 0x10}; +static struct bt_uuid test_uuid_2 = {.type = 0x11}; +static struct bt_uuid test_uuid_3 = {.type = 0x12}; + +/* Test attributes - minimal structure for testing */ +static struct bt_gatt_attr test_attrs_1[] = { + { + .uuid = &test_uuid_1, + .handle = 1, + .perm = 0, + .read = NULL, + .write = NULL, + .user_data = NULL, + }, + { + .uuid = &test_uuid_1, + .handle = 2, + .perm = 0, + .read = NULL, + .write = NULL, + .user_data = (void *)0x1234, + }, +}; + +static struct bt_gatt_attr test_attrs_2[] = { + { + .uuid = &test_uuid_2, + .handle = 3, + .perm = 0, + .read = NULL, + .write = NULL, + .user_data = NULL, + }, + { + .uuid = &test_uuid_2, + .handle = 4, + .perm = 0, + .read = NULL, + .write = NULL, + .user_data = (void *)0x5678, + }, +}; + +static struct bt_gatt_attr test_attrs_3[] = { + { + .uuid = &test_uuid_3, + .handle = 5, + .perm = 0, + .read = NULL, + .write = NULL, + .user_data = NULL, + }, + { + .uuid = &test_uuid_3, + .handle = 6, + .perm = 0, + .read = NULL, + .write = NULL, + .user_data = (void *)0x9ABC, + }, +}; + +static struct bt_gatt_service test_svc_1 = { + .attrs = test_attrs_1, + .attr_count = ARRAY_SIZE(test_attrs_1), +}; + +static struct bt_gatt_service test_svc_2 = { + .attrs = test_attrs_2, + .attr_count = ARRAY_SIZE(test_attrs_2), +}; + +static struct bt_gatt_service test_svc_3 = { + .attrs = test_attrs_3, + .attr_count = ARRAY_SIZE(test_attrs_3), +}; + +/** + * @brief Test setup - verify initial state is empty + */ +static void test_setup(void *fixture) +{ + ARG_UNUSED(fixture); + /* Verify initial state is empty */ + zassert_true(is_buffer_empty(), "Buffer should be empty initially"); +} + +/** + * @brief Test teardown - cleanup all services + */ +static void test_teardown(void *fixture) +{ + ARG_UNUSED(fixture); + size_t count = get_service_count(); + + /* Remove all services */ + for (size_t i = 0; i < count; i++) { + const struct bt_gatt_service *svc = bt_rpc_gatt_get_service_by_index(0); + + if (svc) { + bt_rpc_gatt_remove_service(svc); + } + } + + /* Verify cleanup */ + zassert_true(is_buffer_empty(), "Buffer should be empty after teardown"); +} + +/** + * @brief Test: Register a single service and verify it's added + */ +ZTEST(bt_rpc_gatt_service, test_register_single_service) +{ + uint32_t svc_index; + int err; + + /* Register service */ + err = bt_rpc_gatt_add_service(&test_svc_1, &svc_index); + zassert_equal(err, 0, "Service registration should succeed"); + zassert_equal(svc_index, 0, "First service should have index 0"); + + /* Verify service count */ + zassert_equal(get_service_count(), 1, "Service count should be 1"); + + /* Verify service can be retrieved */ + const struct bt_gatt_service *retrieved = bt_rpc_gatt_get_service_by_index(0); + + zassert_not_null(retrieved, "Service should be retrievable"); + zassert_equal(retrieved, &test_svc_1, "Retrieved service should match"); +} + +/** + * @brief Test: Register multiple services and verify all are added + */ +ZTEST(bt_rpc_gatt_service, test_register_multiple_services) +{ + uint32_t svc_index_1, svc_index_2, svc_index_3; + int err; + + /* Register first service */ + err = bt_rpc_gatt_add_service(&test_svc_1, &svc_index_1); + zassert_equal(err, 0, "First service registration should succeed"); + zassert_equal(svc_index_1, 0, "First service should have index 0"); + + /* Register second service */ + err = bt_rpc_gatt_add_service(&test_svc_2, &svc_index_2); + zassert_equal(err, 0, "Second service registration should succeed"); + zassert_equal(svc_index_2, 1, "Second service should have index 1"); + + /* Register third service */ + err = bt_rpc_gatt_add_service(&test_svc_3, &svc_index_3); + zassert_equal(err, 0, "Third service registration should succeed"); + zassert_equal(svc_index_3, 2, "Third service should have index 2"); + + /* Verify service count */ + zassert_equal(get_service_count(), 3, "Service count should be 3"); + + /* Verify all services can be retrieved */ + zassert_not_null(bt_rpc_gatt_get_service_by_index(0), "Service 0 should exist"); + zassert_not_null(bt_rpc_gatt_get_service_by_index(1), "Service 1 should exist"); + zassert_not_null(bt_rpc_gatt_get_service_by_index(2), "Service 2 should exist"); +} + +/** + * @brief Test: Deregister all services and verify buffer is reset + * + */ +ZTEST(bt_rpc_gatt_service, test_deregister_all_services_resets_buffer) +{ + uint32_t svc_index_1, svc_index_2, svc_index_3; + int err; + size_t initial_count, after_remove_count, final_count; + + /* Get initial state */ + initial_count = get_service_count(); + zassert_true(initial_count == 0, "Initial state should be empty"); + + /* Register 3 services */ + err = bt_rpc_gatt_add_service(&test_svc_1, &svc_index_1); + zassert_equal(err, 0, "Service 1 registration should succeed"); + + err = bt_rpc_gatt_add_service(&test_svc_2, &svc_index_2); + zassert_equal(err, 0, "Service 2 registration should succeed"); + + err = bt_rpc_gatt_add_service(&test_svc_3, &svc_index_3); + zassert_equal(err, 0, "Service 3 registration should succeed"); + + /* Verify all services are registered */ + zassert_equal(get_service_count(), 3, "All 3 services should be registered"); + + /* Remove first service */ + err = bt_rpc_gatt_remove_service(&test_svc_1); + zassert_equal(err, 0, "Service 1 removal should succeed"); + after_remove_count = get_service_count(); + zassert_equal(after_remove_count, 2, "Service count should be 2 after removing first"); + + /* Remove second service */ + err = bt_rpc_gatt_remove_service(&test_svc_2); + zassert_equal(err, 0, "Service 2 removal should succeed"); + zassert_equal(get_service_count(), 1, "Service count should be 1 after removing second"); + + /* Remove last service - this should trigger buffer reset */ + err = bt_rpc_gatt_remove_service(&test_svc_3); + zassert_equal(err, 0, "Service 3 removal should succeed"); + + /* Verify buffer is empty after removing all services */ + final_count = get_service_count(); + zassert_equal(final_count, 0, "Service count should be 0 after removing all services"); + zassert_true(is_buffer_empty(), "Buffer should be empty after removing all services"); + + /* Verify no services can be retrieved */ + zassert_is_null(bt_rpc_gatt_get_service_by_index(0), + "Service at index 0 should not exist after cleanup"); +} + +/** + * @brief Test: Multiple init/disable cycles + * + * This test simulates multiple bt_init/bt_disable cycles to ensure + * the buffer doesn't leak memory across cycles. + */ +ZTEST(bt_rpc_gatt_service, test_multiple_init_disable_cycles) +{ + const int num_cycles = 10; + uint32_t svc_index; + int err; + + for (int cycle = 0; cycle < num_cycles; cycle++) { + svc_index = (uint32_t)-1; + /* Verify initial state is empty */ + zassert_true(is_buffer_empty(), "Buffer should be empty at start of cycle %d", + cycle); + + /* Register service (simulating bt_init) */ + err = bt_rpc_gatt_add_service(&test_svc_1, &svc_index); + zassert_equal(err, 0, "Service registration should succeed in cycle %d", cycle); + zassert_equal(get_service_count(), 1, "Service count should be 1 in cycle %d", + cycle); + /* svc_index should be valid and when we retrieve the service by + * index it should be the same test_svc_1 that was added + */ + zassert_not_equal(svc_index, (uint32_t)-1, "svc_index should be valid in cycle %d", + cycle); + const struct bt_gatt_service *svc = bt_rpc_gatt_get_service_by_index(svc_index); + + zassert_not_null(svc, "Service should be retrievable by index in cycle %d", cycle); + zassert_equal_ptr(svc, &test_svc_1, + "Service at index should match test_svc_1 in cycle %d", cycle); + + /* Deregister service (simulating bt_disable) */ + err = bt_rpc_gatt_remove_service(&test_svc_1); + zassert_equal(err, 0, "Service removal should succeed in cycle %d", cycle); + + /* Verify buffer is empty after each cycle */ + zassert_true(is_buffer_empty(), "Buffer should be empty after cycle %d", cycle); + zassert_equal(get_service_count(), 0, "Service count should be 0 after cycle %d", + cycle); + } +} + +/** + * @brief Test: Remove services in different orders + */ +ZTEST(bt_rpc_gatt_service, test_remove_services_different_orders) +{ + uint32_t svc_index_1, svc_index_2, svc_index_3; + int err; + + /* Register 3 services */ + bt_rpc_gatt_add_service(&test_svc_1, &svc_index_1); + bt_rpc_gatt_add_service(&test_svc_2, &svc_index_2); + bt_rpc_gatt_add_service(&test_svc_3, &svc_index_3); + + zassert_equal(get_service_count(), 3, "All services should be registered"); + + /* Remove middle service first */ + err = bt_rpc_gatt_remove_service(&test_svc_2); + zassert_equal(err, 0, "Middle service removal should succeed"); + zassert_equal(get_service_count(), 2, "Service count should be 2"); + + /* Remove last service */ + err = bt_rpc_gatt_remove_service(&test_svc_3); + zassert_equal(err, 0, "Last service removal should succeed"); + zassert_equal(get_service_count(), 1, "Service count should be 1"); + + /* Remove first service (last remaining) */ + err = bt_rpc_gatt_remove_service(&test_svc_1); + zassert_equal(err, 0, "First service removal should succeed"); + + /* Verify buffer is empty */ + zassert_true(is_buffer_empty(), "Buffer should be empty after removing all services"); +} + +/** + * @brief Test: Service count should not exceed maximum even with many services + * + * This test adds services up to the maximum allowed and verifies that: + * 1. We can add up to CONFIG_BT_RPC_GATT_SRV_MAX services + * 2. Adding more than the maximum fails + * 3. Removing services allows adding new ones again + * 4. The count never exceeds the maximum + */ +ZTEST(bt_rpc_gatt_service, test_service_count_never_exceeds_maximum) +{ + const size_t max_services = CONFIG_BT_RPC_GATT_SRV_MAX; + struct bt_gatt_service test_services[10]; + struct bt_gatt_attr test_attrs_array[10][2]; + uint32_t svc_indices[10]; + int err; + size_t count; + + /* Create test services */ + for (size_t i = 0; i < 10; i++) { + test_attrs_array[i][0] = (struct bt_gatt_attr){ + .uuid = &test_uuid_1, + .handle = (uint16_t)(i * 10 + 1), + .perm = 0, + .read = NULL, + .write = NULL, + .user_data = NULL, + }; + test_attrs_array[i][1] = (struct bt_gatt_attr){ + .uuid = &test_uuid_1, + .handle = (uint16_t)(i * 10 + 2), + .perm = 0, + .read = NULL, + .write = NULL, + .user_data = (void *)(uintptr_t)(i + 100), + }; + test_services[i] = (struct bt_gatt_service){ + .attrs = test_attrs_array[i], + .attr_count = 2, + }; + } + + /* Add services up to maximum */ + for (size_t i = 0; i < max_services; i++) { + err = bt_rpc_gatt_add_service(&test_services[i], &svc_indices[i]); + zassert_equal(err, 0, "Adding service %zu should succeed", i); + count = get_service_count(); + zassert_equal(count, i + 1, "Service count should be %zu after adding service %zu", + i + 1, i); + zassert_true(count <= max_services, + "Service count (%zu) should not exceed maximum (%zu)", count, + max_services); + } + + /* Verify we're at maximum */ + count = get_service_count(); + zassert_equal(count, max_services, "Service count should equal maximum (%zu)", + max_services); + + /* Try to add one more - should fail */ + err = bt_rpc_gatt_add_service(&test_services[max_services], &svc_indices[max_services]); + zassert_not_equal(err, 0, "Adding service beyond maximum should fail"); + count = get_service_count(); + zassert_equal(count, max_services, "Service count should still be %zu after failed add", + max_services); + + /* Remove all services */ + for (size_t i = 0; i < max_services; i++) { + err = bt_rpc_gatt_remove_service(&test_services[i]); + zassert_equal(err, 0, "Removing service %zu should succeed", i); + count = get_service_count(); + zassert_equal(count, max_services - i - 1, + "Service count should be %zu after removing service %zu", + max_services - i - 1, i); + } + + /* Verify empty state */ + count = get_service_count(); + zassert_equal(count, 0, "Service count should be 0 after removing all"); + zassert_true(is_buffer_empty(), "Buffer should be empty after removing all services"); + + /* Now we should be able to add services again */ + err = bt_rpc_gatt_add_service(&test_svc_1, &svc_indices[0]); + zassert_equal(err, 0, "Should be able to add service after cleanup"); + count = get_service_count(); + zassert_equal(count, 1, "Service count should be 1 after re-adding"); +} + +ZTEST_SUITE(bt_rpc_gatt_service, NULL, NULL, test_setup, test_teardown, NULL); diff --git a/tests/subsys/bluetooth/rpc_gatt_service/src/nrf_rpc_cbor.h b/tests/subsys/bluetooth/rpc_gatt_service/src/nrf_rpc_cbor.h new file mode 100644 index 000000000000..f78ef9a6bb85 --- /dev/null +++ b/tests/subsys/bluetooth/rpc_gatt_service/src/nrf_rpc_cbor.h @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + * + * Stub header for nRF RPC CBOR types needed for unit testing + */ + +#ifndef NRF_RPC_CBOR_H_ +#define NRF_RPC_CBOR_H_ + +/* Forward declaration - full definition not needed for unit testing */ +struct nrf_rpc_cbor_ctx; + + +#endif /* NRF_RPC_CBOR_H_ */ diff --git a/tests/subsys/bluetooth/rpc_gatt_service/src/test_config.h b/tests/subsys/bluetooth/rpc_gatt_service/src/test_config.h new file mode 100644 index 000000000000..a45676044de4 --- /dev/null +++ b/tests/subsys/bluetooth/rpc_gatt_service/src/test_config.h @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + * + * Test configuration header - defines config values needed for unit testing + * without full BT RPC stack + * + * This header is included via -include flag to ensure it's processed before + * any source files that need these definitions. + */ + +#ifndef TEST_CONFIG_H_ +#define TEST_CONFIG_H_ + +/* Undefine first in case they're defined elsewhere, then define our test values */ +#ifdef CONFIG_BT_RPC_GATT_SRV_MAX +#undef CONFIG_BT_RPC_GATT_SRV_MAX +#endif +#define CONFIG_BT_RPC_GATT_SRV_MAX 10 + +#ifdef CONFIG_BT_RPC_LOG_LEVEL +#undef CONFIG_BT_RPC_LOG_LEVEL +#endif +#define CONFIG_BT_RPC_LOG_LEVEL 4 + +#endif /* TEST_CONFIG_H_ */ diff --git a/tests/subsys/bluetooth/rpc_gatt_service/testcase.yaml b/tests/subsys/bluetooth/rpc_gatt_service/testcase.yaml new file mode 100644 index 000000000000..f61537c1aa4d --- /dev/null +++ b/tests/subsys/bluetooth/rpc_gatt_service/testcase.yaml @@ -0,0 +1,9 @@ +tests: + bluetooth.rpc_gatt_service: + platform_allow: native_sim + tags: + - ci_build + - bluetooth + - ci_tests_subsys_bluetooth + integration_platforms: + - native_sim diff --git a/tests/subsys/debug/cpu_load/src/test_cpu_load.c b/tests/subsys/debug/cpu_load/src/test_cpu_load.c index 518561232588..062a90b46e88 100644 --- a/tests/subsys/debug/cpu_load/src/test_cpu_load.c +++ b/tests/subsys/debug/cpu_load/src/test_cpu_load.c @@ -21,7 +21,7 @@ static void timer_handler(nrf_timer_event_t event_type, void *context) static int dppi_shared_resources_init(void) { - nrfx_err_t err; + int err; static nrfx_timer_t timer = NRFX_TIMER_INSTANCE(NRF_TIMER1); uint32_t base_frequency = NRF_TIMER_BASE_FREQUENCY_GET(timer.p_reg); nrfx_timer_config_t config = NRFX_TIMER_DEFAULT_CONFIG(base_frequency); @@ -35,7 +35,7 @@ static int dppi_shared_resources_init(void) config.bit_width = NRF_TIMER_BIT_WIDTH_32; err = nrfx_timer_init(&timer, &config, timer_handler); - zassert_equal(err, NRFX_SUCCESS, "Unexpected error:%d", err); + zassert_equal(err, 0, "Unexpected error:%d", err); rv = nrfx_gppi_conn_alloc(evt, tsk, &handle); zassert_equal(rv, 0); diff --git a/tests/subsys/emds/emds_flash/prj.conf b/tests/subsys/emds/emds_flash/prj.conf index b902b8539f83..b90913d8f038 100644 --- a/tests/subsys/emds/emds_flash/prj.conf +++ b/tests/subsys/emds/emds_flash/prj.conf @@ -9,5 +9,4 @@ CONFIG_FLASH=y CONFIG_FLASH_MAP=y CONFIG_DK_LIBRARY=y CONFIG_EMDS=y -CONFIG_BT=y CONFIG_ENTROPY_GENERATOR=y diff --git a/tests/subsys/emds/emds_flash/src/main.c b/tests/subsys/emds/emds_flash/src/main.c index 9159363b7efd..a61dbf1c836e 100644 --- a/tests/subsys/emds/emds_flash/src/main.c +++ b/tests/subsys/emds/emds_flash/src/main.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include @@ -31,17 +32,56 @@ #else #define FLASH DT_INST(0, soc_nv_flash) #define EMDS_FLASH_BLOCK_SIZE DT_PROP(FLASH, write_block_size) +#if defined(CONFIG_SOC_NRF5340_CPUAPP) +#define EXPECTED_STORE_TIME_BLOCK_SIZE (48) +#define EXPECTED_STORE_TIME_1024 (11600) +#else /* 32bits word is written maximum 41us (from datasheet) */ -#define EXPECTED_STORE_TIME_BLOCK_SIZE (41) +#define EXPECTED_STORE_TIME_BLOCK_SIZE (46) /* 1024 bytes should take ideally 10496us (really takes about 11000us) */ #define EXPECTED_STORE_TIME_1024 (11500) #endif +#endif #define EMDS_SNAPSHOT_METADATA_MARKER 0x4D444553 #define PARTITIONS_NUM_MAX 2 static struct emds_partition partition[PARTITIONS_NUM_MAX]; +/* Configure for 1MHz (1μs precision) */ +#if defined(CONFIG_SOC_NRF54L15) +#define NORDIC_TIMER_INSTANCE NRF_TIMER20 +#else +#define NORDIC_TIMER_INSTANCE NRF_TIMER2 +#endif + +static void microsecond_timer_init(void) +{ + /* Configure timer for 1 microsecond precision */ + nrf_timer_mode_set(NORDIC_TIMER_INSTANCE, NRF_TIMER_MODE_TIMER); + nrf_timer_bit_width_set(NORDIC_TIMER_INSTANCE, NRF_TIMER_BIT_WIDTH_32); + nrf_timer_prescaler_set(NORDIC_TIMER_INSTANCE, NRF_TIMER_FREQ_1MHz); + + nrf_timer_task_trigger(NORDIC_TIMER_INSTANCE, NRF_TIMER_TASK_CLEAR); + nrf_timer_task_trigger(NORDIC_TIMER_INSTANCE, NRF_TIMER_TASK_START); + + printk("Timer initialized at 1MHz (1μs resolution)\n"); +} + +static uint32_t get_time_us(void) +{ + nrf_timer_task_trigger(NORDIC_TIMER_INSTANCE, NRF_TIMER_TASK_CAPTURE0); + return nrf_timer_cc_get(NORDIC_TIMER_INSTANCE, NRF_TIMER_CC_CHANNEL0); +} + +static void microsecond_timer_cleanup(void) +{ + /* Stop and disable timer to prevent system issues */ + nrf_timer_task_trigger(NORDIC_TIMER_INSTANCE, NRF_TIMER_TASK_STOP); + nrf_timer_task_trigger(NORDIC_TIMER_INSTANCE, NRF_TIMER_TASK_CLEAR); + printk("Timer stopped and cleaned up\n"); +} + /** Local functions ***********************************************************/ static void *emds_flash_setup(void) { @@ -537,50 +577,51 @@ ZTEST(emds_flash, test_write_speed) static uint8_t data_in[EMDS_FLASH_BLOCK_SIZE]; static uint8_t data_in_big[1024]; static uint8_t read_back[1024] = {0}; - int64_t tic; - int64_t toc; - uint64_t store_time_us; + uint32_t start_us, end_us, elapsed_us; off_t data_off = 0; memset(data_in, 69, sizeof(data_in)); - memset(data_in_big, 69, sizeof(data_in_big)); + memset(data_in_big, 42, sizeof(data_in_big)); (void)dk_leds_init(); (void)dk_set_led(0, false); -#if defined(CONFIG_BT) - /* This is done to turn off mpsl scheduler to speed up storage time. */ - (void)sdc_disable(); - mpsl_uninit(); -#endif + /* Initialize microsecond timer */ + microsecond_timer_init(); dk_set_led(0, true); - tic = k_uptime_ticks(); + start_us = get_time_us(); emds_flash_write_data(&partition[partition_index], data_off, data_in, sizeof(data_in)); - toc = k_uptime_ticks(); + end_us = get_time_us(); dk_set_led(0, false); - store_time_us = k_ticks_to_us_ceil64(toc - tic); - printk("Storing %d bytes took: %lldus\n", sizeof(data_in), store_time_us); - zassert_true(store_time_us < EXPECTED_STORE_TIME_BLOCK_SIZE, - "Storing %d bytes took to long time", sizeof(data_in)); + elapsed_us = end_us - start_us; + printk("Storing %d bytes took %uus\n", sizeof(data_in), elapsed_us); + + zassert_true(elapsed_us < EXPECTED_STORE_TIME_BLOCK_SIZE, + "Storing %d bytes took too long time", sizeof(data_in)); + /* Verify data integrity */ zassert_ok(flash_area_read(fa, data_off, read_back, sizeof(data_in))); zassert_mem_equal(read_back, data_in, sizeof(data_in)); - (void)memset(read_back, 0, sizeof(data_in)); + /* Large data test */ dk_set_led(0, true); - tic = k_uptime_ticks(); + start_us = get_time_us(); emds_flash_write_data(&partition[partition_index], data_off + sizeof(data_in), data_in_big, sizeof(data_in_big)); - toc = k_uptime_ticks(); + end_us = get_time_us(); dk_set_led(0, false); - store_time_us = k_ticks_to_us_ceil64(toc - tic); - printk("Storing %d bytes took: %lldus\n", sizeof(data_in_big), store_time_us); - zassert_true(store_time_us < EXPECTED_STORE_TIME_1024, - "Storing %d bytes took too long time", sizeof(data_in_big)); + elapsed_us = end_us - start_us; + printk("Storing %d bytes took %uus\n", sizeof(data_in_big), elapsed_us); + zassert_true(elapsed_us < EXPECTED_STORE_TIME_1024, "Storing %d bytes took too long time", + sizeof(data_in_big)); + + /* Verify large data */ zassert_ok(flash_area_read(fa, data_off + sizeof(data_in), read_back, sizeof(data_in_big))); zassert_mem_equal(read_back, data_in_big, sizeof(data_in_big)); + + microsecond_timer_cleanup(); } ZTEST_SUITE(emds_flash, NULL, emds_flash_setup, NULL, emds_flash_partitions_erase, NULL); diff --git a/tests/subsys/net/openthread/rpc/client/src/instance_suite.c b/tests/subsys/net/openthread/rpc/client/src/instance_suite.c index 941ce1c165e4..cddd1429ba7f 100644 --- a/tests/subsys/net/openthread/rpc/client/src/instance_suite.c +++ b/tests/subsys/net/openthread/rpc/client/src/instance_suite.c @@ -13,9 +13,6 @@ #include -/* Instance address used when testing serialization of a function that takes otInstance* */ -#define INSTANCE_ADDR UINT32_MAX - static void nrf_rpc_err_handler(const struct nrf_rpc_err_report *report) { zassert_ok(report->code); @@ -28,40 +25,34 @@ static void tc_setup(void *f) mock_nrf_rpc_tr_expect_reset(); } -/* Test serialization of otInstanceInitSingle() returning 0 */ +/* Test serialization of otInstanceInitSingle() */ ZTEST(ot_rpc_instance, test_otInstanceInitSingle_0) { otInstance *instance; + otInstance *instance2; - mock_nrf_rpc_tr_expect_add(RPC_CMD(OT_RPC_CMD_INSTANCE_INIT_SINGLE), RPC_RSP(0)); + /* Verify a non-null instance is returned from the function. */ + mock_nrf_rpc_tr_expect_add(RPC_CMD(OT_RPC_CMD_INSTANCE_INIT_SINGLE), RPC_RSP()); instance = otInstanceInitSingle(); mock_nrf_rpc_tr_expect_done(); - zassert_equal(instance, NULL); -} - -/* Test serialization of otInstanceInitSingle() returning max allowed 0xffffffff */ -ZTEST(ot_rpc_instance, test_otInstanceInitSingle_max) -{ - otInstance *instance; + zassert_not_null(instance, NULL); - mock_nrf_rpc_tr_expect_add(RPC_CMD(OT_RPC_CMD_INSTANCE_INIT_SINGLE), - RPC_RSP(CBOR_UINT32(UINT32_MAX))); - instance = otInstanceInitSingle(); + /* Verify that the same instance is returned for subsequent calls. */ + mock_nrf_rpc_tr_expect_add(RPC_CMD(OT_RPC_CMD_INSTANCE_INIT_SINGLE), RPC_RSP()); + instance2 = otInstanceInitSingle(); mock_nrf_rpc_tr_expect_done(); - zassert_equal(instance, (void *)UINT32_MAX); + zassert_equal(instance, instance2); } /* Test serialization of otInstanceGetId() returning 0 */ ZTEST(ot_rpc_instance, test_otInstanceGetId_0) { - otInstance *instance = (otInstance *)INSTANCE_ADDR; uint32_t id; - mock_nrf_rpc_tr_expect_add(RPC_CMD(OT_RPC_CMD_INSTANCE_GET_ID, CBOR_UINT32(INSTANCE_ADDR)), - RPC_RSP(0)); - id = otInstanceGetId(instance); + mock_nrf_rpc_tr_expect_add(RPC_CMD(OT_RPC_CMD_INSTANCE_GET_ID), RPC_RSP(0)); + id = otInstanceGetId(NULL); mock_nrf_rpc_tr_expect_done(); zassert_equal(id, 0); @@ -70,12 +61,11 @@ ZTEST(ot_rpc_instance, test_otInstanceGetId_0) /* Test serialization of otInstanceGetId() returning max allowed UINT32_MAX */ ZTEST(ot_rpc_instance, test_otInstanceGetId_max) { - otInstance *instance = (otInstance *)INSTANCE_ADDR; uint32_t id; - mock_nrf_rpc_tr_expect_add(RPC_CMD(OT_RPC_CMD_INSTANCE_GET_ID, CBOR_UINT32(INSTANCE_ADDR)), + mock_nrf_rpc_tr_expect_add(RPC_CMD(OT_RPC_CMD_INSTANCE_GET_ID), RPC_RSP(CBOR_UINT32(UINT32_MAX))); - id = otInstanceGetId(instance); + id = otInstanceGetId(NULL); mock_nrf_rpc_tr_expect_done(); zassert_equal(id, UINT32_MAX); @@ -84,13 +74,11 @@ ZTEST(ot_rpc_instance, test_otInstanceGetId_max) /* Test serialization of otInstanceIsInitialized() returning false */ ZTEST(ot_rpc_instance, test_otInstanceIsInitialized_false) { - otInstance *instance = (otInstance *)INSTANCE_ADDR; bool initialized; - mock_nrf_rpc_tr_expect_add( - RPC_CMD(OT_RPC_CMD_INSTANCE_IS_INITIALIZED, CBOR_UINT32(INSTANCE_ADDR)), - RPC_RSP(CBOR_FALSE)); - initialized = otInstanceIsInitialized(instance); + mock_nrf_rpc_tr_expect_add(RPC_CMD(OT_RPC_CMD_INSTANCE_IS_INITIALIZED), + RPC_RSP(CBOR_FALSE)); + initialized = otInstanceIsInitialized(NULL); mock_nrf_rpc_tr_expect_done(); zassert_false(initialized); @@ -99,13 +87,10 @@ ZTEST(ot_rpc_instance, test_otInstanceIsInitialized_false) /* Test serialization of otInstanceIsInitialized() returning true */ ZTEST(ot_rpc_instance, test_otInstanceIsInitialized_true) { - otInstance *instance = (otInstance *)INSTANCE_ADDR; bool initialized; - mock_nrf_rpc_tr_expect_add( - RPC_CMD(OT_RPC_CMD_INSTANCE_IS_INITIALIZED, CBOR_UINT32(INSTANCE_ADDR)), - RPC_RSP(CBOR_TRUE)); - initialized = otInstanceIsInitialized(instance); + mock_nrf_rpc_tr_expect_add(RPC_CMD(OT_RPC_CMD_INSTANCE_IS_INITIALIZED), RPC_RSP(CBOR_TRUE)); + initialized = otInstanceIsInitialized(NULL); mock_nrf_rpc_tr_expect_done(); zassert_true(initialized); @@ -114,24 +99,19 @@ ZTEST(ot_rpc_instance, test_otInstanceIsInitialized_true) /* Test serialization of otInstanceFinalize() */ ZTEST(ot_rpc_instance, test_otInstanceFinalize) { - otInstance *instance = (otInstance *)INSTANCE_ADDR; - - mock_nrf_rpc_tr_expect_add( - RPC_CMD(OT_RPC_CMD_INSTANCE_FINALIZE, CBOR_UINT32(INSTANCE_ADDR)), RPC_RSP()); - otInstanceFinalize(instance); + mock_nrf_rpc_tr_expect_add(RPC_CMD(OT_RPC_CMD_INSTANCE_FINALIZE), RPC_RSP()); + otInstanceFinalize(NULL); mock_nrf_rpc_tr_expect_done(); } /* Test serialization of otInstanceErasePersistentInfo() returning success */ ZTEST(ot_rpc_instance, test_otInstanceErasePersistentInfo_ok) { - otInstance *instance = (otInstance *)INSTANCE_ADDR; otError error; - mock_nrf_rpc_tr_expect_add( - RPC_CMD(OT_RPC_CMD_INSTANCE_ERASE_PERSISTENT_INFO, CBOR_UINT32(INSTANCE_ADDR)), - RPC_RSP(OT_ERROR_NONE)); - error = otInstanceErasePersistentInfo(instance); + mock_nrf_rpc_tr_expect_add(RPC_CMD(OT_RPC_CMD_INSTANCE_ERASE_PERSISTENT_INFO), + RPC_RSP(OT_ERROR_NONE)); + error = otInstanceErasePersistentInfo(NULL); mock_nrf_rpc_tr_expect_done(); zassert_equal(error, OT_ERROR_NONE); @@ -140,13 +120,11 @@ ZTEST(ot_rpc_instance, test_otInstanceErasePersistentInfo_ok) /* Test serialization of otInstanceErasePersistentInfo() returning error */ ZTEST(ot_rpc_instance, test_otInstanceErasePersistentInfo_error) { - otInstance *instance = (otInstance *)INSTANCE_ADDR; otError error; - mock_nrf_rpc_tr_expect_add( - RPC_CMD(OT_RPC_CMD_INSTANCE_ERASE_PERSISTENT_INFO, CBOR_UINT32(INSTANCE_ADDR)), - RPC_RSP(OT_ERROR_INVALID_STATE)); - error = otInstanceErasePersistentInfo(instance); + mock_nrf_rpc_tr_expect_add(RPC_CMD(OT_RPC_CMD_INSTANCE_ERASE_PERSISTENT_INFO), + RPC_RSP(OT_ERROR_INVALID_STATE)); + error = otInstanceErasePersistentInfo(NULL); mock_nrf_rpc_tr_expect_done(); zassert_equal(error, OT_ERROR_INVALID_STATE); diff --git a/tests/subsys/net/openthread/rpc/server/src/instance_suite.c b/tests/subsys/net/openthread/rpc/server/src/instance_suite.c index 61b1b6c31866..cff8484a626c 100644 --- a/tests/subsys/net/openthread/rpc/server/src/instance_suite.c +++ b/tests/subsys/net/openthread/rpc/server/src/instance_suite.c @@ -54,28 +54,10 @@ static void tc_setup(void *f) /* * Test reception of otInstanceInitSingle() command. - * Test serialization of the result: NULL. */ -ZTEST(ot_rpc_instance, test_otInstanceInitSingle_0) +ZTEST(ot_rpc_instance, test_otInstanceInitSingle) { - otInstanceInitSingle_fake.return_val = NULL; - - mock_nrf_rpc_tr_expect_add(RPC_RSP(0), NO_RSP); - mock_nrf_rpc_tr_receive(RPC_CMD(OT_RPC_CMD_INSTANCE_INIT_SINGLE)); - mock_nrf_rpc_tr_expect_done(); - - zassert_equal(otInstanceInitSingle_fake.call_count, 1); -} - -/* - * Test reception of otInstanceInitSingle() command. - * Test serialization of the result: 0xffffffff. - */ -ZTEST(ot_rpc_instance, test_otInstanceInitSingle_max) -{ - otInstanceInitSingle_fake.return_val = (otInstance *)UINT32_MAX; - - mock_nrf_rpc_tr_expect_add(RPC_RSP(CBOR_UINT32(UINT32_MAX)), NO_RSP); + mock_nrf_rpc_tr_expect_add(RPC_RSP(), NO_RSP); mock_nrf_rpc_tr_receive(RPC_CMD(OT_RPC_CMD_INSTANCE_INIT_SINGLE)); mock_nrf_rpc_tr_expect_done(); @@ -88,16 +70,14 @@ ZTEST(ot_rpc_instance, test_otInstanceInitSingle_max) */ ZTEST(ot_rpc_instance, test_otInstanceGetId_0) { - uintptr_t instance = (uintptr_t)openthread_get_default_instance(); - otInstanceGetId_fake.return_val = 0; mock_nrf_rpc_tr_expect_add(RPC_RSP(0), NO_RSP); - mock_nrf_rpc_tr_receive(RPC_CMD(OT_RPC_CMD_INSTANCE_GET_ID, CBOR_UINT32(instance))); + mock_nrf_rpc_tr_receive(RPC_CMD(OT_RPC_CMD_INSTANCE_GET_ID)); mock_nrf_rpc_tr_expect_done(); zassert_equal(otInstanceGetId_fake.call_count, 1); - zassert_equal(otInstanceGetId_fake.arg0_val, (otInstance *)instance); + zassert_equal(otInstanceGetId_fake.arg0_val, openthread_get_default_instance()); } /* @@ -106,16 +86,14 @@ ZTEST(ot_rpc_instance, test_otInstanceGetId_0) */ ZTEST(ot_rpc_instance, test_otInstanceGetId_max) { - uintptr_t instance = (uintptr_t)openthread_get_default_instance(); - - otInstanceGetId_fake.return_val = 0xffffffff; + otInstanceGetId_fake.return_val = UINT32_MAX; mock_nrf_rpc_tr_expect_add(RPC_RSP(CBOR_UINT32(UINT32_MAX)), NO_RSP); - mock_nrf_rpc_tr_receive(RPC_CMD(OT_RPC_CMD_INSTANCE_GET_ID, CBOR_UINT32(instance))); + mock_nrf_rpc_tr_receive(RPC_CMD(OT_RPC_CMD_INSTANCE_GET_ID)); mock_nrf_rpc_tr_expect_done(); zassert_equal(otInstanceGetId_fake.call_count, 1); - zassert_equal(otInstanceGetId_fake.arg0_val, (otInstance *)instance); + zassert_equal(otInstanceGetId_fake.arg0_val, openthread_get_default_instance()); } /* @@ -124,16 +102,14 @@ ZTEST(ot_rpc_instance, test_otInstanceGetId_max) */ ZTEST(ot_rpc_instance, test_otInstanceIsInitialized_false) { - uintptr_t instance = (uintptr_t)openthread_get_default_instance(); - otInstanceIsInitialized_fake.return_val = false; mock_nrf_rpc_tr_expect_add(RPC_RSP(CBOR_FALSE), NO_RSP); - mock_nrf_rpc_tr_receive(RPC_CMD(OT_RPC_CMD_INSTANCE_IS_INITIALIZED, CBOR_UINT32(instance))); + mock_nrf_rpc_tr_receive(RPC_CMD(OT_RPC_CMD_INSTANCE_IS_INITIALIZED)); mock_nrf_rpc_tr_expect_done(); zassert_equal(otInstanceIsInitialized_fake.call_count, 1); - zassert_equal(otInstanceIsInitialized_fake.arg0_val, (otInstance *)instance); + zassert_equal(otInstanceIsInitialized_fake.arg0_val, openthread_get_default_instance()); } /* @@ -142,16 +118,14 @@ ZTEST(ot_rpc_instance, test_otInstanceIsInitialized_false) */ ZTEST(ot_rpc_instance, test_otInstanceIsInitialized_true) { - uintptr_t instance = (uintptr_t)openthread_get_default_instance(); - otInstanceIsInitialized_fake.return_val = true; mock_nrf_rpc_tr_expect_add(RPC_RSP(CBOR_TRUE), NO_RSP); - mock_nrf_rpc_tr_receive(RPC_CMD(OT_RPC_CMD_INSTANCE_IS_INITIALIZED, CBOR_UINT32(instance))); + mock_nrf_rpc_tr_receive(RPC_CMD(OT_RPC_CMD_INSTANCE_IS_INITIALIZED)); mock_nrf_rpc_tr_expect_done(); zassert_equal(otInstanceIsInitialized_fake.call_count, 1); - zassert_equal(otInstanceIsInitialized_fake.arg0_val, (otInstance *)instance); + zassert_equal(otInstanceIsInitialized_fake.arg0_val, openthread_get_default_instance()); } /* @@ -159,13 +133,12 @@ ZTEST(ot_rpc_instance, test_otInstanceIsInitialized_true) */ ZTEST(ot_rpc_instance, test_otInstanceFinalize) { - uintptr_t instance = (uintptr_t)openthread_get_default_instance(); - mock_nrf_rpc_tr_expect_add(RPC_RSP(), NO_RSP); - mock_nrf_rpc_tr_receive(RPC_CMD(OT_RPC_CMD_INSTANCE_FINALIZE, CBOR_UINT32(instance))); + mock_nrf_rpc_tr_receive(RPC_CMD(OT_RPC_CMD_INSTANCE_FINALIZE)); mock_nrf_rpc_tr_expect_done(); zassert_equal(otInstanceFinalize_fake.call_count, 1); + zassert_equal(otInstanceFinalize_fake.arg0_val, openthread_get_default_instance()); } /* @@ -174,17 +147,15 @@ ZTEST(ot_rpc_instance, test_otInstanceFinalize) */ ZTEST(ot_rpc_instance, test_otInstanceErasePersistentInfo_ok) { - uintptr_t instance = (uintptr_t)openthread_get_default_instance(); - otInstanceErasePersistentInfo_fake.return_val = OT_ERROR_NONE; mock_nrf_rpc_tr_expect_add(RPC_RSP(OT_ERROR_NONE), NO_RSP); - mock_nrf_rpc_tr_receive( - RPC_CMD(OT_RPC_CMD_INSTANCE_ERASE_PERSISTENT_INFO, CBOR_UINT32(instance))); + mock_nrf_rpc_tr_receive(RPC_CMD(OT_RPC_CMD_INSTANCE_ERASE_PERSISTENT_INFO)); mock_nrf_rpc_tr_expect_done(); zassert_equal(otInstanceErasePersistentInfo_fake.call_count, 1); - zassert_equal(otInstanceErasePersistentInfo_fake.arg0_val, (otInstance *)instance); + zassert_equal(otInstanceErasePersistentInfo_fake.arg0_val, + openthread_get_default_instance()); } /* @@ -193,17 +164,15 @@ ZTEST(ot_rpc_instance, test_otInstanceErasePersistentInfo_ok) */ ZTEST(ot_rpc_instance, test_otInstanceErasePersistentInfo_error) { - uintptr_t instance = (uintptr_t)openthread_get_default_instance(); - otInstanceErasePersistentInfo_fake.return_val = OT_ERROR_INVALID_STATE; mock_nrf_rpc_tr_expect_add(RPC_RSP(OT_ERROR_INVALID_STATE), NO_RSP); - mock_nrf_rpc_tr_receive( - RPC_CMD(OT_RPC_CMD_INSTANCE_ERASE_PERSISTENT_INFO, CBOR_UINT32(instance))); + mock_nrf_rpc_tr_receive(RPC_CMD(OT_RPC_CMD_INSTANCE_ERASE_PERSISTENT_INFO)); mock_nrf_rpc_tr_expect_done(); zassert_equal(otInstanceErasePersistentInfo_fake.call_count, 1); - zassert_equal(otInstanceErasePersistentInfo_fake.arg0_val, (otInstance *)instance); + zassert_equal(otInstanceErasePersistentInfo_fake.arg0_val, + openthread_get_default_instance()); } /* @@ -211,14 +180,12 @@ ZTEST(ot_rpc_instance, test_otInstanceErasePersistentInfo_error) */ ZTEST(ot_rpc_instance, test_otInstanceFactoryReset) { - uintptr_t instance = (uintptr_t)openthread_get_default_instance(); - mock_nrf_rpc_tr_expect_add(RPC_RSP(), NO_RSP); mock_nrf_rpc_tr_receive(RPC_CMD(OT_RPC_CMD_INSTANCE_FACTORY_RESET)); mock_nrf_rpc_tr_expect_done(); zassert_equal(otInstanceFactoryReset_fake.call_count, 1); - zassert_equal(otInstanceFactoryReset_fake.arg0_val, (otInstance *)instance); + zassert_equal(otInstanceFactoryReset_fake.arg0_val, openthread_get_default_instance()); } /* diff --git a/tests/zephyr/boards/nrf/i2c/i2c_slave/boards/nrf7120pdk_nrf7120_cpuapp.overlay b/tests/zephyr/boards/nrf/i2c/i2c_slave/boards/nrf7120pdk_nrf7120_cpuapp.overlay index e6aaec1a86a1..a592761249e5 100644 --- a/tests/zephyr/boards/nrf/i2c/i2c_slave/boards/nrf7120pdk_nrf7120_cpuapp.overlay +++ b/tests/zephyr/boards/nrf/i2c/i2c_slave/boards/nrf7120pdk_nrf7120_cpuapp.overlay @@ -8,14 +8,14 @@ i2c21_default_alt: i2c21_default_alt { group1 { psels = , - ; + ; }; }; i2c21_sleep_alt: i2c21_sleep_alt { group1 { psels = , - ; + ; low-power-enable; }; }; @@ -26,7 +26,7 @@ * to configure pins for TWIS with pinctrl. */ psels = , - ; + ; bias-pull-up; }; }; @@ -34,7 +34,7 @@ i2c22_sleep_alt: i2c22_sleep_alt { group1 { psels = , - ; + ; low-power-enable; }; }; diff --git a/tests/zephyr/boards/nrf/qdec/boards/nrf7120pdk_nrf7120_common.dtsi b/tests/zephyr/boards/nrf/qdec/boards/nrf7120pdk_nrf7120_common.dtsi index 1ebe3169eae3..91aeb58ff5e6 100644 --- a/tests/zephyr/boards/nrf/qdec/boards/nrf7120pdk_nrf7120_common.dtsi +++ b/tests/zephyr/boards/nrf/qdec/boards/nrf7120pdk_nrf7120_common.dtsi @@ -7,8 +7,8 @@ /* Required loopbacks * P1.11 <-> P1.12 * P1.13 <-> P1.15 - * P1.2 <-> P1.3 - * P1.4 <-> P2.5 + * P1.02 <-> P1.3 + * P1.00 <-> P1.14 */ / { @@ -24,7 +24,7 @@ gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>; }; phase_b1: phase_b1 { - gpios = <&gpio1 4 GPIO_ACTIVE_HIGH>; + gpios = <&gpio1 0 GPIO_ACTIVE_HIGH>; }; }; @@ -60,14 +60,14 @@ qdec_21_pinctrl: qdec_21_pinctrl { group1 { psels = , - ; + ; }; }; qdec_21_sleep_pinctrl: qdec_21_sleep_pinctrl { group1 { psels = , - ; + ; low-power-enable; }; }; diff --git a/tests/zephyr/drivers/i2c/i2c_nrfx_twim/boards/nrf7120pdk_nrf7120_cpuapp.overlay b/tests/zephyr/drivers/i2c/i2c_nrfx_twim/boards/nrf7120pdk_nrf7120_cpuapp.overlay index 0a155c601955..5407e0715184 100644 --- a/tests/zephyr/drivers/i2c/i2c_nrfx_twim/boards/nrf7120pdk_nrf7120_cpuapp.overlay +++ b/tests/zephyr/drivers/i2c/i2c_nrfx_twim/boards/nrf7120pdk_nrf7120_cpuapp.overlay @@ -6,7 +6,7 @@ /* * SDA = P1.8 and P1.9 - * SCL = P1.14 and P1.15 + * SCL = P1.2 and P1.3 */ / { @@ -20,7 +20,7 @@ i2c21_default: i2c21_default { group1 { psels = , - ; + ; bias-pull-up; }; }; @@ -28,7 +28,7 @@ i2c21_sleep: i2c21_sleep { group1 { psels = , - ; + ; low-power-enable; }; }; @@ -36,7 +36,7 @@ i2c22_default: i2c22_default { group1 { psels = , - ; + ; bias-pull-up; }; }; @@ -44,7 +44,7 @@ i2c22_sleep: i2c22_sleep { group1 { psels = , - ; + ; low-power-enable; }; }; diff --git a/tests/zephyr/drivers/i2c/i2c_target_api/boards/nrf7120pdk_nrf7120_cpuapp.overlay b/tests/zephyr/drivers/i2c/i2c_target_api/boards/nrf7120pdk_nrf7120_cpuapp.overlay index 83b7ecf43ace..5027cf022045 100644 --- a/tests/zephyr/drivers/i2c/i2c_target_api/boards/nrf7120pdk_nrf7120_cpuapp.overlay +++ b/tests/zephyr/drivers/i2c/i2c_target_api/boards/nrf7120pdk_nrf7120_cpuapp.overlay @@ -1,13 +1,13 @@ /* * SDA = P1.8 and P1.9 - * SCL = P1.14 and P1.15 + * SCL = P1.2 and P1.3 */ &pinctrl { i2c21_default: i2c21_default { group1 { psels = , - ; + ; bias-pull-up; }; }; @@ -15,7 +15,7 @@ i2c21_sleep: i2c21_sleep { group1 { psels = , - ; + ; low-power-enable; }; }; @@ -23,7 +23,7 @@ i2c22_default: i2c22_default { group1 { psels = , - ; + ; bias-pull-up; }; }; @@ -31,7 +31,7 @@ i2c22_sleep: i2c22_sleep { group1 { psels = , - ; + ; low-power-enable; }; }; diff --git a/tests/zephyr/drivers/spi/spi_controller_peripheral/boards/nrf7120pdk_nrf7120_cpuapp.overlay b/tests/zephyr/drivers/spi/spi_controller_peripheral/boards/nrf7120pdk_nrf7120_cpuapp.overlay index 5dea09cb1e7b..85633930b6e6 100644 --- a/tests/zephyr/drivers/spi/spi_controller_peripheral/boards/nrf7120pdk_nrf7120_cpuapp.overlay +++ b/tests/zephyr/drivers/spi/spi_controller_peripheral/boards/nrf7120pdk_nrf7120_cpuapp.overlay @@ -27,7 +27,7 @@ psels = , , , - ; + ; }; }; @@ -36,7 +36,7 @@ psels = , , , - ; + ; low-power-enable; }; }; @@ -52,7 +52,7 @@ pinctrl-1 = <&spi22_sleep_alt>; pinctrl-names = "default", "sleep"; overrun-character = <0x00>; - cs-gpios = <&gpio1 4 GPIO_ACTIVE_LOW>; + cs-gpios = <&gpio1 15 GPIO_ACTIVE_LOW>; zephyr,pm-device-runtime-auto; dut_spi_dt: test-spi-dev@0 { compatible = "vnd,spi-device"; diff --git a/tests/zephyr/drivers/spi/spi_loopback/boards/nrf7120pdk_nrf7120_cpuapp.overlay b/tests/zephyr/drivers/spi/spi_loopback/boards/nrf7120pdk_nrf7120_cpuapp.overlay index ba6bbc58addb..0665e07b24d7 100644 --- a/tests/zephyr/drivers/spi/spi_loopback/boards/nrf7120pdk_nrf7120_cpuapp.overlay +++ b/tests/zephyr/drivers/spi/spi_loopback/boards/nrf7120pdk_nrf7120_cpuapp.overlay @@ -6,15 +6,15 @@ /* * Test requires following loopback: - * P1.4 - P1.5 + * P1.11 - P1.12 */ &pinctrl { spi20_default: spi20_default { group1 { psels = , - , - ; + , + ; low-power-enable; }; }; @@ -22,8 +22,8 @@ spi20_sleep: spi20_sleep { group1 { psels = , - , - ; + , + ; low-power-enable; }; }; diff --git a/tests/zephyr/drivers/uart/uart_async_api/boards/nrf7120pdk_nrf7120_cpuapp.overlay b/tests/zephyr/drivers/uart/uart_async_api/boards/nrf7120pdk_nrf7120_cpuapp.overlay index cf425f2d2926..20dbf11339bf 100644 --- a/tests/zephyr/drivers/uart/uart_async_api/boards/nrf7120pdk_nrf7120_cpuapp.overlay +++ b/tests/zephyr/drivers/uart/uart_async_api/boards/nrf7120pdk_nrf7120_cpuapp.overlay @@ -7,15 +7,15 @@ &pinctrl { uart21_default_alt: uart21_default_alt { group1 { - psels = , - ; + psels = , + ; }; }; uart21_sleep_alt: uart21_sleep_alt { group1 { - psels = , - ; + psels = , + ; low-power-enable; }; }; diff --git a/tests/zephyr/drivers/uart/uart_elementary/boards/nrf7120pdk_nrf7120_cpuapp.overlay b/tests/zephyr/drivers/uart/uart_elementary/boards/nrf7120pdk_nrf7120_cpuapp.overlay index 9e000f530996..fc26bdafc3f8 100644 --- a/tests/zephyr/drivers/uart/uart_elementary/boards/nrf7120pdk_nrf7120_cpuapp.overlay +++ b/tests/zephyr/drivers/uart/uart_elementary/boards/nrf7120pdk_nrf7120_cpuapp.overlay @@ -7,8 +7,8 @@ &pinctrl { uart21_default: uart21_default { group1 { - psels = , - , + psels = , + , , ; }; @@ -16,8 +16,8 @@ uart21_sleep: uart21_sleep { group1 { - psels = , - , + psels = , + , , ; low-power-enable; diff --git a/tests/zephyr/drivers/uart/uart_elementary/boards/nrf7120pdk_nrf7120_cpuapp_dual_uart.overlay b/tests/zephyr/drivers/uart/uart_elementary/boards/nrf7120pdk_nrf7120_cpuapp_dual_uart.overlay index 0e410fd32141..9099ef29406c 100644 --- a/tests/zephyr/drivers/uart/uart_elementary/boards/nrf7120pdk_nrf7120_cpuapp_dual_uart.overlay +++ b/tests/zephyr/drivers/uart/uart_elementary/boards/nrf7120pdk_nrf7120_cpuapp_dual_uart.overlay @@ -7,7 +7,7 @@ &pinctrl { uart21_default: uart21_default { group1 { - psels = , + psels = , ; bias-pull-up; }; @@ -15,7 +15,7 @@ uart21_sleep: uart21_sleep { group1 { - psels = , + psels = , ; low-power-enable; }; @@ -24,7 +24,7 @@ uart22_default: uart22_default { group1 { psels = , - ; + ; bias-pull-up; }; }; @@ -32,7 +32,7 @@ uart22_sleep: uart22_sleep { group1 { psels = , - ; + ; low-power-enable; }; }; diff --git a/tests/zephyr/drivers/uart/uart_errors/boards/nrf7120pdk_nrf7120_cpuapp.overlay b/tests/zephyr/drivers/uart/uart_errors/boards/nrf7120pdk_nrf7120_cpuapp.overlay index 05cbb25c9716..0f56ec825d87 100644 --- a/tests/zephyr/drivers/uart/uart_errors/boards/nrf7120pdk_nrf7120_cpuapp.overlay +++ b/tests/zephyr/drivers/uart/uart_errors/boards/nrf7120pdk_nrf7120_cpuapp.overlay @@ -8,14 +8,14 @@ uart21_default: uart21_default { group1 { psels = , - ; + ; }; }; uart21_sleep: uart21_sleep { group1 { psels = , - ; + ; low-power-enable; }; }; @@ -23,7 +23,7 @@ uart22_default: uart22_default { group1 { psels = - ; + ; bias-pull-up; }; group2 { @@ -34,7 +34,7 @@ uart22_sleep: uart22_sleep { group1 { psels = , - ; + ; low-power-enable; }; }; diff --git a/tests/zephyr/drivers/uart/uart_mix_fifo_poll/boards/nrf7120pdk_nrf7120_cpuapp.overlay b/tests/zephyr/drivers/uart/uart_mix_fifo_poll/boards/nrf7120pdk_nrf7120_cpuapp.overlay index 16a9a2702e23..3c8d4b62af23 100644 --- a/tests/zephyr/drivers/uart/uart_mix_fifo_poll/boards/nrf7120pdk_nrf7120_cpuapp.overlay +++ b/tests/zephyr/drivers/uart/uart_mix_fifo_poll/boards/nrf7120pdk_nrf7120_cpuapp.overlay @@ -7,19 +7,19 @@ &pinctrl { uart21_default: uart21_default { group1 { - psels = , - , - , - ; + psels = , + , + , + ; }; }; uart21_sleep: uart21_sleep { group1 { - psels = , - , - , - ; + psels = , + , + , + ; low-power-enable; }; }; diff --git a/tests/zephyr/drivers/uart/uart_pm/boards/nrf7120pdk_nrf7120_cpuapp.overlay b/tests/zephyr/drivers/uart/uart_pm/boards/nrf7120pdk_nrf7120_cpuapp.overlay index e7f84d0411c8..89f72b1eb9f0 100644 --- a/tests/zephyr/drivers/uart/uart_pm/boards/nrf7120pdk_nrf7120_cpuapp.overlay +++ b/tests/zephyr/drivers/uart/uart_pm/boards/nrf7120pdk_nrf7120_cpuapp.overlay @@ -7,15 +7,15 @@ &pinctrl { uart21_default: uart21_default { group1 { - psels = , - ; + psels = , + ; }; }; uart21_sleep: uart21_sleep { group1 { - psels = , - ; + psels = , + ; low-power-enable; }; }; diff --git a/west.yml b/west.yml index 4e869f686633..4952fd0012c9 100644 --- a/west.yml +++ b/west.yml @@ -64,7 +64,7 @@ manifest: # https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/guides/modules.html - name: zephyr repo-path: sdk-zephyr - revision: 56fbb4f3c7bba12fb34a5cd111b4ea9f7ad52162 + revision: pull/3613/head import: # In addition to the zephyr repository itself, NCS also # imports the contents of zephyr/west.yml at the above @@ -143,7 +143,7 @@ manifest: - name: nrfxlib repo-path: sdk-nrfxlib path: nrfxlib - revision: 5b0b19946f2bb47cfa4aa358322146edee38cbd5 + revision: 9ef8718adab25805858c70f7ce46705c7488b7c1 - name: trusted-firmware-m repo-path: sdk-trusted-firmware-m path: modules/tee/tf-m/trusted-firmware-m @@ -155,7 +155,7 @@ manifest: - name: matter repo-path: sdk-connectedhomeip path: modules/lib/matter - revision: bce9dd5a9e2e58bf2c0b762c4385dbb3f11f686a + revision: b9ffabef417865b481d1d737c6d539ff8dab21a2 west-commands: scripts/west/west-commands.yml submodules: - name: nlio @@ -181,7 +181,7 @@ manifest: # Only for internal Nordic development repo-path: dragoon.git remote: dragoon - revision: cf419408648ce1eee1fbea1d4b6a8366f9bcf737 + revision: dbf89b7bb05209a68fe2f28b8132fb6b1e1b2368 groups: - dragoon - name: cjson @@ -195,7 +195,7 @@ manifest: compare-by-default: false - name: find-my repo-path: sdk-find-my - revision: 1bccfd5dcd26637c34a2af755e00a93e070b7f32 + revision: bc92a28d63c9c4ce2d0401221d28dfb6a653eed6 groups: - find-my - name: azure-sdk-for-c @@ -217,7 +217,7 @@ manifest: upstream-sha: 1be6ca7253133a21a1e9fe0fbb4656e17d63a936 compare-by-default: false - name: libmodem - revision: 5e2ff763095e44c279fc3c2e41464874aab27c2c + revision: c1056e47eda61024a6937cda5574c97667467346 groups: - libmodem - name: openthread @@ -244,7 +244,7 @@ manifest: remote: throwtheswitch - name: memfault-firmware-sdk path: modules/lib/memfault-firmware-sdk - revision: 1.31.0 + revision: 1.32.0 remote: memfault - name: bsim repo-path: bsim_west