diff --git a/.checkpatch.conf b/.checkpatch.conf index 971cf6ba56db..3248690b08e8 100644 --- a/.checkpatch.conf +++ b/.checkpatch.conf @@ -51,3 +51,4 @@ --exclude applications/nrf5340_audio/src/utils/macros --exclude lib/at_parser/generated --exclude lib/bin/lwm2m_carrier/include +--exclude tests/lib/uicc_lwm2m diff --git a/.github/test-spec.yml b/.github/test-spec.yml index 7267583c3db0..defe5414dff7 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -592,6 +592,7 @@ - "snippets/emulated-*/**/*" - "tests/subsys/event_manager_proxy/**/*" - "tests/benchmarks/multicore/idle/**/*" + - "tests/drivers/gpio/egpio_basic_api/**/*" - "tests/drivers/pwm/**/*" - "tests/drivers/sensor/**/*" diff --git a/.github/workflows/src-mirror.yml b/.github/workflows/src-mirror.yml index 442dd6f88806..35f88d8d7fc5 100644 --- a/.github/workflows/src-mirror.yml +++ b/.github/workflows/src-mirror.yml @@ -21,9 +21,9 @@ jobs: git config --global pack.windowMemory "32m" && west forall -c 'git gc --prune --aggressive' - - name: Create 7z archive + - name: Create tar archive run: | - 7z a -t7z src.7z ./workspace/ + tar -C ./workspace -czvf src.tar.gz . - name: Set up JFrog CLI uses: jfrog/setup-jfrog-cli@v4 @@ -32,7 +32,7 @@ jobs: env: ARTIFACTORY_URL: https://eu.files.nordicsemi.com/artifactory REPOSITORY: ncs-src-mirror - FILE_PATH: src.7z + FILE_PATH: src.tar.gz TARGET_PATH: external/${{ github.ref_name }}/ run: > jfrog rt u $FILE_PATH $REPOSITORY/$TARGET_PATH diff --git a/.github/workflows/pip-requirements.yml b/.github/workflows/validate-pip-requirements-fixed-file.yml similarity index 67% rename from .github/workflows/pip-requirements.yml rename to .github/workflows/validate-pip-requirements-fixed-file.yml index 8b3892e930be..cffe93501313 100644 --- a/.github/workflows/pip-requirements.yml +++ b/.github/workflows/validate-pip-requirements-fixed-file.yml @@ -1,7 +1,7 @@ name: Validate pip requirements-fixed.txt on: - pull_request_target: + pull_request: types: [opened, synchronize, reopened] branches: - main @@ -9,9 +9,6 @@ on: paths: - 'scripts/requirements*.txt' -env: - REACT_EMOTE: 'eyes' - jobs: check-requirements: runs-on: ubuntu-20.04 @@ -30,7 +27,7 @@ jobs: echo "python_version=$PYTHON_VERSION" >> $GITHUB_OUTPUT - name: Setup python version - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: '${{ steps.pyv.outputs.python_version }}' @@ -40,31 +37,11 @@ jobs: pip3 install --user -U setuptools wheel pip virtualenv virtualenvwrapper - name: Execute script diff action - uses: nrfconnect/action-script-diff@v0.2 + uses: nrfconnect/action-script-diff@v0.3 with: - github-token: ${{ secrets.NCS_GITHUB_TOKEN }} - message_diff: | - This pr introduces changes to requirements files. - The compiled requirements-fixed.txt has changed. - To automatically add the changed file to this pr react with the :$REACT_EMOTE: emote to this comment and re-run the check. - [Check Run]($GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID) -
- requirements-fixed.txt diff - - \`\`\` diff - $GITDIFF - \`\`\` -
- message_success: | - The changes to the 'requirements-fixed.txt' have been added to this PR. - All further changes to any of the requirements file will automatically be applied as long an :$REACT_EMOTE: is present. - git_diff_root: ncs/nrf - diff_path: scripts - diff_file: requirements-fixed.txt - reaction_emote: "${{ env.REACT_EMOTE }}" - git_user_name: "Nordic Builder" - git_user_email: "pylon@nordicsemi.no" + diff_file: "ncs/nrf/scripts/requirements-fixed.txt" script_call: | + cd ncs OUT_FILE="nrf/scripts/requirements-fixed.txt" echo "Writing frozen requirements to: $OUT_FILE" echo "Log python version: $(python --version)" diff --git a/.github/workflows/west-commands.yml b/.github/workflows/west-commands.yml index a795e86b8b63..f9f9551f3111 100644 --- a/.github/workflows/west-commands.yml +++ b/.github/workflows/west-commands.yml @@ -4,10 +4,9 @@ on: pull_request: branches: [main] paths: - - scripts/west_commands/mypy.ini - - scripts/west_commands/ncs_commands.py - - scripts/west_commands/ncs_west_helpers.py - - scripts/west_commands/pygit2_helpers.py + - scripts/west_commands/** + - scripts/requirements-west-ncs-sbom.txt + - scripts/requirements-extra.txt jobs: west_commands_job: @@ -15,16 +14,11 @@ jobs: name: Run Python checks for west commands on patch series (PR) steps: - name: Checkout the code - uses: actions/checkout@v3 + uses: nrfconnect/action-checkout-west-update@main with: path: ncs/nrf - ref: ${{ github.event.pull_request.head.sha }} - fetch-depth: 0 - - name: cache-pip - uses: actions/cache@v3 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-doc-pip + git-ref: ${{ github.event.pull_request.head.sha }} + git-fetch-depth: 0 - name: Install python dependencies working-directory: ncs/nrf run: | @@ -38,3 +32,31 @@ jobs: working-directory: ncs/nrf/scripts/west_commands run: | python3 -m mypy --config-file mypy.ini ncs_west_helpers.py pygit2_helpers.py ncs_commands.py + + run-west-cmds: + name: Run smoke tests for ncs west commands + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-13, windows-latest] + runs-on: ${{ matrix.os }} + steps: + - name: Checkout sources + uses: nrfconnect/action-checkout-west-update@main + with: + git-fetch-depth: 0 + path: nrf + - name: Install requirements + shell: bash + run: | + pip3 install -r nrf/scripts/requirements-west-ncs-sbom.txt + pip3 install -r nrf/scripts/requirements-extra.txt + - name: Test ncs-sbom with asset tracker sample + shell: bash + run: | + west ncs-sbom --input-files nrf/applications/asset_tracker_v2/**/*.c + - name: Smoke test ncs-loot & ncs-compare + shell: bash + run: | + west ncs-loot -h + west ncs-compare -h diff --git a/CODEOWNERS b/CODEOWNERS index 41e9c3c2e7cb..a2e405622aa2 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -4,8 +4,10 @@ # Order is important; the last matching pattern takes the most # precedence. -# No general default entry with `*`. Instead the compliance workflow verifies -# that all new files are covered by an entry in the CODEOWNERS file. +# The default entry with `*` only applies to GitHub adding reviewers. +# The compliance workflow verifies that all new files are covered by an +# entry in the CODEOWNERS file, but skips this `*` entry altogether. +* @nrfconnect/ncs-code-owners # Root folder /.* @nrfconnect/ncs-code-owners @@ -14,7 +16,7 @@ /Jenkinsfile @nrfconnect/ncs-ci /ncs_version.h.in @nrfconnect/ncs-code-owners /LICENSE @carlescufi -/README.rst @carlescufi +/README.rst @carlescufi @nrfconnect/ncs-doc-leads /VERSION @nrfconnect/ncs-code-owners /west.yml @nrfconnect/ncs-code-owners /west-test.yml @nrfconnect/ncs-ci @@ -25,7 +27,6 @@ /.vscode/ @FilipZajdel # Applications -/applications/ @nrfconnect/ncs-code-owners /applications/asset_tracker_v2/ @nrfconnect/ncs-cia @coderbyheart /applications/connectivity_bridge/ @nrfconnect/ncs-cia @nordic-auko /applications/ipc_radio/ @nrfconnect/ncs-si-muffin @@ -34,15 +35,28 @@ /applications/matter_weather_station/ @nrfconnect/ncs-matter /applications/nrf5340_audio/ @nrfconnect/ncs-audio /applications/nrf_desktop/ @nrfconnect/ncs-si-bluebagel -/applications/sdp/ @masz-nordic +/applications/sdp/ @nrfconnect/ncs-ll-ursus /applications/serial_lte_modem/ @nrfconnect/ncs-co-networking @nrfconnect/ncs-iot-oulu /applications/serial_lte_modem/src/lwm2m_carrier/ @nrfconnect/ncs-carrier /applications/zigbee_weather_station/ @nrfconnect/ncs-zigbee -/applications/**/*.rst @nrfconnect/ncs-doc-owners +/applications/asset_tracker_v2/**/*.rst @nrfconnect/ncs-cia-doc +/applications/connectivity_bridge/*.rst @nrfconnect/ncs-cia-doc +/applications/ipc_radio/*.rst @nrfconnect/ncs-si-muffin-doc +/applications/machine_learning/*.rst @nrfconnect/ncs-si-muffin-doc +/applications/matter_bridge/**/*.rst @nrfconnect/ncs-matter-doc +/applications/matter_weather_station/*.rst @nrfconnect/ncs-matter-doc +/applications/nrf5340_audio/**/*.rst @nrfconnect/ncs-audio-doc +/applications/nrf_desktop/**/*.rst @nrfconnect/ncs-si-bluebagel-doc +/applications/serial_lte_modem/**/*.rst @nrfconnect/ncs-iot-oulu-tampere-doc +/applications/serial_lte_modem/doc/CARRIER_AT_commands.rst @nrfconnect/ncs-carrier-doc +/applications/zigbee_weather_station/*.rst @nrfconnect/ncs-terahertz-doc # Boards -/boards/ @nrfconnect/ncs-co-boards +/boards/nordic/nrf52* @nrfconnect/ncs-co-boards @nrfconnect/ncs-si-bluebagel /boards/nordic/thingy91* @nrfconnect/ncs-co-boards @nrfconnect/ncs-cia +/boards/shields/coverage_support/ @nrfconnect/ncs-low-level-test + +/boards/shields/pca63566/doc/*.rst @nrfconnect/ncs-doc-leads # SUIT configuration files /config/suit/ @nrfconnect/ncs-charon @@ -53,64 +67,275 @@ /cmake/sysbuild/suit_utilities.cmake @nrfconnect/ncs-charon # All doc related files -/doc/ @nrfconnect/ncs-co-doc /doc/_zoomin/ @nrfconnect/ncs-co-doc @nrfconnect/ncs-doc-leads -/doc/**/*.rst @nrfconnect/ncs-doc-owners -/doc/**/*.svg @nrfconnect/ncs-doc-owners -/doc/**/*.png @nrfconnect/ncs-doc-owners -/doc/nrf/protocols/thread/*.rst @wiba-nordic -/doc/nrf/app_dev/device_guides/working_with_nrf/nrf54h/ @FrancescoSer +/doc/kconfig/ @nrfconnect/ncs-doc-leads +/doc/matter/ @nrfconnect/ncs-matter-doc +/doc/mcuboot/ @nrfconnect/ncs-pluto-doc +/doc/nrf/*.rst @nrfconnect/ncs-doc-leads +/doc/nrf/app_dev/ @nrfconnect/ncs-doc-leads @nrfconnect/ncs-vestavind-doc +/doc/nrf/app_dev/bootloaders_dfu/ @nrfconnect/ncs-pluto-doc +/doc/nrf/app_dev/device_guides/fem/ @nrfconnect/ncs-doc-leads +/doc/nrf/app_dev/device_guides/nrf52/ @nrfconnect/ncs-doc-leads +/doc/nrf/app_dev/device_guides/nrf53/ @nrfconnect/ncs-doc-leads +/doc/nrf/app_dev/device_guides/nrf53/qspi_xip_guide_nrf5340.rst @nrfconnect/ncs-pluto-doc /doc/nrf/app_dev/device_guides/nrf54l/ @annwoj +/doc/nrf/app_dev/device_guides/nrf70/ @nrfconnect/ncs-wifi-doc +/doc/nrf/app_dev/device_guides/nrf91/ @nrfconnect/ncs-modem-doc +/doc/nrf/app_dev/device_guides/nrf91/nrf91_snippet.rst @nrfconnect/ncs-cia-doc +/doc/nrf/app_dev/device_guides/pmic/ @nrfconnect/ncs-pmic-doc +/doc/nrf/app_dev/device_guides/working_with_nrf/nrf54h/ @FrancescoSer +/doc/nrf/app_dev/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_suit_*.rst @nrfconnect/ncs-charon-doc +/doc/nrf/app_dev/device_guides/nrf54h.rst @FrancescoSer +/doc/nrf/app_dev/device_guides/wifi_coex.rst @nrfconnect/ncs-doc-leads +/doc/nrf/dev_model_and_contributions/ @nrfconnect/ncs-doc-leads @nrfconnect/ncs-vestavind-doc +/doc/nrf/drivers/bh1749.rst @nrfconnect/ncs-cia-doc +/doc/nrf/drivers/bme68x_iaq.rst @nrfconnect/ncs-cia-doc +/doc/nrf/drivers/entropy_cc3xx.rst @nrfconnect/ncs-aegir-doc +/doc/nrf/drivers/eth_rtt.rst @nrfconnect/ncs-si-muffin-doc +/doc/nrf/drivers/hw_cc3xx.rst @nrfconnect/ncs-aegir-doc +/doc/nrf/drivers/paw3212.rst @nrfconnect/ncs-si-bluebagel-doc +/doc/nrf/drivers/pmw3360.rst @nrfconnect/ncs-si-bluebagel-doc +/doc/nrf/drivers/sensor_sim.rst @nrfconnect/ncs-si-muffin-doc +/doc/nrf/drivers/sensor_stub.rst @nrfconnect/ncs-si-muffin-doc +/doc/nrf/drivers/uart_ipc.rst @nrfconnect/ncs-doc-leads +/doc/nrf/drivers/uart_nrf_sw_lpuart.rst @nrfconnect/ncs-doc-leads +/doc/nrf/external_comp/avsystem.rst @nrfconnect/ncs-iot-oulu-tampere-doc +/doc/nrf/external_comp/bt_fast_pair.rst @nrfconnect/ncs-si-bluebagel-doc +/doc/nrf/external_comp/coremark.rst @nrfconnect/ncs-si-bluebagel-doc +/doc/nrf/external_comp/dult.rst @nrfconnect/ncs-si-bluebagel-doc +/doc/nrf/external_comp/edge_impulse.rst @nrfconnect/ncs-si-muffin-doc +/doc/nrf/external_comp/memfault.rst @nrfconnect/ncs-cia-doc +/doc/nrf/external_comp/nrf_cloud.rst @nrfconnect/ncs-nrf-cloud-doc +/doc/nrf/gsg_guides/ @nrfconnect/ncs-doc-leads @nrfconnect/ncs-vestavind-doc @nrfconnect/ncs-wayland-doc +/doc/nrf/gsg_guides/thingy91_gsg.rst @nrfconnect/ncs-cia-doc +/doc/nrf/gsg_guides/nrf9160_gs.rst @nrfconnect/ncs-modem-doc +/doc/nrf/gsg_guides/nrf7002_gs.rst @nrfconnect/ncs-wifi-doc +/doc/nrf/includes/ @nrfconnect/ncs-doc-leads +/doc/nrf/includes/boardname_tables/sample_boardnames.txt @nrfconnect/ncs-co-doc +/doc/nrf/installation/ @nrfconnect/ncs-doc-leads @nrfconnect/ncs-vestavind-doc @nrfconnect/ncs-wayland-doc +/doc/nrf/libraries/bin/ @nrfconnect/ncs-doc-leads +/doc/nrf/libraries/bin/lwm2m_carrier/ @nrfconnect/ncs-carrier-doc +/doc/nrf/libraries/bluetooth_services/ @nrfconnect/ncs-si-muffin-doc @nrfconnect/ncs-dragoon-doc +/doc/nrf/libraries/bluetooth_services/mesh/ @nrfconnect/ncs-paladin-doc +/doc/nrf/libraries/bluetooth_services/adv_prov.rst @nrfconnect/ncs-si-bluebagel-doc +/doc/nrf/libraries/bluetooth_services/mesh.rst @nrfconnect/ncs-paladin-doc +/doc/nrf/libraries/bluetooth_services/services/fast_pair.rst @nrfconnect/ncs-si-bluebagel-doc +/doc/nrf/libraries/bluetooth_services/services/wifi_prov.rst @nrfconnect/ncs-wifi-doc +/doc/nrf/libraries/caf/ @nrfconnect/ncs-si-muffin-doc @nrfconnect/ncs-si-bluebagel-doc +/doc/nrf/libraries/debug/cpu_load.rst @nrfconnect/ncs-doc-leads +/doc/nrf/libraries/debug/etb_trace.rst @nrfconnect/ncs-cia-doc +/doc/nrf/libraries/debug/index.rst @nrfconnect/ncs-doc-leads +/doc/nrf/libraries/debug/memfault_ncs.rst @nrfconnect/ncs-cia-doc +/doc/nrf/libraries/debug/ppi_trace.rst @nrfconnect/ncs-doc-leads +/doc/nrf/libraries/dfu/ @nrfconnect/ncs-pluto-doc +/doc/nrf/libraries/dfu/suit_dfu.rst @nrfconnect/ncs-charon-doc +/doc/nrf/libraries/gazell/ @nrfconnect/ncs-si-muffin-doc +/doc/nrf/libraries/modem/nrf_modem_lib/ @nrfconnect/ncs-modem-doc +/doc/nrf/libraries/modem/at_cmd_custom.rst @nrfconnect/ncs-modem-doc +/doc/nrf/libraries/modem/at_cmd_parser.rst @nrfconnect/ncs-modem-doc +/doc/nrf/libraries/modem/at_host.rst @nrfconnect/ncs-modem-doc +/doc/nrf/libraries/modem/at_monitor.rst @nrfconnect/ncs-modem-doc +/doc/nrf/libraries/modem/at_params.rst @nrfconnect/ncs-modem-doc +/doc/nrf/libraries/modem/at_parser.rst @nrfconnect/ncs-modem-doc +/doc/nrf/libraries/modem/at_shell.rst @nrfconnect/ncs-cia-doc +/doc/nrf/libraries/modem/gcf_sms_lib.rst @nrfconnect/ncs-modem-doc +/doc/nrf/libraries/modem/index.rst @nrfconnect/ncs-modem-doc +/doc/nrf/libraries/modem/location.rst @nrfconnect/ncs-iot-positioning-doc +/doc/nrf/libraries/modem/lte_lc.rst @nrfconnect/ncs-iot-positioning-doc +/doc/nrf/libraries/modem/modem_antenna.rst @nrfconnect/ncs-iot-positioning-doc +/doc/nrf/libraries/modem/modem_attest_token.rst @nrfconnect/ncs-nrf-cloud-doc +/doc/nrf/libraries/modem/modem_battery.rst @nrfconnect/ncs-modem-doc +/doc/nrf/libraries/modem/modem_info.rst @nrfconnect/ncs-modem-doc +/doc/nrf/libraries/modem/modem_jwt.rst @nrfconnect/ncs-iot-oulu-tampere-doc +/doc/nrf/libraries/modem/modem_key_mgmt.rst @nrfconnect/ncs-modem-doc +/doc/nrf/libraries/modem/modem_slm.rst @nrfconnect/ncs-iot-oulu-tampere-doc +/doc/nrf/libraries/modem/pdn.rst @nrfconnect/ncs-modem-doc +/doc/nrf/libraries/modem/sms.rst @nrfconnect/ncs-iot-positioning-doc +/doc/nrf/libraries/modem/uicc_lwm2m.rst @nrfconnect/ncs-modem-doc +/doc/nrf/libraries/modem/zzhc.rst @nrfconnect/ncs-doc-leads +/doc/nrf/libraries/mpsl/ @nrfconnect/ncs-dragoon-doc +/doc/nrf/libraries/networking/aws_*.rst @nrfconnect/ncs-cia-doc +/doc/nrf/libraries/networking/azure_*.rst @nrfconnect/ncs-cia-doc +/doc/nrf/libraries/networking/coap_utils.rst @nrfconnect/ncs-terahertz-doc +/doc/nrf/libraries/networking/download_client.rst @nrfconnect/ncs-modem-doc +/doc/nrf/libraries/networking/fota_download.rst @nrfconnect/ncs-pluto-doc +/doc/nrf/libraries/networking/ftp_client.rst @nrfconnect/ncs-iot-oulu-tampere-doc +/doc/nrf/libraries/networking/icalendar_parser.rst @nrfconnect/ncs-doc-leads +/doc/nrf/libraries/networking/index.rst @nrfconnect/ncs-doc-leads +/doc/nrf/libraries/networking/lwm2m_*.rst @nrfconnect/ncs-iot-oulu-tampere-doc +/doc/nrf/libraries/networking/mqtt_helper.rst @nrfconnect/ncs-cia-doc +/doc/nrf/libraries/networking/nrf_cloud.rst @nrfconnect/ncs-nrf-cloud-doc +/doc/nrf/libraries/networking/nrf_cloud_*.rst @nrfconnect/ncs-nrf-cloud-doc +/doc/nrf/libraries/networking/nrf_provisioning.rst @nrfconnect/ncs-iot-oulu-tampere-doc +/doc/nrf/libraries/networking/rest_client.rst @nrfconnect/ncs-iot-positioning-doc +/doc/nrf/libraries/networking/softap_wifi_provision.rst @nrfconnect/ncs-cia-doc +/doc/nrf/libraries/networking/wifi_credentials.rst @nrfconnect/ncs-cia-doc +/doc/nrf/libraries/networking/wifi_mgmt_ext.rst @nrfconnect/ncs-cia-doc +/doc/nrf/libraries/networking/wifi_ready.rst @nrfconnect/ncs-wifi-doc +/doc/nrf/libraries/nfc/ @nrfconnect/ncs-si-muffin-doc +/doc/nrf/libraries/nrf_rpc/ @nrfconnect/ncs-si-muffin-doc +/doc/nrf/libraries/others/adp536x.rst @nrfconnect/ncs-cia-doc +/doc/nrf/libraries/others/app_event_manager.rst @nrfconnect/ncs-si-muffin-doc @nrfconnect/ncs-si-bluebagel-doc +/doc/nrf/libraries/others/app_event_manager_profiler_tracer.rst @nrfconnect/ncs-si-bluebagel-doc +/doc/nrf/libraries/others/audio_module.rst @nrfconnect/ncs-audio-doc +/doc/nrf/libraries/others/contin_array.rst @nrfconnect/ncs-audio-doc +/doc/nrf/libraries/others/data_fifo.rst @nrfconnect/ncs-audio-doc +/doc/nrf/libraries/others/date_time.rst @nrfconnect/ncs-iot-positioning-doc +/doc/nrf/libraries/others/dk_buttons_and_leds.rst @nrfconnect/ncs-cia-doc +/doc/nrf/libraries/others/dm.rst @nrfconnect/ncs-si-muffin-doc +/doc/nrf/libraries/others/dult.rst @nrfconnect/ncs-si-bluebagel-doc +/doc/nrf/libraries/others/ei_wrapper.rst @nrfconnect/ncs-si-muffin-doc +/doc/nrf/libraries/others/emds.rst @nrfconnect/ncs-paladin-doc +/doc/nrf/libraries/others/esb.rst @nrfconnect/ncs-si-muffin-doc +/doc/nrf/libraries/others/event_manager_proxy.rst @nrfconnect/ncs-si-muffin-doc +/doc/nrf/libraries/others/fem_al.rst @nrfconnect/ncs-si-muffin-doc +/doc/nrf/libraries/others/flash_map_pm.rst @nrfconnect/ncs-pluto-doc +/doc/nrf/libraries/others/hw_id.rst @nrfconnect/ncs-cia-doc +/doc/nrf/libraries/others/index.rst @nrfconnect/ncs-doc-leads +/doc/nrf/libraries/others/network_core_monitor.rst @nrfconnect/ncs-si-muffin-doc +/doc/nrf/libraries/others/nrf_profiler.rst @nrfconnect/ncs-si-bluebagel-doc +/doc/nrf/libraries/others/pcm_mix.rst @nrfconnect/ncs-audio-doc +/doc/nrf/libraries/others/pcm_stream_channel_modifier.rst @nrfconnect/ncs-audio-doc +/doc/nrf/libraries/others/qos.rst @nrfconnect/ncs-cia-doc +/doc/nrf/libraries/others/ram_pwrdn.rst @nrfconnect/ncs-terahertz-doc +/doc/nrf/libraries/others/sfloat.rst @nrfconnect/ncs-si-muffin-doc +/doc/nrf/libraries/others/st25r3911b_nfc.rst @nrfconnect/ncs-si-muffin-doc +/doc/nrf/libraries/others/supl_os_client.rst @nrfconnect/ncs-iot-positioning-doc +/doc/nrf/libraries/others/tone.rst @nrfconnect/ncs-audio-doc +/doc/nrf/libraries/others/uart_async_adapter.rst @nrfconnect/ncs-si-muffin-doc +/doc/nrf/libraries/others/wave_gen.rst @nrfconnect/ncs-si-muffin-doc +/doc/nrf/libraries/security/bootloader/ @nrfconnect/ncs-pluto-doc +/doc/nrf/libraries/security/nrf_security/ @nrfconnect/ncs-aegir-doc +/doc/nrf/libraries/security/tfm/ @nrfconnect/ncs-aegir-doc +/doc/nrf/libraries/security/fatal_error.rst @nrfconnect/ncs-doc-leads +/doc/nrf/libraries/security/hw_unique_key.rst @nrfconnect/ncs-aegir-doc +/doc/nrf/libraries/security/identity_key.rst @nrfconnect/ncs-aegir-doc +/doc/nrf/libraries/security/index.rst @nrfconnect/ncs-aegir-doc +/doc/nrf/libraries/security/trusted_storage.rst @nrfconnect/ncs-aegir-doc +/doc/nrf/libraries/shell/ @nrfconnect/ncs-doc-leads +/doc/nrf/libraries/zigbee/ @nrfconnect/ncs-terahertz-doc +/doc/nrf/libraries/index.rst @nrfconnect/ncs-doc-leads +/doc/nrf/protocols/amazon_sidewalk/ @nrfconnect/ncs-sidewalk-doc +/doc/nrf/protocols/bt/bt_mesh/ @nrfconnect/ncs-paladin-doc +/doc/nrf/protocols/bt/bt_qualification/ @nrfconnect/ncs-dragoon-doc +/doc/nrf/protocols/bt/ @nrfconnect/ncs-dragoon-doc +/doc/nrf/protocols/coexistence/ @nrfconnect/ncs-doc-leads +/doc/nrf/protocols/dect/ @nrfconnect/ncs-modem-doc +/doc/nrf/protocols/esb/ @nrfconnect/ncs-si-muffin-doc +/doc/nrf/protocols/gazell/ @nrfconnect/ncs-si-muffin-doc +/doc/nrf/protocols/lte/ @nrfconnect/ncs-carrier-doc +/doc/nrf/protocols/matter/ @nrfconnect/ncs-matter-doc +/doc/nrf/protocols/multiprotocol/ @nrfconnect/ncs-doc-leads +/doc/nrf/protocols/nfc/ @nrfconnect/ncs-si-muffin-doc +/doc/nrf/protocols/thread/ @nrfconnect/ncs-terahertz-doc +/doc/nrf/protocols/wifi/ @nrfconnect/ncs-wifi-doc +/doc/nrf/protocols/zigbee/ @nrfconnect/ncs-terahertz-doc +/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/cellular.rst @nrfconnect/ncs-cia-doc +/doc/nrf/samples/crypto.rst @nrfconnect/ncs-aegir-doc +/doc/nrf/samples/debug.rst @nrfconnect/ncs-cia-doc +/doc/nrf/samples/dect.rst @nrfconnect/ncs-modem-doc +/doc/nrf/samples/edge.rst @nrfconnect/ncs-si-muffin-doc +/doc/nrf/samples/esb.rst @nrfconnect/ncs-si-muffin-doc +/doc/nrf/samples/fast_pair.rst @nrfconnect/ncs-si-bluebagel-doc +/doc/nrf/samples/gazell.rst @nrfconnect/ncs-si-muffin-doc +/doc/nrf/samples/keys.rst @nrfconnect/ncs-aegir-doc +/doc/nrf/samples/matter.rst @nrfconnect/ncs-matter-doc +/doc/nrf/samples/mesh.rst @nrfconnect/ncs-paladin-doc +/doc/nrf/samples/net.rst @nrfconnect/ncs-doc-leads +/doc/nrf/samples/nfc.rst @nrfconnect/ncs-si-muffin-doc +/doc/nrf/samples/nrf5340.rst @nrfconnect/ncs-doc-leads +/doc/nrf/samples/other.rst @nrfconnect/ncs-doc-leads +/doc/nrf/samples/peripheral.rst @nrfconnect/ncs-radio-sw-doc +/doc/nrf/samples/pmic.rst @nrfconnect/ncs-pmic-doc +/doc/nrf/samples/sdfw.rst @nrfconnect/ncs-aurora-doc +/doc/nrf/samples/sensor.rst @nrfconnect/ncs-cia-doc +/doc/nrf/samples/serialization.rst @nrfconnect/ncs-si-muffin-doc +/doc/nrf/samples/suit.rst @nrfconnect/ncs-charon-doc +/doc/nrf/samples/tfm.rst @nrfconnect/ncs-aegir-doc +/doc/nrf/samples/thread.rst @nrfconnect/ncs-terahertz-doc +/doc/nrf/samples/wifi.rst @nrfconnect/ncs-wifi-doc +/doc/nrf/samples/wifi_provisioning.rst @nrfconnect/ncs-wifi-doc +/doc/nrf/samples/wifi_zephyr.rst @nrfconnect/ncs-wifi-doc +/doc/nrf/samples/zigbee.rst @nrfconnect/ncs-terahertz-doc +/doc/nrf/security/ @nrfconnect/ncs-aegir-doc +/doc/nrf/templates/ @nrfconnect/ncs-doc-leads +/doc/nrf/test_and_optimize/ @nrfconnect/ncs-doc-leads +/doc/nrf/test_and_optimize/optimizing/power_nrf91.rst @nrfconnect/ncs-cia-doc + +/doc/**/*.svg @nrfconnect/ncs-doc-leads +/doc/**/*.png @nrfconnect/ncs-doc-leads + # Drivers -/drivers/ @nrfconnect/ncs-co-drivers -/drivers/gpio/ @nrfconnect/ncs-co-drivers @masz-nordic +/drivers/bluetooth/ @nrfconnect/ncs-co-drivers @nrfconnect/ncs-dragoon +/drivers/entropy/ @nrfconnect/ncs-co-drivers @nrfconnect/ncs-aegir +/drivers/flash/ @nrfconnect/ncs-co-drivers +/drivers/gpio/ @nrfconnect/ncs-co-drivers @nrfconnect/ncs-ll-ursus +/drivers/hw_cc3xx/ @nrfconnect/ncs-co-drivers @nrfconnect/ncs-aegir +/drivers/mpsl/ @nrfconnect/ncs-co-drivers @nrfconnect/ncs-dragoon +/drivers/net/ @nrfconnect/ncs-co-drivers @doki-nordic /drivers/serial/ @nrfconnect/ncs-co-drivers @nordic-krch /drivers/sensor/bh1749/ @nrfconnect/ncs-co-drivers @nrfconnect/ncs-cia /drivers/sensor/bme68x_iaq/ @nrfconnect/ncs-co-drivers @nrfconnect/ncs-cia /drivers/sensor/paw3212/ @nrfconnect/ncs-co-drivers @nrfconnect/ncs-si-bluebagel /drivers/sensor/pmw3360/ @nrfconnect/ncs-co-drivers @nrfconnect/ncs-si-bluebagel +/drivers/sensor/sensor_sim/ @nrfconnect/ncs-co-drivers @nrfconnect/ncs-cia +/drivers/sensor/sensor_stub/ @nrfconnect/ncs-co-drivers @nrfconnect/ncs-cia # Devicetree /dts/ @nrfconnect/ncs-co-drivers # External -/ext/ @carlescufi +/ext/curl/ @nrfconnect/ncs-code-owners @jhirsi +/ext/freebsd-getopt/ @nrfconnect/ncs-code-owners +/ext/iperf3/ @nrfconnect/ncs-code-owners @jhirsi # Include -/include/ @nrfconnect/ncs-code-owners -/include/net/azure_* @nrfconnect/ncs-cia @coderbyheart -/include/net/wifi_credentials.h @nrfconnect/ncs-cia -/include/net/nrf_cloud_* @nrfconnect/ncs-nrf-cloud /include/audio/ @nrfconnect/ncs-audio /include/audio_module/ @nrfconnect/ncs-audio /include/bluetooth/ @nrfconnect/ncs-si-muffin @nrfconnect/ncs-dragoon -/include/bluetooth/services/fast_pair/ @nrfconnect/ncs-si-bluebagel /include/bluetooth/adv_prov.h @nrfconnect/ncs-si-bluebagel /include/bluetooth/mesh/ @nrfconnect/ncs-paladin +/include/bluetooth/services/fast_pair/ @nrfconnect/ncs-si-bluebagel /include/caf/ @nrfconnect/ncs-si-muffin @nrfconnect/ncs-si-bluebagel +/include/debug/ @nrfconnect/ncs-co-drivers /include/debug/ppi_trace.h @nrfconnect/ncs-co-drivers @nordic-krch +/include/dfu/ @nrfconnect/ncs-code-owners /include/dfu/dfu_target_suit.h @nrfconnect/ncs-charon /include/dfu/suit_dfu_fetch_source.h @nrfconnect/ncs-charon /include/dfu/suit_dfu.h @nrfconnect/ncs-charon -/include/drivers/ @nrfconnect/ncs-co-drivers -/include/drivers/gpio/ @nrfconnect/ncs-co-drivers @masz-nordic -/include/dult.h @nrfconnect/ncs-si-bluebagel +/include/drivers/flash/ @nrfconnect/ncs-co-drivers +/include/drivers/gpio/ @nrfconnect/ncs-co-drivers @nrfconnect/ncs-ll-ursus +/include/drivers/bme68x_iaq.h @nrfconnect/ncs-co-drivers @nrfconnect/ncs-cia +/include/drivers/sensor_sim.h @nrfconnect/ncs-co-drivers @nrfconnect/ncs-cia +/include/drivers/sensor_stub.h @nrfconnect/ncs-co-drivers @nrfconnect/ncs-cia +/include/emds/ @balaklaka @nrfconnect/ncs-paladin +/include/fem_al/ @nrfconnect/ncs-dragoon /include/logging/ @nrfconnect/ncs-protocols-serialization +/include/mgmt/ @nrfconnect/ncs-pluto +/include/modem/ @nrfconnect/ncs-modem /include/mpsl/ @nrfconnect/ncs-dragoon -/include/net/ @nrfconnect/ncs-co-networking +/include/net/azure_* @nrfconnect/ncs-cia @coderbyheart +/include/net/nrf_cloud_* @nrfconnect/ncs-nrf-cloud +/include/net/wifi_credentials.h @nrfconnect/ncs-cia /include/nfc/ @nrfconnect/ncs-co-drivers @nrfconnect/ncs-si-muffin /include/nrf_compress/ @nordicjm +/include/nrf_rpc/ @nrfconnect/ncs-co-drivers @nrfconnect/ncs-si-muffin +/include/power/ @nrfconnect/ncs-co-drivers /include/sdfw/ @nrfconnect/ncs-aurora /include/sdfw/sdfw_services/extmem_remote.h @nrfconnect/ncs-charon /include/sdfw/sdfw_services/suit_service.h @nrfconnect/ncs-charon +/include/sdp/ @nrfconnect/ncs-ll-ursus /include/shell/ @nordic-krch +/include/tfm/ @nrfconnect/ncs-aegir +/include/zigbee/ @nrfconnect/ncs-zigbee +/include/dult.h @nrfconnect/ncs-si-bluebagel # Libraries -/lib/ @nrfconnect/ncs-code-owners -/lib/bin/ @nrfconnect/ncs-co-networking @lemrey -/lib/bin/lwm2m_carrier/ @nrfconnect/ncs-carrier -/lib/boot_banner/ @nordicjm /lib/adp536x/ @nrfconnect/ncs-cia /lib/at_cmd_parser/ @nrfconnect/ncs-co-networking @nrfconnect/ncs-modem /lib/at_cmd_custom/ @nrfconnect/ncs-modem @@ -118,55 +343,62 @@ /lib/at_monitor/ @nrfconnect/ncs-co-networking @nrfconnect/ncs-modem /lib/at_parser/ @nrfconnect/ncs-co-networking @nrfconnect/ncs-modem /lib/at_shell/ @nrfconnect/ncs-cia -/lib/gcf_sms/ @nrfconnect/ncs-modem -/lib/nrf_modem_lib/ @nrfconnect/ncs-co-networking @nrfconnect/ncs-modem +/lib/bin/ @nrfconnect/ncs-co-networking @lemrey +/lib/bin/lwm2m_carrier/ @nrfconnect/ncs-carrier +/lib/boot_banner/ @nordicjm +/lib/contin_array/ @nrfconnect/ncs-audio +/lib/data_fifo/ @nrfconnect/ncs-audio +/lib/date_time/ @trantanen @tokangas +/lib/dk_buttons_and_leds/ @nrfconnect/ncs-si-muffin /lib/edge_impulse/ @nrfconnect/ncs-si-muffin +/lib/fatal_error/ @nordic-krch /lib/fem_al/ @nrfconnect/ncs-si-muffin -/lib/fprotect/ @nrfconnect/ncs-pluto /lib/flash_patch/ @nrfconnect/ncs-pluto +/lib/fprotect/ @nrfconnect/ncs-pluto +/lib/gcf_sms/ @nrfconnect/ncs-modem +/lib/hw_id/ @nrfconnect/ncs-cia +/lib/hw_unique_key/ @nrfconnect/ncs-aegir +/lib/identity_key/ @nrfconnect/ncs-aegir /lib/location/ @trantanen @jhirsi @tokangas /lib/lte_link_control/ @tokangas @trantanen @jhirsi @nrfconnect/ncs-modem /lib/modem_antenna/ @tokangas @nrfconnect/ncs-modem +/lib/modem_attest_token/ @jayteemo /lib/modem_battery/ @nrfconnect/ncs-modem /lib/modem_info/ @nrfconnect/ncs-co-networking @nrfconnect/ncs-modem +/lib/modem_jwt/ @nrfconnect/ncs-iot-oulu @nrfconnect/ncs-modem /lib/modem_key_mgmt/ @nrfconnect/ncs-co-networking @nrfconnect/ncs-modem +/lib/modem_slm/ @nrfconnect/ncs-iot-oulu /lib/multithreading_lock/ @nrfconnect/ncs-dragoon +/lib/nrf_modem_lib/ @nrfconnect/ncs-co-networking @nrfconnect/ncs-modem +/lib/pcm_mix/ @nrfconnect/ncs-audio +/lib/pcm_stream_channel_modifier/ @nrfconnect/ncs-audio /lib/pdn/ @nrfconnect/ncs-co-networking @nrfconnect/ncs-modem +/lib/qos/ @nrfconnect/ncs-cia /lib/ram_pwrdn/ @MarekPorwisz -/lib/fatal_error/ @nordic-krch +/lib/sample_rate_converter/ @nrfconnect/ncs-audio /lib/sfloat/ @nrfconnect/ncs-si-muffin /lib/sms/ @trantanen @tokangas /lib/st25r3911b/ @nrfconnect/ncs-si-muffin /lib/supl/ @nrfconnect/ncs-co-networking @tokangas -/lib/date_time/ @trantanen @tokangas -/lib/hw_id/ @nrfconnect/ncs-cia -/lib/wave_gen/ @nrfconnect/ncs-si-muffin -/lib/hw_unique_key/ @nrfconnect/ncs-aegir -/lib/identity_key/ @nrfconnect/ncs-aegir -/lib/modem_jwt/ @nrfconnect/ncs-iot-oulu @nrfconnect/ncs-modem -/lib/modem_slm/ @nrfconnect/ncs-iot-oulu -/lib/modem_attest_token/ @jayteemo -/lib/qos/ @nrfconnect/ncs-cia -/lib/contin_array/ @nrfconnect/ncs-audio -/lib/data_fifo/ @nrfconnect/ncs-audio -/lib/pcm_mix/ @nrfconnect/ncs-audio -/lib/pcm_stream_channel_modifier/ @nrfconnect/ncs-audio -/lib/sample_rate_converter/ @nrfconnect/ncs-audio /lib/tone/ @nrfconnect/ncs-audio +/lib/uicc_lwm2m/ @stig-bjorlykke +/lib/wave_gen/ @nrfconnect/ncs-si-muffin # Modules -/modules/ @nrfconnect/ncs-co-build-system -/modules/mcuboot/ @nrfconnect/ncs-pluto +/modules/azure-sdk-for-c/ @nrfconnect/ncs-cia @plskeggs /modules/cjson/ @nrfconnect/ncs-cia @plskeggs -/modules/trusted-firmware-m/ @nrfconnect/ncs-aegir /modules/coremark/ @nrfconnect/ncs-si-bluebagel +/modules/mcuboot/ @nrfconnect/ncs-pluto +/modules/memfault-firmware-sdk/ @nrfconnect/ncs-cia @plskeggs +/modules/nrfxlib/ @nrfconnect/ncs-code-owners +/modules/trusted-firmware-m/ @nrfconnect/ncs-aegir +/modules/wfa-qt/ @nrfconnect/ncs-wifi # Samples -/samples/ @nrfconnect/ncs-code-owners /samples/CMakeLists.txt @nrfconnect/ncs-co-build-system -/samples/net/ @nrfconnect/ncs-cia @nrfconnect/ncs-modem -/samples/sensor/bh1749/ @nrfconnect/ncs-cia -/samples/sensor/bme68x_iaq/ @nrfconnect/ncs-cia +/samples/app_event_manager/ @nrfconnect/ncs-si-muffin @nrfconnect/ncs-si-bluebagel +/samples/app_event_manager_profiler_tracer/ @nrfconnect/ncs-si-muffin @nrfconnect/ncs-si-bluebagel +/samples/benchmarks/coremark/ @nrfconnect/ncs-si-bluebagel /samples/bluetooth/ @nrfconnect/ncs-si-muffin @nrfconnect/ncs-dragoon /samples/bluetooth/broadcast_config_tool/ @nrfconnect/ncs-audio /samples/bluetooth/mesh/ @nrfconnect/ncs-paladin @@ -174,47 +406,59 @@ /samples/bluetooth/direction_finding_connectionless_tx/ @ppryga-nordic /samples/bluetooth/fast_pair/ @nrfconnect/ncs-si-bluebagel /samples/bootloader/ @nrfconnect/ncs-pluto -/samples/matter/ @nrfconnect/ncs-matter +/samples/caf/ @nrfconnect/ncs-si-muffin @nrfconnect/ncs-si-bluebagel +/samples/caf_sensor_manager/ @nrfconnect/ncs-si-muffin @nrfconnect/ncs-si-bluebagel +/samples/cellular/ @nrfconnect/ncs-co-networking @nrfconnect/ncs-modem +/samples/cellular/battery/ @nrfconnect/ncs-modem +/samples/cellular/location/ @trantanen @jhirsi @tokangas +/samples/cellular/lwm2m_carrier/ @nrfconnect/ncs-carrier +/samples/cellular/lwm2m_client/ @nrfconnect/ncs-co-networking @nrfconnect/ncs-iot-oulu +/samples/cellular/modem_shell/ @trantanen @jhirsi @tokangas +/samples/cellular/nidd/ @stig-bjorlykke +/samples/cellular/nrf_cloud_* @nrfconnect/ncs-nrf-cloud +/samples/cellular/nrf_provisioning/ @nrfconnect/ncs-iot-oulu +/samples/cellular/modem_trace_flash/ @nrfconnect/ncs-modem +/samples/cellular/slm_shell/ @nrfconnect/ncs-iot-oulu +/samples/cellular/sms/ @trantanen @tokangas +/samples/cellular/uicc_lwm2m/ @stig-bjorlykke +/samples/common/ @nrfconnect/ncs-si-muffin @nrfconnect/ncs-si-bluebagel /samples/crypto/ @nrfconnect/ncs-aegir /samples/debug/memfault/ @nrfconnect/ncs-cia /samples/debug/ppi_trace/ @nordic-krch -/samples/hw_id/ @nrfconnect/ncs-cia +/samples/dect/dect_phy/dect_shell/ @jhirsi +/samples/dect/dect_phy/hello_dect/ @nrfconnect/ncs-modem /samples/edge_impulse/ @nrfconnect/ncs-si-muffin -/samples/esb/ @lemrey -/samples/app_event_manager/ @nrfconnect/ncs-si-muffin @nrfconnect/ncs-si-bluebagel +/samples/esb/ @nrfconnect/ncs-si-muffin /samples/event_manager_proxy/ @nrfconnect/ncs-si-muffin /samples/gazell/ @leewkb4567 +/samples/hw_id/ @nrfconnect/ncs-cia +/samples/ipc/ipc_service/ @nrfconnect/ncs-si-muffin /samples/keys/ @nrfconnect/ncs-aegir +/samples/matter/ @nrfconnect/ncs-matter /samples/mpsl/ @nrfconnect/ncs-dragoon +/samples/net/ @nrfconnect/ncs-cia @nrfconnect/ncs-modem /samples/nfc/ @nrfconnect/ncs-si-muffin +/samples/nrf5340/netboot/ @nrfconnect/ncs-pluto +/samples/nrf5340/multiprotocol_rpmsg/ @hubertmis /samples/nrf_rpc/ @nrfconnect/ncs-si-muffin +/samples/sensor/bh1749/ @nrfconnect/ncs-cia +/samples/sensor/bme68x_iaq/ @nrfconnect/ncs-cia /samples/nrf5340/empty_app_core/ @nrfconnect/ncs-si-muffin -/samples/cellular/ @nrfconnect/ncs-co-networking @nrfconnect/ncs-modem -/samples/cellular/battery/ @MirkoCovizzi -/samples/cellular/location/ @trantanen @jhirsi @tokangas -/samples/cellular/lwm2m_carrier/ @nrfconnect/ncs-carrier -/samples/cellular/lwm2m_client/ @nrfconnect/ncs-co-networking @nrfconnect/ncs-iot-oulu -/samples/cellular/modem_shell/ @trantanen @jhirsi @tokangas -/samples/cellular/nidd/ @stig-bjorlykke -/samples/cellular/nrf_cloud_* @nrfconnect/ncs-nrf-cloud -/samples/cellular/nrf_provisioning/ @nrfconnect/ncs-iot-oulu -/samples/cellular/modem_trace_flash/ @eivindj-nordic -/samples/cellular/slm_shell/ @nrfconnect/ncs-iot-oulu -/samples/cellular/sms/ @trantanen @tokangas -/samples/openthread/ @nrfconnect/ncs-co-networking @nrfconnect/ncs-thread +/samples/nrf_compress/ @nordicjm /samples/nrf_profiler/ @nrfconnect/ncs-si-bluebagel /samples/nrf_rpc/protocols_serialization/ @nrfconnect/ncs-protocols-serialization -/samples/peripheral/radio_test/ @nrfconnect/ncs-si-muffin -/samples/peripheral/lpuart/ @nordic-krch +/samples/openthread/ @nrfconnect/ncs-co-networking @nrfconnect/ncs-thread /samples/peripheral/802154_phy_test/ @nrfconnect/ncs-radio-sw /samples/peripheral/802154_sniffer/ @e-rk -/samples/tfm/ @nrfconnect/ncs-aegir -/samples/zigbee/ @nrfconnect/ncs-zigbee -/samples/nrf5340/netboot/ @nrfconnect/ncs-pluto -/samples/nrf5340/multiprotocol_rpmsg/ @hubertmis +/samples/peripheral/lpuart/ @nordic-krch +/samples/peripheral/radio_test/ @nrfconnect/ncs-si-muffin +/samples/pmic/native/ @nordic-auko /samples/sdfw/ @nrfconnect/ncs-aurora /samples/sdfw/ssf_client/ @anhmolt +/samples/sensor/bh1749/ @nrfconnect/ncs-co-drivers @nrfconnect/ncs-cia +/samples/sensor/bme68x_iaq/ @nrfconnect/ncs-co-drivers @nrfconnect/ncs-cia /samples/suit/ @nrfconnect/ncs-charon +/samples/tfm/ @nrfconnect/ncs-aegir /samples/wifi/provisioning/ble/ @wentong-li @bama-nordic /samples/wifi/provisioning/softap/ @nrfconnect/ncs-cia /samples/wifi/radio_test/ @bama-nordic @sachinthegreen @@ -229,11 +473,72 @@ /samples/wifi/softap/ @D-Triveni @krish2718 /samples/wifi/monitor/ @D-Triveni /samples/wifi/promiscuous/ @D-Triveni -/samples/benchmarks/coremark/ @nrfconnect/ncs-si-bluebagel -/samples/**/*.rst @nrfconnect/ncs-doc-owners +/samples/zigbee/ @nrfconnect/ncs-zigbee + +/samples/app_event_manager/*.rst @nrfconnect/ncs-si-muffin-doc @nrfconnect/ncs-si-bluebagel-doc +/samples/app_event_manager_profiler_tracer/*.rst @nrfconnect/ncs-si-muffin-doc +/samples/benchmarks/coremark/*.rst @nrfconnect/ncs-si-bluebagel-doc +/samples/bluetooth/**/*.rst @nrfconnect/ncs-dragoon-doc @nrfconnect/ncs-si-muffin-doc +/samples/bluetooth/broadcast_config_tool/*.rst @nrfconnect/ncs-audio-doc +/samples/bluetooth/fast_pair/**/*.rst @nrfconnect/ncs-si-bluebagel-doc +/samples/bluetooth/mesh/**/*.rst @nrfconnect/ncs-paladin-doc +/samples/bootloader/*.rst @nrfconnect/ncs-pluto-doc +/samples/caf/*.rst @nrfconnect/ncs-si-muffin-doc @nrfconnect/ncs-si-bluebagel-doc +/samples/caf_sensor_manager/*.rst @nrfconnect/ncs-si-muffin-doc @nrfconnect/ncs-si-bluebagel-doc +/samples/cellular/**/*.rst @nrfconnect/ncs-modem-doc +/samples/cellular/gnss/*.rst @nrfconnect/ncs-iot-positioning-doc +/samples/cellular/location/*.rst @nrfconnect/ncs-iot-positioning-doc +/samples/cellular/lwm2m_carrier/*.rst @nrfconnect/ncs-carrier-doc +/samples/cellular/lwm2m_client/*.rst @nrfconnect/ncs-iot-oulu-tampere-doc +/samples/cellular/modem_shell/*.rst @nrfconnect/ncs-iot-positioning-doc +/samples/cellular/nrf_cloud_*/**/*.rst @nrfconnect/ncs-nrf-cloud-doc +/samples/cellular/nrf_provisioning/*.rst @nrfconnect/ncs-iot-oulu-tampere-doc +/samples/cellular/slm_shell/*.rst @nrfconnect/ncs-iot-oulu-tampere-doc +/samples/cellular/sms/*.rst @nrfconnect/ncs-iot-positioning-doc +/samples/crypto/**/*.rst @nrfconnect/ncs-aegir-doc +/samples/debug/memfault/*.rst @nrfconnect/ncs-cia-doc +/samples/debug/ppi_trace/*.rst @nrfconnect/ncs-doc-leads +/samples/dect/**/*.rst @nrfconnect/ncs-modem-doc +/samples/esb/**/*.rst @nrfconnect/ncs-si-muffin-doc +/samples/edge_impulse/**/*.rst @nrfconnect/ncs-si-muffin-doc +/samples/event_manager_proxy/*.rst @nrfconnect/ncs-si-muffin-doc +/samples/gazell/**/*.rst @nrfconnect/ncs-si-muffin-doc +/samples/hw_id/*.rst @nrfconnect/ncs-cia-doc +/samples/ipc/ipc_service/*.rst @nrfconnect/ncs-si-muffin-doc +/samples/keys/**/*.rst @nrfconnect/ncs-aegir-doc +/samples/matter/**/*.rst @nrfconnect/ncs-matter-doc +/samples/mpsl/**/*.rst @nrfconnect/ncs-dragoon-doc +/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/nrf5340/empty_app_core/*.rst @nrfconnect/ncs-si-muffin-doc +/samples/nrf5340/empty_net_core/*.rst @nrfconnect/ncs-si-bluebagel-doc +/samples/nrf5340/extxip_smp_svr/*.rst @nrfconnect/ncs-pluto-doc +/samples/nrf5340/multiprotocol_rpmsg/*.rst @nrfconnect/ncs-doc-leads +/samples/nrf5340/netboot/*.rst @nrfconnect/ncs-pluto-doc +/samples/nrf5340/remote_shell/*.rst @nrfconnect/ncs-si-muffin-doc +/samples/nrf_profiler/*.rst @nrfconnect/ncs-si-bluebagel-doc +/samples/nrf_rpc/entropy_nrf53/*.rst @nrfconnect/ncs-si-muffin-doc +/samples/nrf_rpc/protocols_serialization/**/*.rst @nrfconnect/ncs-terahertz-doc +/samples/openthread/**/*.rst @nrfconnect/ncs-terahertz-doc +/samples/peripheral/802154_phy_test/*.rst @nrfconnect/ncs-radio-sw-doc +/samples/peripheral/802154_sniffer/*.rst @nrfconnect/ncs-radio-sw-doc +/samples/peripheral/lpuart/*.rst @nrfconnect/ncs-doc-leads +/samples/peripheral/radio_test/*.rst @nrfconnect/ncs-si-muffin-doc +/samples/pmic/**/*.rst @nrfconnect/ncs-pmic-doc +/samples/sdfw/**/*.rst @nrfconnect/ncs-aurora-doc +/samples/sensor/**/*.rst @nrfconnect/ncs-cia-doc +/samples/suit/**/*.rst @nrfconnect/ncs-charon-doc +/samples/tfm/**/*.rst @nrfconnect/ncs-aegir-doc +/samples/wifi/**/*.rst @nrfconnect/ncs-wifi-doc +/samples/wifi/provisioning/softap/*.rst @nrfconnect/ncs-cia-doc +/samples/zigbee/**/*.rst @nrfconnect/ncs-terahertz-doc + +/samples/**/*.svg @nrfconnect/ncs-doc-leads +/samples/**/*.png @nrfconnect/ncs-doc-leads + # Scripts -/scripts/ @nrfconnect/ncs-code-owners /scripts/docker/ @nrfconnect/ncs-ci /scripts/ci/tags.yaml @nordic-piks @PerMac @katgiadla /scripts/ci/twister_ignore.txt @nordic-piks @PerMac @katgiadla @@ -242,6 +547,7 @@ /scripts/ncs-toolchain-version-minimum.txt @nrfconnect/ncs-co-build-system @nrfconnect/ncs-ci /scripts/tools-versions-*.txt @nrfconnect/ncs-co-build-system @nrfconnect/ncs-ci /scripts/requirements-*.txt @nrfconnect/ncs-co-build-system @nrfconnect/ncs-ci +/scripts/west_commands/genboard/ @gmarull /scripts/west_commands/sbom/ @nrfconnect/ncs-si-muffin /scripts/west_commands/thingy91x_dfu.py @nrfconnect/ncs-cia /scripts/bootloader/ @nrfconnect/ncs-pluto @@ -249,27 +555,39 @@ /scripts/print_docker_image.sh @nrfconnect/ncs-ci /scripts/print_toolchain_checksum.sh @nrfconnect/ncs-ci +/scripts/hid_configurator/*.rst @nrfconnect/ncs-si-bluebagel-doc +/scripts/memfault/*.rst @nrfconnect/ncs-cia-doc +/scripts/nrf_provision/fast_pair/*.rst @nrfconnect/ncs-si-bluebagel-doc +/scripts/partition_manager/*.rst @nrfconnect/ncs-aurora-doc +/scripts/shell/ble_console/**/*.rst @nrfconnect/ncs-doc-leads +/scripts/west_commands/sbom/*.rst @nrfconnect/ncs-si-muffin-doc + # Share -/share/ @nrfconnect/ncs-co-build-system +/share/ @nrfconnect/ncs-co-build-system # Snippets -/snippets/ @nrfconnect/ncs-co-boards @nrfconnect/ncs-co-build-system -/snippets/emulated*/ @masz-nordic +/snippets/ci-shell/ @nrfconnect/ncs-protocols-serialization +/snippets/emulated*/ @nrfconnect/ncs-ll-ursus /snippets/hw-flow-control/ @nrfconnect/ncs-low-level-test @miha-nordic +/snippets/matter-diagnostic-logs/ @nrfconnect/ncs-matter +/snippets/nordic-bt-rpc/ @ppryga-nordic +/snippets/nrf70-driver-debug/ @krish2718 @sachinthegreen +/snippets/nrf70-driver-verbose-debug/ @krish2718 @sachinthegreen +/snippets/nrf70-fw-patch-ext-flash/ @krish2718 @sachinthegreen +/snippets/nrf70-wifi/ @krish2718 @sachinthegreen /snippets/nrf91-modem-trace-ext-flash/ @nrfconnect/ncs-cia -/snippets/nrf91-modem-trace-uart/ @eivindj-nordic +/snippets/nrf91-modem-trace-ram/ @nrfconnect/ncs-modem +/snippets/nrf91-modem-trace-rtt/ @nrfconnect/ncs-modem +/snippets/nrf91-modem-trace-uart/ @nrfconnect/ncs-modem /snippets/tfm-enable-share-uart/ @nrfconnect/ncs-cia -/snippets/nrf70-driver-verbose-debug/ @krish2718 @sachinthegreen -/snippets/nrf70-driver-debug/ @krish2718 @sachinthegreen /snippets/wpa-supplicant-debug/ @krish2718 @sachinthegreen -/snippets/nrf70-fw-patch-ext-flash/ @krish2718 @sachinthegreen -/snippets/nordic-bt-rpc/ @ppryga-nordic -/snippets/matter-diagnostic-logs/ @nrfconnect/ncs-matter -/snippets/ci-shell/ @nrfconnect/ncs-protocols-serialization /snippets/zperf/ @nrfconnect/ncs-protocols-serialization +/snippets/nordic-bt-rpc/*.rst @nrfconnect/ncs-doc-leads + # Subsystems -/subsys/ @nrfconnect/ncs-code-owners +/subsys/app_event_manager/ @nrfconnect/ncs-si-muffin @nrfconnect/ncs-si-bluebagel +/subsys/app_event_manager_profiler_tracer/ @nrfconnect/ncs-si-bluebagel /subsys/audio/audio_module_template/ @nrfconnect/ncs-audio /subsys/audio_module/ @nrfconnect/ncs-audio /subsys/bluetooth/ @nrfconnect/ncs-si-muffin @nrfconnect/ncs-dragoon @@ -277,6 +595,7 @@ /subsys/bluetooth/controller/ @nrfconnect/ncs-dragoon /subsys/bluetooth/host_extensions/ @nrfconnect/ncs-dragoon /subsys/bluetooth/mesh/ @nrfconnect/ncs-paladin +/subsys/bluetooth/rpc/ @nrfconnect/ncs-si-bluebagel /subsys/bluetooth/services/fast_pair/ @nrfconnect/ncs-si-bluebagel /subsys/bluetooth/services/wifi_prov/ @wentong-li @bama-nordic /subsys/bootloader/ @nrfconnect/ncs-pluto @@ -286,17 +605,15 @@ /subsys/dfu/dfu_multi_image/ @Damian-Nordic /subsys/dm/ @nrfconnect/ncs-si-muffin /subsys/dult/ @nrfconnect/ncs-si-bluebagel -/subsys/ieee802154/ @nrfconnect/ncs-co-networking @nrfconnect/ncs-radio-sw -/subsys/mgmt/ @nrfconnect/ncs-pluto -/subsys/mgmt/suitfu/ @nrfconnect/ncs-charon /subsys/emds/ @balaklaka @nrfconnect/ncs-paladin /subsys/esb/ @lemrey -/subsys/app_event_manager/ @nrfconnect/ncs-si-muffin @nrfconnect/ncs-si-bluebagel -/subsys/app_event_manager_profiler_tracer/ @nrfconnect/ncs-si-bluebagel /subsys/event_manager_proxy/ @nrfconnect/ncs-si-muffin /subsys/fw_info/ @nrfconnect/ncs-pluto /subsys/gazell/ @leewkb4567 +/subsys/ieee802154/ @nrfconnect/ncs-co-networking @nrfconnect/ncs-radio-sw /subsys/logging/ @nrfconnect/ncs-protocols-serialization +/subsys/mgmt/ @nrfconnect/ncs-pluto +/subsys/mgmt/suitfu/ @nrfconnect/ncs-charon /subsys/mpsl/ @nrfconnect/ncs-dragoon /subsys/mpsl/cx/ @ankuns @martintv /subsys/mpsl/fem/ @ankuns @martintv @@ -307,29 +624,29 @@ /subsys/net/lib/ftp_client/ @nrfconnect/ncs-iot-oulu /subsys/net/lib/icalendar_parser/ @lats1980 /subsys/net/lib/lwm2m_client_utils/ @nrfconnect/ncs-co-networking @nrfconnect/ncs-iot-oulu -/subsys/net/lib/nrf_cloud/ @nrfconnect/ncs-nrf-cloud +/subsys/net/lib/nrf_cloud/ @nrfconnect/ncs-nrf-cloud /subsys/net/lib/nrf_provisioning/ @nrfconnect/ncs-iot-oulu /subsys/net/lib/zzhc/ @junqingzou /subsys/net/lib/wifi_credentials/ @nrfconnect/ncs-cia /subsys/net/lib/softap_wifi_provision/ @nrfconnect/ncs-cia /subsys/net/openthread/ @nrfconnect/ncs-co-networking @nrfconnect/ncs-thread /subsys/net/openthread/rpc/ @nrfconnect/ncs-protocols-serialization +/subsys/net_core_monitor/ @nrfconnect/ncs-si-muffin /subsys/nfc/ @nrfconnect/ncs-si-muffin /subsys/nfc/rpc/ @nrfconnect/ncs-protocols-serialization /subsys/nrf_compress/ @nordicjm +/subsys/nrf_profiler/ @nrfconnect/ncs-si-bluebagel /subsys/nrf_rpc/ @nrfconnect/ncs-si-muffin +/subsys/nrf_security/ @nrfconnect/ncs-aegir /subsys/partition_manager/ @nordicjm @tejlmand /subsys/pcd/ @nrfconnect/ncs-pluto -/subsys/nrf_profiler/ @nrfconnect/ncs-si-bluebagel -/subsys/shell/ @nordic-krch /subsys/sdfw_services/ @nrfconnect/ncs-aurora /subsys/sdfw_services/services/extmem/ @nrfconnect/ncs-charon /subsys/sdfw_services/services/suit_service/ @nrfconnect/ncs-charon +/subsys/shell/ @nordic-krch /subsys/suit/ @nrfconnect/ncs-charon -/subsys/nrf_security/ @nrfconnect/ncs-aegir /subsys/trusted_storage/ @nrfconnect/ncs-aegir /subsys/uart_async_adapter/ @nrfconnect/ncs-si-muffin -/subsys/net_core_monitor/ @nrfconnect/ncs-si-muffin /subsys/zigbee/ @nrfconnect/ncs-zigbee # Sysbuild @@ -338,60 +655,62 @@ /sysbuild/suit.cmake @nrfconnect/ncs-charon # Tests -/tests/ @nrfconnect/ncs-co-verification @katgiadla /tests/benchmarks/ @nrfconnect/ncs-low-level-test /tests/benchmarks/multicore/ @carlescufi @nrfconnect/ncs-low-level-test +/tests/benchmarks/multicore/idle* @nrfconnect/ncs-low-level-test /tests/benchmarks/multicore/idle/ @adamkondraciuk @nrfconnect/ncs-low-level-test /tests/benchmarks/multicore/idle_gpio/ @adamkondraciuk @nrfconnect/ncs-low-level-test -/tests/bluetooth/tester/ @carlescufi @nrfconnect/ncs-paladin /tests/bluetooth/iso/ @nrfconnect/ncs-audio @Frodevan +/tests/bluetooth/tester/ @carlescufi @nrfconnect/ncs-paladin /tests/crypto/ @stephen-nordic @magnev -/tests/drivers/flash_patch/ @nrfconnect/ncs-pluto +/tests/drivers/gpio/egpio_basic_api/ @nrfconnect/ncs-ll-ursus /tests/drivers/flash/flash_rpc/ @nrfconnect/ncs-pluto +/tests/drivers/flash_patch/ @nrfconnect/ncs-pluto /tests/drivers/fprotect/ @nrfconnect/ncs-pluto /tests/drivers/lpuart/ @nordic-krch /tests/drivers/nrfx_integration_test/ @nrfconnect/ncs-co-drivers /tests/drivers/pwm/gpio_loopback/ @nrfconnect/ncs-low-level-test /tests/drivers/sensor/multicore_temp/ @nrfconnect/ncs-low-level-test -/tests/lib/at_parser/ @MirkoCovizzi -/tests/lib/at_cmd_parser/ @lemrey -/tests/lib/at_cmd_custom/ @eivindj-nordic +/tests/lib/at_cmd_parser/ @nrfconnect/ncs-modem +/tests/lib/at_cmd_custom/ @nrfconnect/ncs-modem +/tests/lib/at_parser/ @nrfconnect/ncs-modem +/tests/lib/contin_array/ @nrfconnect/ncs-audio +/tests/lib/data_fifo/ @nrfconnect/ncs-audio /tests/lib/date_time/ @trantanen @tokangas /tests/lib/edge_impulse/ @nrfconnect/ncs-si-muffin -/tests/lib/nrf_fuel_gauge/ @nordic-auko -/tests/lib/gcf_sms/ @eivindj-nordic +/tests/lib/gcf_sms/ @nrfconnect/ncs-modem /tests/lib/hw_unique_key*/ @nrfconnect/ncs-aegir /tests/lib/hw_id/ @nrfconnect/ncs-cia /tests/lib/location/ @trantanen @tokangas -/tests/lib/lte_lc/ @trantanen @tokangas /tests/lib/lte_lc_api/ @trantanen @tokangas -/tests/lib/modem_jwt/ @nrfconnect/ncs-iot-oulu -/tests/lib/modem_battery/ @MirkoCovizzi +/tests/lib/modem_battery/ @nrfconnect/ncs-modem /tests/lib/modem_info/ @nrfconnect/ncs-cia -/tests/lib/qos/ @nrfconnect/ncs-cia -/tests/lib/sfloat/ @nrfconnect/ncs-si-muffin -/tests/lib/sms/ @trantanen @tokangas -/tests/lib/nrf_modem_lib/ @lemrey @MirkoCovizzi -/tests/lib/nrf_modem_lib/nrf9x_sockets/ @MirkoCovizzi -/tests/lib/pdn/ @lemrey @eivindj-nordic -/tests/lib/ram_pwrdn/ @Damian-Nordic -/tests/lib/contin_array/ @nrfconnect/ncs-audio -/tests/lib/data_fifo/ @nrfconnect/ncs-audio +/tests/lib/modem_jwt/ @nrfconnect/ncs-iot-oulu +/tests/lib/nrf_fuel_gauge/ @nordic-auko +/tests/lib/nrf_modem_lib/ @nrfconnect/ncs-modem +/tests/lib/nrf_modem_lib/nrf9x_sockets/ @nrfconnect/ncs-modem +/tests/lib/pdn/ @nrfconnect/ncs-modem /tests/lib/pcm_mix/ @nrfconnect/ncs-audio /tests/lib/pcm_stream_channel_modifier/ @nrfconnect/ncs-audio +/tests/lib/qos/ @nrfconnect/ncs-cia +/tests/lib/ram_pwrdn/ @Damian-Nordic /tests/lib/sample_rate_converter/ @nrfconnect/ncs-audio +/tests/lib/sfloat/ @nrfconnect/ncs-si-muffin +/tests/lib/sms/ @trantanen @tokangas /tests/lib/tone/ @nrfconnect/ncs-audio +/tests/lib/uicc_lwm2m/ @stig-bjorlykke /tests/mocks/nrf_rpc/ @nrfconnect/ncs-protocols-serialization /tests/modules/lib/zcbor/ @oyvindronningstad /tests/modules/mcuboot/direct_xip/ @nrfconnect/ncs-pluto /tests/modules/mcuboot/external_flash/ @nrfconnect/ncs-pluto /tests/nrf5340_audio/ @nrfconnect/ncs-audio @nordic-auko +/tests/subsys/app_event_manager/ @nrfconnect/ncs-si-muffin @nrfconnect/ncs-si-bluebagel /tests/subsys/audio/audio_module_template/ @nrfconnect/ncs-audio /tests/subsys/audio_module/ @nrfconnect/ncs-audio /tests/subsys/bluetooth/gatt_dm/ @nrfconnect/ncs-si-muffin -/tests/subsys/bluetooth/mesh/ @nrfconnect/ncs-paladin /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/bootloader/ @nrfconnect/ncs-pluto /tests/subsys/caf/ @nrfconnect/ncs-si-muffin @nrfconnect/ncs-si-bluebagel /tests/subsys/debug/cpu_load/ @nordic-krch @@ -399,29 +718,32 @@ /tests/subsys/dfu/dfu_multi_image/ @Damian-Nordic /tests/subsys/emds/ @balaklaka @nrfconnect/ncs-paladin /tests/subsys/event_manager_proxy/ @nrfconnect/ncs-si-muffin -/tests/subsys/app_event_manager/ @nrfconnect/ncs-si-muffin @nrfconnect/ncs-si-bluebagel /tests/subsys/fw_info/ @nrfconnect/ncs-pluto /tests/subsys/mpsl/ @nrfconnect/ncs-dragoon /tests/subsys/net/lib/aws_*/ @nrfconnect/ncs-cia /tests/subsys/net/lib/azure_iot_hub/ @nrfconnect/ncs-cia /tests/subsys/net/lib/fota_download/ @nrfconnect/ncs-pluto /tests/subsys/net/lib/lwm2m_*/ @nrfconnect/ncs-iot-oulu +/tests/subsys/net/lib/mqtt_helper/ @nrfconnect/ncs-cia /tests/subsys/net/lib/nrf_cloud/ @nrfconnect/ncs-nrf-cloud /tests/subsys/net/lib/nrf_provisioning/ @nrfconnect/ncs-iot-oulu /tests/subsys/net/lib/wifi_credentials*/ @nrfconnect/ncs-cia -/tests/subsys/net/lib/mqtt_helper/ @nrfconnect/ncs-cia /tests/subsys/net/openthread/rpc/ @nrfconnect/ncs-protocols-serialization /tests/subsys/nfc/rpc/ @nrfconnect/ncs-protocols-serialization /tests/subsys/nrf_compress/ @nordicjm +/tests/subsys/nrf_profiler/ @nrfconnect/ncs-si-bluebagel /tests/subsys/partition_manager/region/ @nordicjm @tejlmand -/tests/subsys/partition_manager/static_pm_file/ @nordicjm @tejlmand +/tests/subsys/partition_manager/static_pm_file/ @nordicjm @tejlmand /tests/subsys/pcd/ @nrfconnect/ncs-pluto -/tests/subsys/nrf_profiler/ @nrfconnect/ncs-si-bluebagel /tests/subsys/sdfw_services/ @nrfconnect/ncs-aurora -/tests/subsys/zigbee/ @nrfconnect/ncs-zigbee /tests/subsys/suit/ @nrfconnect/ncs-charon /tests/tfm/ @nrfconnect/ncs-aegir @stephen-nordic @magnev /tests/unity/ @nordic-krch +/tests/subsys/zigbee/ @nrfconnect/ncs-zigbee + +/tests/benchmarks/multicore/idle/*.rst @nrfconnect/ncs-si-bluebagel-doc +/tests/benchmarks/multicore/idle_gpio/*.rst @nrfconnect/ncs-si-bluebagel-doc +/tests/benchmarks/multicore/idle_with_pwm/*.rst @nrfconnect/ncs-si-bluebagel-doc # CI specific west /test-manifests/99-default-test-nrf.yml @nrfconnect/ncs-ci diff --git a/applications/asset_tracker_v2/README.rst b/applications/asset_tracker_v2/README.rst index 5b71df8e2fba..1702f5a5d277 100644 --- a/applications/asset_tracker_v2/README.rst +++ b/applications/asset_tracker_v2/README.rst @@ -7,7 +7,10 @@ Asset Tracker v2 :local: :depth: 2 -The Asset Tracker v2 is a real-time configurable ultra-low power capable application firmware for the nRF91 Series :term:`System in Package (SiP)`. +.. important:: + |ATv2_maintenance_note| + +Asset Tracker v2 is a real-time configurable ultra-low power capable application firmware for the nRF91 Series :term:`System in Package (SiP)`. See the subpages for detailed documentation on the application and its modules: diff --git a/applications/asset_tracker_v2/doc/app_behavior.rst b/applications/asset_tracker_v2/doc/app_behavior.rst index 2fa18042ebb8..ab8d73cc0e91 100644 --- a/applications/asset_tracker_v2/doc/app_behavior.rst +++ b/applications/asset_tracker_v2/doc/app_behavior.rst @@ -7,6 +7,9 @@ Application behavior and functionality :local: :depth: 2 +.. important:: + |ATv2_maintenance_note| + This section describes the general functioning of the Asset Tracker v2 application. Data types diff --git a/applications/asset_tracker_v2/doc/app_module.rst b/applications/asset_tracker_v2/doc/app_module.rst index 951b3d1e51e1..092fc7749c25 100644 --- a/applications/asset_tracker_v2/doc/app_module.rst +++ b/applications/asset_tracker_v2/doc/app_module.rst @@ -7,6 +7,9 @@ Application module :local: :depth: 2 +.. important:: + |ATv2_maintenance_note| + The application module controls key mechanisms in the Asset Tracker v2. It decides when to sample data, what types of data to sample, and has explicit control over some aspects of the application. diff --git a/applications/asset_tracker_v2/doc/asset_tracker_v2_description.rst b/applications/asset_tracker_v2/doc/asset_tracker_v2_description.rst index 1cf39f1da2d0..6be8811c08ef 100644 --- a/applications/asset_tracker_v2/doc/asset_tracker_v2_description.rst +++ b/applications/asset_tracker_v2/doc/asset_tracker_v2_description.rst @@ -7,6 +7,9 @@ Application description :local: :depth: 2 +.. important:: + |ATv2_maintenance_note| + The Asset Tracker v2 application is built on the following principles: * Ultra-low power by design - The application highlights the power saving features of the nRF91 Series SiP, which is critical for successfully developing small form-factor devices and products which need very long battery lifetime. diff --git a/applications/asset_tracker_v2/doc/cloud_module.rst b/applications/asset_tracker_v2/doc/cloud_module.rst index 0f76ab798725..ae1b41517a41 100644 --- a/applications/asset_tracker_v2/doc/cloud_module.rst +++ b/applications/asset_tracker_v2/doc/cloud_module.rst @@ -7,6 +7,9 @@ Cloud module :local: :depth: 2 +.. important:: + |ATv2_maintenance_note| + The cloud module establishes and maintains the connection to a supported cloud service. It uses the :ref:`Cloud wrapper API ` to integrate and handle the client libraries present in the |NCS|. diff --git a/applications/asset_tracker_v2/doc/cloud_wrapper.rst b/applications/asset_tracker_v2/doc/cloud_wrapper.rst index 7c638ee22ae9..7a61f1cdb88a 100644 --- a/applications/asset_tracker_v2/doc/cloud_wrapper.rst +++ b/applications/asset_tracker_v2/doc/cloud_wrapper.rst @@ -7,6 +7,9 @@ Cloud wrapper API :local: :depth: 2 +.. important:: + |ATv2_maintenance_note| + The cloud wrapper API is a generic API used for controlling the connection to a supported |NCS| client library through :ref:`Integration layers `. It exposes generic functions such as ``send``, ``connect``, and ``disconnect``, hiding the functionality that is specific to a single client library implementation. diff --git a/applications/asset_tracker_v2/doc/data_module.rst b/applications/asset_tracker_v2/doc/data_module.rst index 756dd872b884..f8bf8425327c 100644 --- a/applications/asset_tracker_v2/doc/data_module.rst +++ b/applications/asset_tracker_v2/doc/data_module.rst @@ -7,6 +7,9 @@ Data module :local: :depth: 2 +.. important:: + |ATv2_maintenance_note| + The data module gathers data that has been sampled by other modules in the system and stores it into ring buffers. It keeps track of data requested by the :ref:`asset_tracker_v2_app_module` and decides when data is sent to the cloud. diff --git a/applications/asset_tracker_v2/doc/debug_module.rst b/applications/asset_tracker_v2/doc/debug_module.rst index 36adac09cab9..7f9b3895e58b 100644 --- a/applications/asset_tracker_v2/doc/debug_module.rst +++ b/applications/asset_tracker_v2/doc/debug_module.rst @@ -7,6 +7,9 @@ Debug module :local: :depth: 2 +.. important:: + |ATv2_maintenance_note| + The debug module intends to improve the overall debugging experience in the application. By default, it subscribes to all the events in the system and implements support for `Memfault`_ through the :ref:`mod_memfault` module integrated in |NCS|. diff --git a/applications/asset_tracker_v2/doc/firmware_architecture.rst b/applications/asset_tracker_v2/doc/firmware_architecture.rst index a4fa477cb1d1..47b069ea2535 100644 --- a/applications/asset_tracker_v2/doc/firmware_architecture.rst +++ b/applications/asset_tracker_v2/doc/firmware_architecture.rst @@ -7,6 +7,9 @@ Firmware architecture :local: :depth: 2 +.. important:: + |ATv2_maintenance_note| + The Asset Tracker v2 application has a modular structure, where each module has a defined scope of responsibility. The application makes use of the :ref:`app_event_manager` to distribute events between modules in the system. The Application Event Manager is used for all the communication between the modules. diff --git a/applications/asset_tracker_v2/doc/location_module.rst b/applications/asset_tracker_v2/doc/location_module.rst index e571f807fdc0..c3ddad55641e 100644 --- a/applications/asset_tracker_v2/doc/location_module.rst +++ b/applications/asset_tracker_v2/doc/location_module.rst @@ -7,6 +7,9 @@ Location module :local: :depth: 2 +.. important:: + |ATv2_maintenance_note| + The location module controls the GNSS, cellular and Wi-Fi positioning functionality. It can be used to retrieve the location of the device in the form of events containing a position, velocity and time (PVT) structure. diff --git a/applications/asset_tracker_v2/doc/lwm2m_carrier_library.rst b/applications/asset_tracker_v2/doc/lwm2m_carrier_library.rst index 05420fe84212..5679659616f5 100644 --- a/applications/asset_tracker_v2/doc/lwm2m_carrier_library.rst +++ b/applications/asset_tracker_v2/doc/lwm2m_carrier_library.rst @@ -3,6 +3,10 @@ Using the carrier library ######################### +.. important:: + |ATv2_maintenance_note| + + .. |application_sample_name| replace:: Asset Tracker v2 application .. include:: /includes/lwm2m_carrier_library.txt diff --git a/applications/asset_tracker_v2/doc/modem_module.rst b/applications/asset_tracker_v2/doc/modem_module.rst index e73b8129f319..22f84003ee06 100644 --- a/applications/asset_tracker_v2/doc/modem_module.rst +++ b/applications/asset_tracker_v2/doc/modem_module.rst @@ -7,6 +7,9 @@ Modem module :local: :depth: 2 +.. important:: + |ATv2_maintenance_note| + The modem module communicates with the modem to control the LTE connection and retrieve information from the modem about the device and LTE network. Features diff --git a/applications/asset_tracker_v2/doc/modules.rst b/applications/asset_tracker_v2/doc/modules.rst index c1370c10c029..854015292dff 100644 --- a/applications/asset_tracker_v2/doc/modules.rst +++ b/applications/asset_tracker_v2/doc/modules.rst @@ -3,6 +3,10 @@ Application modules ################### +.. important:: + |ATv2_maintenance_note| + + The Asset Tracker v2 application consists of a set of modules. See :ref:`asset_tracker_v2_architecture` for more information on how the application is structured. diff --git a/applications/asset_tracker_v2/doc/modules_common.rst b/applications/asset_tracker_v2/doc/modules_common.rst index 59c4ef79c74f..ddd73d7accd9 100644 --- a/applications/asset_tracker_v2/doc/modules_common.rst +++ b/applications/asset_tracker_v2/doc/modules_common.rst @@ -7,6 +7,9 @@ Modules common API :local: :depth: 2 +.. important:: + |ATv2_maintenance_note| + The Modules common API provides the functionality to administer mechanisms in the application architecture, and consist of functions that are shared between modules. The API supports the following functionalities: diff --git a/applications/asset_tracker_v2/doc/sensor_module.rst b/applications/asset_tracker_v2/doc/sensor_module.rst index 351e55fd277d..ed607d2c07c1 100644 --- a/applications/asset_tracker_v2/doc/sensor_module.rst +++ b/applications/asset_tracker_v2/doc/sensor_module.rst @@ -7,6 +7,9 @@ Sensor module :local: :depth: 2 +.. important:: + |ATv2_maintenance_note| + The sensor module interacts with external sensors present on the `Thingy:91 `_ and Thingy:91 X. It collects environmental data and detects motion over a set threshold value. diff --git a/applications/asset_tracker_v2/doc/ui_module.rst b/applications/asset_tracker_v2/doc/ui_module.rst index 845cc0116484..a88ea0d04323 100644 --- a/applications/asset_tracker_v2/doc/ui_module.rst +++ b/applications/asset_tracker_v2/doc/ui_module.rst @@ -7,6 +7,9 @@ User Interface module :local: :depth: 2 +.. important:: + |ATv2_maintenance_note| + The User Interface module controls and monitors the UI elements on nRF91 Series development kits, Thingy:91, and Thingy:91 X. Features diff --git a/applications/asset_tracker_v2/doc/unit_test.rst b/applications/asset_tracker_v2/doc/unit_test.rst index 7608b3cd1e55..1654d469fedf 100644 --- a/applications/asset_tracker_v2/doc/unit_test.rst +++ b/applications/asset_tracker_v2/doc/unit_test.rst @@ -7,6 +7,9 @@ Unit tests :local: :depth: 2 +.. important:: + |ATv2_maintenance_note| + The internal modules of the :ref:`asset_tracker_v2` application have a set of unit tests in the :file:`asset_tracker_v2/tests` folder. Following are the modules that have unit tests: diff --git a/applications/asset_tracker_v2/doc/util_module.rst b/applications/asset_tracker_v2/doc/util_module.rst index 5d598584c1db..29fa256f930e 100644 --- a/applications/asset_tracker_v2/doc/util_module.rst +++ b/applications/asset_tracker_v2/doc/util_module.rst @@ -7,6 +7,9 @@ Utility module :local: :depth: 2 +.. important:: + |ATv2_maintenance_note| + The utility module provides the functionality to administer and monitor mechanisms in the application architecture. Features diff --git a/applications/connectivity_bridge/prj.conf b/applications/connectivity_bridge/prj.conf index 8693f39ac72e..239733fa0ba5 100644 --- a/applications/connectivity_bridge/prj.conf +++ b/applications/connectivity_bridge/prj.conf @@ -73,3 +73,6 @@ CONFIG_NRFX_TIMER2=y CONFIG_NRFX_PPI=y CONFIG_HW_ID_LIBRARY=y +CONFIG_RESET_ON_FATAL_ERROR=y +CONFIG_ASSERT=y +CONFIG_POWEROFF=y diff --git a/applications/connectivity_bridge/src/modules/CMakeLists.txt b/applications/connectivity_bridge/src/modules/CMakeLists.txt index c455903dc109..6a9e15dff7a0 100644 --- a/applications/connectivity_bridge/src/modules/CMakeLists.txt +++ b/applications/connectivity_bridge/src/modules/CMakeLists.txt @@ -4,7 +4,7 @@ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # -target_sources_ifdef(CONFIG_PM_DEVICE +target_sources_ifdef(CONFIG_POWEROFF app PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/power_handler.c) target_sources_ifdef(CONFIG_SERIAL diff --git a/applications/connectivity_bridge/src/modules/power_handler.c b/applications/connectivity_bridge/src/modules/power_handler.c index 06996418f53a..0b0cf7210e7a 100644 --- a/applications/connectivity_bridge/src/modules/power_handler.c +++ b/applications/connectivity_bridge/src/modules/power_handler.c @@ -8,6 +8,7 @@ #include #include #include +#include #define MODULE power_handler #include "module_state_event.h" @@ -49,6 +50,7 @@ static bool app_event_handler(const struct app_event_header *aeh) __ASSERT_NO_MSG(module_active_count >= 0); if (module_active_count == 0) { + /* All modules went into standby, shutting down system. */ k_work_reschedule(&power_down_work, K_SECONDS(1)); } } @@ -56,9 +58,8 @@ static bool app_event_handler(const struct app_event_header *aeh) } if (is_power_down_event(aeh)) { -#if defined(CONFIG_SOC_SERIES_NRF52X) - nrf_power_system_off(NRF_POWER); -#endif + /* Put the chip in SYSTEM OFF mode, to be rebooted when USB is connected. */ + sys_poweroff(); } /* If event is unhandled, unsubscribe. */ diff --git a/applications/connectivity_bridge/src/modules/usb_bulk_interface.c b/applications/connectivity_bridge/src/modules/usb_bulk_interface.c index 7d8a07dab62d..650561e224c0 100644 --- a/applications/connectivity_bridge/src/modules/usb_bulk_interface.c +++ b/applications/connectivity_bridge/src/modules/usb_bulk_interface.c @@ -205,12 +205,15 @@ static bool app_event_handler(const struct app_event_header *aeh) const struct module_state_event *event = cast_module_state_event(aeh); if (check_state(event, MODULE_ID(main), MODULE_STATE_READY)) { + /* tell the rest of the system that we are busy. */ + module_set_state(MODULE_STATE_READY); + /* Add MS OS 2.0 BOS descriptor to BOS structure */ usb_bos_register_cap((void *)&bos_cap_msosv2); /* Point interface index to string descriptor */ iface_string_desc_init(&dapusb_config); - /* tell the usb_cdc_handler we are done */ + /* tell the usb_cdc_handler we are done. */ module_set_state(MODULE_STATE_STANDBY); } return false; diff --git a/applications/ipc_radio/README.rst b/applications/ipc_radio/README.rst index dfaf9a4e3c92..6c78b02cf072 100644 --- a/applications/ipc_radio/README.rst +++ b/applications/ipc_radio/README.rst @@ -76,9 +76,6 @@ You can select the Bluetooth Low Energy serialization using the :kconfig:option: The Bluetooth Low Energy and IEEE 802.15.4 functionalities can operate simultaneously and are only limited by available memory. -.. note:: - The IEEE 802.15.4 is currently not supported on the :ref:`zephyr:nrf54h20dk_nrf54h20` board. - Sysbuild Kconfig options ======================== diff --git a/applications/ipc_radio/overlay-bt_hci_ipc.conf b/applications/ipc_radio/overlay-bt_hci_ipc.conf index b3c871080986..5771becc0206 100644 --- a/applications/ipc_radio/overlay-bt_hci_ipc.conf +++ b/applications/ipc_radio/overlay-bt_hci_ipc.conf @@ -16,8 +16,6 @@ CONFIG_BT_HCI_RAW=y CONFIG_BT_CTLR_ASSERT_HANDLER=y CONFIG_ASSERT=y -CONFIG_DEBUG_INFO=y -CONFIG_EXCEPTION_STACK_TRACE=y CONFIG_IPC_RADIO_BT=y CONFIG_IPC_RADIO_BT_HCI_IPC=y diff --git a/applications/matter_bridge/Kconfig b/applications/matter_bridge/Kconfig index d8a415b49b6a..dc4e3344840b 100644 --- a/applications/matter_bridge/Kconfig +++ b/applications/matter_bridge/Kconfig @@ -80,7 +80,11 @@ config BT_SCAN # Configure how many Bluetooth LE devices the Matter bridge can support (the final number is given value - 1, as 1 connection is used for the Matter Bluetooth LE service). config BT_MAX_CONN - default 3 + default 10 + +# Set ACL RX count to CONFIG_BT_MAX_CONN + 1, as it is expected that CONFIG_BT_BUF_ACL_RX_COUNT > CONFIG_BT_MAX_CONN. +config BT_BUF_ACL_RX_COUNT + default 11 config BT_SCAN_FILTER_ENABLE default y @@ -111,7 +115,7 @@ config BT_SETTINGS # Configure how many Bluetooth LE devices will be paired with Matter bridge. Assuming it will be only bridged devices, it should be set to BT_MAX_CONN - 1. config BT_MAX_PAIRED - default 2 + default 9 # Use two Bluetooth LE identities. The first one is used by the peripheral for Matter service advertising purposes, and the other is used by the Matter bridge central. config BT_ID_MAX diff --git a/applications/matter_bridge/doc/matter_bridge_description.rst b/applications/matter_bridge/doc/matter_bridge_description.rst index 4e657247032d..0c99ab9ee87d 100644 --- a/applications/matter_bridge/doc/matter_bridge_description.rst +++ b/applications/matter_bridge/doc/matter_bridge_description.rst @@ -531,7 +531,7 @@ Every Bluetooth LE bridged device uses a separate Bluetooth LE connection, so yo Since the Matter stack uses one Bluetooth LE connection for commissioning, the maximum number of connections you can use for bridged devices is one less than is configured using the :kconfig:option:`CONFIG_BT_MAX_CONN` Kconfig option. Increasing the number of Bluetooth LE connections affects the RAM usage on both the application and network cores. -The current maximum number of Bluetooth LE connections that can be selected using the default configuration is ``10``. +The current maximum number of Bluetooth LE connections that can be selected using the default configuration is ``10``, which effectively means 9 bridged devices. .. tabs:: @@ -547,7 +547,7 @@ The current maximum number of Bluetooth LE connections that can be selected usin You can increase the number of Bluetooth LE connections if you decrease the size of the Bluetooth LE TX/RX buffers used by the Bluetooth controller, but this will decrease the communication throughput. - Build the target using the following command in the project directory to enable a configuration that increases the number of Bluetooth LE connections to ``20`` by decreasing the size of Bluetooth LE TX/RX buffers: + Build the target using the following command in the project directory to enable a configuration that increases the number of Bluetooth LE connections to ``20`` (which effectively means 19 bridged devices) by decreasing the size of Bluetooth LE TX/RX buffers: .. parsed-literal:: :class: highlight @@ -559,7 +559,7 @@ The current maximum number of Bluetooth LE connections that can be selected usin You can not increase the default number of Bluetooth LE connections in this configuration using overlays. This is because the configuration uses both Thread and Bluetooth LE protocols, and limited RAM memory. You can still increase the number of connections by modifying the board files and decreasing the buffer sizes. - The default number of connections is nine. + The default number of connections is ``10``, which effectively means 9 bridged devices. .. group-tab:: nRF54 DKs @@ -571,7 +571,7 @@ The current maximum number of Bluetooth LE connections that can be selected usin You can increase the number of Bluetooth LE connections if you decrease the size of the Bluetooth LE TX/RX buffers used by the Bluetooth controller, but this will decrease the communication throughput. - Build the target using the following command in the project directory to enable a configuration that increases the number of Bluetooth LE connections to ``20`` by decreasing the sizes of Bluetooth LE TX/RX buffers: + Build the target using the following command in the project directory to enable a configuration that increases the number of Bluetooth LE connections to ``20`` (which effectively means 19 bridged devices) by decreasing the sizes of Bluetooth LE TX/RX buffers: .. parsed-literal:: :class: highlight @@ -582,7 +582,7 @@ The current maximum number of Bluetooth LE connections that can be selected usin You can increase the number of Bluetooth LE connections if you decrease the size of the Bluetooth LE TX/RX buffers used by the Bluetooth controller, but this will decrease the communication throughput. - Build the target using the following command in the project directory to enable a configuration that increases the number of Bluetooth LE connections to ``20`` by decreasing the sizes of Bluetooth LE TX/RX buffers: + Build the target using the following command in the project directory to enable a configuration that increases the number of Bluetooth LE connections to ``20`` (which effectively means 19 bridged devices) by decreasing the sizes of Bluetooth LE TX/RX buffers: .. parsed-literal:: :class: highlight @@ -599,7 +599,7 @@ The current maximum number of Bluetooth LE connections that can be selected usin You can increase the number of Bluetooth LE connections if you decrease the size of the Bluetooth LE TX/RX buffers used by the Bluetooth controller, but this will decrease the communication throughput. - Build the target using the following command in the project directory to enable a configuration that increases the number of Bluetooth LE connections to ``20`` by decreasing the sizes of Bluetooth LE TX/RX buffers: + Build the target using the following command in the project directory to enable a configuration that increases the number of Bluetooth LE connections to ``20`` (which effectively means 19 bridged devices) by decreasing the sizes of Bluetooth LE TX/RX buffers: .. parsed-literal:: :class: highlight diff --git a/applications/nrf5340_audio/src/audio/audio_datapath.c b/applications/nrf5340_audio/src/audio/audio_datapath.c index 733ca782c4b7..96d9f7311475 100644 --- a/applications/nrf5340_audio/src/audio/audio_datapath.c +++ b/applications/nrf5340_audio/src/audio/audio_datapath.c @@ -69,9 +69,9 @@ LOG_MODULE_REGISTER(audio_datapath, CONFIG_AUDIO_DATAPATH_LOG_LEVEL); #define PRES_COMP_NUM_DATA_PTS (DRIFT_MEAS_PERIOD_US / CONFIG_AUDIO_FRAME_DURATION_US) /* Audio clock - nRF5340 Analog Phase-Locked Loop (APLL) */ -#define APLL_FREQ_CENTER 39854 -#define APLL_FREQ_MIN 36834 -#define APLL_FREQ_MAX 42874 +#define APLL_FREQ_MIN HFCLKAUDIO_12_165_MHZ +#define APLL_FREQ_CENTER HFCLKAUDIO_12_288_MHZ +#define APLL_FREQ_MAX HFCLKAUDIO_12_411_MHZ /* Use nanoseconds to reduce rounding errors */ /* clang-format off */ #define APLL_FREQ_ADJ(t) (-((t)*1000) / 331) diff --git a/applications/nrf5340_audio/src/modules/audio_i2s.c b/applications/nrf5340_audio/src/modules/audio_i2s.c index d8c113ae644e..2b855ce7a49f 100644 --- a/applications/nrf5340_audio/src/modules/audio_i2s.c +++ b/applications/nrf5340_audio/src/modules/audio_i2s.c @@ -16,8 +16,6 @@ #define I2S_NL DT_NODELABEL(i2s0) -#define HFCLKAUDIO_12_288_MHZ 0x9BAE - enum audio_i2s_state { AUDIO_I2S_STATE_UNINIT, AUDIO_I2S_STATE_IDLE, diff --git a/applications/nrf5340_audio/src/modules/audio_i2s.h b/applications/nrf5340_audio/src/modules/audio_i2s.h index 0c732dcb5749..e7171320e53c 100644 --- a/applications/nrf5340_audio/src/modules/audio_i2s.h +++ b/applications/nrf5340_audio/src/modules/audio_i2s.h @@ -15,6 +15,17 @@ * be 10 or 7.5 ms. Since we can't have floats in a define we use 15/2 instead */ +/** + * Calculation: + * FREQ_VALUE = 2^16 * ((12 * f_out / 32M) - 4) + * f_out == 12.288 + * 39845.888 = 2^16 * ((12 * 12.288 / 32M) - 4) + * 39846 = 0x9BA6 + */ +#define HFCLKAUDIO_12_288_MHZ 0x9BA6 +#define HFCLKAUDIO_12_165_MHZ 0x8FD8 +#define HFCLKAUDIO_12_411_MHZ 0xA774 + #if ((CONFIG_AUDIO_FRAME_DURATION_US == 7500) && CONFIG_SW_CODEC_LC3) #define FRAME_SIZE_BYTES \ diff --git a/applications/nrf_desktop/bootloader_dfu.rst b/applications/nrf_desktop/bootloader_dfu.rst index f6495c6a76d3..f15f79b1e432 100644 --- a/applications/nrf_desktop/bootloader_dfu.rst +++ b/applications/nrf_desktop/bootloader_dfu.rst @@ -317,6 +317,10 @@ The update image can also be transferred in the background through one of the fo The `nRF Connect Device Manager`_ application transfers the image update files over the Simple Management Protocol (SMP). +.. note:: + If your DFU target is not paired through Bluetooth with your Android device, the DFU procedure automatically triggers the pairing procedure. + The nRF Desktop configurations with the DFU support over SMP require encryption for operations on the Bluetooth GATT SMP service (see the :kconfig:option:`CONFIG_MCUMGR_TRANSPORT_BT_PERM_RW_ENCRYPT` Kconfig option). + To perform DFU using the `nRF Connect Device Manager`_ mobile app, complete the following steps: .. tabs:: diff --git a/applications/nrf_desktop/configuration/nrf52840dk_nrf52840/prj_fast_pair.conf b/applications/nrf_desktop/configuration/nrf52840dk_nrf52840/prj_fast_pair.conf index 5e7ddf15bfff..29a89b0c987f 100644 --- a/applications/nrf_desktop/configuration/nrf52840dk_nrf52840/prj_fast_pair.conf +++ b/applications/nrf_desktop/configuration/nrf52840dk_nrf52840/prj_fast_pair.conf @@ -113,7 +113,7 @@ CONFIG_LED_PWM=y # Enable MCUmgr Bluetooth transport and increase Bluetooth buffers to speed up DFU image transfer. CONFIG_MCUMGR_TRANSPORT_BT=y -CONFIG_MCUMGR_TRANSPORT_BT_PERM_RW=y +CONFIG_MCUMGR_TRANSPORT_BT_PERM_RW_ENCRYPT=y CONFIG_MCUMGR_GRP_IMG_VERSION_CMP_USE_BUILD_NUMBER=y CONFIG_IMG_MANAGER=y diff --git a/applications/nrf_desktop/configuration/nrf52840dk_nrf52840/prj_mcuboot_smp.conf b/applications/nrf_desktop/configuration/nrf52840dk_nrf52840/prj_mcuboot_smp.conf index b6e4d4d2f407..fd6081c5e720 100644 --- a/applications/nrf_desktop/configuration/nrf52840dk_nrf52840/prj_mcuboot_smp.conf +++ b/applications/nrf_desktop/configuration/nrf52840dk_nrf52840/prj_mcuboot_smp.conf @@ -99,7 +99,7 @@ CONFIG_LED_PWM=y # Enable MCUmgr Bluetooth transport and increase Bluetooth buffers to speed up DFU image transfer. CONFIG_MCUMGR_TRANSPORT_BT=y -CONFIG_MCUMGR_TRANSPORT_BT_PERM_RW=y +CONFIG_MCUMGR_TRANSPORT_BT_PERM_RW_ENCRYPT=y CONFIG_MCUMGR_GRP_IMG_VERSION_CMP_USE_BUILD_NUMBER=y CONFIG_BT_L2CAP_TX_MTU=260 diff --git a/applications/nrf_desktop/configuration/nrf52840gmouse_nrf52840/prj_fast_pair.conf b/applications/nrf_desktop/configuration/nrf52840gmouse_nrf52840/prj_fast_pair.conf index a75263a4fc1f..3a1bfb8bab41 100644 --- a/applications/nrf_desktop/configuration/nrf52840gmouse_nrf52840/prj_fast_pair.conf +++ b/applications/nrf_desktop/configuration/nrf52840gmouse_nrf52840/prj_fast_pair.conf @@ -155,7 +155,7 @@ CONFIG_SPI_NRFX_RAM_BUFFER_SIZE=8 # Enable MCUmgr Bluetooth transport and increase Bluetooth buffers to speed up DFU image transfer. CONFIG_MCUMGR_TRANSPORT_BT=y -CONFIG_MCUMGR_TRANSPORT_BT_PERM_RW=y +CONFIG_MCUMGR_TRANSPORT_BT_PERM_RW_ENCRYPT=y CONFIG_MCUMGR_GRP_IMG_VERSION_CMP_USE_BUILD_NUMBER=y CONFIG_IMG_MANAGER=y diff --git a/applications/nrf_desktop/configuration/nrf52840gmouse_nrf52840/prj_mcuboot_smp.conf b/applications/nrf_desktop/configuration/nrf52840gmouse_nrf52840/prj_mcuboot_smp.conf index e82be3872341..b25f3b562942 100644 --- a/applications/nrf_desktop/configuration/nrf52840gmouse_nrf52840/prj_mcuboot_smp.conf +++ b/applications/nrf_desktop/configuration/nrf52840gmouse_nrf52840/prj_mcuboot_smp.conf @@ -141,7 +141,7 @@ CONFIG_ZCBOR=y CONFIG_CRC=y CONFIG_MCUMGR=y CONFIG_MCUMGR_TRANSPORT_BT=y -CONFIG_MCUMGR_TRANSPORT_BT_PERM_RW=y +CONFIG_MCUMGR_TRANSPORT_BT_PERM_RW_ENCRYPT=y CONFIG_MCUMGR_GRP_IMG_VERSION_CMP_USE_BUILD_NUMBER=y CONFIG_MCUMGR_GRP_IMG=y diff --git a/applications/nrf_desktop/configuration/nrf52840gmouse_nrf52840/prj_release_fast_pair.conf b/applications/nrf_desktop/configuration/nrf52840gmouse_nrf52840/prj_release_fast_pair.conf index 43eb5444b973..70b3fd6bffbf 100644 --- a/applications/nrf_desktop/configuration/nrf52840gmouse_nrf52840/prj_release_fast_pair.conf +++ b/applications/nrf_desktop/configuration/nrf52840gmouse_nrf52840/prj_release_fast_pair.conf @@ -149,7 +149,7 @@ CONFIG_SPI_NRFX_RAM_BUFFER_SIZE=8 # Enable MCUmgr Bluetooth transport and increase Bluetooth buffers to speed up DFU image transfer. CONFIG_MCUMGR_TRANSPORT_BT=y -CONFIG_MCUMGR_TRANSPORT_BT_PERM_RW=y +CONFIG_MCUMGR_TRANSPORT_BT_PERM_RW_ENCRYPT=y CONFIG_MCUMGR_GRP_IMG_VERSION_CMP_USE_BUILD_NUMBER=y CONFIG_IMG_MANAGER=y diff --git a/applications/nrf_desktop/configuration/nrf52kbd_nrf52832/prj_release_fast_pair.conf b/applications/nrf_desktop/configuration/nrf52kbd_nrf52832/prj_release_fast_pair.conf index 4bc310b853b4..6c05724e3396 100644 --- a/applications/nrf_desktop/configuration/nrf52kbd_nrf52832/prj_release_fast_pair.conf +++ b/applications/nrf_desktop/configuration/nrf52kbd_nrf52832/prj_release_fast_pair.conf @@ -112,7 +112,7 @@ CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y # Enable MCUmgr Bluetooth transport and increase Bluetooth buffers to speed up DFU image transfer. CONFIG_MCUMGR_TRANSPORT_BT=y -CONFIG_MCUMGR_TRANSPORT_BT_PERM_RW=y +CONFIG_MCUMGR_TRANSPORT_BT_PERM_RW_ENCRYPT=y CONFIG_MCUMGR_GRP_IMG_VERSION_CMP_USE_BUILD_NUMBER=y CONFIG_IMG_MANAGER=y diff --git a/applications/nrf_desktop/configuration/nrf5340dk_nrf5340_cpunet/images/ipc_radio/prj.conf b/applications/nrf_desktop/configuration/nrf5340dk_nrf5340_cpunet/images/ipc_radio/prj.conf index b6141122a043..f3b89b7c3d4a 100644 --- a/applications/nrf_desktop/configuration/nrf5340dk_nrf5340_cpunet/images/ipc_radio/prj.conf +++ b/applications/nrf_desktop/configuration/nrf5340dk_nrf5340_cpunet/images/ipc_radio/prj.conf @@ -29,8 +29,6 @@ CONFIG_BT_CTLR_DATA_LENGTH_MAX=35 CONFIG_BT_CTLR_SDC_MAX_CONN_EVENT_LEN_DEFAULT=3000 CONFIG_ASSERT=y -CONFIG_DEBUG_INFO=y -CONFIG_EXCEPTION_STACK_TRACE=y # Use minimal C library instead of the Picolib CONFIG_MINIMAL_LIBC=y diff --git a/applications/nrf_desktop/configuration/nrf54h20dk_nrf54h20_cpuapp/prj.conf b/applications/nrf_desktop/configuration/nrf54h20dk_nrf54h20_cpuapp/prj.conf index d7d5f7414349..f5571ec57872 100644 --- a/applications/nrf_desktop/configuration/nrf54h20dk_nrf54h20_cpuapp/prj.conf +++ b/applications/nrf_desktop/configuration/nrf54h20dk_nrf54h20_cpuapp/prj.conf @@ -117,7 +117,7 @@ CONFIG_LOG_PROCESS_THREAD_STACK_SIZE=1024 # Enable MCUmgr Bluetooth transport CONFIG_DESKTOP_DFU_MCUMGR_ENABLE=y CONFIG_MCUMGR_TRANSPORT_BT=y -CONFIG_MCUMGR_TRANSPORT_BT_PERM_RW=y +CONFIG_MCUMGR_TRANSPORT_BT_PERM_RW_ENCRYPT=y # Allow for large Bluetooth data packets. CONFIG_BT_L2CAP_TX_MTU=498 diff --git a/applications/nrf_desktop/configuration/nrf54h20dk_nrf54h20_cpuapp/prj_release.conf b/applications/nrf_desktop/configuration/nrf54h20dk_nrf54h20_cpuapp/prj_release.conf index c76ea6d62d0b..366a64afb0b4 100644 --- a/applications/nrf_desktop/configuration/nrf54h20dk_nrf54h20_cpuapp/prj_release.conf +++ b/applications/nrf_desktop/configuration/nrf54h20dk_nrf54h20_cpuapp/prj_release.conf @@ -95,7 +95,7 @@ CONFIG_UART_CONSOLE=n # Enable MCUmgr Bluetooth transport CONFIG_DESKTOP_DFU_MCUMGR_ENABLE=y CONFIG_MCUMGR_TRANSPORT_BT=y -CONFIG_MCUMGR_TRANSPORT_BT_PERM_RW=y +CONFIG_MCUMGR_TRANSPORT_BT_PERM_RW_ENCRYPT=y # Allow for large Bluetooth data packets. CONFIG_BT_L2CAP_TX_MTU=498 diff --git a/applications/nrf_desktop/configuration/nrf54h20dk_nrf54h20_cpurad/images/ipc_radio/prj.conf b/applications/nrf_desktop/configuration/nrf54h20dk_nrf54h20_cpurad/images/ipc_radio/prj.conf index f99145ba2140..7fe4abce1e3d 100644 --- a/applications/nrf_desktop/configuration/nrf54h20dk_nrf54h20_cpurad/images/ipc_radio/prj.conf +++ b/applications/nrf_desktop/configuration/nrf54h20dk_nrf54h20_cpurad/images/ipc_radio/prj.conf @@ -34,8 +34,6 @@ CONFIG_BT_CTLR_FILTER_ACCEPT_LIST=y CONFIG_BT_CTLR_PRIVACY=y CONFIG_ASSERT=y -CONFIG_DEBUG_INFO=y -CONFIG_EXCEPTION_STACK_TRACE=y # Disable reset on fatal error for better debbuging experience. CONFIG_RESET_ON_FATAL_ERROR=n diff --git a/applications/nrf_desktop/configuration/nrf54l15dk_nrf54l15_cpuapp/prj_fast_pair.conf b/applications/nrf_desktop/configuration/nrf54l15dk_nrf54l15_cpuapp/prj_fast_pair.conf index 90362d6a0db1..4b6467321641 100644 --- a/applications/nrf_desktop/configuration/nrf54l15dk_nrf54l15_cpuapp/prj_fast_pair.conf +++ b/applications/nrf_desktop/configuration/nrf54l15dk_nrf54l15_cpuapp/prj_fast_pair.conf @@ -102,7 +102,7 @@ CONFIG_LED_PWM=y # Enable MCUmgr Bluetooth transport and increase Bluetooth buffers to speed up DFU image transfer. CONFIG_MCUMGR_TRANSPORT_BT=y -CONFIG_MCUMGR_TRANSPORT_BT_PERM_RW=y +CONFIG_MCUMGR_TRANSPORT_BT_PERM_RW_ENCRYPT=y CONFIG_MCUMGR_GRP_IMG_VERSION_CMP_USE_BUILD_NUMBER=y CONFIG_IMG_MANAGER=y diff --git a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/app.overlay b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/app.overlay deleted file mode 100644 index a773a2afeccd..000000000000 --- a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/app.overlay +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -/* For nRF54L, watchdog status is disabled by default. Needs to be enabled in DTS overlay. */ -&wdt31 { - status = "okay"; -}; - -/* Application does not use cpuflpr core. Assign whole RRAM to cpuapp. */ -&cpuapp_rram { - reg = < 0x0 DT_SIZE_K(1524) >; -}; - -/ { - /* Disable pwmleds and redefine them to align configuration with CAF LEDs requirements. - * The configuration needs to match the used board revision. - */ - /delete-node/ pwmleds; - - pwmleds0 { - compatible = "pwm-leds"; - status = "okay"; - - pwm_led0: led_pwm_0 { - status = "okay"; - pwms = <&pwm20 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>; - label = "LED System State"; - }; - }; - - pwmleds1 { - compatible = "pwm-leds"; - status = "okay"; - - pwm_led1: led_pwm_1 { - status = "okay"; - pwms = <&pwm21 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>; - label = "LED Conn State"; - }; - }; - - pwmleds2 { - compatible = "pwm-leds"; - status = "okay"; - - pwm_led2: led_pwm_2 { - status = "okay"; - pwms = <&pwm22 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>; - label = "LED Num Lock"; - }; - }; -}; - -&pwm20 { - status = "okay"; - pinctrl-0 = <&pwm20_default_alt>; - pinctrl-1 = <&pwm20_sleep_alt>; - pinctrl-names = "default", "sleep"; -}; - -&pwm21 { - status = "okay"; - pinctrl-0 = <&pwm21_default_alt>; - pinctrl-1 = <&pwm21_sleep_alt>; - pinctrl-names = "default", "sleep"; -}; - -&pwm22 { - status = "okay"; - pinctrl-0 = <&pwm22_default_alt>; - pinctrl-1 = <&pwm22_sleep_alt>; - pinctrl-names = "default", "sleep"; -}; - -&pinctrl { - pwm20_default_alt: pwm20_default_alt { - group1 { - psels = ; - }; - }; - - pwm20_sleep_alt: pwm20_sleep_alt { - group1 { - psels = ; - low-power-enable; - }; - }; - - pwm21_default_alt: pwm21_default_alt { - group1 { - psels = ; - }; - }; - - pwm21_sleep_alt: pwm21_sleep_alt { - group1 { - psels = ; - low-power-enable; - }; - }; - - pwm22_default_alt: pwm22_default_alt { - group1 { - psels = ; - }; - }; - - pwm22_sleep_alt: pwm22_sleep_alt { - group1 { - psels = ; - low-power-enable; - }; - }; -}; diff --git a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/buttons_def.h b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/buttons_def.h deleted file mode 100644 index 5aee49473efb..000000000000 --- a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/buttons_def.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -#include - -/* This configuration file is included only once from button module and holds - * information about pins forming keyboard matrix. - */ - -/* 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 {} buttons_def_include_once; - -static const struct gpio_pin col[] = {}; - -static const struct gpio_pin row[] = { - { .port = 1, .pin = DT_GPIO_PIN(DT_NODELABEL(button0), gpios) }, - { .port = 1, .pin = DT_GPIO_PIN(DT_NODELABEL(button1), gpios) }, - { .port = 1, .pin = DT_GPIO_PIN(DT_NODELABEL(button2), gpios) }, - { .port = 0, .pin = DT_GPIO_PIN(DT_NODELABEL(button3), gpios) }, -}; diff --git a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/buttons_sim_def.h b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/buttons_sim_def.h deleted file mode 100644 index b6a008dc1686..000000000000 --- a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/buttons_sim_def.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -#include - -/* This configuration file is included only once from buttons_sim module - * and holds information about generated button presses sequence. - */ - -/* 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 {} buttons_sim_def_include_once; - -const static uint16_t simulated_key_sequence[] = { - KEY_ID(0x00, 0x11), /* N */ - KEY_ID(0x00, 0x12), /* O */ - KEY_ID(0x00, 0x15), /* R */ - KEY_ID(0x00, 0x07), /* D */ - KEY_ID(0x00, 0x0C), /* I */ - KEY_ID(0x00, 0x06), /* C */ - KEY_ID(0x00, 0x2C), /* spacebar */ -}; diff --git a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/click_detector_def.h b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/click_detector_def.h deleted file mode 100644 index 38a3fee1443b..000000000000 --- a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/click_detector_def.h +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -#include - -/* This configuration file is included only once from click_detector module - * and holds information about click detector configuration. - */ - -/* 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 {} click_detector_def_include_once; - -static const struct click_detector_config click_detector_config[] = { - { - .key_id = CONFIG_DESKTOP_BLE_PEER_CONTROL_BUTTON, - .consume_button_event = false, - }, -}; diff --git a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/hid_keyboard_leds_def.h b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/hid_keyboard_leds_def.h deleted file mode 100644 index 445b2f14943e..000000000000 --- a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/hid_keyboard_leds_def.h +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -#include "hid_keyboard_leds.h" - -/* This configuration file is included only once from hid_state module and holds - * information about LEDs associated with HID keyboard LEDs report. - */ - -/* 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 {} hid_keyboard_leds_def_include_once; - -static const struct led_effect keyboard_led_on = LED_EFFECT_LED_ON(LED_COLOR(255, 255, 255)); -static const struct led_effect keyboard_led_off = LED_EFFECT_LED_OFF(); - -/* Map HID keyboard LEDs to application LED IDs. */ -static const uint8_t keyboard_led_map[] = { -}; diff --git a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/hid_keyboard_leds_def_keyboard.h b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/hid_keyboard_leds_def_keyboard.h deleted file mode 100644 index 22308715e464..000000000000 --- a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/hid_keyboard_leds_def_keyboard.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -#include "hid_keyboard_leds.h" - -/* This configuration file is included only once from hid_state module and holds - * information about LEDs associated with HID keyboard LEDs report. - */ - -/* 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 {} hid_keyboard_leds_def_include_once; - -/* On the nRF54L15 SoC, you can only use the **GPIO1** port for PWM hardware peripheral output. - * Because of that, on the PDK PCA10156 revision v0.3.0, **LED 0** and **LED 2** cannot be used for - * PWM output. - * - * You can still use these LEDs with the PWM LED driver, but you must set the LED color to - * ``LED_COLOR(255, 255, 255)`` or ``LED_COLOR(0, 0, 0)``. This ensures the PWM peripheral is not - * used for the mentioned LEDs. - */ -static const struct led_effect keyboard_led_on = LED_EFFECT_LED_ON(LED_COLOR(255, 255, 255)); -static const struct led_effect keyboard_led_off = LED_EFFECT_LED_OFF(); - -/* Map HID keyboard LEDs to application LED IDs. */ -static const uint8_t keyboard_led_map[] = { - [HID_KEYBOARD_LEDS_NUM_LOCK] = 2, - [HID_KEYBOARD_LEDS_CAPS_LOCK] = LED_UNAVAILABLE, - [HID_KEYBOARD_LEDS_SCROLL_LOCK] = LED_UNAVAILABLE, - [HID_KEYBOARD_LEDS_COMPOSE] = LED_UNAVAILABLE, - [HID_KEYBOARD_LEDS_KANA] = LED_UNAVAILABLE, -}; diff --git a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/hid_keymap_def.h b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/hid_keymap_def.h deleted file mode 100644 index 08cd2cfdae9e..000000000000 --- a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/hid_keymap_def.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -#include "hid_keymap.h" -#include - -/* This configuration file is included only once from hid_state module and holds - * information about mapping between buttons and generated reports. - */ - -/* 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 {} hid_keymap_def_include_once; - -/* - * HID keymap. The Consumer Control keys are defined in section 15 of - * the HID Usage Tables document under the following URL: - * https://www.usb.org/sites/default/files/hut1_12.pdf - */ -static const struct hid_keymap hid_keymap[] = { - /* Intentionally left empty. nRF54L PDK by default uses all buttons only to control - * generating motion. - */ -}; diff --git a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/hid_keymap_def_keyboard.h b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/hid_keymap_def_keyboard.h deleted file mode 100644 index 02dff560c18c..000000000000 --- a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/hid_keymap_def_keyboard.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -#include "hid_keymap.h" -#include - -/* This configuration file is included only once from hid_state module and holds - * information about mapping between buttons and generated reports. - */ - -/* 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 {} hid_keymap_def_include_once; - -/* - * HID keymap. The Consumer Control keys are defined in section 15 of - * the HID Usage Tables document under the following URL: - * https://www.usb.org/sites/default/files/hut1_12.pdf - */ -static const struct hid_keymap hid_keymap[] = { - { KEY_ID(0x00, 0x00), 0x0004, REPORT_ID_KEYBOARD_KEYS }, /* A */ - { KEY_ID(0x00, 0x01), 0x0005, REPORT_ID_KEYBOARD_KEYS }, /* B */ - { KEY_ID(0x00, 0x02), 0x00E1, REPORT_ID_KEYBOARD_KEYS }, /* left shift */ - - { KEY_ID(0x00, 0x04), 0x0004, REPORT_ID_KEYBOARD_KEYS }, /* A */ - { KEY_ID(0x00, 0x05), 0x0005, REPORT_ID_KEYBOARD_KEYS }, /* B */ - { KEY_ID(0x00, 0x06), 0x0006, REPORT_ID_KEYBOARD_KEYS }, /* C */ - { KEY_ID(0x00, 0x07), 0x0007, REPORT_ID_KEYBOARD_KEYS }, /* D */ - { KEY_ID(0x00, 0x08), 0x0008, REPORT_ID_KEYBOARD_KEYS }, /* E */ - { KEY_ID(0x00, 0x09), 0x0009, REPORT_ID_KEYBOARD_KEYS }, /* F */ - { KEY_ID(0x00, 0x0A), 0x000A, REPORT_ID_KEYBOARD_KEYS }, /* G */ - { KEY_ID(0x00, 0x0B), 0x000B, REPORT_ID_KEYBOARD_KEYS }, /* H */ - { KEY_ID(0x00, 0x0C), 0x000C, REPORT_ID_KEYBOARD_KEYS }, /* I */ - { KEY_ID(0x00, 0x0D), 0x000D, REPORT_ID_KEYBOARD_KEYS }, /* J */ - { KEY_ID(0x00, 0x0E), 0x000E, REPORT_ID_KEYBOARD_KEYS }, /* K */ - { KEY_ID(0x00, 0x0F), 0x000F, REPORT_ID_KEYBOARD_KEYS }, /* L */ - { KEY_ID(0x00, 0x10), 0x0010, REPORT_ID_KEYBOARD_KEYS }, /* M */ - { KEY_ID(0x00, 0x11), 0x0011, REPORT_ID_KEYBOARD_KEYS }, /* N */ - { KEY_ID(0x00, 0x12), 0x0012, REPORT_ID_KEYBOARD_KEYS }, /* O */ - { KEY_ID(0x00, 0x13), 0x0013, REPORT_ID_KEYBOARD_KEYS }, /* P */ - { KEY_ID(0x00, 0x14), 0x0014, REPORT_ID_KEYBOARD_KEYS }, /* Q */ - { KEY_ID(0x00, 0x15), 0x0015, REPORT_ID_KEYBOARD_KEYS }, /* R */ - { KEY_ID(0x00, 0x16), 0x0016, REPORT_ID_KEYBOARD_KEYS }, /* S */ - { KEY_ID(0x00, 0x17), 0x0017, REPORT_ID_KEYBOARD_KEYS }, /* T */ - { KEY_ID(0x00, 0x18), 0x0018, REPORT_ID_KEYBOARD_KEYS }, /* U */ - { KEY_ID(0x00, 0x19), 0x0019, REPORT_ID_KEYBOARD_KEYS }, /* V */ - { KEY_ID(0x00, 0x1A), 0x001A, REPORT_ID_KEYBOARD_KEYS }, /* W */ - { KEY_ID(0x00, 0x1B), 0x001B, REPORT_ID_KEYBOARD_KEYS }, /* X */ - { KEY_ID(0x00, 0x1C), 0x001C, REPORT_ID_KEYBOARD_KEYS }, /* Y */ - { KEY_ID(0x00, 0x1D), 0x001D, REPORT_ID_KEYBOARD_KEYS }, /* Z */ - - { KEY_ID(0x00, 0x2C), 0x002C, REPORT_ID_KEYBOARD_KEYS }, /* spacebar */ -}; diff --git a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/images/mcuboot/app.overlay b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/images/mcuboot/app.overlay deleted file mode 100644 index f7ae36e73487..000000000000 --- a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/images/mcuboot/app.overlay +++ /dev/null @@ -1,10 +0,0 @@ -/* Application does not use cpuflpr core. Assign whole RRAM to cpuapp. */ -&cpuapp_rram { - reg = < 0x0 DT_SIZE_K(1524) >; -}; - -/ { - chosen { - zephyr,code-partition = &boot_partition; - }; -}; diff --git a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/images/mcuboot/mcuboot_private.pem b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/images/mcuboot/mcuboot_private.pem deleted file mode 100644 index af30c7b46e05..000000000000 --- a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/images/mcuboot/mcuboot_private.pem +++ /dev/null @@ -1,28 +0,0 @@ ------BEGIN PRIVATE KEY----- -MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQDMgpljNyVhjcme -L5w3afeB45AuxOKocy4y/WCbAgH5fWU6KP4E3DNCbKsta17hyZyzfC0QJl4gJK8Z -76FmGNHEv3Xg5ZXBLRo8SDak0zqCkhprx70m8xSEx6sxCPDFndYECluv/G0XPvIz -dQJ9yQdHHv78niAJQoGCf/0D4NjrTj5GIMSmyh1bssmi1j6TxrBXH+eplfyeuhbK -DlagXRjTXOBtyNY7SSAhDZX0xCIdLWJ5GLyRmKvX4HXvhdFjuBwdQmfBggU37gPz -mvhnell2c2Fyd/zcefl9H8paKFiIJd16GcJfmlO5zR++JhME+tGO92+dnp51NrE5 -jD7JvDBHAgMBAAECggEABeKCLcKHTwHTTzvOfSJi+WKwzO+5wqAh2wdt0WK4PNN4 -vLjeP7SNvbe+dehKNX662sf+zKFWAbXHMMdeTRT3avfEGWxx0o+3hWGMlPybs+h8 -CHrvEfZaXPcZPCgmNCw2XYJmIK/HpyzBWm1fsiU9PN+C9dufpLSRtngeseRf9DwM -eG6Et2J5RLxeTHk6J7FhLK0peW3Str3Mrc3eqcRM/AvdKlEwjL/lUjrsIAIBYpwQ -fl62E00MsTmFu/35iVlPHIWRstZ0NZxwfVJKjunoSIiUTI33KrB2RiNR6hcXSN/B -LnzvVO71mHr41R6IvDbmorGR+dekA5kPXTCsQ6qoZQKBgQDcv4BgiG5kCEVXqHla -M/dsAsXX1u2+uftIL+7UbpCdwmNf8jm5nAyIU5RomGD2+sWdUXGd5urUYALLuzms -WpL19RuKp+uwueJ2Gj6Onbn0ZrUzz92+0nL73hdQVXFuHFFrRT/1p3NZn8ApA7wN -X2Fvw71Zmg64WAmFEdzSV19W6wKBgQDtK0TagT+OztmcIHtw1w94uJRSqrqvKtXT -yqtba23aKBhbJlQOccpw6oNgxiQJf48CnOO3bY1r08i4RmQ8efNs0IYhKwhrslVj -TTUP9lmJxFpbi6ABFufuih1xV7lr4qCme2yoyU6/Wm6GXGF9WAAHU7HQ88EPPHTg -MS7DKrhtFQKBgHxM3RX+XOK5AYrdlA+l6XGJkiv6m37lLMi2LO6zn30l4104gSax -5yCwp4XKH/eSt8ng/XAjgiG6OnjL4SrbCZuzvCF0crPdx9Ym6wjVactkNi6Jotx7 -lkGbCley9R9ClNopcV17P+m8mbC+qJqDFdOgTbPxms5UzG+A4m4Swt2nAoGAPD1P -QciuYhF8CEHf2KtnTJxlYBHpVPCmWyMRHylMP6sLdKtpkjmo18FZGU16fcceheVf -mYmD8C1cwCFw+ENpZuwYBXiurNwhABXuMl26JFnxMWtnep9czaPbEpzbheGMOH0E -/mITVFsd05bHVFTzvOivM4mWMc6DSSZ04DGLonkCgYBtEF1taMXwOQWiN5feFDPJ -tsBjeONi4n0oUcYmm9zRuvTgP3CswK5B4yFWTZ+UcDwAyg6jeFT9kKeB5TA+i0mE -0XOEZA+X0ybm/V1gERliQqyKQ38waNjlXeM3fYfD/KFBpmtXZB+hjebfXBVggzyA -WBbUOJ/pM1gbI8wtH4kyOw== ------END PRIVATE KEY----- diff --git a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/images/mcuboot/mcuboot_private_fast_pair.pem b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/images/mcuboot/mcuboot_private_fast_pair.pem deleted file mode 100644 index 59463fd2229b..000000000000 --- a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/images/mcuboot/mcuboot_private_fast_pair.pem +++ /dev/null @@ -1,28 +0,0 @@ ------BEGIN PRIVATE KEY----- -MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQDW6mrXbq6DAPhv -pM31j+H0t/T227c39Ve34HxvsoqnUsmVUpaI1VZqp+r5VZ4j4LAM0ya9gOuHc33Z -isgW6lvy5/T83gq7hpjptOKbOO/yuhropuyqJtAtFEKuHzvebnAcZEf/S3oBOik4 -BF12g6WaGrMauW478C0/HUmLXkXhiUmv4j3AOKvMywe4htvZ6wwKYa8/8GXyxDoF -M2VhYMH+aen6Aj7nZobKmIBMBHFfsqvY4UtQgPkrDFRxiP4LzaeYFB87BJt6scNJ -rNI1hAxSs5Pw9YbA6DXNJWzhJt9bInRsuqTgtOvI/D6PLz2UK/o76NuDUEAOiqos -9UqYui6JAgMBAAECggEAHTZHx3iX596d5i70f8hK4kSO228J/GUwwyGUSGpwRkYO -eGl9ZKP61wxz9+gXUrEbvOKGhYOcgBDGrmcaw2KflOjKeASGWO72oe2gT5DxrIB3 -X+AwkwArk7UJSzmbnaRNQM6wqpbLwpbxO1f8jDtgqw2uApfpz+PZgpashHEP9pO+ -08jYGHNVdgOxG6QGth/1ib9fu+GriLtXQpBMbUXuMVgtQjl6DdWttWl+ZGr45W8x -T6fEr5DMY7ikfYZmeTTFVGmYLtXc4omMXFikzbKs0VkQg6sQM6vvFGMQVcSRXTgq -QrdWIx7F5Ueg1zFbs4snEJp1rRSLvIa+jsjEjPG9wQKBgQDlCVB+MiiGGkgYJbCx -ikMJI6zMNjcWA0rNx3LW6+K6+YaH+KRahqpo3SepgzhMIbrvm7S2l3DaXrdJRduA -vSj3VPDkZOgrBFSMv0NYKoXHCWra+vN5P+WkxiPRLz7X1eDC+d4IGEDfS5kRakAe -sXT5s2IghiNtE13/vbHKI2wTdQKBgQDwN4jJDw57pK8aWu/Y3NtKPOUf3pOCchfT -/SlOutsnklO7XqE/GG/qkdilpQIFRgMJZ8pmwsqTOwCMFd5YMFFGW08Cf0NNKQu+ -PtvvzWS8feDd1vuefu/ddjgTONXG3ZyFVsRyo8HXuZQzRUmezV3Wso4jCNYgUEiC -u2HA5ccwRQKBgEpXM6FCdpTQgwYTdb6qugeFZNkD3+1tNCKG0megOP+nbltEAVTA -0R8oaW9EAEn1yM9tIsMBdMfsZmGKIy0uONXO5EG93v3XcfodOqarZrCsBdr+CXkZ -nFhXV9jWFPfJnCKtJ7xI4wWXbB+S9S0BPI6wAvG7mFQXLTONRt/tj27hAoGATqPv -nNrYA/Ra+sbQhG9xPvGGlRNZuTe+w0C62DJl8qN90/Zb1XsbkHBku320lqNf9SFM -aq3UgbSsLjAulTJkOSNFT2z4THdmh8auW+gi1W5kQlvSDgZCYn8ERo6xtaPxTNmm -AF3J5OS1Nr+1JU7YLKRR0fhfmT6PLnVHwE25Ev0CgYBw4tT/CDLMuS5A+LuEalQA -+AFWuCR+Xw+MFF55ioMlHqveSUVbJzhkllR76JUMP7/7aaJsqi4A7zjr+tgvBobf -qYyYyoLPahOHA+h330RHh3IPX2JZWBMVT1bb/K+qxQ9CkwCYXKFPzXVi/JU/Yjgz -Yh16Jr2zB33KIZIMyeM2LA== ------END PRIVATE KEY----- diff --git a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/images/mcuboot/prj.conf b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/images/mcuboot/prj.conf deleted file mode 100644 index f51a24fe9890..000000000000 --- a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/images/mcuboot/prj.conf +++ /dev/null @@ -1,36 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# -CONFIG_SIZE_OPTIMIZATIONS=y - -# Disable memory guard to avoid false faults in application after boot -CONFIG_HW_STACK_PROTECTION=n - -CONFIG_SYSTEM_CLOCK_NO_WAIT=y - -CONFIG_MAIN_STACK_SIZE=10240 -CONFIG_MBEDTLS_CFG_FILE="mcuboot-mbedtls-cfg.h" - -CONFIG_BOOT_MAX_IMG_SECTORS=256 -CONFIG_BOOT_BOOTSTRAP=n - -CONFIG_BOOT_VERSION_CMP_USE_BUILD_NUMBER=y - -CONFIG_FLASH=y - -# Reduce memory consumption -CONFIG_BOOT_BANNER=n -CONFIG_NCS_BOOT_BANNER=n -CONFIG_GPIO=n -CONFIG_SERIAL=n -CONFIG_CONSOLE=n -CONFIG_UART_CONSOLE=n -CONFIG_USE_SEGGER_RTT=n - -# Use minimal C library instead of the Picolib -CONFIG_MINIMAL_LIBC=y - -# Improve debugging experience by disabling reset on fatal error -CONFIG_RESET_ON_FATAL_ERROR=n diff --git a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/images/mcuboot/prj_fast_pair.conf b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/images/mcuboot/prj_fast_pair.conf deleted file mode 100644 index f51a24fe9890..000000000000 --- a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/images/mcuboot/prj_fast_pair.conf +++ /dev/null @@ -1,36 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# -CONFIG_SIZE_OPTIMIZATIONS=y - -# Disable memory guard to avoid false faults in application after boot -CONFIG_HW_STACK_PROTECTION=n - -CONFIG_SYSTEM_CLOCK_NO_WAIT=y - -CONFIG_MAIN_STACK_SIZE=10240 -CONFIG_MBEDTLS_CFG_FILE="mcuboot-mbedtls-cfg.h" - -CONFIG_BOOT_MAX_IMG_SECTORS=256 -CONFIG_BOOT_BOOTSTRAP=n - -CONFIG_BOOT_VERSION_CMP_USE_BUILD_NUMBER=y - -CONFIG_FLASH=y - -# Reduce memory consumption -CONFIG_BOOT_BANNER=n -CONFIG_NCS_BOOT_BANNER=n -CONFIG_GPIO=n -CONFIG_SERIAL=n -CONFIG_CONSOLE=n -CONFIG_UART_CONSOLE=n -CONFIG_USE_SEGGER_RTT=n - -# Use minimal C library instead of the Picolib -CONFIG_MINIMAL_LIBC=y - -# Improve debugging experience by disabling reset on fatal error -CONFIG_RESET_ON_FATAL_ERROR=n diff --git a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/images/mcuboot/prj_keyboard.conf b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/images/mcuboot/prj_keyboard.conf deleted file mode 100644 index f51a24fe9890..000000000000 --- a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/images/mcuboot/prj_keyboard.conf +++ /dev/null @@ -1,36 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# -CONFIG_SIZE_OPTIMIZATIONS=y - -# Disable memory guard to avoid false faults in application after boot -CONFIG_HW_STACK_PROTECTION=n - -CONFIG_SYSTEM_CLOCK_NO_WAIT=y - -CONFIG_MAIN_STACK_SIZE=10240 -CONFIG_MBEDTLS_CFG_FILE="mcuboot-mbedtls-cfg.h" - -CONFIG_BOOT_MAX_IMG_SECTORS=256 -CONFIG_BOOT_BOOTSTRAP=n - -CONFIG_BOOT_VERSION_CMP_USE_BUILD_NUMBER=y - -CONFIG_FLASH=y - -# Reduce memory consumption -CONFIG_BOOT_BANNER=n -CONFIG_NCS_BOOT_BANNER=n -CONFIG_GPIO=n -CONFIG_SERIAL=n -CONFIG_CONSOLE=n -CONFIG_UART_CONSOLE=n -CONFIG_USE_SEGGER_RTT=n - -# Use minimal C library instead of the Picolib -CONFIG_MINIMAL_LIBC=y - -# Improve debugging experience by disabling reset on fatal error -CONFIG_RESET_ON_FATAL_ERROR=n diff --git a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/images/mcuboot/prj_release.conf b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/images/mcuboot/prj_release.conf deleted file mode 100644 index f51a24fe9890..000000000000 --- a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/images/mcuboot/prj_release.conf +++ /dev/null @@ -1,36 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# -CONFIG_SIZE_OPTIMIZATIONS=y - -# Disable memory guard to avoid false faults in application after boot -CONFIG_HW_STACK_PROTECTION=n - -CONFIG_SYSTEM_CLOCK_NO_WAIT=y - -CONFIG_MAIN_STACK_SIZE=10240 -CONFIG_MBEDTLS_CFG_FILE="mcuboot-mbedtls-cfg.h" - -CONFIG_BOOT_MAX_IMG_SECTORS=256 -CONFIG_BOOT_BOOTSTRAP=n - -CONFIG_BOOT_VERSION_CMP_USE_BUILD_NUMBER=y - -CONFIG_FLASH=y - -# Reduce memory consumption -CONFIG_BOOT_BANNER=n -CONFIG_NCS_BOOT_BANNER=n -CONFIG_GPIO=n -CONFIG_SERIAL=n -CONFIG_CONSOLE=n -CONFIG_UART_CONSOLE=n -CONFIG_USE_SEGGER_RTT=n - -# Use minimal C library instead of the Picolib -CONFIG_MINIMAL_LIBC=y - -# Improve debugging experience by disabling reset on fatal error -CONFIG_RESET_ON_FATAL_ERROR=n diff --git a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/led_state_def.h b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/led_state_def.h deleted file mode 100644 index eeb15ce4d2e0..000000000000 --- a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/led_state_def.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -#include "led_state.h" -#include - -/* This configuration file is included only once from led_state module and holds - * information about LED effect associated with each state. - */ - -/* 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 {} led_state_def_include_once; - - -/* Map function to LED ID */ -static const uint8_t led_map[LED_ID_COUNT] = { - [LED_ID_SYSTEM_STATE] = 0, - [LED_ID_PEER_STATE] = 1 -}; - -/* On the nRF54L15 SoC, you can only use the **GPIO1** port for PWM hardware peripheral output. - * Because of that, on the PDK PCA10156 revision v0.3.0 **LED 0** and **LED 2** cannot be used - * for PWM output. - * - * You can still use these LEDs with the PWM LED driver, but you must set the LED color to - * ``LED_COLOR(255, 255, 255)`` or ``LED_COLOR(0, 0, 0)``. This ensures the PWM peripheral is not - * used for the mentioned LEDs. - */ - -static const struct led_effect led_system_state_effect[LED_SYSTEM_STATE_COUNT] = { - [LED_SYSTEM_STATE_IDLE] = LED_EFFECT_LED_ON(LED_COLOR(255, 255, 255)), - [LED_SYSTEM_STATE_CHARGING] = LED_EFFECT_LED_ON(LED_COLOR(255, 255, 255)), - [LED_SYSTEM_STATE_ERROR] = LED_EFFECT_LED_BLINK(200, LED_COLOR(255, 255, 255)), -}; - -static const struct led_effect led_peer_state_effect[LED_PEER_COUNT][LED_PEER_STATE_COUNT] = { - {[LED_PEER_STATE_DISCONNECTED] = LED_EFFECT_LED_OFF(), - [LED_PEER_STATE_CONNECTED] = LED_EFFECT_LED_ON(LED_COLOR(100, 100, 100)), - [LED_PEER_STATE_PEER_SEARCH] = LED_EFFECT_LED_BREATH(1000, LED_COLOR(100, 100, 100)), - [LED_PEER_STATE_CONFIRM_SELECT] = LED_EFFECT_LED_BLINK(50, LED_COLOR(100, 100, 100)), - [LED_PEER_STATE_CONFIRM_ERASE] = LED_EFFECT_LED_BLINK(25, LED_COLOR(100, 100, 100)), - [LED_PEER_STATE_ERASE_ADV] = LED_EFFECT_LED_BREATH(100, LED_COLOR(100, 100, 100)), - }, -}; diff --git a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/pm_static.yml b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/pm_static.yml deleted file mode 100644 index 0525b519b522..000000000000 --- a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/pm_static.yml +++ /dev/null @@ -1,47 +0,0 @@ -app: - address: 0x8800 - region: flash_primary - size: 0xb7800 -mcuboot: - address: 0x0 - region: flash_primary - size: 0x8000 -mcuboot_pad: - address: 0x8000 - region: flash_primary - size: 0x800 -mcuboot_primary: - address: 0x8000 - orig_span: &id001 - - app - - mcuboot_pad - region: flash_primary - size: 0xb8000 - span: *id001 -mcuboot_primary_app: - address: 0x8800 - orig_span: &id002 - - app - region: flash_primary - size: 0xb7800 - span: *id002 -mcuboot_secondary: - address: 0xc0000 - orig_span: &id003 - - mcuboot_secondary_pad - - mcuboot_secondary_app - region: flash_primary - size: 0xb8000 - span: *id003 -mcuboot_secondary_pad: - region: flash_primary - address: 0xc0000 - size: 0x800 -mcuboot_secondary_app: - region: flash_primary - address: 0xc0800 - size: 0xb7800 -settings_storage: - address: 0x178000 - region: flash_primary - size: 0x5000 diff --git a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/pm_static_fast_pair.yml b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/pm_static_fast_pair.yml deleted file mode 100644 index 725785cf4026..000000000000 --- a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/pm_static_fast_pair.yml +++ /dev/null @@ -1,51 +0,0 @@ -app: - address: 0x8800 - region: flash_primary - size: 0xb6800 -mcuboot: - address: 0x0 - region: flash_primary - size: 0x8000 -mcuboot_pad: - address: 0x8000 - region: flash_primary - size: 0x800 -mcuboot_primary: - address: 0x8000 - orig_span: &id001 - - app - - mcuboot_pad - region: flash_primary - size: 0xb7000 - span: *id001 -mcuboot_primary_app: - address: 0x8800 - orig_span: &id002 - - app - region: flash_primary - size: 0xb6800 - span: *id002 -mcuboot_secondary: - address: 0xbf000 - orig_span: &id003 - - mcuboot_secondary_pad - - mcuboot_secondary_app - region: flash_primary - size: 0xb7000 - span: *id003 -mcuboot_secondary_pad: - region: flash_primary - address: 0xbf000 - size: 0x800 -mcuboot_secondary_app: - region: flash_primary - address: 0xbf800 - size: 0xb6800 -bt_fast_pair: - address: 0x176000 - region: flash_primary - size: 0x1000 -settings_storage: - address: 0x177000 - region: flash_primary - size: 0x6000 diff --git a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/pm_static_keyboard.yml b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/pm_static_keyboard.yml deleted file mode 100644 index 0525b519b522..000000000000 --- a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/pm_static_keyboard.yml +++ /dev/null @@ -1,47 +0,0 @@ -app: - address: 0x8800 - region: flash_primary - size: 0xb7800 -mcuboot: - address: 0x0 - region: flash_primary - size: 0x8000 -mcuboot_pad: - address: 0x8000 - region: flash_primary - size: 0x800 -mcuboot_primary: - address: 0x8000 - orig_span: &id001 - - app - - mcuboot_pad - region: flash_primary - size: 0xb8000 - span: *id001 -mcuboot_primary_app: - address: 0x8800 - orig_span: &id002 - - app - region: flash_primary - size: 0xb7800 - span: *id002 -mcuboot_secondary: - address: 0xc0000 - orig_span: &id003 - - mcuboot_secondary_pad - - mcuboot_secondary_app - region: flash_primary - size: 0xb8000 - span: *id003 -mcuboot_secondary_pad: - region: flash_primary - address: 0xc0000 - size: 0x800 -mcuboot_secondary_app: - region: flash_primary - address: 0xc0800 - size: 0xb7800 -settings_storage: - address: 0x178000 - region: flash_primary - size: 0x5000 diff --git a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/pm_static_release.yml b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/pm_static_release.yml deleted file mode 100644 index 0525b519b522..000000000000 --- a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/pm_static_release.yml +++ /dev/null @@ -1,47 +0,0 @@ -app: - address: 0x8800 - region: flash_primary - size: 0xb7800 -mcuboot: - address: 0x0 - region: flash_primary - size: 0x8000 -mcuboot_pad: - address: 0x8000 - region: flash_primary - size: 0x800 -mcuboot_primary: - address: 0x8000 - orig_span: &id001 - - app - - mcuboot_pad - region: flash_primary - size: 0xb8000 - span: *id001 -mcuboot_primary_app: - address: 0x8800 - orig_span: &id002 - - app - region: flash_primary - size: 0xb7800 - span: *id002 -mcuboot_secondary: - address: 0xc0000 - orig_span: &id003 - - mcuboot_secondary_pad - - mcuboot_secondary_app - region: flash_primary - size: 0xb8000 - span: *id003 -mcuboot_secondary_pad: - region: flash_primary - address: 0xc0000 - size: 0x800 -mcuboot_secondary_app: - region: flash_primary - address: 0xc0800 - size: 0xb7800 -settings_storage: - address: 0x178000 - region: flash_primary - size: 0x5000 diff --git a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/port_state_def.h b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/port_state_def.h deleted file mode 100644 index 30d47da14299..000000000000 --- a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/port_state_def.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -#include - -#include "port_state.h" - -/* This configuration file is included only once from board module and holds - * information about default pin states set while board is on and off. - */ - -/* 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 {} port_state_def_include_once; - - -static const struct port_state port_state_on[] = { -}; - -static const struct port_state port_state_off[] = { -}; diff --git a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/prj.conf b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/prj.conf deleted file mode 100644 index 8212535635a5..000000000000 --- a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/prj.conf +++ /dev/null @@ -1,115 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# -################################################################################ -# Application Configuration - -CONFIG_DESKTOP_INIT_LOG_MOTION_EVENT=n -CONFIG_DESKTOP_INIT_LOG_HID_REPORT_EVENT=n -CONFIG_DESKTOP_INIT_LOG_HID_REPORT_SENT_EVENT=n -CONFIG_CAF_INIT_LOG_KEEP_ALIVE_EVENTS=n - -CONFIG_DESKTOP_ROLE_HID_PERIPHERAL=y -CONFIG_DESKTOP_PERIPHERAL_TYPE_MOUSE=y -CONFIG_DESKTOP_DEVICE_PID=0x52DE -CONFIG_DESKTOP_HID_BOOT_INTERFACE_MOUSE=y - -CONFIG_DESKTOP_MOTION_BUTTONS_ENABLE=y -CONFIG_DESKTOP_MOTION_BUTTONS_UP_KEY_ID=0 -CONFIG_DESKTOP_MOTION_BUTTONS_DOWN_KEY_ID=3 -CONFIG_DESKTOP_MOTION_BUTTONS_LEFT_KEY_ID=2 -CONFIG_DESKTOP_MOTION_BUTTONS_RIGHT_KEY_ID=1 - -CONFIG_CAF_BUTTONS=y -CONFIG_CAF_BUTTONS_POLARITY_INVERSED=y -CONFIG_CAF_BUTTONS_PM_KEEP_ALIVE=n - -CONFIG_CAF_CLICK_DETECTOR=y - -CONFIG_CAF_LEDS=y - -CONFIG_DESKTOP_BLE_USE_DEFAULT_ID=y - -CONFIG_DESKTOP_BLE_PEER_CONTROL=y -CONFIG_DESKTOP_BLE_PEER_CONTROL_BUTTON=0x0000 -CONFIG_DESKTOP_BLE_PEER_ERASE_ON_START=y - -CONFIG_DESKTOP_BLE_SECURITY_FAIL_TIMEOUT_S=10 -CONFIG_DESKTOP_BLE_LOW_LATENCY_LOCK=y - -CONFIG_DESKTOP_CONFIG_CHANNEL_ENABLE=y -CONFIG_DESKTOP_CONFIG_CHANNEL_OUT_REPORT=y -CONFIG_DESKTOP_CONFIG_CHANNEL_DFU_ENABLE=y - -################################################################################ -# Zephyr Configuration - -CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=1536 -CONFIG_ISR_STACK_SIZE=1536 -CONFIG_MAIN_STACK_SIZE=840 -CONFIG_BT_RX_STACK_SIZE=2048 -CONFIG_BT_HCI_TX_STACK_SIZE_WITH_PROMPT=y -CONFIG_BT_HCI_TX_STACK_SIZE=1536 - -CONFIG_BOOT_BANNER=n -CONFIG_NCS_BOOT_BANNER=n - -CONFIG_NUM_COOP_PRIORITIES=10 -CONFIG_NUM_PREEMPT_PRIORITIES=11 - -CONFIG_HEAP_MEM_POOL_SIZE=512 - -CONFIG_SYS_CLOCK_TICKS_PER_SEC=1000 -CONFIG_SYSTEM_CLOCK_NO_WAIT=y - -CONFIG_HW_STACK_PROTECTION=y -CONFIG_RESET_ON_FATAL_ERROR=n - -CONFIG_GPIO=y - -CONFIG_REBOOT=y - -CONFIG_SPEED_OPTIMIZATIONS=y - -CONFIG_PWM=y - -CONFIG_LED=y -CONFIG_LED_PWM=y - -CONFIG_BT_MAX_PAIRED=2 -CONFIG_BT_ID_MAX=3 - -CONFIG_BT_CTLR_SDC_LLPM=y -CONFIG_BT_CTLR_TX_PWR_DYNAMIC_CONTROL=y -CONFIG_BT_ATT_TX_COUNT=4 -CONFIG_BT_CONN_TX_MAX=4 - -CONFIG_STREAM_FLASH=y -CONFIG_IMG_MANAGER=y -CONFIG_MCUBOOT_IMG_MANAGER=y - -# Assign RRAM write buffer size to ensure short write slots. Trying to allocate long write slots -# while maintaining a BLE connection with short interval and no connection latency may lead to -# timeouts in flash_sync_mpsl. -CONFIG_NRF_RRAM_WRITE_BUFFER_SIZE=8 - -################################################################################ - -CONFIG_ASSERT=y -CONFIG_ASSERT_LEVEL=2 - -# nRF54L PDK uses UART for logs. -CONFIG_SERIAL=y -CONFIG_CONSOLE=y -CONFIG_UART_CONSOLE=y - -CONFIG_LOG=y -CONFIG_LOG_BACKEND_UART=y -CONFIG_LOG_BACKEND_SHOW_COLOR=n -CONFIG_LOG_BACKEND_FORMAT_TIMESTAMP=n -CONFIG_LOG_MODE_DEFERRED=y -CONFIG_LOG_PRINTK=y -CONFIG_LOG_BUFFER_SIZE=4096 -CONFIG_LOG_PROCESS_THREAD_STACK_SIZE=1024 diff --git a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/prj_fast_pair.conf b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/prj_fast_pair.conf deleted file mode 100644 index a374218176a6..000000000000 --- a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/prj_fast_pair.conf +++ /dev/null @@ -1,151 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# -################################################################################ -# debug: Fast Pair version -# -# This debug build type configuration enables Fast Pair support. -# The build type configuration supports both configuration channel and MCUmgr DFU transports. -# -# Application Configuration - -CONFIG_DESKTOP_INIT_LOG_MOTION_EVENT=n -CONFIG_DESKTOP_INIT_LOG_HID_REPORT_EVENT=n -CONFIG_DESKTOP_INIT_LOG_HID_REPORT_SENT_EVENT=n -CONFIG_CAF_INIT_LOG_KEEP_ALIVE_EVENTS=n - -CONFIG_DESKTOP_ROLE_HID_PERIPHERAL=y -CONFIG_DESKTOP_PERIPHERAL_TYPE_MOUSE=y -CONFIG_DESKTOP_DEVICE_PID=0x52DE -CONFIG_DESKTOP_DEVICE_GENERATION="FastPair" -CONFIG_DESKTOP_HID_BOOT_INTERFACE_MOUSE=y - -CONFIG_DESKTOP_MOTION_BUTTONS_ENABLE=y -CONFIG_DESKTOP_MOTION_BUTTONS_UP_KEY_ID=0 -CONFIG_DESKTOP_MOTION_BUTTONS_DOWN_KEY_ID=3 -CONFIG_DESKTOP_MOTION_BUTTONS_LEFT_KEY_ID=2 -CONFIG_DESKTOP_MOTION_BUTTONS_RIGHT_KEY_ID=1 - -CONFIG_CAF_BUTTONS=y -CONFIG_CAF_BUTTONS_POLARITY_INVERSED=y -CONFIG_CAF_BUTTONS_PM_KEEP_ALIVE=n - -CONFIG_CAF_CLICK_DETECTOR=y - -CONFIG_CAF_LEDS=y - -CONFIG_DESKTOP_DFU_MCUMGR_ENABLE=y -CONFIG_CAF_INIT_LOG_BLE_SMP_TRANSFER_EVENTS=n - -# Align advertising intervals with Fast Pair specification. -CONFIG_CAF_BLE_ADV_FAST_INT_MIN=0x0040 -CONFIG_CAF_BLE_ADV_FAST_INT_MAX=0x0060 -CONFIG_CAF_BLE_ADV_SLOW_INT_MIN=0x0060 -CONFIG_CAF_BLE_ADV_SLOW_INT_MAX=0x0080 - -# Disable filter accept list to allow for multiple bonds for a given local identity. -CONFIG_CAF_BLE_ADV_FILTER_ACCEPT_LIST=n -CONFIG_CAF_BLE_STATE_MAX_LOCAL_ID_BONDS=3 - -# Align the advertised TX power with Fast Pair expectations. -CONFIG_BT_ADV_PROV_TX_POWER_CORRECTION_VAL=-17 - -CONFIG_DESKTOP_BLE_USE_DEFAULT_ID=y - -CONFIG_DESKTOP_BLE_PEER_CONTROL=y -CONFIG_DESKTOP_BLE_PEER_CONTROL_BUTTON=0x0000 -CONFIG_DESKTOP_BLE_PEER_ERASE_ON_START=y - -CONFIG_DESKTOP_BLE_SECURITY_FAIL_TIMEOUT_S=30 -CONFIG_DESKTOP_BLE_LOW_LATENCY_LOCK=y - -CONFIG_DESKTOP_CONFIG_CHANNEL_ENABLE=y -CONFIG_DESKTOP_CONFIG_CHANNEL_OUT_REPORT=y -CONFIG_DESKTOP_CONFIG_CHANNEL_DFU_ENABLE=y - -################################################################################ -# Zephyr Configuration - -CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=1536 -CONFIG_ISR_STACK_SIZE=1536 -CONFIG_MAIN_STACK_SIZE=840 -CONFIG_BT_RX_STACK_SIZE=2048 -CONFIG_BT_HCI_TX_STACK_SIZE_WITH_PROMPT=y -CONFIG_BT_HCI_TX_STACK_SIZE=1536 - -CONFIG_BOOT_BANNER=n -CONFIG_NCS_BOOT_BANNER=n - -CONFIG_NUM_COOP_PRIORITIES=10 -CONFIG_NUM_PREEMPT_PRIORITIES=11 - -CONFIG_HEAP_MEM_POOL_SIZE=2048 - -CONFIG_SYS_CLOCK_TICKS_PER_SEC=1000 -CONFIG_SYSTEM_CLOCK_NO_WAIT=y - -CONFIG_HW_STACK_PROTECTION=y -CONFIG_RESET_ON_FATAL_ERROR=n - -CONFIG_GPIO=y - -CONFIG_REBOOT=y - -CONFIG_SPEED_OPTIMIZATIONS=y - -CONFIG_PWM=y - -CONFIG_LED=y -CONFIG_LED_PWM=y - -# Enable MCUmgr Bluetooth transport and increase Bluetooth buffers to speed up DFU image transfer. -CONFIG_MCUMGR_TRANSPORT_BT=y -CONFIG_MCUMGR_TRANSPORT_BT_PERM_RW=y -CONFIG_MCUMGR_GRP_IMG_VERSION_CMP_USE_BUILD_NUMBER=y - -CONFIG_IMG_MANAGER=y -CONFIG_MCUBOOT_IMG_MANAGER=y - -CONFIG_MCUMGR_GRP_IMG_REJECT_DIRECT_XIP_MISMATCHED_SLOT=y - -CONFIG_BT_L2CAP_TX_MTU=260 -CONFIG_BT_BUF_ACL_RX_SIZE=264 - -CONFIG_BT_MAX_PAIRED=4 -CONFIG_BT_ID_MAX=3 - -CONFIG_BT_CTLR_SDC_LLPM=y -CONFIG_BT_CTLR_TX_PWR_DYNAMIC_CONTROL=y -CONFIG_BT_ATT_TX_COUNT=4 -CONFIG_BT_CONN_TX_MAX=4 - -CONFIG_BT_FAST_PAIR=y -CONFIG_BT_FAST_PAIR_USE_CASE_MOUSE=y -CONFIG_BT_FAST_PAIR_LOG_LEVEL_DBG=y -CONFIG_BT_PRIVACY=y - -# Assign RRAM write buffer size to ensure short write slots. Trying to allocate long write slots -# while maintaining a BLE connection with short interval and no connection latency may lead to -# timeouts in flash_sync_mpsl. -CONFIG_NRF_RRAM_WRITE_BUFFER_SIZE=8 - -################################################################################ - -CONFIG_ASSERT=y -CONFIG_ASSERT_LEVEL=2 - -# nRF54L PDK uses UART for logs. -CONFIG_SERIAL=y -CONFIG_CONSOLE=y -CONFIG_UART_CONSOLE=y - -CONFIG_LOG=y -CONFIG_LOG_BACKEND_UART=y -CONFIG_LOG_BACKEND_SHOW_COLOR=n -CONFIG_LOG_BACKEND_FORMAT_TIMESTAMP=n -CONFIG_LOG_MODE_DEFERRED=y -CONFIG_LOG_PRINTK=y -CONFIG_LOG_BUFFER_SIZE=4096 -CONFIG_LOG_PROCESS_THREAD_STACK_SIZE=1024 diff --git a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/prj_keyboard.conf b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/prj_keyboard.conf deleted file mode 100644 index 3cc6397aae29..000000000000 --- a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/prj_keyboard.conf +++ /dev/null @@ -1,120 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# -################################################################################ -# debug: Keyboard version -# -# This debug build type configuration acts as a keyboard. -# -# Application Configuration - -CONFIG_DESKTOP_INIT_LOG_HID_REPORT_EVENT=n -CONFIG_DESKTOP_INIT_LOG_HID_REPORT_SENT_EVENT=n -CONFIG_CAF_INIT_LOG_KEEP_ALIVE_EVENTS=n - -CONFIG_DESKTOP_ROLE_HID_PERIPHERAL=y -CONFIG_DESKTOP_PERIPHERAL_TYPE_KEYBOARD=y -CONFIG_DESKTOP_DEVICE_PID=0x52DD -CONFIG_DESKTOP_HID_BOOT_INTERFACE_KEYBOARD=y -CONFIG_DESKTOP_HID_STATE_HID_KEYMAP_DEF_PATH="hid_keymap_def_keyboard.h" -CONFIG_DESKTOP_HID_STATE_HID_KEYBOARD_LEDS_DEF_PATH="hid_keyboard_leds_def_keyboard.h" -CONFIG_DESKTOP_HID_REPORT_EXPIRATION=10000 -CONFIG_DESKTOP_HID_EVENT_QUEUE_SIZE=60 - -CONFIG_CAF_BUTTONS=y -CONFIG_CAF_BUTTONS_POLARITY_INVERSED=y -CONFIG_CAF_BUTTONS_PM_KEEP_ALIVE=n - -CONFIG_CAF_CLICK_DETECTOR=y - -CONFIG_CAF_LEDS=y - -CONFIG_DESKTOP_BUTTONS_SIM_ENABLE=y -CONFIG_DESKTOP_BUTTONS_SIM_INTERVAL=100 -CONFIG_DESKTOP_BUTTONS_SIM_LOOP_FOREVER=y -CONFIG_DESKTOP_BUTTONS_SIM_TRIGGER_KEY_ID=0x03 - -CONFIG_DESKTOP_BLE_PEER_CONTROL=y -CONFIG_DESKTOP_BLE_PEER_CONTROL_BUTTON=0x0000 -CONFIG_DESKTOP_BLE_PEER_ERASE_ON_START=y - -CONFIG_DESKTOP_BLE_USE_DEFAULT_ID=y - -CONFIG_DESKTOP_BLE_SECURITY_FAIL_TIMEOUT_S=10 -CONFIG_DESKTOP_BLE_LOW_LATENCY_LOCK=y - -CONFIG_DESKTOP_CONFIG_CHANNEL_ENABLE=y -CONFIG_DESKTOP_CONFIG_CHANNEL_OUT_REPORT=y -CONFIG_DESKTOP_CONFIG_CHANNEL_DFU_ENABLE=y - -################################################################################ -# Zephyr Configuration - -CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=1536 -CONFIG_ISR_STACK_SIZE=1536 -CONFIG_MAIN_STACK_SIZE=840 -CONFIG_BT_RX_STACK_SIZE=2048 -CONFIG_BT_HCI_TX_STACK_SIZE_WITH_PROMPT=y -CONFIG_BT_HCI_TX_STACK_SIZE=1536 - -CONFIG_BOOT_BANNER=n -CONFIG_NCS_BOOT_BANNER=n - -CONFIG_NUM_COOP_PRIORITIES=10 -CONFIG_NUM_PREEMPT_PRIORITIES=11 - -CONFIG_HEAP_MEM_POOL_SIZE=4096 - -CONFIG_SYS_CLOCK_TICKS_PER_SEC=1000 -CONFIG_SYSTEM_CLOCK_NO_WAIT=y - -CONFIG_HW_STACK_PROTECTION=y -CONFIG_RESET_ON_FATAL_ERROR=n - -CONFIG_GPIO=y -CONFIG_REBOOT=y - -CONFIG_SPEED_OPTIMIZATIONS=y - -CONFIG_PWM=y - -CONFIG_LED=y -CONFIG_LED_PWM=y - -CONFIG_BT_MAX_PAIRED=2 -CONFIG_BT_ID_MAX=3 - -CONFIG_BT_CTLR_SDC_LLPM=y -CONFIG_BT_CTLR_TX_PWR_DYNAMIC_CONTROL=y -CONFIG_BT_ATT_TX_COUNT=6 -CONFIG_BT_CONN_TX_MAX=6 - -CONFIG_STREAM_FLASH=y -CONFIG_IMG_MANAGER=y -CONFIG_MCUBOOT_IMG_MANAGER=y - -# Assign RRAM write buffer size to ensure short write slots. Trying to allocate long write slots -# while maintaining a BLE connection with short interval and no connection latency may lead to -# timeouts in flash_sync_mpsl. -CONFIG_NRF_RRAM_WRITE_BUFFER_SIZE=8 - -################################################################################ - -CONFIG_ASSERT=y -CONFIG_ASSERT_LEVEL=2 - -# nRF54L PDK uses UART for logs. -CONFIG_SERIAL=y -CONFIG_CONSOLE=y -CONFIG_UART_CONSOLE=y - -CONFIG_LOG=y -CONFIG_LOG_BACKEND_UART=y -CONFIG_LOG_BACKEND_SHOW_COLOR=n -CONFIG_LOG_BACKEND_FORMAT_TIMESTAMP=n -CONFIG_LOG_MODE_DEFERRED=y -CONFIG_LOG_PRINTK=y -CONFIG_LOG_BUFFER_SIZE=4096 -CONFIG_LOG_PROCESS_THREAD_STACK_SIZE=1024 diff --git a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/prj_release.conf b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/prj_release.conf deleted file mode 100644 index d21819bcaa51..000000000000 --- a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/prj_release.conf +++ /dev/null @@ -1,97 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# -################################################################################ -# Application Configuration - -CONFIG_DESKTOP_ROLE_HID_PERIPHERAL=y -CONFIG_DESKTOP_PERIPHERAL_TYPE_MOUSE=y -CONFIG_DESKTOP_DEVICE_PID=0x52DE -CONFIG_DESKTOP_HID_BOOT_INTERFACE_MOUSE=y - -CONFIG_DESKTOP_MOTION_BUTTONS_ENABLE=y -CONFIG_DESKTOP_MOTION_BUTTONS_UP_KEY_ID=0 -CONFIG_DESKTOP_MOTION_BUTTONS_DOWN_KEY_ID=3 -CONFIG_DESKTOP_MOTION_BUTTONS_LEFT_KEY_ID=2 -CONFIG_DESKTOP_MOTION_BUTTONS_RIGHT_KEY_ID=1 - -CONFIG_CAF_BUTTONS=y -CONFIG_CAF_BUTTONS_POLARITY_INVERSED=y -CONFIG_CAF_BUTTONS_PM_KEEP_ALIVE=n - -CONFIG_CAF_CLICK_DETECTOR=y - -CONFIG_CAF_LEDS=y - -CONFIG_DESKTOP_BLE_PEER_CONTROL=y -CONFIG_DESKTOP_BLE_PEER_CONTROL_BUTTON=0x0000 -CONFIG_DESKTOP_BLE_PEER_ERASE_ON_START=y - -CONFIG_DESKTOP_BLE_SECURITY_FAIL_TIMEOUT_S=10 -CONFIG_DESKTOP_BLE_LOW_LATENCY_LOCK=y - -CONFIG_DESKTOP_WATCHDOG_ENABLE=y -CONFIG_DESKTOP_FAILSAFE_ENABLE=y - -CONFIG_DESKTOP_CONFIG_CHANNEL_ENABLE=y -CONFIG_DESKTOP_CONFIG_CHANNEL_OUT_REPORT=y -CONFIG_DESKTOP_CONFIG_CHANNEL_DFU_ENABLE=y - -# Assign RRAM write buffer size to ensure short write slots. Trying to allocate long write slots -# while maintaining a BLE connection with short interval and no connection latency may lead to -# timeouts in flash_sync_mpsl. -CONFIG_NRF_RRAM_WRITE_BUFFER_SIZE=8 - -################################################################################ -# Zephyr Configuration - -CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=1536 -CONFIG_ISR_STACK_SIZE=1536 -CONFIG_MAIN_STACK_SIZE=840 -CONFIG_BT_RX_STACK_SIZE=2048 -CONFIG_BT_HCI_TX_STACK_SIZE_WITH_PROMPT=y -CONFIG_BT_HCI_TX_STACK_SIZE=1536 - -CONFIG_BOOT_BANNER=n -CONFIG_NCS_BOOT_BANNER=n - -CONFIG_NUM_COOP_PRIORITIES=10 -CONFIG_NUM_PREEMPT_PRIORITIES=11 - -CONFIG_HEAP_MEM_POOL_SIZE=512 - -CONFIG_SYS_CLOCK_TICKS_PER_SEC=1000 -CONFIG_SYSTEM_CLOCK_NO_WAIT=y - -CONFIG_HW_STACK_PROTECTION=n -CONFIG_RESET_ON_FATAL_ERROR=n - -CONFIG_GPIO=y - -CONFIG_SERIAL=n -CONFIG_CONSOLE=n -CONFIG_UART_CONSOLE=n -CONFIG_USE_SEGGER_RTT=n - -CONFIG_REBOOT=y - -CONFIG_SPEED_OPTIMIZATIONS=y - -CONFIG_PWM=y - -CONFIG_LED=y -CONFIG_LED_PWM=y - -CONFIG_BT_MAX_PAIRED=2 -CONFIG_BT_ID_MAX=3 - -CONFIG_BT_CTLR_SDC_LLPM=y -CONFIG_BT_CTLR_TX_PWR_DYNAMIC_CONTROL=y -CONFIG_BT_ATT_TX_COUNT=4 -CONFIG_BT_CONN_TX_MAX=4 - -CONFIG_STREAM_FLASH=y -CONFIG_IMG_MANAGER=y -CONFIG_MCUBOOT_IMG_MANAGER=y diff --git a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/sysbuild.conf b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/sysbuild.conf deleted file mode 100644 index f777fb91fbb5..000000000000 --- a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/sysbuild.conf +++ /dev/null @@ -1,11 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# -################################################################################ - -SB_CONFIG_BOOTLOADER_MCUBOOT=y -SB_CONFIG_MCUBOOT_MODE_DIRECT_XIP=y -SB_CONFIG_BOOT_SIGNATURE_TYPE_RSA=y -SB_CONFIG_BOOT_SIGNATURE_KEY_FILE="\${APPLICATION_CONFIG_DIR}/images/mcuboot/mcuboot_private.pem" diff --git a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/sysbuild_fast_pair.conf b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/sysbuild_fast_pair.conf deleted file mode 100644 index e2d9e7ec083e..000000000000 --- a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/sysbuild_fast_pair.conf +++ /dev/null @@ -1,12 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# -################################################################################ - -SB_CONFIG_BT_FAST_PAIR=y -SB_CONFIG_BOOTLOADER_MCUBOOT=y -SB_CONFIG_MCUBOOT_MODE_DIRECT_XIP=y -SB_CONFIG_BOOT_SIGNATURE_TYPE_RSA=y -SB_CONFIG_BOOT_SIGNATURE_KEY_FILE="\${APPLICATION_CONFIG_DIR}/images/mcuboot/mcuboot_private_fast_pair.pem" diff --git a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/sysbuild_keyboard.conf b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/sysbuild_keyboard.conf deleted file mode 100644 index f777fb91fbb5..000000000000 --- a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/sysbuild_keyboard.conf +++ /dev/null @@ -1,11 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# -################################################################################ - -SB_CONFIG_BOOTLOADER_MCUBOOT=y -SB_CONFIG_MCUBOOT_MODE_DIRECT_XIP=y -SB_CONFIG_BOOT_SIGNATURE_TYPE_RSA=y -SB_CONFIG_BOOT_SIGNATURE_KEY_FILE="\${APPLICATION_CONFIG_DIR}/images/mcuboot/mcuboot_private.pem" diff --git a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/sysbuild_release.conf b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/sysbuild_release.conf deleted file mode 100644 index f777fb91fbb5..000000000000 --- a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/sysbuild_release.conf +++ /dev/null @@ -1,11 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# -################################################################################ - -SB_CONFIG_BOOTLOADER_MCUBOOT=y -SB_CONFIG_MCUBOOT_MODE_DIRECT_XIP=y -SB_CONFIG_BOOT_SIGNATURE_TYPE_RSA=y -SB_CONFIG_BOOT_SIGNATURE_KEY_FILE="\${APPLICATION_CONFIG_DIR}/images/mcuboot/mcuboot_private.pem" diff --git a/applications/nrf_desktop/doc/dfu_mcumgr.rst b/applications/nrf_desktop/doc/dfu_mcumgr.rst index c3873f2552a0..b3513a76559a 100644 --- a/applications/nrf_desktop/doc/dfu_mcumgr.rst +++ b/applications/nrf_desktop/doc/dfu_mcumgr.rst @@ -36,6 +36,13 @@ The module selects the following configurations: * :kconfig:option:`CONFIG_MCUMGR` - This option enables the MCUmgr support, which is required for the DFU process. For details, see :ref:`zephyr:mcu_mgr` in the Zephyr documentation. +* :kconfig:option:`CONFIG_MCUMGR_GRP_OS` - This option enables the MCUmgr OS management handlers that are required for the DFU process. + For details, see :ref:`zephyr:device_mgmt` in the Zephyr documentation. + + MCUmgr OS management handlers: + + * :kconfig:option:`CONFIG_MCUMGR_GRP_OS_BOOTLOADER_INFO` - MCUmgr handler responsible for providing the bootloader information. + * :kconfig:option:`CONFIG_MCUMGR_MGMT_NOTIFICATION_HOOKS` - This option enables the MCUmgr notification hook support, which allows the module to listen for an MCUmgr event. For details, see :ref:`zephyr:mcumgr_callbacks` in the Zephyr documentation. @@ -79,14 +86,9 @@ MCUmgr configuration using MCUboot backend The MCUboot backend configuration selects the following options: -* MCUmgr groups: - - * :kconfig:option:`CONFIG_MCUMGR_GRP_IMG` - This option enables the MCUmgr image management handlers that are required for the DFU process. - For details, see :ref:`zephyr:device_mgmt` in the Zephyr documentation. - * :kconfig:option:`CONFIG_MCUMGR_GRP_IMG_MUTEX` - * :kconfig:option:`CONFIG_MCUMGR_GRP_OS` - This option enables the MCUmgr OS management handlers that are required for the DFU process. - For details, see :ref:`zephyr:device_mgmt` in the Zephyr documentation. - +* :kconfig:option:`CONFIG_MCUMGR_GRP_IMG` - This option enables the MCUmgr image management handlers that are required for the DFU process. + For details, see :ref:`zephyr:device_mgmt` in the Zephyr documentation. +* :kconfig:option:`CONFIG_MCUMGR_GRP_IMG_MUTEX` * :kconfig:option:`CONFIG_IMG_MANAGER` * :kconfig:option:`CONFIG_STREAM_FLASH` * :kconfig:option:`CONFIG_MCUBOOT_BOOTUTIL_LIB` diff --git a/applications/nrf_desktop/sample.yaml b/applications/nrf_desktop/sample.yaml index 519014c6c80a..c3a8061c877d 100644 --- a/applications/nrf_desktop/sample.yaml +++ b/applications/nrf_desktop/sample.yaml @@ -1,6 +1,8 @@ sample: - name: nRF Desktop - description: HID device reference design + name: nRF Desktop - HID reference design + description: The nRF Desktop is an HID reference design application. + It can be configured to function as a mouse, keyboard or USB dongle + bridging radio connected HID peripheral. common: sysbuild: true tags: ci_build sysbuild ci_applications_nrf_desktop @@ -19,11 +21,9 @@ tests: applications.nrf_desktop.zdebug.uart: platform_allow: - nrf54h20dk/nrf54h20/cpuapp - - nrf54l15pdk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp integration_platforms: - nrf54h20dk/nrf54h20/cpuapp - - nrf54l15pdk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp applications.nrf_desktop.zdebug: build_only: true @@ -51,10 +51,8 @@ tests: extra_args: FILE_SUFFIX=wwcb applications.nrf_desktop.zdebug_fast_pair.gmouse.uart: platform_allow: - - nrf54l15pdk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp integration_platforms: - - nrf54l15pdk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp extra_args: FILE_SUFFIX=fast_pair FP_MODEL_ID=0x8E717D @@ -115,10 +113,8 @@ tests: extra_args: FILE_SUFFIX=dongle applications.nrf_desktop.zdebug_keyboard.uart: platform_allow: - - nrf54l15pdk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp integration_platforms: - - nrf54l15pdk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp extra_args: FILE_SUFFIX=keyboard applications.nrf_desktop.zdebug_keyboard: @@ -160,7 +156,6 @@ tests: - nrf52840gmouse/nrf52840 - nrf5340dk/nrf5340/cpuapp - nrf54h20dk/nrf54h20/cpuapp - - nrf54l15pdk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp integration_platforms: - nrf52dmouse/nrf52832 @@ -175,7 +170,6 @@ tests: - nrf52840gmouse/nrf52840 - nrf5340dk/nrf5340/cpuapp - nrf54h20dk/nrf54h20/cpuapp - - nrf54l15pdk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp extra_args: FILE_SUFFIX=release applications.nrf_desktop.zrelease_fast_pair.keyboard: diff --git a/applications/nrf_desktop/src/modules/Kconfig.config_channel b/applications/nrf_desktop/src/modules/Kconfig.config_channel index 50d26b9263ea..d01de82965d4 100644 --- a/applications/nrf_desktop/src/modules/Kconfig.config_channel +++ b/applications/nrf_desktop/src/modules/Kconfig.config_channel @@ -60,9 +60,6 @@ config DESKTOP_CONFIG_CHANNEL_DFU_ENABLE depends on (SSF_SUIT_SERVICE_ENABLED || !SUIT) help This option enables DFU over the config channel. - The option automatically enables 8-bit write block size emulation to - ensure that update images with size unaligned to word size can be - handled while writing to SoC FLASH. if DESKTOP_CONFIG_CHANNEL_DFU_ENABLE diff --git a/applications/nrf_desktop/src/modules/Kconfig.dfu_mcumgr b/applications/nrf_desktop/src/modules/Kconfig.dfu_mcumgr index 8aaa9884fc41..b3d708639b22 100644 --- a/applications/nrf_desktop/src/modules/Kconfig.dfu_mcumgr +++ b/applications/nrf_desktop/src/modules/Kconfig.dfu_mcumgr @@ -9,6 +9,8 @@ menuconfig DESKTOP_DFU_MCUMGR_ENABLE select EXPERIMENTAL select CAF_BLE_SMP_TRANSFER_EVENTS if MCUMGR_TRANSPORT_BT select MCUMGR + select MCUMGR_GRP_OS + select MCUMGR_GRP_OS_BOOTLOADER_INFO select MCUMGR_MGMT_NOTIFICATION_HOOKS select MCUMGR_SMP_COMMAND_STATUS_HOOKS select CRC @@ -47,7 +49,6 @@ config DESKTOP_DFU_BACKEND_MCUBOOT select IMG_MANAGER select MCUMGR_GRP_IMG select MCUMGR_GRP_IMG_MUTEX if DESKTOP_DFU_LOCK - select MCUMGR_GRP_OS select STREAM_FLASH depends on BOOTLOADER_MCUBOOT help diff --git a/applications/nrf_desktop/src/modules/Kconfig.usb_state b/applications/nrf_desktop/src/modules/Kconfig.usb_state index dee657d9df98..a0f7424236b6 100644 --- a/applications/nrf_desktop/src/modules/Kconfig.usb_state +++ b/applications/nrf_desktop/src/modules/Kconfig.usb_state @@ -96,9 +96,16 @@ config DESKTOP_USB_STACK_NEXT bool "USB next stack [EXPERIMENTAL]" select EXPERIMENTAL select USB_DEVICE_STACK_NEXT + imply SOC_FLASH_NRF_PARTIAL_ERASE help Use experimental integration of USB next stack. + The option implies partial erase of nRF SoC flash in the driver + configuration to improve stability of the USB next stack. The partial + erase feature works around device errors that might be reported by + Windows USB host in Device Manager if USB cable is connected while + erasing secondary image slot in background. + config DESKTOP_USB_STACK_LEGACY bool "USB legacy stack" select USB_DEVICE_STACK diff --git a/applications/sdp/gpio/CMakeLists.txt b/applications/sdp/gpio/CMakeLists.txt index 5a428c69b31e..2e996f5b15ca 100644 --- a/applications/sdp/gpio/CMakeLists.txt +++ b/applications/sdp/gpio/CMakeLists.txt @@ -9,6 +9,6 @@ cmake_minimum_required(VERSION 3.20.0) find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) project(emulated_gpio) -target_sources_ifdef(CONFIG_GPIO_NRFE_EGPIO_BACKEND_ICMSG app PRIVATE src/nrfe_icmsg.c) -target_sources_ifdef(CONFIG_GPIO_NRFE_EGPIO_BACKEND_MBOX app PRIVATE src/nrfe_mbox.c) target_sources(app PRIVATE src/main.c) +target_sources_ifdef(CONFIG_GPIO_NRFE_EGPIO_BACKEND_ICMSG app PRIVATE src/backend/backend_icmsg.c) +target_sources_ifdef(CONFIG_GPIO_NRFE_EGPIO_BACKEND_MBOX app PRIVATE src/backend/backend_mbox.c) diff --git a/applications/sdp/gpio/boards/nrf54l15dk_nrf54l15_cpuflpr.conf b/applications/sdp/gpio/boards/nrf54l15dk_nrf54l15_cpuflpr.conf index 4d4345cb7004..6c1b7543e212 100644 --- a/applications/sdp/gpio/boards/nrf54l15dk_nrf54l15_cpuflpr.conf +++ b/applications/sdp/gpio/boards/nrf54l15dk_nrf54l15_cpuflpr.conf @@ -18,6 +18,7 @@ CONFIG_PM=n # Interrupts CONFIG_DYNAMIC_INTERRUPTS=n CONFIG_IRQ_OFFLOAD=n +CONFIG_GEN_SW_ISR_TABLE=n # Memory protection CONFIG_THREAD_STACK_INFO=n @@ -26,6 +27,7 @@ CONFIG_FPU=n # Boot CONFIG_BOOT_BANNER=n +CONFIG_NCS_BOOT_BANNER=n # Console CONFIG_CONSOLE=n diff --git a/applications/sdp/gpio/boards/nrf54l15dk_nrf54l15_cpuflpr.overlay b/applications/sdp/gpio/boards/nrf54l15dk_nrf54l15_cpuflpr.overlay index 80ecba58376d..ccbed019993a 100644 --- a/applications/sdp/gpio/boards/nrf54l15dk_nrf54l15_cpuflpr.overlay +++ b/applications/sdp/gpio/boards/nrf54l15dk_nrf54l15_cpuflpr.overlay @@ -10,19 +10,27 @@ #address-cells = <1>; #size-cells = <1>; - sram_tx: memory@20018000 { - reg = <0x20018000 0x0800>; + sram_tx: memory@2003c000 { + reg = <0x2003c000 0x0800>; }; - sram_rx: memory@20020000 { - reg = <0x20020000 0x0800>; + sram_rx: memory@2003c800 { + reg = <0x2003c800 0x0800>; }; }; }; }; +&cpuflpr_sram { + reg = <0x2003d000 DT_SIZE_K(12)>; + ranges = <0x0 0x2003d000 0x3000>; +}; + &cpuflpr_vevif_rx { status = "okay"; + interrupts = <16 NRF_DEFAULT_IRQ_PRIORITY>; + nordic,tasks = <1>; + nordic,tasks-mask = <0x00010000>; }; &cpuflpr_vevif_tx { diff --git a/applications/sdp/gpio/boards/nrf54l15dk_nrf54l15_cpuflpr_icmsg.overlay b/applications/sdp/gpio/boards/nrf54l15dk_nrf54l15_cpuflpr_icmsg.overlay index 002cf9b3aded..8413634b2dae 100644 --- a/applications/sdp/gpio/boards/nrf54l15dk_nrf54l15_cpuflpr_icmsg.overlay +++ b/applications/sdp/gpio/boards/nrf54l15dk_nrf54l15_cpuflpr_icmsg.overlay @@ -10,7 +10,7 @@ compatible = "zephyr,ipc-icmsg"; tx-region = <&sram_tx>; rx-region = <&sram_rx>; - mboxes = <&cpuflpr_vevif_rx 21>, <&cpuflpr_vevif_tx 20>; + mboxes = <&cpuflpr_vevif_rx 16>, <&cpuflpr_vevif_tx 20>; mbox-names = "rx", "tx"; status = "okay"; }; diff --git a/applications/sdp/gpio/boards/nrf54l15dk_nrf54l15_cpuflpr_mbox.overlay b/applications/sdp/gpio/boards/nrf54l15dk_nrf54l15_cpuflpr_mbox.overlay index 57534433d353..747ef88e440c 100644 --- a/applications/sdp/gpio/boards/nrf54l15dk_nrf54l15_cpuflpr_mbox.overlay +++ b/applications/sdp/gpio/boards/nrf54l15dk_nrf54l15_cpuflpr_mbox.overlay @@ -7,7 +7,7 @@ / { mbox_consumer: mbox_consumer { compatible = "vnd,mbox-consumer"; - mboxes = <&cpuflpr_vevif_rx 21>, <&cpuflpr_vevif_tx 20>; + mboxes = <&cpuflpr_vevif_rx 16>, <&cpuflpr_vevif_tx 20>; mbox-names = "rx", "tx"; }; }; diff --git a/applications/sdp/gpio/include/main.h b/applications/sdp/gpio/include/main.h deleted file mode 100644 index e0a0e0cf0c35..000000000000 --- a/applications/sdp/gpio/include/main.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -#ifndef MAIN_H__ -#define MAIN_H__ - -#include -#include - -#if !defined(CONFIG_GPIO_NRFE_EGPIO_BACKEND_ICMSG) && !defined(CONFIG_GPIO_NRFE_EGPIO_BACKEND_MBOX) -#error "Define communication backend type" -#endif - -void process_packet(nrfe_gpio_data_packet_t *packet); -int backend_init(void); - -#endif /* MAIN_H__ */ diff --git a/applications/sdp/gpio/src/backend/backend.h b/applications/sdp/gpio/src/backend/backend.h new file mode 100644 index 000000000000..02e6bb37541e --- /dev/null +++ b/applications/sdp/gpio/src/backend/backend.h @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef _BACKEND_H__ +#define _BACKEND_H__ + +#include + +#if !defined(CONFIG_GPIO_NRFE_EGPIO_BACKEND_ICMSG) && !defined(CONFIG_GPIO_NRFE_EGPIO_BACKEND_MBOX) +#error "Define communication backend type" +#endif + +/** + * @brief Callback function called by backend when new packet arrives. + * + * @param packet New packet. + */ +typedef void (*backend_callback_t)(nrfe_gpio_data_packet_t *packet); + +/** + * @brief Initialize backend. + * + * @param callback Function to be called when new packet arrives. + */ +int backend_init(backend_callback_t callback); + + +#endif /* BACKEND_H__ */ diff --git a/applications/sdp/gpio/src/nrfe_icmsg.c b/applications/sdp/gpio/src/backend/backend_icmsg.c similarity index 83% rename from applications/sdp/gpio/src/nrfe_icmsg.c rename to applications/sdp/gpio/src/backend/backend_icmsg.c index 64d7478bd99f..b23cabbee22d 100644 --- a/applications/sdp/gpio/src/nrfe_icmsg.c +++ b/applications/sdp/gpio/src/backend/backend_icmsg.c @@ -4,12 +4,12 @@ * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause */ -#include "../include/main.h" +#include "backend.h" #include static struct ipc_ept ep; - -volatile uint32_t bound_sem = 1; +static backend_callback_t cbck; +static volatile uint32_t bound_sem = 1; static void ep_bound(void *priv) { @@ -21,7 +21,7 @@ static void ep_recv(const void *data, size_t len, void *priv) (void)len; (void)priv; - process_packet((nrfe_gpio_data_packet_t *)data); + cbck((nrfe_gpio_data_packet_t *)data); } static struct ipc_ept_cfg ep_cfg = { @@ -31,11 +31,12 @@ static struct ipc_ept_cfg ep_cfg = { }, }; -int backend_init(void) +int backend_init(backend_callback_t callback) { int ret = 0; const struct device *ipc0_instance; volatile uint32_t delay = 0; + cbck = callback; #if !defined(CONFIG_SYS_CLOCK_EXISTS) /* Wait a little bit for IPC service to be ready on APP side */ diff --git a/applications/sdp/gpio/src/nrfe_mbox.c b/applications/sdp/gpio/src/backend/backend_mbox.c similarity index 94% rename from applications/sdp/gpio/src/nrfe_mbox.c rename to applications/sdp/gpio/src/backend/backend_mbox.c index c0573b47a855..ff8ccae4e4b2 100644 --- a/applications/sdp/gpio/src/nrfe_mbox.c +++ b/applications/sdp/gpio/src/backend/backend_mbox.c @@ -4,10 +4,11 @@ * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause */ -#include "../include/main.h" +#include "backend.h" #include static const struct mbox_dt_spec rx_channel = MBOX_DT_SPEC_GET(DT_PATH(mbox_consumer), rx); +static backend_callback_t cbck; /** * @brief Callback function for when a message is received from the mailbox @@ -40,7 +41,7 @@ static void mbox_callback(const struct device *instance, uint32_t channel, void nrfe_gpio_data_packet_t *packet = (nrfe_gpio_data_packet_t *)&rx_data->data; - process_packet(packet); + cbck(packet); /* Clear shared_data.buffer_size (there is no more data available) * This is necessary so that the other core knows that the data has been read @@ -73,9 +74,10 @@ static int mbox_init(void *shared_data) return mbox_set_enabled_dt(&rx_channel, true); } -int backend_init(void) +int backend_init(backend_callback_t callback) { int ret = 0; + cbck = callback; static nrfe_gpio_mbox_data_t *rx_data = (nrfe_gpio_mbox_data_t *)((uint8_t *)(DT_REG_ADDR(DT_NODELABEL(sram_rx)))); diff --git a/applications/sdp/gpio/src/main.c b/applications/sdp/gpio/src/main.c index fc31686ae2df..8fdf18083961 100644 --- a/applications/sdp/gpio/src/main.c +++ b/applications/sdp/gpio/src/main.c @@ -4,10 +4,11 @@ * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause */ -#include "../include/main.h" - +#include "./backend/backend.h" +#include #include #include +#include #include #include #include @@ -144,7 +145,7 @@ int main(void) { int ret = 0; - ret = backend_init(); + ret = backend_init(process_packet); if (ret < 0) { return 0; } diff --git a/applications/serial_lte_modem/doc/SOCKET_AT_commands.rst b/applications/serial_lte_modem/doc/SOCKET_AT_commands.rst index 35690bfb3dd5..3b25511d0854 100644 --- a/applications/serial_lte_modem/doc/SOCKET_AT_commands.rst +++ b/applications/serial_lte_modem/doc/SOCKET_AT_commands.rst @@ -571,6 +571,10 @@ Syntax Indicates that the socket is in active use by a server application. This lets the modem stay in connected mode longer. + * ``62`` - :c:macro:`SO_IPV6_DELAYED_ADDR_REFRESH`. + + * ```` is an integer that indicates whether delayed IPv6 address refresh is enabled. + It is ``0`` for disabled or ``1`` for enabled. See :ref:`nRF socket options ` for explanation of the supported options. diff --git a/applications/serial_lte_modem/src/slm_at_socket.c b/applications/serial_lte_modem/src/slm_at_socket.c index a00c80b03131..ddc667d947cf 100644 --- a/applications/serial_lte_modem/src/slm_at_socket.c +++ b/applications/serial_lte_modem/src/slm_at_socket.c @@ -346,6 +346,9 @@ static int at_sockopt_to_sockopt(enum at_sockopt at_option, int *level, int *opt *level = IPPROTO_IPV6; *option = SO_IPV6_ECHO_REPLY; break; + case AT_SO_IPV6_DELAYED_ADDR_REFRESH: + *level = IPPROTO_IPV6; + *option = SO_IPV6_DELAYED_ADDR_REFRESH; case AT_SO_BINDTOPDN: *level = SOL_SOCKET; *option = SO_BINDTOPDN; diff --git a/applications/serial_lte_modem/src/slm_sockopt.h b/applications/serial_lte_modem/src/slm_sockopt.h index 71960baf1911..749eaf076a12 100644 --- a/applications/serial_lte_modem/src/slm_sockopt.h +++ b/applications/serial_lte_modem/src/slm_sockopt.h @@ -26,6 +26,7 @@ enum at_sockopt { AT_SO_BINDTOPDN = 40, AT_SO_TCP_SRV_SESSTIMEO = 55, AT_SO_RAI = 61, + AT_SO_IPV6_DELAYED_ADDR_REFRESH = 62, }; /** diff --git a/applications/serial_lte_modem/src/slm_trap_macros.h b/applications/serial_lte_modem/src/slm_trap_macros.h index 5844dd04f448..783d0e5a62ab 100644 --- a/applications/serial_lte_modem/src/slm_trap_macros.h +++ b/applications/serial_lte_modem/src/slm_trap_macros.h @@ -13,8 +13,8 @@ * when forwarding intercepted AT commands from within the callbacks. * Alternatives to these functions are available in slm_util.h. */ -#define nrf_modem_at_printf(...) function_disallowed_use_slm_util_alternative(void) -#define nrf_modem_at_scanf(...) function_disallowed_use_slm_util_alternative(void) -#define nrf_modem_at_cmd_async(...) function_disallowed(void) +#define nrf_modem_at_printf(...) function_disallowed_use_slm_util_printf_alternative(__VA_ARGS__) +#define nrf_modem_at_scanf(...) function_disallowed_use_slm_util_scanf_alternative(__VA_ARGS__) +#define nrf_modem_at_cmd_async(...) function_disallowed(__VA_ARGS__) #endif diff --git a/boards/shields/coverage_support/boards/nrf52840dk_nrf52840.conf b/boards/shields/coverage_support/boards/nrf52840dk_nrf52840.conf new file mode 100644 index 000000000000..1164b4fc066c --- /dev/null +++ b/boards/shields/coverage_support/boards/nrf52840dk_nrf52840.conf @@ -0,0 +1,19 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_FORCE_COVERAGE=y +CONFIG_COVERAGE_GCOV=y +CONFIG_COVERAGE_GCOV_HEAP_SIZE=0 +CONFIG_MAIN_STACK_SIZE=4096 +CONFIG_TEST_EXTRA_STACK_SIZE=2048 +CONFIG_ISR_STACK_SIZE=5120 +CONFIG_IDLE_STACK_SIZE=4096 +CONFIG_PRIVILEGED_STACK_SIZE=2048 +CONFIG_SHELL_STACK_SIZE=4096 +CONFIG_ZTEST_STACK_SIZE=4096 +CONFIG_IPM_CONSOLE_STACK_SIZE=8092 +CONFIG_IPC_SERVICE_BACKEND_ICMSG_WQ_STACK_SIZE=4096 +CONFIG_SIZE_OPTIMIZATIONS=y diff --git a/boards/shields/coverage_support/boards/nrf5340dk_nrf5340_cpuapp.conf b/boards/shields/coverage_support/boards/nrf5340dk_nrf5340_cpuapp.conf new file mode 100644 index 000000000000..1164b4fc066c --- /dev/null +++ b/boards/shields/coverage_support/boards/nrf5340dk_nrf5340_cpuapp.conf @@ -0,0 +1,19 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_FORCE_COVERAGE=y +CONFIG_COVERAGE_GCOV=y +CONFIG_COVERAGE_GCOV_HEAP_SIZE=0 +CONFIG_MAIN_STACK_SIZE=4096 +CONFIG_TEST_EXTRA_STACK_SIZE=2048 +CONFIG_ISR_STACK_SIZE=5120 +CONFIG_IDLE_STACK_SIZE=4096 +CONFIG_PRIVILEGED_STACK_SIZE=2048 +CONFIG_SHELL_STACK_SIZE=4096 +CONFIG_ZTEST_STACK_SIZE=4096 +CONFIG_IPM_CONSOLE_STACK_SIZE=8092 +CONFIG_IPC_SERVICE_BACKEND_ICMSG_WQ_STACK_SIZE=4096 +CONFIG_SIZE_OPTIMIZATIONS=y diff --git a/boards/shields/coverage_support/boards/nrf5340dk_nrf5340_cpuapp.overlay b/boards/shields/coverage_support/boards/nrf5340dk_nrf5340_cpuapp.overlay new file mode 100644 index 000000000000..330a442cdcdf --- /dev/null +++ b/boards/shields/coverage_support/boards/nrf5340dk_nrf5340_cpuapp.overlay @@ -0,0 +1,9 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +&uart0 { + hw-flow-control; +}; diff --git a/boards/shields/coverage_support/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/boards/shields/coverage_support/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index 3da5eb309810..70e96a9b0348 100644 --- a/boards/shields/coverage_support/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/boards/shields/coverage_support/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -18,3 +18,7 @@ &cpurad_slot0_partition { reg = <0x66000 DT_SIZE_K(128)>; }; + +&uart136 { + hw-flow-control; +}; diff --git a/boards/shields/coverage_support/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/boards/shields/coverage_support/boards/nrf54l15dk_nrf54l15_cpuapp.overlay index ec3bcb57a555..2e241b49ea82 100644 --- a/boards/shields/coverage_support/boards/nrf54l15dk_nrf54l15_cpuapp.overlay +++ b/boards/shields/coverage_support/boards/nrf54l15dk_nrf54l15_cpuapp.overlay @@ -11,3 +11,7 @@ &slot0_partition { reg = <0x10000 DT_SIZE_K(388)>; }; + +&uart20 { + hw-flow-control; +}; diff --git a/cmake/sysbuild/image_signing.cmake b/cmake/sysbuild/image_signing.cmake index 136f77b730bd..7710e6df9a0e 100644 --- a/cmake/sysbuild/image_signing.cmake +++ b/cmake/sysbuild/image_signing.cmake @@ -52,8 +52,10 @@ function(zephyr_mcuboot_tasks) # MCUboot. # # Therefore, go with an explicitly installed imgtool first, falling - # back on mcuboot/scripts/imgtool.py. - if(IMGTOOL) + # back on mcuboot/scripts/imgtool.py. We exclude the system imgtool when + # compressed image support is enabled due to needing a version of imgtool + # that has features not in the most recent public release. + if(IMGTOOL AND NOT CONFIG_MCUBOOT_COMPRESSED_IMAGE_SUPPORT_ENABLED) set(imgtool_path "${IMGTOOL}") elseif(DEFINED ZEPHYR_MCUBOOT_MODULE_DIR) set(IMGTOOL_PY "${ZEPHYR_MCUBOOT_MODULE_DIR}/scripts/imgtool.py") @@ -103,6 +105,19 @@ function(zephyr_mcuboot_tasks) set(imgtool_extra) endif() + if(CONFIG_MCUBOOT_COMPRESSED_IMAGE_SUPPORT_ENABLED) + set(imgtool_bin_extra --compression lzma2armthumb) + else() + set(imgtool_bin_extra) + endif() + + # Apply compression to hex file if this is a test + if(ncs_compress_test_compress_hex) + set(imgtool_hex_extra ${imgtool_bin_extra}) + else() + set(imgtool_hex_extra) + endif() + if(CONFIG_MCUBOOT_HARDWARE_DOWNGRADE_PREVENTION) set(imgtool_extra --security-counter ${CONFIG_MCUBOOT_HW_DOWNGRADE_PREVENTION_COUNTER_VALUE} ${imgtool_extra}) endif() @@ -153,7 +168,7 @@ function(zephyr_mcuboot_tasks) # calls to the "extra_post_build_commands" property ensures they run # after the commands which generate the unsigned versions. set_property(GLOBAL APPEND PROPERTY extra_post_build_commands COMMAND - ${imgtool_sign} ${imgtool_args} ${unconfirmed_args}) + ${imgtool_sign} ${imgtool_args} ${imgtool_bin_extra} ${unconfirmed_args}) if(NOT "${keyfile_enc}" STREQUAL "") if(CONFIG_BUILD_WITH_TFM) @@ -169,7 +184,7 @@ function(zephyr_mcuboot_tasks) ) set_property(GLOBAL APPEND PROPERTY extra_post_build_commands COMMAND - ${imgtool_sign} ${imgtool_args} --encrypt "${keyfile_enc}" ${unconfirmed_args}) + ${imgtool_sign} ${imgtool_args} --encrypt "${keyfile_enc}" ${imgtool_bin_extra} ${unconfirmed_args}) endif() endif() @@ -196,7 +211,7 @@ function(zephyr_mcuboot_tasks) # calls to the "extra_post_build_commands" property ensures they run # after the commands which generate the unsigned versions. set_property(GLOBAL APPEND PROPERTY extra_post_build_commands COMMAND - ${imgtool_sign} ${imgtool_args} ${imgtool_directxip_hex_command} ${unconfirmed_args}) + ${imgtool_sign} ${imgtool_args} ${imgtool_directxip_hex_command} ${imgtool_hex_extra} ${unconfirmed_args}) if(NOT "${keyfile_enc}" STREQUAL "") set(unconfirmed_args ${input}.hex ${output}.encrypted.hex) @@ -206,7 +221,7 @@ function(zephyr_mcuboot_tasks) ) set_property(GLOBAL APPEND PROPERTY extra_post_build_commands COMMAND - ${imgtool_sign} ${imgtool_args} --encrypt "${keyfile_enc}" ${unconfirmed_args}) + ${imgtool_sign} ${imgtool_args} --encrypt "${keyfile_enc}" ${imgtool_hex_extra} ${unconfirmed_args}) endif() endif() diff --git a/cmake/sysbuild/suit.cmake b/cmake/sysbuild/suit.cmake index a96d095e4f6b..9f2939f1c377 100644 --- a/cmake/sysbuild/suit.cmake +++ b/cmake/sysbuild/suit.cmake @@ -83,9 +83,14 @@ function(suit_generate_dfu_zip) GLOBAL PROPERTY SUIT_DFU_ARTIFACTS ) + get_property( + additional_script_params + GLOBAL PROPERTY + SUIT_DFU_ZIP_ADDITIONAL_SCRIPT_PARAMS + ) set(root_name "${SB_CONFIG_SUIT_ENVELOPE_ROOT_ARTIFACT_NAME}.suit") - set(script_params "${root_name}type=suit-envelope") + set(script_params "${root_name}type=suit-envelope;${additional_script_params}") include(${ZEPHYR_NRF_MODULE_DIR}/cmake/fw_zip.cmake) @@ -105,9 +110,14 @@ function(suit_generate_recovery_dfu_zip) GLOBAL PROPERTY SUIT_RECOVERY_DFU_ARTIFACTS ) + get_property( + additional_script_params + GLOBAL PROPERTY + SUIT_RECOVERY_DFU_ZIP_ADDITIONAL_SCRIPT_PARAMS + ) set(root_name "${SB_CONFIG_SUIT_ENVELOPE_APP_RECOVERY_ARTIFACT_NAME}.suit") - set(script_params "${root_name}type=suit-envelope") + set(script_params "${root_name}type=suit-envelope;${additional_script_params}") include(${ZEPHYR_NRF_MODULE_DIR}/cmake/fw_zip.cmake) @@ -316,17 +326,30 @@ function(suit_create_package) ) endforeach() - # First parse which images should be extracted to which cache partition + # First parse which images should be extracted to which cache partitions set(DFU_CACHE_PARTITIONS_USED "") + set(RECOVERY_DFU_CACHE_PARTITIONS_USED "") + foreach(image ${IMAGES}) sysbuild_get(EXTRACT_TO_CACHE IMAGE ${image} VAR CONFIG_SUIT_DFU_CACHE_EXTRACT_IMAGE KCONFIG) if(EXTRACT_TO_CACHE) sysbuild_get(CACHE_PARTITION_NUM IMAGE ${image} VAR CONFIG_SUIT_DFU_CACHE_EXTRACT_IMAGE_PARTITION KCONFIG) - list(APPEND DFU_CACHE_PARTITIONS_USED ${CACHE_PARTITION_NUM}) - list(APPEND SUIT_CACHE_PARTITION_${CACHE_PARTITION_NUM} ${image}) + + unset(CONFIG_SUIT_RECOVERY) + sysbuild_get(CONFIG_SUIT_RECOVERY IMAGE ${image} VAR CONFIG_SUIT_RECOVERY KCONFIG) + + if(CONFIG_SUIT_RECOVERY) + list(APPEND RECOVERY_DFU_CACHE_PARTITIONS_USED ${CACHE_PARTITION_NUM}) + list(APPEND SUIT_RECOVERY_CACHE_PARTITION_${CACHE_PARTITION_NUM} ${image}) + else() + list(APPEND DFU_CACHE_PARTITIONS_USED ${CACHE_PARTITION_NUM}) + list(APPEND SUIT_CACHE_PARTITION_${CACHE_PARTITION_NUM} ${image}) + endif() endif() endforeach() + list(REMOVE_DUPLICATES DFU_CACHE_PARTITIONS_USED) + list(REMOVE_DUPLICATES RECOVERY_DFU_CACHE_PARTITIONS_USED) # Then create the cache partitions foreach(CACHE_PARTITION_NUM ${DFU_CACHE_PARTITIONS_USED}) @@ -339,16 +362,45 @@ function(suit_create_package) "--input" "\"${IMAGE_CACHE_URI},${BINARY_DIR}/zephyr/${BINARY_FILE}.bin\"" ) endforeach() - list(APPEND CACHE_CREATE_ARGS "--output-file" "${SUIT_ROOT_DIRECTORY}dfu_cache_partition_${CACHE_PARTITION_NUM}.bin") if(SUIT_DFU_CACHE_PARTITION_${CACHE_PARTITION_NUM}_EB_SIZE) list(APPEND CACHE_CREATE_ARGS "--eb-size" "${SUIT_DFU_CACHE_PARTITION_${CACHE_PARTITION_NUM}_EB_SIZE}") endif() - suit_create_cache_partition("${CACHE_CREATE_ARGS}") + suit_create_cache_partition( + "${CACHE_CREATE_ARGS}" + "${SUIT_ROOT_DIRECTORY}dfu_cache_partition_${CACHE_PARTITION_NUM}.bin" + ${CACHE_PARTITION_NUM} + FALSE + ) endforeach() if(SB_CONFIG_SUIT_BUILD_RECOVERY) + + # Create cache partitions for the recovery images + foreach(CACHE_PARTITION_NUM ${RECOVERY_DFU_CACHE_PARTITIONS_USED}) + set(CACHE_CREATE_ARGS "") + foreach(image ${SUIT_RECOVERY_CACHE_PARTITION_${CACHE_PARTITION_NUM}}) + sysbuild_get(BINARY_DIR IMAGE ${image} VAR APPLICATION_BINARY_DIR CACHE) + sysbuild_get(BINARY_FILE IMAGE ${image} VAR CONFIG_KERNEL_BIN_NAME KCONFIG) + sysbuild_get(IMAGE_CACHE_URI IMAGE ${image} VAR CONFIG_SUIT_DFU_CACHE_EXTRACT_IMAGE_URI KCONFIG) + list(APPEND CACHE_CREATE_ARGS + "--input" "\"${IMAGE_CACHE_URI},${BINARY_DIR}/zephyr/${BINARY_FILE}.bin\"" + ) + endforeach() + + if(SUIT_DFU_CACHE_PARTITION_${CACHE_PARTITION_NUM}_EB_SIZE) + list(APPEND CACHE_CREATE_ARGS "--eb-size" "${SUIT_DFU_CACHE_PARTITION_${CACHE_PARTITION_NUM}_EB_SIZE}") + endif() + + suit_create_cache_partition( + "${CACHE_CREATE_ARGS}" + "${SUIT_ROOT_DIRECTORY}dfu_cache_partition_recovery_${CACHE_PARTITION_NUM}.bin" + ${CACHE_PARTITION_NUM} + TRUE + ) + endforeach() + suit_get_manifest(${SB_CONFIG_SUIT_ENVELOPE_APP_RECOVERY_TEMPLATE_FILENAME} INPUT_APP_RECOVERY_ENVELOPE_JINJA_FILE) # create app recovery envelope if defined @@ -368,6 +420,34 @@ function(suit_create_package) endif() endif() + if(SB_CONFIG_SUIT_MULTI_IMAGE_PACKAGE_BUILD) + include(${ZEPHYR_NRF_MODULE_DIR}/cmake/fw_zip.cmake) + include(${ZEPHYR_NRF_MODULE_DIR}/cmake/dfu_multi_image.cmake) + + set(suit_multi_image_ids) + set(suit_multi_image_paths) + set(suit_multi_image_targets) + + list(APPEND suit_multi_image_ids 0) + # Include the suit Envelope to the multi image package to store it in dfu_partition + list(APPEND suit_multi_image_paths "${SUIT_ROOT_DIRECTORY}root.suit") + list(APPEND suit_multi_image_targets "${SUIT_ROOT_DIRECTORY}root.suit") + # Include cache partition to the multi image package to store it in cache_partition + foreach(cache_partition_num ${DFU_CACHE_PARTITIONS_USED}) + math(EXPR dfu_image_id "${cache_partition_num} + 1") + list(APPEND suit_multi_image_ids ${dfu_image_id}) + list(APPEND suit_multi_image_paths "${SUIT_ROOT_DIRECTORY}dfu_cache_partition_${cache_partition_num}.bin") + endforeach() + + dfu_multi_image_package( + dfu_multi_image_pkg + IMAGE_IDS ${suit_multi_image_ids} + IMAGE_PATHS ${suit_multi_image_paths} + OUTPUT ${CMAKE_BINARY_DIR}/dfu_multi_image.bin + DEPENDS ${suit_multi_image_targets} + ) + endif() # SB_CONFIG_SUIT_MULTI_IMAGE_PACKAGE_BUILD + suit_get_manifest(${SB_CONFIG_SUIT_ENVELOPE_ROOT_TEMPLATE_FILENAME} INPUT_ROOT_ENVELOPE_JINJA_FILE) message(STATUS "Found root manifest template: ${INPUT_ROOT_ENVELOPE_JINJA_FILE}") diff --git a/cmake/sysbuild/suit_utilities.cmake b/cmake/sysbuild/suit_utilities.cmake index 61074a641153..9acdbc639c02 100644 --- a/cmake/sysbuild/suit_utilities.cmake +++ b/cmake/sysbuild/suit_utilities.cmake @@ -84,7 +84,10 @@ function(suit_create_envelope input_file output_file create_signature) endif() endfunction() -function(suit_create_cache_partition args) +function(suit_create_cache_partition args output_file partition_num recovery) + + list(APPEND args "--output-file" "${output_file}") + set_property( GLOBAL APPEND PROPERTY SUIT_POST_BUILD_COMMANDS COMMAND ${PYTHON_EXECUTABLE} ${SUIT_GENERATOR_CLI_SCRIPT} @@ -92,4 +95,16 @@ function(suit_create_cache_partition args) ${args} BYPRODUCTS ${output_file} ) + + get_filename_component(output_file_name ${output_file} NAME) + + if (recovery) + set_property(GLOBAL APPEND PROPERTY SUIT_RECOVERY_DFU_ARTIFACTS ${output_file}) + set_property(GLOBAL APPEND PROPERTY SUIT_RECOVERY_DFU_ZIP_ADDITIONAL_SCRIPT_PARAMS + "${output_file_name}type=cache;${output_file_name}partition=${partition_num};") + else() + set_property(GLOBAL APPEND PROPERTY SUIT_DFU_ARTIFACTS ${output_file}) + set_property(GLOBAL APPEND PROPERTY SUIT_DFU_ZIP_ADDITIONAL_SCRIPT_PARAMS + "${output_file_name}type=cache;${output_file_name}partition=${partition_num};") + endif() endfunction() diff --git a/cmake/sysbuild/zip.cmake b/cmake/sysbuild/zip.cmake index 7c7ca4841470..aadc580eb2e6 100644 --- a/cmake/sysbuild/zip.cmake +++ b/cmake/sysbuild/zip.cmake @@ -97,8 +97,13 @@ function(dfu_app_zip_package) ) endif() else() - set(app_update_name "${DEFAULT_IMAGE}.bin") - set(secondary_app_update_name mcuboot_secondary_app.bin) + if(SB_CONFIG_BOOT_ENCRYPTION) + set(app_update_name "${DEFAULT_IMAGE}.signed.encrypted.bin") + else() + set(app_update_name "${DEFAULT_IMAGE}.signed.bin") + set(secondary_app_update_name mcuboot_secondary_app.signed.bin) + endif() + mcuboot_image_number_to_slot(slot_primary ${SB_CONFIG_MCUBOOT_APPLICATION_IMAGE_NUMBER} n) mcuboot_image_number_to_slot(slot_secondary ${SB_CONFIG_MCUBOOT_APPLICATION_IMAGE_NUMBER} y) @@ -111,10 +116,15 @@ function(dfu_app_zip_package) "${app_update_name}slot_index_secondary=${slot_secondary}" "${app_update_name}version_MCUBOOT=${CONFIG_MCUBOOT_IMGTOOL_SIGN_VERSION}" ) - list(APPEND bin_files "${CMAKE_BINARY_DIR}/${DEFAULT_IMAGE}/zephyr/${CONFIG_KERNEL_BIN_NAME}.signed.bin") + if(SB_CONFIG_BOOT_ENCRYPTION) + list(APPEND bin_files "${CMAKE_BINARY_DIR}/${DEFAULT_IMAGE}/zephyr/${CONFIG_KERNEL_BIN_NAME}.signed.encrypted.bin") + set(exclude_files EXCLUDE ${CMAKE_BINARY_DIR}/${DEFAULT_IMAGE}/zephyr/${CONFIG_KERNEL_BIN_NAME}.signed.encrypted.bin) + else() + list(APPEND bin_files "${CMAKE_BINARY_DIR}/${DEFAULT_IMAGE}/zephyr/${CONFIG_KERNEL_BIN_NAME}.signed.bin") + set(exclude_files EXCLUDE ${CMAKE_BINARY_DIR}/${DEFAULT_IMAGE}/zephyr/${CONFIG_KERNEL_BIN_NAME}.signed.bin) + endif() list(APPEND zip_names ${app_update_name}) list(APPEND signed_targets ${DEFAULT_IMAGE}_extra_byproducts) - set(exclude_files EXCLUDE ${CMAKE_BINARY_DIR}/${DEFAULT_IMAGE}/zephyr/${CONFIG_KERNEL_BIN_NAME}.signed.bin) set(include_files INCLUDE ${CMAKE_BINARY_DIR}/${DEFAULT_IMAGE}/zephyr/${CONFIG_KERNEL_BIN_NAME}.bin) else() # Application in DirectXIP mode @@ -133,12 +143,12 @@ function(dfu_app_zip_package) "${CMAKE_BINARY_DIR}/${DEFAULT_IMAGE}/zephyr/${CONFIG_KERNEL_BIN_NAME}.signed.bin" "${CMAKE_BINARY_DIR}/mcuboot_secondary_app/zephyr/${CONFIG_KERNEL_BIN_NAME}.signed.bin" ) - list(APPEND zip_names "${app_update_name};${secondary_app_update_name}") - list(APPEND signed_targets ${DEFAULT_IMAGE}_extra_byproducts mcuboot_secondary_app_extra_byproducts) set(exclude_files EXCLUDE ${CMAKE_BINARY_DIR}/${DEFAULT_IMAGE}/zephyr/${CONFIG_KERNEL_BIN_NAME}.signed.bin ${CMAKE_BINARY_DIR}/mcuboot_secondary_app/zephyr/${CONFIG_KERNEL_BIN_NAME}.signed.bin ) + list(APPEND zip_names "${app_update_name};${secondary_app_update_name}") + list(APPEND signed_targets ${DEFAULT_IMAGE}_extra_byproducts mcuboot_secondary_app_extra_byproducts) set(include_files INCLUDE ${CMAKE_BINARY_DIR}/${DEFAULT_IMAGE}/zephyr/${CONFIG_KERNEL_BIN_NAME}.bin ${CMAKE_BINARY_DIR}/mcuboot_secondary_app/zephyr/${CONFIG_KERNEL_BIN_NAME}.bin diff --git a/config/suit/templates/nrf54h20/default/v1/app_envelope.yaml.jinja2 b/config/suit/templates/nrf54h20/default/v1/app_envelope.yaml.jinja2 index a543fd490b49..d47f93979790 100644 --- a/config/suit/templates/nrf54h20/default/v1/app_envelope.yaml.jinja2 +++ b/config/suit/templates/nrf54h20/default/v1/app_envelope.yaml.jinja2 @@ -74,7 +74,12 @@ SUIT_Envelope_Tagged: suit-current-version: {{ DEFAULT_VERSION }} {%- endif %} +{%- if application['dt'].label2node['suit_storage_partition'].regs[0].size == 24576 %} + # Application DTS contains larger SUIT storage - use legacy encoding + suit-install-legacy: +{%- else %} suit-install: +{%- endif %} - suit-directive-set-component-index: 1 - suit-directive-override-parameters: {%- if 'CONFIG_SUIT_DFU_CACHE_EXTRACT_IMAGE_URI' in application['config'] and application['config']['CONFIG_SUIT_DFU_CACHE_EXTRACT_IMAGE_URI'] != '' %} diff --git a/config/suit/templates/nrf54h20/default/v1/app_recovery_envelope.yaml.jinja2 b/config/suit/templates/nrf54h20/default/v1/app_recovery_envelope.yaml.jinja2 index e709761515a3..ab6e6b592555 100644 --- a/config/suit/templates/nrf54h20/default/v1/app_recovery_envelope.yaml.jinja2 +++ b/config/suit/templates/nrf54h20/default/v1/app_recovery_envelope.yaml.jinja2 @@ -139,7 +139,12 @@ SUIT_Envelope_Tagged: suit-current-version: {{ DEFAULT_VERSION }} {%- endif %} +{%- if application['dt'].label2node['suit_storage_partition'].regs[0].size == 24576 %} + # Application DTS contains larger SUIT storage - use legacy encoding + suit-install-legacy: +{%- else %} suit-install: +{%- endif %} {%- if rad_recovery is defined %} - suit-directive-set-component-index: 1 - suit-directive-override-parameters: diff --git a/config/suit/templates/nrf54h20/default/v1/rad_envelope.yaml.jinja2 b/config/suit/templates/nrf54h20/default/v1/rad_envelope.yaml.jinja2 index 63f88053a61c..0ffbeb1b7ae7 100644 --- a/config/suit/templates/nrf54h20/default/v1/rad_envelope.yaml.jinja2 +++ b/config/suit/templates/nrf54h20/default/v1/rad_envelope.yaml.jinja2 @@ -79,7 +79,12 @@ SUIT_Envelope_Tagged: suit-current-version: {{ DEFAULT_VERSION }} {%- endif %} +{%- if radio['dt'].label2node['suit_storage_partition'].regs[0].size == 24576 %} + # Radio DTS contains larger SUIT storage - use legacy encoding + suit-install-legacy: +{%- else %} suit-install: +{%- endif %} - suit-directive-set-component-index: 1 - suit-directive-override-parameters: {%- if 'CONFIG_SUIT_DFU_CACHE_EXTRACT_IMAGE_URI' in radio['config'] and radio['config']['CONFIG_SUIT_DFU_CACHE_EXTRACT_IMAGE_URI'] != '' %} diff --git a/config/suit/templates/nrf54h20/default/v1/rad_recovery_envelope.yaml.jinja2 b/config/suit/templates/nrf54h20/default/v1/rad_recovery_envelope.yaml.jinja2 index cef1c230f52b..7f9beec0eb61 100644 --- a/config/suit/templates/nrf54h20/default/v1/rad_recovery_envelope.yaml.jinja2 +++ b/config/suit/templates/nrf54h20/default/v1/rad_recovery_envelope.yaml.jinja2 @@ -69,7 +69,13 @@ SUIT_Envelope_Tagged: {%- elif DEFAULT_VERSION is defined %} suit-current-version: {{ DEFAULT_VERSION }} {%- endif %} + +{%- if radio['dt'].label2node['suit_storage_partition'].regs[0].size == 24576 %} + # Radio DTS contains larger SUIT storage - use legacy encoding + suit-install-legacy: +{%- else %} suit-install: +{%- endif %} - suit-directive-set-component-index: 1 - suit-directive-override-parameters: suit-parameter-uri: '#{{ rad_recovery['name'] }}' @@ -101,7 +107,7 @@ SUIT_Envelope_Tagged: - RFC4122_UUID: namespace: {{ mpi_rad_recovery_vendor_name }} name: {{ mpi_rad_recovery_class_name }} - suit-integrated-payloads: {%- if 'CONFIG_SUIT_DFU_CACHE_EXTRACT_IMAGE' not in rad_recovery['config'] or rad_recovery['config']['CONFIG_SUIT_DFU_CACHE_EXTRACT_IMAGE'] == '' %} + suit-integrated-payloads: '#{{ rad_recovery['name'] }}': {{ rad_recovery['binary'] }} {%- endif %} diff --git a/config/suit/templates/nrf54h20/default/v1/root_with_binary_nordic_top.yaml.jinja2 b/config/suit/templates/nrf54h20/default/v1/root_with_binary_nordic_top.yaml.jinja2 index 7677b82e229e..abe79fb80a68 100644 --- a/config/suit/templates/nrf54h20/default/v1/root_with_binary_nordic_top.yaml.jinja2 +++ b/config/suit/templates/nrf54h20/default/v1/root_with_binary_nordic_top.yaml.jinja2 @@ -120,7 +120,12 @@ SUIT_Envelope_Tagged: suit-current-version: {{ DEFAULT_VERSION }} {%- endif %} +{%- if main_config['dt'].label2node['suit_storage_partition'].regs[0].size == 24576 %} + # Main DTS contains larger SUIT storage - use legacy encoding + suit-install-legacy: +{%- else %} suit-install: +{%- endif %} - suit-directive-set-component-index: 0 {%- if radio is defined %} - suit-directive-override-parameters: diff --git a/config/suit/templates/nrf54h20/matter/v1/app_envelope.yaml.jinja2 b/config/suit/templates/nrf54h20/matter/v1/app_envelope.yaml.jinja2 index dbbfc6d07565..1b259d398326 100644 --- a/config/suit/templates/nrf54h20/matter/v1/app_envelope.yaml.jinja2 +++ b/config/suit/templates/nrf54h20/matter/v1/app_envelope.yaml.jinja2 @@ -21,7 +21,7 @@ SUIT_Envelope_Tagged: - {{ application['dt'].chosen_nodes['zephyr,code-partition'].regs[0].size }} - - CAND_IMG - 0 -{%- if 'CONFIG_SUIT_DFU_CACHE_EXTRACT_IMAGE' not in application['config'] or application['config']['CONFIG_SUIT_DFU_CACHE_EXTRACT_IMAGE'] == '' %} +{%- if 'CONFIG_SUIT_DFU_CACHE_EXTRACT_IMAGE' in application['config'] and application['config']['CONFIG_SUIT_DFU_CACHE_EXTRACT_IMAGE'] != '' %} - - CACHE_POOL - 1 {%- endif %} @@ -88,32 +88,6 @@ SUIT_Envelope_Tagged: suit-current-version: {{ DEFAULT_VERSION }} {%- endif %} - suit-candidate-verification: - - suit-directive-set-component-index: 1 - - suit-directive-override-parameters: -{%- if 'CONFIG_SUIT_DFU_CACHE_EXTRACT_IMAGE_URI' in application['config'] and application['config']['CONFIG_SUIT_DFU_CACHE_EXTRACT_IMAGE_URI'] != '' %} - suit-parameter-uri: '{{ application['config']['CONFIG_SUIT_DFU_CACHE_EXTRACT_IMAGE_URI'] }}' -{%- else %} - suit-parameter-uri: 'file://{{ application['filename'] }}' -{%- endif %} - suit-parameter-image-digest: - suit-digest-algorithm-id: cose-alg-sha-256 - suit-digest-bytes: - file: {{ application['binary'] }} - - suit-directive-fetch: - - suit-send-record-failure - - suit-directive-try-each: - - - suit-condition-image-match: - - suit-send-record-success - - suit-send-record-failure - - suit-send-sysinfo-success - - suit-send-sysinfo-failure - - - suit-condition-image-match: - - suit-send-record-success - - suit-send-record-failure - - suit-send-sysinfo-success - - suit-send-sysinfo-failure - {%- if 'CONFIG_SUIT_DFU_CACHE_EXTRACT_IMAGE' not in application['config'] or application['config']['CONFIG_SUIT_DFU_CACHE_EXTRACT_IMAGE'] == '' %} suit-payload-fetch: - suit-directive-set-component-index: 2 @@ -122,7 +96,13 @@ SUIT_Envelope_Tagged: - suit-directive-fetch: - suit-send-record-failure {%- endif %} + +{%- if application['dt'].label2node['suit_storage_partition'].regs[0].size == 24576 %} + # Application DTS contains larger SUIT storage - use legacy encoding + suit-install-legacy: +{%- else %} suit-install: +{%- endif %} {%- if flash_companion is defined %} - suit-directive-set-component-index: 1 - suit-directive-override-parameters: @@ -182,6 +162,32 @@ SUIT_Envelope_Tagged: suit-text: suit-digest-algorithm-id: cose-alg-sha-256 + suit-candidate-verification: + - suit-directive-set-component-index: 1 + - suit-directive-override-parameters: +{%- if 'CONFIG_SUIT_DFU_CACHE_EXTRACT_IMAGE_URI' in application['config'] and application['config']['CONFIG_SUIT_DFU_CACHE_EXTRACT_IMAGE_URI'] != '' %} + suit-parameter-uri: '{{ application['config']['CONFIG_SUIT_DFU_CACHE_EXTRACT_IMAGE_URI'] }}' +{%- else %} + suit-parameter-uri: 'file://{{ application['filename'] }}' +{%- endif %} + suit-parameter-image-digest: + suit-digest-algorithm-id: cose-alg-sha-256 + suit-digest-bytes: + file: {{ application['binary'] }} + - suit-directive-fetch: + - suit-send-record-failure + - suit-directive-try-each: + - - suit-condition-image-match: + - suit-send-record-success + - suit-send-record-failure + - suit-send-sysinfo-success + - suit-send-sysinfo-failure + - - suit-condition-image-match: + - suit-send-record-success + - suit-send-record-failure + - suit-send-sysinfo-success + - suit-send-sysinfo-failure + suit-manifest-component-id: - INSTLD_MFST - RFC4122_UUID: diff --git a/config/suit/templates/nrf54h20/matter/v1/rad_envelope.yaml.jinja2 b/config/suit/templates/nrf54h20/matter/v1/rad_envelope.yaml.jinja2 index 0064aa3f9935..dc0c81a7a3f8 100644 --- a/config/suit/templates/nrf54h20/matter/v1/rad_envelope.yaml.jinja2 +++ b/config/suit/templates/nrf54h20/matter/v1/rad_envelope.yaml.jinja2 @@ -26,7 +26,7 @@ SUIT_Envelope_Tagged: - {{ radio['dt'].chosen_nodes['zephyr,code-partition'].regs[0].size }} - - CAND_IMG - 0 -{%- if 'CONFIG_SUIT_DFU_CACHE_EXTRACT_IMAGE' not in application['config'] or application['config']['CONFIG_SUIT_DFU_CACHE_EXTRACT_IMAGE'] == '' %} +{%- if 'CONFIG_SUIT_DFU_CACHE_EXTRACT_IMAGE' in radio['config'] and radio['config']['CONFIG_SUIT_DFU_CACHE_EXTRACT_IMAGE'] != '' %} - - CACHE_POOL - 1 {%- endif %} @@ -79,32 +79,6 @@ SUIT_Envelope_Tagged: suit-current-version: {{ DEFAULT_VERSION }} {%- endif %} - suit-candidate-verification: - - suit-directive-set-component-index: 1 - - suit-directive-override-parameters: -{%- if 'CONFIG_SUIT_DFU_CACHE_EXTRACT_IMAGE_URI' in radio['config'] and radio['config']['CONFIG_SUIT_DFU_CACHE_EXTRACT_IMAGE_URI'] != '' %} - suit-parameter-uri: '{{ radio['config']['CONFIG_SUIT_DFU_CACHE_EXTRACT_IMAGE_URI'] }}' -{%- else %} - suit-parameter-uri: '#{{ radio['name'] }}' -{%- endif %} - suit-parameter-image-digest: - suit-digest-algorithm-id: cose-alg-sha-256 - suit-digest-bytes: - file: {{ radio['binary'] }} - - suit-directive-fetch: - - suit-send-record-failure - - suit-directive-try-each: - - - suit-condition-image-match: - - suit-send-record-success - - suit-send-record-failure - - suit-send-sysinfo-success - - suit-send-sysinfo-failure - - - suit-condition-image-match: - - suit-send-record-success - - suit-send-record-failure - - suit-send-sysinfo-success - - suit-send-sysinfo-failure - {%- if 'CONFIG_SUIT_DFU_CACHE_EXTRACT_IMAGE' not in radio['config'] or radio['config']['CONFIG_SUIT_DFU_CACHE_EXTRACT_IMAGE'] == '' %} suit-payload-fetch: - suit-directive-set-component-index: 2 @@ -113,7 +87,13 @@ SUIT_Envelope_Tagged: - suit-directive-fetch: - suit-send-record-failure {%- endif %} + +{%- if radio['dt'].label2node['suit_storage_partition'].regs[0].size == 24576 %} + # Radio DTS contains larger SUIT storage - use legacy encoding + suit-install-legacy: +{%- else %} suit-install: +{%- endif %} - suit-directive-set-component-index: 1 - suit-directive-override-parameters: {%- if 'CONFIG_SUIT_DFU_CACHE_EXTRACT_IMAGE_URI' in radio['config'] and radio['config']['CONFIG_SUIT_DFU_CACHE_EXTRACT_IMAGE_URI'] != '' %} @@ -140,6 +120,33 @@ SUIT_Envelope_Tagged: - suit-send-sysinfo-failure suit-text: suit-digest-algorithm-id: cose-alg-sha-256 + + suit-candidate-verification: + - suit-directive-set-component-index: 1 + - suit-directive-override-parameters: +{%- if 'CONFIG_SUIT_DFU_CACHE_EXTRACT_IMAGE_URI' in radio['config'] and radio['config']['CONFIG_SUIT_DFU_CACHE_EXTRACT_IMAGE_URI'] != '' %} + suit-parameter-uri: '{{ radio['config']['CONFIG_SUIT_DFU_CACHE_EXTRACT_IMAGE_URI'] }}' +{%- else %} + suit-parameter-uri: '#{{ radio['name'] }}' +{%- endif %} + suit-parameter-image-digest: + suit-digest-algorithm-id: cose-alg-sha-256 + suit-digest-bytes: + file: {{ radio['binary'] }} + - suit-directive-fetch: + - suit-send-record-failure + - suit-directive-try-each: + - - suit-condition-image-match: + - suit-send-record-success + - suit-send-record-failure + - suit-send-sysinfo-success + - suit-send-sysinfo-failure + - - suit-condition-image-match: + - suit-send-record-success + - suit-send-record-failure + - suit-send-sysinfo-success + - suit-send-sysinfo-failure + suit-manifest-component-id: - INSTLD_MFST - RFC4122_UUID: diff --git a/config/suit/templates/nrf54h20/matter/v1/root_with_binary_nordic_top.yaml.jinja2 b/config/suit/templates/nrf54h20/matter/v1/root_with_binary_nordic_top.yaml.jinja2 index 1cc7ca5127d5..ada7e8b29b56 100644 --- a/config/suit/templates/nrf54h20/matter/v1/root_with_binary_nordic_top.yaml.jinja2 +++ b/config/suit/templates/nrf54h20/matter/v1/root_with_binary_nordic_top.yaml.jinja2 @@ -156,7 +156,12 @@ SUIT_Envelope_Tagged: - suit-send-sysinfo-failure {%- endif %} +{%- if main_config['dt'].label2node['suit_storage_partition'].regs[0].size == 24576 %} + # Main DTS contains larger SUIT storage - use legacy encoding + suit-install-legacy: +{%- else %} suit-install: +{%- endif %} - suit-directive-set-component-index: 0 {%- if application is defined %} - suit-directive-override-parameters: diff --git a/doc/_scripts/software_maturity/software_maturity_features.yaml b/doc/_scripts/software_maturity/software_maturity_features.yaml index 0a5737cea4eb..ddfe5f7a8751 100644 --- a/doc/_scripts/software_maturity/software_maturity_features.yaml +++ b/doc/_scripts/software_maturity/software_maturity_features.yaml @@ -77,7 +77,7 @@ features: NET_L2_OPENTHREAD && OPENTHREAD_MTD_SED wifi: STA Mode: - rule: WPA_SUPP && WIFI_NRF70 + rule: WIFI_NM_WPA_SUPPLICANT && WIFI_NRF70 boards_and_shields: - SHIELD_NRF7002EK - SHIELD_NRF7002EK_NRF7000 @@ -88,7 +88,7 @@ features: - BOARD_NRF7002DK_NRF5340_CPUAPP - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 Scan only (for location accuracy): - rule: WIFI_NRF70 && !WPA_SUPP + rule: WIFI_NRF70 && !WIFI_NM_WPA_SUPPLICANT boards_and_shields: - SHIELD_NRF7002EK - SHIELD_NRF7002EK_NRF7000 diff --git a/doc/_scripts/software_maturity/software_maturity_scanner.py b/doc/_scripts/software_maturity/software_maturity_scanner.py index 7f08df51d2ba..b11ae15eaf5f 100644 --- a/doc/_scripts/software_maturity/software_maturity_scanner.py +++ b/doc/_scripts/software_maturity/software_maturity_scanner.py @@ -59,7 +59,7 @@ Matter over Thread: CHIP && NET_L2_OPENTHREAD wifi: STA Mode: - rule: WPA_SUPP && WIFI_NRF70 + rule: WIFI_NM_WPA_SUPPLICANT && WIFI_NRF70 boards_and_shields: - SHIELD_NRF7002EK - BOARD_NRF7002DK_NRF5340_CPUAPP diff --git a/doc/_utils/redirects.py b/doc/_utils/redirects.py index a599b72f1c41..dec13c2fa87a 100644 --- a/doc/_utils/redirects.py +++ b/doc/_utils/redirects.py @@ -32,13 +32,15 @@ ("ug_nrf7002_gs", "gsg_guides/nrf7002_gs"), # Getting started with nRF7002 DK ("working_with_nrf/nrf70/gs", "gsg_guides/nrf7002_gs"), ("device_guides/working_with_nrf/nrf70/gs", "gsg_guides/nrf7002_gs"), - ("device_guides/working_with_nrf/nrf53/nrf5340_gs", "gsg_guides/nrf5340_gs"), # Getting started with nRF5340 DK + ("device_guides/working_with_nrf/nrf53/nrf5340_gs", "gsg_guides"), # Getting started with nRF5340 DK (removed in v2.8.0) + ("gsg_guides/nrf5340_gs", "gsg_guides"), ("ug_thingy53_gs", "gsg_guides/thingy53_gs"), # Getting started with Thingy:53 ("working_with_nrf/nrf53/thingy53_gs", "gsg_guides/thingy53_gs"), ("device_guides/working_with_nrf/nrf53/thingy53_gs", "gsg_guides/thingy53_gs"), - ("ug_nrf52_gs", "gsg_guides/nrf52_gs"), # Getting started with nRF52 Series - ("working_with_nrf/nrf52/gs", "gsg_guides/nrf52_gs"), - ("device_guides/working_with_nrf/nrf52/gs", "gsg_guides/nrf52_gs"), + ("ug_nrf52_gs", "gsg_guides"), # Getting started with nRF52 Series (removed in v2.8.0) + ("working_with_nrf/nrf52/gs", "gsg_guides"), + ("device_guides/working_with_nrf/nrf52/gs", "gsg_guides"), + ("gsg_guides/nrf52_gs", "gsg_guides"), ("gs_assistant", "installation/install_ncs"), # Installing the nRF Connect SDK ("getting_started", "installation"), ("getting_started/assistant", "installation/install_ncs"), @@ -201,8 +203,6 @@ ("app_dev/device_guides/working_with_nrf/nrf54l/nrf54l15_gs", "gsg_guides"), ("device_guides/working_with_nrf/nrf54l/testing_dfu", "app_dev/device_guides/nrf54l/testing_dfu"), # Testing the DFU solution ("app_dev/device_guides/working_with_nrf/nrf54l/testing_dfu", "app_dev/device_guides/nrf54l/testing_dfu"), - ("device_guides/working_with_nrf/nrf54l/peripheral_sensor_node_shield", "app_dev/device_guides/nrf54l/peripheral_sensor_node_shield"), # Developing with Peripheral Sensor node shield - ("app_dev/device_guides/working_with_nrf/nrf54l/peripheral_sensor_node_shield", "app_dev/device_guides/nrf54l/peripheral_sensor_node_shield"), ("device_guides/nrf54h", "app_dev/device_guides/nrf54h"), # Developing with nRF54H Series ("device_guides/working_with_nrf/nrf54h/ug_nrf54h20_gs", "app_dev/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_gs"), # Getting started with the nRF54H20 DK ("device_guides/working_with_nrf/nrf54h/ug_nrf54h20_app_samples", "app_dev/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_app_samples"), # nRF54H20 applications and samples (orphaned as of 2.7.0) diff --git a/doc/_zoomin/ncs.tags.yml b/doc/_zoomin/ncs.tags.yml index 785c4b8246c9..fb420c1337f8 100644 --- a/doc/_zoomin/ncs.tags.yml +++ b/doc/_zoomin/ncs.tags.yml @@ -24,12 +24,13 @@ mapping_topics: - nrf/gsg_guides/thingy91_gsg.html: ["nrf91-series", "thingy91", "nrf9160", "nrf52840", "lte", "prototyping-platforms"] - nrf/gsg_guides/nrf7002_gs.html: ["nrf70-series", "nrf7002", "development-kits"] - - nrf/gsg_guides/nrf5340_gs.html: ["nrf53-series", "nrf5340", "development-kits"] - nrf/gsg_guides/thingy53_gs.html: ["nrf53-series", "thingy53", "prototyping-platforms"] - - nrf/gsg_guides/nrf52_gs.html: ["nrf52-series", "development-kits", "nrf52840", "nrf52833", - "nrf52832", "nrf52820", "nrf52811", "nrf52810", "nrf52805"] - - nrf/gsg_guides/gsg_other.html: ["nrf9161", "nrf9151", "development-kits", "npm1300", "nrf54h20", - "nrf54l15", "nrf7002", "evaluation-kits", "pmic"] + - nrf/gsg_guides/gsg_other.html: ["nrf52-series", "nrf52840", "nrf52833", + "nrf52832", "nrf52820", "nrf52811", "nrf52810", "nrf52805", + "nrf53-series", "nrf5340", "thingy53", "nrf9161", + "nrf9160", "nrf9151", "thingy91", "development-kits", + "npm1300", "nrf54h20", "nrf54l15", "nrf7002", "evaluation-kits", + "pmic"] - nrf/installation.html: ["nrf91-series", "nrf70-series", "nrf54-series", "nrf53-series", "nrf52-series", "nrf7002", "nrf7001", "nrf7000", "nrf9160", "thingy91", "nrf9161", "nrf9151", "nrf9131", "nrf54h20", "nrf54l15", "nrf5340", diff --git a/doc/nrf/app_dev/board_support/board_names.rst b/doc/nrf/app_dev/board_support/board_names.rst index f376a84fd3d7..dc08a441a7e8 100644 --- a/doc/nrf/app_dev/board_support/board_names.rst +++ b/doc/nrf/app_dev/board_support/board_names.rst @@ -90,8 +90,10 @@ Also see the :ref:`zephyr:boards` section in the Zephyr documentation. | nRF54L15 PDK | PCA10156 | :ref:`nrf54l15pdk ` | ``nrf54l15pdk/nrf54l15/cpuapp`` | | | | | | | | | | ``nrf54l15pdk@0.2.1/nrf54l15/cpuapp`` | ++-------------------+------------+-------------------------------------------------------------------+---------------------------------------+ +| nRF54L15 DK | PCA10156 | :ref:`nrf54l15dk ` | ``nrf54l15dk/nrf54l15/cpuapp`` | | | | | | -| | | | ``nrf54l15pdk/nrf54l15/cpuapp/ns`` | +| | | | ``nrf54l15dk/nrf54l15/cpuapp/ns`` | +-------------------+------------+-------------------------------------------------------------------+---------------------------------------+ | nRF5340 DK | PCA10095 | :ref:`nrf5340dk ` | ``nrf5340dk/nrf5340/cpunet`` | | | | | | diff --git a/doc/nrf/app_dev/bootloaders_dfu/index.rst b/doc/nrf/app_dev/bootloaders_dfu/index.rst index 42478eb1d21c..2b9b73b4f266 100644 --- a/doc/nrf/app_dev/bootloaders_dfu/index.rst +++ b/doc/nrf/app_dev/bootloaders_dfu/index.rst @@ -52,3 +52,4 @@ To learn more, refer to the following documentation pages: mcuboot_nsib/bootloader_mcuboot_nsib qspi_xip_split_image dfu_tools_mcumgr_cli + mcuboot_image_compression diff --git a/doc/nrf/app_dev/bootloaders_dfu/mcuboot_image_compression.rst b/doc/nrf/app_dev/bootloaders_dfu/mcuboot_image_compression.rst new file mode 100644 index 000000000000..4a87348d34a2 --- /dev/null +++ b/doc/nrf/app_dev/bootloaders_dfu/mcuboot_image_compression.rst @@ -0,0 +1,87 @@ +.. _mcuboot_image_compression: + +MCUboot image compression +######################### + +.. contents:: + :local: + :depth: 2 + +:ref:`MCUboot ` in the |NCS| optionally supports compressed image updates. + +The system includes the following features and limitation: + +* Allows slot ``1`` to be approximately 70% the size of slot ``0``. +* Supports a single-image only. + It does not support network core updates for the nRF5340 SoC or :ref:`bootloader` updates. +* Does not support reverting to previous versions. + MCUboot must be configured for upgrade-only mode. +* Validates the compressed image during the update process before the main image is erased, ensuring the update does not lead to a bricked module due to un-loadable firmware. +* Does not support image encryption. +* Uses LZMA2 compression with ARM thumb filter for compressed images. +* Requires a static :ref:`Partition Manager ` file. +* Must use :ref:`configuration_system_overview_sysbuild`. + +Sample +****** + +For a demonstration of this feature, see the :ref:`nrf_compression_mcuboot_compressed_update` sample. +This sample already implements the configuration requirements mentioned in :ref:`mcuboot_image_compression_setup` below. + +.. _mcuboot_image_compression_setup: + +Required setup +************** + +You must meet the following configuration requirements for this feature to work. + +Static Partition Manager file for MCUboot +========================================= + +The static Partition Manager file should include the following partitions: + + * ``boot_partition`` - Requires a minimum size of 48 KiB for a minimal build without logging. + * ``slot1_partition`` - Should be approximately 70% of the size of the slot ``0`` partition for optimal configuration, assuming that image savings will be 30%. + The total compression depends on the data within the image. + +For more information about the static Partition Manager file, see :ref:`ug_pm_static` in the Partition Manager documentation. + +Example of static Partition Manager layout +------------------------------------------ + +The following shows an example static Partition Manager layout for image compression: + +.. tabs:: + + .. group-tab:: nRF52840 + + .. literalinclude:: ../../../../tests/subsys/nrf_compress/decompression/mcuboot_update/pm_static_nrf52840dk_nrf52840.yml + :language: yaml + + .. group-tab:: nRF5340 + + .. literalinclude:: ../../../../tests/subsys/nrf_compress/decompression/mcuboot_update/pm_static_nrf5340dk_nrf5340_cpuapp.yml + :language: yaml + + .. group-tab:: nRF54L15 + + .. literalinclude:: ../../../../tests/subsys/nrf_compress/decompression/mcuboot_update/pm_static_nrf54l15dk_nrf54l15_cpuapp.yml + :language: yaml + +Required sysbuild configuration options +======================================= + +The following :ref:`configuration_system_overview_sysbuild` Kconfig options are required to enable support for compressed images: + +* :kconfig:option:`SB_CONFIG_BOOTLOADER_MCUBOOT` +* :kconfig:option:`SB_CONFIG_MCUBOOT_MODE_OVERWRITE_ONLY` +* :kconfig:option:`SB_CONFIG_MCUBOOT_COMPRESSED_IMAGE_SUPPORT` + +See :ref:`configuring_kconfig` for different methods of configuring these options. +You want to have the following configuration in your application: + +.. code-block:: cfg + + SB_CONFIG_BOOTLOADER_MCUBOOT=y + SB_CONFIG_MCUBOOT_MODE_OVERWRITE_ONLY=y + SB_CONFIG_MCUBOOT_COMPRESSED_IMAGE_SUPPORT=y diff --git a/doc/nrf/app_dev/bootloaders_dfu/mcuboot_nsib/bootloader_quick_start.rst b/doc/nrf/app_dev/bootloaders_dfu/mcuboot_nsib/bootloader_quick_start.rst index 43750b832b4f..79f8d153c4c8 100644 --- a/doc/nrf/app_dev/bootloaders_dfu/mcuboot_nsib/bootloader_quick_start.rst +++ b/doc/nrf/app_dev/bootloaders_dfu/mcuboot_nsib/bootloader_quick_start.rst @@ -148,8 +148,8 @@ The following table is an overview of the currently supported bootloaders: - Yes - Yes - :ref:`Monotonic (HW) `, :ref:`Semantic (SW) ` - - Image swap - single primary - Dual-slot direct-xip + - | Image swap - single primary + | Dual-slot direct-xip .. rst-class:: numbered-step diff --git a/doc/nrf/app_dev/config_and_build/output_build_files.rst b/doc/nrf/app_dev/config_and_build/output_build_files.rst index c13c3162de39..bdf014ebe2df 100644 --- a/doc/nrf/app_dev/config_and_build/output_build_files.rst +++ b/doc/nrf/app_dev/config_and_build/output_build_files.rst @@ -64,6 +64,22 @@ Which files you are going to use depends on the application configuration and no | | ``zephyr`` is the value of :kconfig:option:`CONFIG_KERNEL_BIN_NAME`. | | | | The file is located in the :file:`build//zephyr` directory. | | +--------------------------------------+--------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ +| :file:`zephyr.signed.encrypted.bin` | Image update file used to create :file:`dfu_application.zip` for encrypted multi-core DFU updates. | DFU process for single or multi-core board targets | +| | Can also be used standalone for a single-image DFU. | | +| | Contains the signed and encrypted version of the application. | | +| | This file is transferred in the real-life update procedure, as opposed to HEX files | | +| | that are transferred with nrfjprog when emulating an update procedure. | | +| | :ref:`Compatible with MCUboot `. | | +| | ``zephyr`` is the value of :kconfig:option:`CONFIG_KERNEL_BIN_NAME`. | | +| | The file is located in the :file:`build//zephyr` directory. | | ++--------------------------------------+--------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ +| :file:`zephyr.signed.encrypted.hex` | HEX file variant of the :file:`.signed.encrypted.bin` file. | Programming single or multi-core board targets | +| | Can also be used standalone for a single-image DFU. | | +| | Contains the signed and encrypted version of the application. | | +| | :ref:`Compatible with MCUboot `. | | +| | ``zephyr`` is the value of :kconfig:option:`CONFIG_KERNEL_BIN_NAME`. | | +| | The file is located in the :file:`build//zephyr` directory. | | ++--------------------------------------+--------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :file:`zephyr.signed.bin` in | Secondary slot variant of the :file:`zephyr.signed.bin` file. | DFU process for single-core board targets. | | :file:`mcuboot_secondary_app` folder | :ref:`Compatible with MCUboot ` in the :doc:`direct-xip mode `. | | | | ``zephyr`` is the value of :kconfig:option:`CONFIG_KERNEL_BIN_NAME`. | | diff --git a/doc/nrf/app_dev/create_application.rst b/doc/nrf/app_dev/create_application.rst index fc2c00d3cdd0..fcca7084246d 100644 --- a/doc/nrf/app_dev/create_application.rst +++ b/doc/nrf/app_dev/create_application.rst @@ -185,7 +185,7 @@ Use the following steps depending on the application placement: You can now start :ref:`configuring and building ` the application. - See the `extension documentation `_ for more information about west workspace and workspace applications in the extension. + See the `extension documentation `_ for more information about working with workspace applications in the extension. .. group-tab:: Freestanding application @@ -213,7 +213,7 @@ Use the following steps depending on the application placement: .. note:: You can transform your freestanding application into a workspace application at any moment by completing the step 7 under the Workspace application tab. -See the `extension documentation `_ for more information about the differences between the applications types from the extension's perspective. +For more information about the differences between the applications types from the extension's perspective, see the `Applications `_ page in the extension documentation. .. _creating_cmd: diff --git a/doc/nrf/app_dev/device_guides/fem/21540ek_dev_guide.rst b/doc/nrf/app_dev/device_guides/fem/21540ek_dev_guide.rst index 5fcd34ce0595..03a71a63a9a7 100644 --- a/doc/nrf/app_dev/device_guides/fem/21540ek_dev_guide.rst +++ b/doc/nrf/app_dev/device_guides/fem/21540ek_dev_guide.rst @@ -52,14 +52,20 @@ For example: .. parsed-literal:: :class: highlight - west build -b nrf5340dk/nrf5340/cpuapp -- -DSHIELD=nrf21540ek_fwd -Dmultiprotocol_rpmsg_SHIELD=nrf21540ek + west build -b nrf5340dk/nrf5340/cpuapp -- -DSHIELD=nrf21540ek_fwd -Dipc_radio_SHIELD=nrf21540ek -In this command, the *childImageName_* parameter has the ``multiprotocol_rpmsg_`` value and builds a multiprotocol application with support for 802.15.4 and Bluetooth. -The *childImageName_* parameter can take the following values: +In this command, the *childImageName_* parameter has the ``ipc_radio_`` value as default and builds the application with support for the combination of 802.15.4 and Bluetooth. +The ``ipc_radio`` has been used since the build system migration to sysbuild. +See :ref:`Migrating to sysbuild ` page. +Setting the correct sysbuild option enables support for 802.15.4 and Bluetooth :ref:`ipc_radio`. + +``ipc_radio`` represents all applications with support for the combination of both 802.15.4 and Bluetooth. +You can configure your application using the following sysbuild configurations: + +* ``SB_CONFIG_NETCORE_IPC_RADIO=y`` for applications having support for 802.15.4, but not for Bluetooth. +* ``SB_CONFIG_NETCORE_IPC_RADIO_BT_HCI_IPC=y`` for application having support for Bluetooth, but not for 802.15.4. +* ``SB_CONFIG_NETCORE_IPC_RADIO=y`` and ``SB_CONFIG_NETCORE_IPC_RADIO_BT_HCI_IPC=y`` for multiprotocol applications having support for both 802.15.4 and Bluetooth. -* ``multiprotocol_rpmsg_`` for multiprotocol applications with support for 802.15.4 and Bluetooth -* ``802154_rpmsg_`` for applications with support for 802.15.4, but without support for Bluetooth -* ``hci_ipc_`` for application with support for Bluetooth, but without support for 802.15.4 .. note:: On nRF53 devices, ``SPIM0`` and ``UARTE0`` are mutually exclusive AHB bus masters on the network core as described in the `Product Specification `_, Section 6.4.3.1, Table 22. diff --git a/doc/nrf/app_dev/device_guides/fem/fem_nrf21540_gpio.rst b/doc/nrf/app_dev/device_guides/fem/fem_nrf21540_gpio.rst index b25954f917e8..d8b8ce7a392d 100644 --- a/doc/nrf/app_dev/device_guides/fem/fem_nrf21540_gpio.rst +++ b/doc/nrf/app_dev/device_guides/fem/fem_nrf21540_gpio.rst @@ -51,14 +51,18 @@ To use nRF21540 in GPIO mode, complete the following steps: The state of the remaining control pins should be set in other ways and according to `nRF21540 Product Specification`_. -#. On nRF53 devices, you must also apply the same devicetree node mentioned in step 1 to the network core. - To do so, apply the overlay to the correct network core child image by creating an overlay file named :file:`child_image/*childImageName*.overlay` in your application directory, for example :file:`child_image/multiprotocol_rpmsg.overlay`. +#. On nRF53 devices, you must also apply the same devicetree node mentioned in **Step 1** to the network core using sysbuild. + To apply the overlay to the correct network core child image, create an overlay file named :file:`sysbuild/*childImageName*/boards/nrf5340dk_nrf5340_cpunet.overlay` in your application directory, for example :file:`sysbuild/ipc_radio/boards/nrf5340dk_nrf5340_cpunet.overlay`. + For more information, see the :ref:`Migrating to sysbuild ` page. - The ``*childImageName*`` string must be one of the following values: + The *childImageName* default value is set to ``ipc_radio``: - * ``multiprotocol_rpmsg`` for multiprotocol applications having support for both 802.15.4 and Bluetooth. - * ``802154_rpmsg`` for applications having support for 802.15.4, but not for Bluetooth. - * ``hci_ipc`` for application having support for Bluetooth, but not for 802.15.4. + ``ipc_radio`` represents all applications with support for the combination of both 802.15.4 and Bluetooth. + You can configure your application using the following sysbuild configurations: + + * ``SB_CONFIG_NETCORE_IPC_RADIO=y`` for applications having support for 802.15.4, but not for Bluetooth. + * ``SB_CONFIG_NETCORE_IPC_RADIO_BT_HCI_IPC=y`` for application having support for Bluetooth, but not for 802.15.4. + * ``SB_CONFIG_NETCORE_IPC_RADIO=y`` and ``SB_CONFIG_NETCORE_IPC_RADIO_BT_HCI_IPC=y`` for multiprotocol applications having support for both 802.15.4 and Bluetooth.SB_CONFIG_NETCORE_IPC_RADIO=y`` and ``SB_CONFIG_NETCORE_IPC_RADIO_BT_HCI_IPC=y`` for multiprotocol applications having support for both 802.15.4 and Bluetooth. .. note:: This step is not needed when testing with :ref:`direct_test_mode` and :ref:`radio_test` on the nRF53 Series devices. diff --git a/doc/nrf/app_dev/device_guides/fem/fem_simple_gpio.rst b/doc/nrf/app_dev/device_guides/fem/fem_simple_gpio.rst index 30cdbcde4f2f..e4691885d9ba 100644 --- a/doc/nrf/app_dev/device_guides/fem/fem_simple_gpio.rst +++ b/doc/nrf/app_dev/device_guides/fem/fem_simple_gpio.rst @@ -50,15 +50,19 @@ To use the Simple GPIO implementation of FEM with SKY66112-11, complete the foll The state of the other control pins should be set according to the SKY66112-11 documentation. See the official `SKY66112-11 page`_ for more information. -#. On nRF53 devices, you must also apply the same devicetree node to the network core. - Create a devicetree overlay file with the same information as you used in Steps 1 to 3. - To apply the overlay to the correct network core child image, create the file in the :file:`child image` directory of your application directory, and name it :file:`*childImageName*.overlay`, for example :file:`child_image/multiprotocol_rpmsg.overlay`. - The ``*childImageName*`` string must be one of the following values: +#. On nRF53 devices, you must also apply the same devicetree node mentioned in **Step 1** to the network core using sysbuild. + To apply the overlay to the correct network core child image, create an overlay file named :file:`sysbuild/*childImageName*/boards/nrf5340dk_nrf5340_cpunet.overlay` in your application directory, for example :file:`sysbuild/ipc_radio/boards/nrf5340dk_nrf5340_cpunet.overlay`. + For more information, see the :ref:`Migrating to sysbuild ` page. - * ``multiprotocol_rpmsg`` for multiprotocol applications with support for 802.15.4 and Bluetooth. - * ``802154_rpmsg`` for applications with support for 802.15.4, but without support for Bluetooth. - * ``hci_ipc`` for applications with support for Bluetooth, but without support for 802.15.4. + The *childImageName* default value is set to ``ipc_radio``: + + ``ipc_radio`` represents all applications with support for the combination of both 802.15.4 and Bluetooth. + You can configure your application using the following sysbuild configurations: + + * ``SB_CONFIG_NETCORE_IPC_RADIO=y`` for applications having support for 802.15.4, but not for Bluetooth. + * ``SB_CONFIG_NETCORE_IPC_RADIO_BT_HCI_IPC=y`` for application having support for Bluetooth, but not for 802.15.4. + * ``SB_CONFIG_NETCORE_IPC_RADIO=y`` and ``SB_CONFIG_NETCORE_IPC_RADIO_BT_HCI_IPC=y`` for multiprotocol applications having support for both 802.15.4 and Bluetooth. .. note:: This step is not needed when testing with the :ref:`direct_test_mode` or :ref:`radio_test` samples on nRF53 Series devices. diff --git a/doc/nrf/app_dev/device_guides/nrf52/features.rst b/doc/nrf/app_dev/device_guides/nrf52/features.rst index 1cd5be669753..c57cd33a7ef4 100644 --- a/doc/nrf/app_dev/device_guides/nrf52/features.rst +++ b/doc/nrf/app_dev/device_guides/nrf52/features.rst @@ -10,10 +10,11 @@ Features of nRF52 Series The nRF52 Series of System-on-Chip (SoC) devices embed an Arm Cortex-M4 processor with Nordic Semiconductor's 2.4 GHz RF transceivers. All of the nRF52 Series SoCs have support for Bluetooth® 5 features, in addition to multiprotocol capabilities. +To get started with the nRF52 Series, download and run the `Quick Start`_ application from `nRF Connect for Desktop`_. + For additional information, see the following documentation: * `nRF52 Series`_ for the technical documentation on the nRF52 Series chips and associated kits. -* :ref:`ug_nrf52_gs`. * :ref:`ug_nrf52` for more advanced topics related to the nRF52 Series. * :ref:`installation` and :ref:`configuration_and_build` documentation to install the |NCS| and learn more about its development environment. diff --git a/doc/nrf/app_dev/device_guides/nrf52/fota_update.rst b/doc/nrf/app_dev/device_guides/nrf52/fota_update.rst index e97265db5b71..c838dbb9ca51 100644 --- a/doc/nrf/app_dev/device_guides/nrf52/fota_update.rst +++ b/doc/nrf/app_dev/device_guides/nrf52/fota_update.rst @@ -18,6 +18,8 @@ See the :ref:`app_dfu` page for general Device Firmware Update (DFU) information .. fota_upgrades_intro_end +.. _ug_nrf52_developing_ble_fota_steps: + FOTA over Bluetooth Low Energy ****************************** @@ -125,6 +127,8 @@ To read about the files that are built when the option is enabled, refer to the .. fota_upgrades_over_ble_mcuboot_direct_xip_information_end +.. _ug_nrf52_developing_ble_fota_steps_testing: + Testing steps ============= diff --git a/doc/nrf/app_dev/device_guides/nrf53/building_nrf53.rst b/doc/nrf/app_dev/device_guides/nrf53/building_nrf53.rst index eedba3b33bc6..988b31bbb141 100644 --- a/doc/nrf/app_dev/device_guides/nrf53/building_nrf53.rst +++ b/doc/nrf/app_dev/device_guides/nrf53/building_nrf53.rst @@ -51,7 +51,7 @@ Using the command line ====================== To build nRF5340 samples from the command line, use :ref:`west `. -To program the nRF5340 DK from the command line, use either west (which uses nrfjprog that is part of the `nRF Command Line Tools`_) or :ref:`nRF Util `. +To program the nRF5340 DK from the command line, use either west (which uses nrfjprog that is part of the `nRF Command Line Tools`_) or :ref:`nRF Util `. .. note:: Programming the nRF5340 DK from the command line with west requires the `nRF Command Line Tools`_ v10.12.0 or later. diff --git a/doc/nrf/app_dev/device_guides/nrf53/features_nrf53.rst b/doc/nrf/app_dev/device_guides/nrf53/features_nrf53.rst index c8c7eea7f1a4..0ffb66726d8b 100644 --- a/doc/nrf/app_dev/device_guides/nrf53/features_nrf53.rst +++ b/doc/nrf/app_dev/device_guides/nrf53/features_nrf53.rst @@ -10,11 +10,12 @@ Features of nRF53 Series The nRF53 Series System-on-Chips (SoC) integrate a high-performance Arm® Cortex®-M33 dual-core processor with a 2.4 GHz RF transceiver, in addition to advanced security features. All nRF53 Series SoC support Bluetooth® 5.1 and Bluetooth Mesh, in addition to multiprotocol capabilities. +To get started with the nRF5340 DK, download and run the `Quick Start`_ application from `nRF Connect for Desktop`_. + For additional information, refer to the following resources: * `nRF53 Series`_ for the technical documentation on the nRF53 Series chips and associated kits. * :ref:`installation` and :ref:`configuration_and_build` documentation to install the |NCS| and learn more about its development environment. -* :ref:`ug_nrf5340_gs` guide for getting started with the nRF5340 DK. * :ref:`ug_thingy53_gs` for getting started with the Thingy:53. Dual-core architecture diff --git a/doc/nrf/app_dev/device_guides/nrf53/fota_update_nrf5340.rst b/doc/nrf/app_dev/device_guides/nrf53/fota_update_nrf5340.rst index a2d748073f1f..80a0f7050ffc 100644 --- a/doc/nrf/app_dev/device_guides/nrf53/fota_update_nrf5340.rst +++ b/doc/nrf/app_dev/device_guides/nrf53/fota_update_nrf5340.rst @@ -11,6 +11,8 @@ FOTA updates with nRF5340 DK :start-after: fota_upgrades_intro_start :end-before: fota_upgrades_intro_end +.. _ug_nrf53_developing_ble_fota_steps: + FOTA over Bluetooth Low Energy ****************************** @@ -28,6 +30,8 @@ Bluetooth buffers configuration introduced by the :kconfig:option:`CONFIG_NCS_SA :start-after: fota_upgrades_over_ble_additional_information_start :end-before: fota_upgrades_over_ble_additional_information_end +.. _ug_nrf53_developing_ble_fota_steps_testing: + Testing steps ============= diff --git a/doc/nrf/app_dev/device_guides/nrf54l/cryptography.rst b/doc/nrf/app_dev/device_guides/nrf54l/cryptography.rst new file mode 100644 index 000000000000..27ab16e5e9e5 --- /dev/null +++ b/doc/nrf/app_dev/device_guides/nrf54l/cryptography.rst @@ -0,0 +1,353 @@ +.. _ug_nrf54l_cryptography: + +nRF54L Series cryptography +########################## + +.. contents:: + :local: + :depth: 2 + +The cryptographic peripherals of the nRF54L Series are supported through a set of standard PSA Crypto APIs, with some additional vendor-specific extensions. + +The nRF Security library offers a set of :ref:`nrf_security_drivers`. +On the nRF54L devices, in addition to the nrf_oberon driver covering the software-based cryptography implementations, the CRACEN driver (nrf_cracen) provides entropy and hardware-accelerated cryptography using the Crypto Accelerator Engine (CRACEN) peripheral. +The CRACEN PSA driver supports the following: + +* Executing cryptographic operations using the CRACEN peripheral. +* Importing, using, and revoking keys stored in the Key Management Unit (KMU). +* Pushing symmetric keys directly from the KMU to the CRACEN symmetric engine, without exposing the key material to the CPU. +* Using isolated keys derived from CRACEN's Isolated Key Generator (IKG) for encryption and signing purposes. + +The keys that are stored in the KMU or generated by the IKG are referenced using the built-in keys that are key IDs in the range from ``MBEDTLS_PSA_KEY_ID_BUILTIN_MIN`` to and including ``MBEDTLS_PSA_KEY_ID_BUILTIN_MAX``. + +KMU and CRACEN peripherals +************************** + +The nRF54L Series Crypto Accelerator Engine (CRACEN) and the Key Management Unit (KMU) peripherals, along with the CRACEN PSA driver, are central when ensuring that the assets of an nRF54L device are protected. +While CRACEN is not accessed by the CPU and typically not directly used by the end-users and their applications, the KMU provides operations to import, use, revoke, and/or delete assets. +Only the KMU is able to push assets to CRACEN's protected RAM and the SEED register. + +The KMU can store cryptographic keys and 384-bit random seeds for the IKG in key storage slots. +The CRACEN PSA driver exposes the KMU operations through standard PSA Crypto API calls, with some vendor-specific extensions. +The following KMU operations are supported: + +* Importing/provisioning keys to KMU slots. +* Deleting a key from the KMU, allowing the underlying storage location to be reused. +* Revoking a key from the KMU, preventing reuse of the underlying key slots. +* Directly pushing symmetric keys to CRACEN's engine for symmetric crypto operations, without exposing the key material to the CPU. +* Directly pushing a 384-bit seed to CRACEN's IKG to derive isolated keys. +* Pushing asymmetric keys to CPU RAM before loading them into CRACEN's engine for asymmetric operations. + +Additionally, the CRACEN PSA driver supports storing encrypted keys in KMU slots, transparently decrypting them to a temporary RAM location before using them in cryptographic operations. + +.. _ug_nrf54l_crypto_kmu_slots: + +KMU slots +========= + +The KMU is partitioned into 256 numbered slots, each capable of storing 128 bits of key material, a 32-bit target push address and 32 bits of metadata. +Storing keys that are larger than 128 bits is supported by using multiple, consecutive slots. + +The application can use the KMU slots to store key data for their own purposes. +Some KMU slots are reserved for current and future |NCS| use cases. +The following table gives an overview of the KMU slots and their usage: + +.. list-table:: List of reserved KMU slots + :widths: auto + :header-rows: 1 + + * - | Reserved KMU slots + | (range inclusive) + - | |NCS| usage + | + - | Description + | + * - 180-182 + - Reserved + - -- + * - 183-185 + - IKG seed + - 384-bit random seed to generate keys using the CRACEN IKG. + * - 186-225 + - Reserved + - -- + * - 226-227 + - UROT_PUBKEY_0 + - | Revokable firmware image key for upgradable bootloader, generation 0. + | ED25519 public key. + * - 228-229 + - UROT_PUBKEY_1 + - | Revokable firmware image key for upgradable bootloader, generation 1. + | ED25519 public key. + * - 230-231 + - UROT_PUBKEY_2 + - | Revokable firmware image key for upgradable bootloader, generation 2. + | ED25519 public key. + * - 232-241 + - Reserved + - -- + * - 242-243 + - BL_PUBKEY_0 + - | Revokable firmware image key for immutable bootloader, generation 0. + | ED25519 public key. + * - 244-245 + - BL_PUBKEY_1 + - | Revokable firmware image key for immutable bootloader, generation 1. + | ED25519 public key. + * - 246-247 + - BL_PUBKEY_2 + - | Revokable firmware image key for immutable bootloader, generation 2. + | ED25519 public key. + * - 248-255 + - Reserved + - -- + +CRACEN Isolated Key Generator +============================= + +CRACEN's Isolated Key Generator (IKG) can derive three keys from a 384-bit seed value. + +IKG-generated keys are also called special hardware keys. +These keys are typically not meant for application use. +They are not accessible by any CPU, but they can be used for cryptographic operations by CRACEN, provided directly to the cryptographic engine as a hardware signal. +IKG keys are not retained, and have to be regenerated for every CRACEN power cycle. + +The 384-bit seed value is provisioned to the device or generated automatically during the first boot of the device using the CRACEN Random Number Generator (RNG), and then stored in the KMU. +Before the keys can be generated, the seed is pushed by the KMU to the SEED register, and then validated. +Generating keys without the valid seed will fail. + +IKG keys are also accessed using the standard PSA Crypto APIs, and are referenced by special built-in key IDs. + ++-----------------+-------------------------------------+---------------------------------------------------+ +| Key type | Key ID | Description | ++=================+=====================================+===================================================+ +| ECC secp256r1 | ``CRACEN_BUILTIN_IDENTITY_KEY_ID`` | Used for signing/verification. | ++-----------------+-------------------------------------+---------------------------------------------------+ +| AES 256-bit | ``CRACEN_BUILTIN_MKEK_ID`` | Used for encryption/decryption or key derivation. | ++-----------------+-------------------------------------+---------------------------------------------------+ +| AES 256-bit | ``CRACEN_BUILTIN_MEXT_ID`` | Used for encryption/decryption or key derivation. | ++-----------------+-------------------------------------+---------------------------------------------------+ + +The keys are not exportable, except for the public key associated with the asymmetric key. + + +Programming model for referencing keys +************************************** + +The keys which are stored in the KMU can be used by most cryptographic functions and key management functions in the PSA Crypto API (see `PSA Certified Crypto API 1.2.1`_), with a built-in key ID representing a particular KMU slot. + +To identify that the KMU is used as a persistent storage backend for a specific ``psa_key_id_t``, you need to create a ``psa_key_attributes_t`` structure and set the required attributes from the list below. + ++----------------------------------------------+-----------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+ +| Attribute (setter function) | Parameters | Description | ++==============================================+=============================================================================+====================================================================================================================================================+ +| ``key_type`` (``psa_set_key_type``) | A supported key type. | Sets the key type and size. | +| | | | +| | | See :ref:`ug_nrf54l_crypto_kmu_supported_key_types` for overview of the supported key types for each driver. | ++----------------------------------------------+-----------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+ +| ``key_bits`` (``psa_set_key_bits``) | A supported key size for the key type. | Sets the key type and size. | +| | | | +| | | See :ref:`ug_nrf54l_crypto_kmu_supported_key_types` for overview of the supported key types for each driver. | ++----------------------------------------------+-----------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+ +| ``key lifetime`` (``psa_set_key_lifetime``) | ``PSA_KEY_LIFETIME_FROM_PERSISTENCE_AND_LOCATION(persistence, location)`` | ``CRACEN_KEY_PERSISTENCE_REVOKABLE`` is a custom persistence mode, which will revoke the key slots when the key is destroyed. | +| | where persistence is set to one of the following: | | +| | ``PSA_KEY_PERSISTENCE_DEFAULT``, | ``PSA_KEY_PERSISTENCE_DEFAULT`` should be used by applications that have no specific needs beyond what is met by implementation-specific features. | +| | ``PSA_KEY_PERSISTENCE_READ_ONLY``, | | +| | ``CRACEN_KEY_PERSISTENCE_REVOKABLE``, | ``PSA_KEY_PERSISTENCE_READ_ONLY`` is for read-only or write-once keys. | +| | and location must be ``PSA_KEY_LOCATION_CRACEN_KMU`` | A key with this persistence level cannot be destroyed. | +| | | Keys that are read-only due to policy restrictions, rather than physical limitations, should not have this persistence level. | ++----------------------------------------------+-----------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+ +| ``key_id`` (``psa_set_key_id``) | ``PSA_KEY_HANDLE_FROM_CRACEN_KMU_SLOT(kmu_usage_scheme, kmu_slot_nr)`` | For correct ``kmu_usage_scheme`` values, see :ref:`ug_nrf54l_crypto_kmu_key_usage_schemes`. | +| | | | +| | | For correct ``kmu_slot_nr`` values, see :ref:`ug_nrf54l_crypto_kmu_slots`. | ++----------------------------------------------+-----------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+ +| ``key_usage`` (``psa_set_key_usage_flags``) | Standard PSA Crypto key usage flags | ``PSA_KEY_USAGE_EXPORT`` and ``PSA_KEY_USAGE_COPY`` are not allowed for keys with the usage scheme ``CRACEN_KEY_USAGE_SCHEME_PROTECTED``. | ++----------------------------------------------+-----------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+ + +.. _ug_nrf54l_crypto_kmu_key_usage_schemes: + +KMU key usage schemes +===================== + +To see what key types are supported with Protected, Encrypted and Raw usage schemes, refer to the table under :ref:`ug_nrf54l_crypto_kmu_supported_key_types`. + +The following list shows available schemes that determine how the keys are used: + ++-------------+--------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+ +| Scheme name | Macro name | Description | ++=============+============================================+======================================================================================================================================+ +| Protected | ``CRACEN_KMU_KEY_USAGE_SCHEME_PROTECTED`` | The keys will be pushed to a RAM only accessible by the CRACEN. | ++-------------+--------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+ +| Encrypted | ``CRACEN_KMU_KEY_USAGE_SCHEME_ENCRYPTED`` | The keys are encrypted, and are decrypted on-the-fly to a CPU-accessible RAM location before being used by the CRACEN. | +| | | | +| | | Encrypted keys require two additional KMU slots to store the authentication nonce and tag. | ++-------------+--------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+ +| Raw | ``CRACEN_KMU_KEY_USAGE_SCHEME_RAW`` | The keys are stored as plain text and pushed to a CPU-accessible RAM location before being used by the CRACEN. | ++-------------+--------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+ +| Seed | ``CRACEN_KMU_KEY_USAGE_SCHEME_SEED`` | The slots will be pushed to CRACEN's SEED registers. | +| | | | +| | | This scheme is typically not meant for the application use. | +| | | | +| | | It is only used for the platform keys, ``CRACEN_BUILTIN_IDENTITY_KEY_ID``, ``CRACEN_BUILTIN_MKEK_ID`` or ``CRACEN_BUILTIN_MEXT_ID``. | ++-------------+--------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+ + +.. _ug_nrf54l_crypto_kmu_supported_key_types: + +Supported key types +=================== + +The following table lists all key types that can be stored in the KMU, indicating which usage schemes (Protected, Encrypted, and Raw) support them and the number of key slots they require. + +.. list-table:: Supported key types + :widths: auto + :header-rows: 1 + + * - Key type + - PSA key attributes + - KMU slots [1]_ + - Protected + - Encrypted + - Raw + * - AES 128-bit keys + - | ``key_type``: ``PSA KEY_TYPE_AES`` + | ``key_bits``: 128 + - 1 + - Yes + - Yes + - Yes + * - AES 192-bit and 256-bit keys + - | ``key_type``: ``PSA_KEY_TYPE_AES`` + | ``key_bits``: 192 + | ``key_bits``: 256 + - 2 + - Yes + - Yes + - Yes + * - ChaCha20-Poly1305 + - ``key_type``: ``PSA_KEY_TYPE_CHACHA20`` + - 2 + - No + - Yes + - Yes + * - ECC secp256r1 key pair + - | ``key_type``: ``PSA_KEY_TYPE_ECC_KEY_PAIR(PSA_ECC_FAMILY_SECP_R1)`` + | ``key_bits``: 256 + - 2 + - No + - Yes + - Yes + * - ECC secp256r1 public key + - | ``key_type``: ``PSA_KEY_TYPE_ECC_PUBLIC_KEY(PSA_ECC_FAMILY_SECP_R1)`` + | ``key_bits``: 256 + - 4 + - No + - Yes + - Yes + * - Ed25519 key pair + - | ``key_type``: ``PSA_KEY_TYPE_ECC_KEY_PAIR(PSA_ECC_FAMILY_TWISTED_EDWARDS)`` + | ``key_bits``: 255 + - 2 + - No + - Yes + - Yes + * - ED25519 public key + - | ``key_type``: ``PSA_KEY_TYPE_ECC_PUBLIC_KEY(PSA_ECC_FAMILY_TWISTED_EDWARDS)`` + | ``key bits``: 255 + - 2 + - No + - Yes + - Yes +.. [1] 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. + +Storing keys in KMU +=================== + +Applications can store keys in KMU slots using the standard PSA cryptographic key management operations ``psa_import_key``, ``psa_generate_key`` or ``psa_copy_key``. +Additionally, the KMU slots can be provisioned using the nRF Util development tool. + +.. note:: + If a power failure occurs during provisioning of a key with persistence ``PSA_KEY_PERSISTENCE_READ_ONLY`` or ``CRACEN_KEY_PERSISTENCE_REVOKABLE``, it might not be possible to recover the key slot. + Provisioning of read-only keys should be restricted to controlled environments (production environments). + +You might encounter the following KMU-specific error codes when storing keys in KMU: + +* ``PSA_ERROR_ALREADY_EXIST``: One of the required key slots has already been provisioned. +* ``PSA_ERROR_NOT_SUPPORTED``: Unsupported key type. + +Removing or revoking keys from KMU +================================== + +Keys are deleted or revoked using the ``psa_destroy_key`` function. +Calling the ``psa_destroy_key`` function on keys that have the persistence ``CRACEN_KEY_PERSISTENCE_REVOKABLE``, will mark the associated KMU slots as revoked, preventing the slots from being reused for new keys. + + +Using KMU keys +============== + +Keys stored in the KMU can be used in standard PSA cryptographic operations for encryption, decryption, signing a hash or a message, and verifying a hash or a message, given that the corresponding ``PSA_KEY_USAGE_*`` flags are set. + +Keys with the usage schemes Protected (``CRACEN_KMU_KEY_USAGE_SCHEME_PROTECTED``) and Seed (``CRACEN_KMU_KEY_USAGE_SCHEME_SEED``) can push data from the slots directly to CRACEN registers that are not accessible by the CPU. +These usage schemes are supported for pushing symmetric keys used for cipher operations, and for seeds used by the CRACEN IKG. + +Keys with the usage scheme Raw (``CRACEN_KMU_KEY_USAGE_SCHEME_RAW``), such as symmetric keys, are temporarily pushed to a RAM location by the CRACEN driver, and then loaded by CRACEN into the asymmetric engine before running operations like sign or verify. + +Key slots with the usage scheme Encrypted (``CRACEN_KMU_KEY_USAGE_SCHEME_ENCRYPTED``) also have to be decrypted to a temporary push location in RAM before they are used by CRACEN, which is handled by the CRACEN driver. + +When the application is built with TF-M, this temporary push location is protected inside the secure processing environment to avoid exposing the key material to the non-secure application. +If TF-M is not used, the keys are pushed to a reserved RAM area at location 0x20000000-0x20000064 (``kmu_push_area``). + +You might encounter the following KMU-specific error codes when using the KMU keys: + +* ``PSA_ERROR_INVALID_HANDLE``: Attempting an operation on an empty KMU slot. +* ``PSA_ERROR_NOT_PERMITTED``: Attempting an operation on a revoked key. +* ``PSA_ERROR_HARDWARE_FAILURE``: The key slot has invalid data. +* ``PSA_ERROR_CORRUPTION_DETECTED``: The key slot has invalid data. + +Configuration +************* + +See :ref:`configuring_kconfig` for information on how to set the required configuration options temporarily or permanently. + +The CRACEN peripheral does not require any configuration. +Its operation is ensured by hardware. + +The following Kconfig options are used to enable support for KMU: + +* :kconfig:option:`CONFIG_NRF_SECURITY`: Enables the nRF Security library +* :kconfig:option:`CONFIG_MBEDTLS_PSA_CRYPTO_C`: Enables the Platform Security Architecture (PSA) cryptography API +* :kconfig:option:`CONFIG_PSA_CRYPTO_DRIVER_CRACEN`: Enables the CRACEN driver + +The following code block shows how KMU support is enabled: + +.. code-block:: console + + CONFIG_NRF_SECURITY=y + CONFIG_MBEDTLS_PSA_CRYPTO_C=y + CONFIG_PSA_CRYPTO_DRIVER_CRACEN=y + +As an example, enabling support for the Encrypted key usage scheme (``CRACEN_KMU_KEY_USAGE_SCHEME_ENCRYPTED``) is done using the following Kconfig options: + +* :kconfig:option:`CONFIG_PSA_WANT_KEY_TYPE_AES` +* :kconfig:option:`CONFIG_PSA_WANT_AES_KEY_SIZE_256` +* :kconfig:option:`CONFIG_PSA_WANT_ALG_ECB_NO_PADDING` +* :kconfig:option:`CONFIG_PSA_WANT_ALG_CMAC` +* :kconfig:option:`CONFIG_PSA_WANT_ALG_SP800_108_COUNTER_CMAC` +* :kconfig:option:`CONFIG_PSA_WANT_ALG_GCM` + +Enabling support for the Encrypted key usage scheme looks as shown in the following code block: + +.. code-block:: console + + CONFIG_PSA_WANT_KEY_TYPE_AES=y + CONFIG_PSA_WANT_AES_KEY_SIZE_256=y + CONFIG_PSA_WANT_ALG_ECB_NO_PADDING=y + CONFIG_PSA_WANT_ALG_CMAC=y + CONFIG_PSA_WANT_ALG_SP800_108_COUNTER_CMAC=y + CONFIG_PSA_WANT_ALG_GCM=y + +The configuration is enabling the key type (AES) and the key size (256 bits) supported by the Encrypted usage scheme as explained in the :ref:`ug_nrf54l_crypto_kmu_supported_key_types` section, and in addition enabling the following :ref:`cryptographic features ` supported by the CRACEN driver: + +* Cipher mode: AES ECB (Electronic CodeBook) mode, no padding +* Message Authentication Code (MAC) cipher: cipher-based MAC (CMAC) cipher +* Key derivation function (KDF) support: SP800-108 CMAC in counter mode +* Authenticated Encryption with Associated Data (AEAD) cipher: GCM (Galois Counter Mode) cipher diff --git a/doc/nrf/app_dev/device_guides/nrf54l/index.rst b/doc/nrf/app_dev/device_guides/nrf54l/index.rst index 8fdcb958b303..52942d28f6ea 100644 --- a/doc/nrf/app_dev/device_guides/nrf54l/index.rst +++ b/doc/nrf/app_dev/device_guides/nrf54l/index.rst @@ -4,10 +4,6 @@ Developing with nRF54L Series ############################# -.. note:: - - All software for the nRF54L15 SoC is experimental and hardware availability is restricted to the participants in the limited sampling program. - .. |nrf_series| replace:: devices of the nRF54L Series .. include:: /includes/guides_complementary_to_app_dev.txt @@ -28,10 +24,14 @@ Zephyr and the |NCS| provide support and contain board definitions for developin - :ref:`Getting started ` - `nRF54L15 System-on-Chip`_ +.. note:: + + When building your project with the nRF54L15 DK v0.8.1 (Engineering B silicon), that is marked as PDK, and the nRF54L15 DK v0.9.1 (Engineering B silicon), you must use the ``nrf54l15dk/nrf54l51/cpuapp`` board target. + .. toctree:: :maxdepth: 2 :caption: Subpages: features + cryptography testing_dfu - peripheral_sensor_node_shield diff --git a/doc/nrf/app_dev/device_guides/nrf54l/peripheral_sensor_node_shield.rst b/doc/nrf/app_dev/device_guides/nrf54l/peripheral_sensor_node_shield.rst deleted file mode 100644 index 5b28c12cb1fc..000000000000 --- a/doc/nrf/app_dev/device_guides/nrf54l/peripheral_sensor_node_shield.rst +++ /dev/null @@ -1,81 +0,0 @@ -.. _peripheral_sensor_node_shield: - -Developing with Peripheral Sensor node shield -############################################# - -.. contents:: - :local: - :depth: 2 - -The Peripheral Sensor node shield is an extension for the :ref:`nRF54L15 PDK `. -It is a testing shield designed for evaluating I2C and SPI protocol drivers. -It includes the following sensors: - -* `ADXL362`_ accelerometer (SPI interface) -* `BMI270`_ accelerometer and gyroscope (SPI interface) -* `BME688`_ temperature, pressure, humidity and gas sensor (I2C interface with on-board pull-up resistors 4.7 kOhm). - -The shield operates at a supply voltage of 1.8V. - -.. figure:: /images/peripheral_sensor_node_shield.png - :width: 350px - :align: center - :alt: Peripheral Sensor node shield - - Peripheral Sensor node shield - -Pin assignment -************** - -For the exact pin assignment for the nRF54L15 PDK, refer to the following table: - -+-------------------------+------------+-----------------+ -| nRF54L15 connector pin | SIGNAL | Shield function | -+=========================+============+=================+ -| P1.13 | BMI270 CS | Chip Select | -+-------------------------+------------+-----------------+ -| P2.10 | ADXL362 CS | Chip Select | -+-------------------------+------------+-----------------+ -| P2.08 | SPI MOSI | Serial Data In | -+-------------------------+------------+-----------------+ -| P2.09 | SPI MISO | Serial Data Out | -+-------------------------+------------+-----------------+ -| P2.06 | SPI SCK | Serial Clock | -+-------------------------+------------+-----------------+ -| P1.14 | GPIO | SPI Interrupt | -+-------------------------+------------+-----------------+ -| P1.11 | TWI SCL | TWI Clock | -+-------------------------+------------+-----------------+ -| P1.12 | TWI SDA | TWI Data | -+-------------------------+------------+-----------------+ - -.. figure:: /images/peripheral_sensor_node_assy.png - :width: 350px - :align: center - :alt: Peripheral Sensor node assembly - - Peripheral Sensor node assembly - -.. note:: - The shield must be oriented in a way that allows its silkscreen to read the same way as the PDK. - The shield must not be rotated. - -Building and programming with Peripheral Sensor node shield -*********************************************************** - -To build for the Peripheral Sensor node Shield on the compatible :ref:`nRF54L15 PDK `, use the CMake ``SHIELD`` option set to ``pca63565``. -For more information on CMake options, see the :ref:`cmake_options` documentation section. - -Run the following command: - -.. code-block:: console - - west build -b nrf54l15pdk/nrf54l15/cpuapp -- -DSHIELD=pca63565 - -If you are using the |nRFVSC|, specify the ``-DSHIELD=pca63565`` argument in the **Extra Cmake arguments** field when `setting up a build configuration `_. - -Alternatively, you can add the shield in the project's :file:`CMakeLists.txt` file: - -.. code-block:: none - - set(SHIELD pca63565) diff --git a/doc/nrf/app_dev/device_guides/nrf70/index.rst b/doc/nrf/app_dev/device_guides/nrf70/index.rst index f5c13a9e74b6..50a2ec8bb55e 100644 --- a/doc/nrf/app_dev/device_guides/nrf70/index.rst +++ b/doc/nrf/app_dev/device_guides/nrf70/index.rst @@ -35,28 +35,28 @@ Zephyr and the |NCS| provide support for developing networking applications with - PCA10095 - ``nrf5340dk/nrf5340/cpuapp`` - | `Product Specification `_ - | :ref:`Getting started ` + | `Quick Start`_ | `User Guide `_ * - :ref:`zephyr:nrf52840dk_nrf52840` - nRF7002 EK - PCA10056 - ``nrf52840dk/nrf52840`` - | `Product Specification `_ - | :ref:`Getting started ` + | `Quick Start`_ | `User Guide `_ * - :ref:`zephyr:nrf9151dk_nrf9151` - nRF7002 EK - PCA10171 - ``nrf9151dk/nrf9151/ns`` - | `Product Specification `_ - | :ref:`Getting started ` + | `Quick Start`_ | `User Guide `_ * - :ref:`zephyr:nrf9161dk_nrf9161` - nRF7002 EK - PCA10153 - ``nrf9161dk/nrf9161/ns`` - | `Product Specification `_ - | :ref:`Getting started ` + | `Quick Start`_ | `User Guide `_ * - :ref:`zephyr:nrf9160dk_nrf9160` - nRF7002 EK diff --git a/doc/nrf/app_dev/device_guides/nrf91/index.rst b/doc/nrf/app_dev/device_guides/nrf91/index.rst index d16016ed71f8..1cba5ee4feac 100644 --- a/doc/nrf/app_dev/device_guides/nrf91/index.rst +++ b/doc/nrf/app_dev/device_guides/nrf91/index.rst @@ -25,7 +25,7 @@ Zephyr and the |NCS| provide support for developing cellular applications using - PCA10153 - ``nrf9161dk/nrf9161``, ``nrf9161dk/nrf9161/ns`` - | `Product Specification `_ - | :ref:`Getting started ` + | `Quick Start`_ | `User Guide `_ - | `nRF9161 DK product page`_ | `nRF9161 System in Package (SiP) `_ @@ -41,7 +41,7 @@ Zephyr and the |NCS| provide support for developing cellular applications using - PCA10171 - ``nrf9151dk/nrf9151``, ``nrf9151dk/nrf9151/ns`` - | `Product Specification `_ - | :ref:`Getting started ` + | `Quick Start`_ | `User Guide `_ - | `nRF9151 DK product page`_ | `nRF9151 System in Package (SiP) `_ diff --git a/doc/nrf/app_dev/device_guides/nrf91/nrf91_snippet.rst b/doc/nrf/app_dev/device_guides/nrf91/nrf91_snippet.rst index b1297818fdca..05b5d51af7f8 100644 --- a/doc/nrf/app_dev/device_guides/nrf91/nrf91_snippet.rst +++ b/doc/nrf/app_dev/device_guides/nrf91/nrf91_snippet.rst @@ -22,6 +22,12 @@ On nRF91 Series devices, you can enable the following functionalities using snip * - :ref:`nrf91_modem_trace_uart_snippet` - ``nrf91-modem-trace-uart`` - :ref:`All nRF91 Series board targets ` + * - :ref:`nrf91_modem_trace_rtt_snippet` + - ``nrf91-modem-trace-rtt`` + - :ref:`All nRF91 Series board targets ` + * - :ref:`nrf91_modem_trace_ram_snippet` + - ``nrf91-modem-trace-ram`` + - :ref:`All nRF91 Series board targets ` * - :ref:`tfm_enable_share_uart` - ``tfm-enable-share-uart`` - :ref:`All nRF91 Series board targets ` @@ -41,6 +47,21 @@ To enable modem traces with the flash backend, use the following command pattern west build --board *board_target* -- -D_SNIPPET="nrf91-modem-trace-ext-flash" +.. _nrf91_modem_trace_ram_snippet: + +nRF91 modem traces with RAM backend using snippets +**************************************************** + +The ``nrf91-modem-trace-ram`` snippet enables modem tracing and configures it to store modem traces to a dedicated partition on the RAM. +To change the partition size, the project needs to configure the :kconfig:option:`CONFIG_NRF_MODEM_LIB_TRACE_BACKEND_RAM_LENGTH` Kconfig option. + +To enable modem traces with the RAM backend, use the following command pattern, where *board_target* corresponds to your board target and `` to your application image name: + +.. parsed-literal:: + :class: highlight + + west build --board *board_target* -- -D_SNIPPET="nrf91-modem-trace-ram" + .. _nrf91_modem_trace_uart_snippet: nRF91 modem tracing with UART backend using snippets @@ -83,6 +104,20 @@ This can be done in one of the following ways: See :ref:`cmake_options` for more details. +.. _nrf91_modem_trace_rtt_snippet: + +nRF91 modem traces with RTT backend using snippets +************************************************** + +The ``nrf91-modem-trace-rtt`` snippet enables the :kconfig:option:`CONFIG_NRF_MODEM_LIB_TRACE` Kconfig option and chooses the RTT trace backend with the necessary Kconfig options. + +To enable modem traces with the RTT backend, use the following command pattern, where *board_target* corresponds to your board target and `` to your application image name: + +.. parsed-literal:: + :class: highlight + + west build --board *board_target* -- -D_SNIPPET="nrf91-modem-trace-rtt" + .. _tfm_enable_share_uart: Shared UART for application and TF-M logging diff --git a/doc/nrf/app_dev/device_guides/pmic/npm1300.rst b/doc/nrf/app_dev/device_guides/pmic/npm1300.rst index 96cb6cc8a83c..0ce6837aae32 100644 --- a/doc/nrf/app_dev/device_guides/pmic/npm1300.rst +++ b/doc/nrf/app_dev/device_guides/pmic/npm1300.rst @@ -64,21 +64,21 @@ The following boards in the `Zephyr`_ open source project and in the |NCS| are c - PCA10095 - ``nrf5340dk/nrf5340/cpuapp`` - | `Product Specification `_ - | :ref:`Getting started ` + | `Quick Start`_ | `User Guide `_ * - :ref:`zephyr:nrf52840dk_nrf52840` - nPM1300 EK - PCA10056 - ``nrf52840dk/nrf52840`` - | `Product Specification `_ - | :ref:`Getting started ` + | `Quick Start`_ | `User Guide `_ * - :ref:`zephyr:nrf52dk_nrf52832` - nPM1300 EK - PCA10040 - ``nrf52dk/nrf52832`` - | `Product Specification `_ - | :ref:`Getting started ` + | `Quick Start`_ | `User Guide `_ PMIC samples and libraries diff --git a/doc/nrf/app_dev/device_guides/wifi_coex.rst b/doc/nrf/app_dev/device_guides/wifi_coex.rst index aab911596361..ab53de495e5a 100644 --- a/doc/nrf/app_dev/device_guides/wifi_coex.rst +++ b/doc/nrf/app_dev/device_guides/wifi_coex.rst @@ -128,14 +128,17 @@ To enable Wi-Fi coexistence on the nRF70 Series device, complete the following s The first element ``&gpio0`` indicates the GPIO port (``port 0`` has been selected in the example shown). The second element is the pin number on that port. -#. On the nRF5340, apply the same devicetree node mentioned in Step 1 to the network core. - Apply the overlay to the correct network-core child image by creating an overlay file named :file:`child_image/*childImageName*.overlay` in your application directory, for example :file:`child_image/multiprotocol_rpmsg.overlay`. +#. On the nRF5340, you must also apply the same devicetree node mentioned in step 1 to the network core using sysbuild build system. For more information, see the :ref:`Migrating to sysbuild ` page. + To do so, apply the overlay to the correct network core child image by creating an overlay file named :file:`sysbuild/*childImageName*/boards/nrf5340dk_nrf5340_cpunet.overlay.overlay` in your application directory, for example :file:`sysbuild/ipc_radio/boards/nrf5340dk_nrf5340_cpunet.overlay`. - The ``*childImageName*`` string must assume one of the following values: + The ``*childImageName*`` default value is set to ``ipc_radio`` :ref:`ipc_radio`. - * ``multiprotocol_rpmsg`` for multiprotocol applications having support for both 802.15.4 and Bluetooth. - * ``802154_rpmsg`` for applications having support for 802.15.4, but not for Bluetooth. - * ``hci_ipc`` for application having support for Bluetooth, but not for 802.15.4. + ``ipc_radio`` represents all applications with support for the combination of both 802.15.4 and Bluetooth. + You can configure your application using the following sysbuild configurations: + + * ``SB_CONFIG_NETCORE_IPC_RADIO=y`` for applications having support for 802.15.4, but not for Bluetooth. + * ``SB_CONFIG_NETCORE_IPC_RADIO_BT_HCI_IPC=y`` for application having support for Bluetooth, but not for 802.15.4. + * ``SB_CONFIG_NETCORE_IPC_RADIO=y`` and ``SB_CONFIG_NETCORE_IPC_RADIO_BT_HCI_IPC=y`` for multiprotocol applications having support for both 802.15.4 and Bluetooth. #. Enable the following Kconfig options: @@ -206,14 +209,18 @@ To enable the generic three-wire coexistence, do the following: The first element ``&gpio0`` indicates the GPIO port (``port 0`` has been selected in the example shown). The second element is the pin number on that port. -#. On the nRF5340, apply the same devicetree node mentioned in Step 1 to the network core. - Apply the overlay to the correct network-core child image by creating an overlay file named :file:`child_image/*childImageName*.overlay` in your application directory, for example :file:`child_image/multiprotocol_rpmsg.overlay`. +#. On nRF53 devices, you must also apply the same devicetree node mentioned in **Step 1** to the network core using sysbuild. + To apply the overlay to the correct network core child image, create an overlay file named :file:`sysbuild/*childImageName*/boards/nrf5340dk_nrf5340_cpunet.overlay` in your application directory, for example :file:`sysbuild/ipc_radio/boards/nrf5340dk_nrf5340_cpunet.overlay`. + For more information, see the :ref:`Migrating to sysbuild ` page. + + The *childImageName* default value is set to ``ipc_radio``: - The ``*childImageName*`` string must assume one of the following values: + ``ipc_radio`` represents all applications with support for the combination of both 802.15.4 and Bluetooth. + You can configure your application using the following sysbuild configurations: - * ``multiprotocol_rpmsg`` for multiprotocol applications having support for both 802.15.4 and Bluetooth. - * ``802154_rpmsg`` for applications having support for 802.15.4, but not for Bluetooth. - * ``hci_ipc`` for application having support for Bluetooth, but not for 802.15.4. + * ``SB_CONFIG_NETCORE_IPC_RADIO=y`` for applications having support for 802.15.4, but not for Bluetooth. + * ``SB_CONFIG_NETCORE_IPC_RADIO_BT_HCI_IPC=y`` for application having support for Bluetooth, but not for 802.15.4. + * ``SB_CONFIG_NETCORE_IPC_RADIO=y`` and ``SB_CONFIG_NETCORE_IPC_RADIO_BT_HCI_IPC=y`` for multiprotocol applications having support for both 802.15.4 and Bluetooth. #. Enable the following Kconfig options: diff --git a/doc/nrf/app_dev/device_guides/working_with_nrf/nrf54h/images/nrf54h20_suit_recovery_boot_path.png b/doc/nrf/app_dev/device_guides/working_with_nrf/nrf54h/images/nrf54h20_suit_recovery_boot_path.png new file mode 100644 index 000000000000..de3ef05a619e Binary files /dev/null and b/doc/nrf/app_dev/device_guides/working_with_nrf/nrf54h/images/nrf54h20_suit_recovery_boot_path.png differ diff --git a/doc/nrf/app_dev/device_guides/working_with_nrf/nrf54h/images/nrf54h20_suit_recovery_manifest_topology.png b/doc/nrf/app_dev/device_guides/working_with_nrf/nrf54h/images/nrf54h20_suit_recovery_manifest_topology.png new file mode 100644 index 000000000000..367a3be73c0b Binary files /dev/null and b/doc/nrf/app_dev/device_guides/working_with_nrf/nrf54h/images/nrf54h20_suit_recovery_manifest_topology.png differ diff --git a/doc/nrf/app_dev/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_architecture.rst b/doc/nrf/app_dev/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_architecture.rst index c1579082e492..29614e5cb5d2 100644 --- a/doc/nrf/app_dev/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_architecture.rst +++ b/doc/nrf/app_dev/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_architecture.rst @@ -23,3 +23,4 @@ The following pages briefly describe topics like the responsibilities of the cor ug_nrf54h20_architecture_lifecycle ug_nrf54h20_architecture_pm ug_nrf54h20_architecture_clockman + ug_nrf54h20_architecture_reset diff --git a/doc/nrf/app_dev/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_architecture_reset.rst b/doc/nrf/app_dev/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_architecture_reset.rst new file mode 100644 index 000000000000..b930eb04861b --- /dev/null +++ b/doc/nrf/app_dev/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_architecture_reset.rst @@ -0,0 +1,85 @@ +.. _ug_nrf54h20_architecture_reset: + +nRF54H20 reset behavior +####################### + +.. contents:: + :local: + :depth: 2 + +The reset behavior of the nRF54H20 SoC depends on the core that triggers the reset: + ++--------------------------+--------------------------------------------------------------+ +| CPU Triggering Reset | Reset Behavior | ++==========================+==============================================================+ +| Secure Domain | Resets the entire SoC | ++--------------------------+--------------------------------------------------------------+ +| System Controller | Resets the entire SoC | ++--------------------------+--------------------------------------------------------------+ +| Application domain | - Resets all peripherals and VPRs owned by the Application | +| | domain | +| | - Resets the Radio domain | +| | - Resets all peripherals and VPRs owned by the Radio domain | ++--------------------------+--------------------------------------------------------------+ +| Radio domain | - Resets all peripherals and VPRs owned by the Radio domain | +| | - Resets the Application domain | +| | - Resets all peripherals and VPRs owned by the Application | +| | domain | ++--------------------------+--------------------------------------------------------------+ + +nRF Util allows for different types of reset behavior on the various cores of the nRF54H20 SoC, based on the current lifecycle state of the device. + +Reset types in LCS EMPTY +------------------------ + +The following is the reset behavior when the LCS of the nRF54H20 SoC is in the ``EMPTY`` state: + +.. list-table:: Reset behavior based on LCS ``EMPTY`` + :header-rows: 1 + + * - Reset kind in LCS ``EMPTY`` + - Reset behavior + * - ``RESET_SYSTEM`` + - Mapped to the ``SYS_RESET_REQUEST`` bit as described in the ARM specification for the *Application Interrupt and Register Controller*. + This reset triggers a reset of the Secure Domain, which subsequently resets the entire system. + It is available only to the Secure Domain. + * - ``RESET_HARD`` + - Initiates a reset using the CTRL-AP through the On-Board Debugger (OBD). + The register used is ``RESET`` (address offset: ``0x00``). + * - ``RESET_PIN`` + - J-Link toggles the **RESET** pin via OBD. + +Reset types in LCS ROT or DEPLOYED +----------------------------------- + +The following is the reset behavior when the LCS of the nRF54H20 SoC is either in the ``ROT`` or ``DEPLOYED`` state: + +.. list-table:: Reset behavior based on LCS ``ROT`` or ``DEPLOYED`` + :header-rows: 1 + + * - Reset kind in LCS ``ROT`` or ``DEPLOYED`` + - Reset behavior + * - ``RESET_SYSTEM`` + - In the Secure Domain, this reset is mapped to the ``SYS_RESET_REQUEST`` bit, as described in the ARM specification for the *Application Interrupt and Register Controller*. + This reset triggers a reset of the Secure Domain, which subsequently resets the entire system. + + In the local domains, this reset is available only if the other domains have a valid configuration in the ``CPUCONF`` register and their access port is unprotected. + The PC tool uses the CTRL-AP mailbox to send a local domain reset request to the Secure Domain Firmware (SDFW). + * - ``RESET_HARD`` + - Initiates a reset using the CTRL-AP through the On-Board Debugger (OBD). + The register used is ``RESET`` (address offset: ``0x00``). + * - ``RESET_PIN`` + - J-Link toggles the ``RESET`` pin via OBD. + +Reset your device using nRF Util +================================ + +To trigger a specific reset type on your nRF54H20 SoC-based device, use the ``nrfutil device reset`` command:: + + nrfutil device reset --serial-number --reset-kind + +For a detailed list of commands for each reset type, run the following:: + + nrfutil device reset --help + +For more information on ``nrfutil device reset``, see `nRF Util documentation pages `_. diff --git a/doc/nrf/app_dev/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_custom_pcb.rst b/doc/nrf/app_dev/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_custom_pcb.rst index 6fcfce643902..c0afcb1428fe 100644 --- a/doc/nrf/app_dev/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_custom_pcb.rst +++ b/doc/nrf/app_dev/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_custom_pcb.rst @@ -22,7 +22,7 @@ We highly recommend using the PCB layouts and component values provided by Nordi * For optimal performance, the output impedance of the **P6** and **P7** ports should match the PCB and external device pin impedance. * Use one of the following power supply options: - * VDDH higher than 2.2V + * VDDH higher than 2.05V. * VDDH shorted to VDD at 1.8V Prepare the configuration files for your custom board in the |NCS| diff --git a/doc/nrf/app_dev/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_gs.rst b/doc/nrf/app_dev/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_gs.rst index 6b0955f6292c..d29da9935141 100644 --- a/doc/nrf/app_dev/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_gs.rst +++ b/doc/nrf/app_dev/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_gs.rst @@ -34,7 +34,7 @@ On your computer, one of the following operating systems: :start-after: os_table_start :end-before: os_table_end -See :ref:`supported_OS` for more information about the tier definitions. +See :ref:`supported_OS` for more information. |supported OS| @@ -59,11 +59,11 @@ You also need the following: * From the Command Prompt:: - JLink_Windows_V794e_x86_64.exe -InstUSBDriver=1 + JLink_Windows_V794i_x86_64.exe -InstUSBDriver=1 * From PowerShell:: - .\JLink_Windows_V794e_x86_64.exe -InstUSBDriver=1 + .\JLink_Windows_V794i_x86_64.exe -InstUSBDriver=1 #. In the :guilabel:`Choose optional components` window, select :guilabel:`update existing installation`. #. Add the J-Link executable to the system path on Linux and MacOS, or to the environment variables on Windows, to run it from anywhere on the system. diff --git a/doc/nrf/app_dev/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_suit_dfu.rst b/doc/nrf/app_dev/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_suit_dfu.rst index 1e5c6b15036f..1279eeec1f28 100644 --- a/doc/nrf/app_dev/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_suit_dfu.rst +++ b/doc/nrf/app_dev/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_suit_dfu.rst @@ -27,7 +27,9 @@ For a list of available SUIT samples, see the :ref:`suit_samples` page. ug_nrf54h20_suit_customize_qsg.rst ug_nrf54h20_suit_customize_dfu.rst ug_nrf54h20_suit_fetch + ug_nrf54h20_suit_push ug_nrf54h20_suit_external_memory ug_nrf54h20_suit_components ug_nrf54h20_suit_hierarchical_manifests ug_nrf54h20_suit_soc_binaries + ug_nrf54h20_suit_recovery.rst diff --git a/doc/nrf/app_dev/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_suit_external_memory.rst b/doc/nrf/app_dev/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_suit_external_memory.rst index 1420c6b26142..76255941e5e0 100644 --- a/doc/nrf/app_dev/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_suit_external_memory.rst +++ b/doc/nrf/app_dev/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_suit_external_memory.rst @@ -12,8 +12,8 @@ However, the application domain can implement an IPC service, which allows the S This guide explains how to prepare the application domain firmware and the SUIT envelope to perform SUIT firmware upgrade using external memory. .. note:: - The prerequisite to this guide is the :ref:`ug_nrf54h20_suit_fetch` user guide, as this guide assumes that the application uses the fetch model to obtain the candidate images. - See the :ref:`ug_nrf54h20_suit_fetch` for more details on how to migrate from push to fetch model. + To use external memory with SUIT, you can either use the push model-based or the fetch model-based firmware upgrade. + See :ref:`ug_nrf54h20_suit_push` for details about the push model and :ref:`ug_nrf54h20_suit_fetch` for details on how to migrate from the push to fetch model. The following terms are used in this guide: @@ -25,12 +25,10 @@ The following terms are used in this guide: Overview of external memory in SUIT firmware updates **************************************************** -To use external memory with SUIT, the fetch model-based firmware upgrade is required. The SUIT envelope must always be stored in the non-volatile memory in the MCU. The SUIT manifests stored in the envelope contain instructions that the device must perform to fetch other required payloads. To store payloads in the external memory, a Device Firmware Update (DFU) cache partition must be defined in the external memory's devicetree node. -In the SUIT manifest, you can define a component representing the cache partition in the external memory. -Within the ``suit-payload-fetch`` sequence, you can then store fetched payload(s) into a ``CACHE_POOL`` component. +The push model-based update and the fetch model-based update differ in the way the cache partition is filled with the images. When the Secure Domain processes the ``suit-install`` sequence, issuing ``suit-directive-fetch`` on any non-integrated payload will instruct the Secure Domain firmware to search for a given URI in all cache partitions in the system. However, when such a cache partition is located in the external memory, the Secure Domain is unable to access the data directly. @@ -43,13 +41,54 @@ The companion image consists of two main parts: * IPC service exposed towards the Secure Domain When the companion image is booted and a directive that accesses the data on the external memory is issued, such as the ``suit-directive-fetch`` or ``suit-directive-copy`` directives, the Secure Domain firmware uses the IPC service provided by the companion image to access the contents of the external memory. -Beyond the booting of the companion image, the update process does not differ from regular fetch model-based update. +Apart from booting the companion image, the update process does not differ from regular push model-based or fetch model-based updates. + +Difference between push and fetch models +======================================== + +Push model +---------- + +In the push model, the cache partition contents are created on the building machine and pushed to the device without modifications. +The images are extracted to the cache partition files using the :kconfig:option:`CONFIG_SUIT_DFU_CACHE_EXTRACT_IMAGE` Kconfig option. + +No additional sequences are required in the SUIT manifest. + +For more details, see :ref:`ug_nrf54h20_suit_push`. + +Fetch model +----------- + +In the fetch model, the SUIT processor runs on the application core. + +In the SUIT manifest, you can define a component that represents the cache partition in the external memory. +Within the ``suit-payload-fetch`` sequence, you can then store fetched payloads into a ``CACHE_POOL`` component. +The device then pulls the images from external sources and manages their storage in the cache partitions. + +For more details, see :ref:`ug_nrf54h20_suit_fetch`. Enabling external flash support in SUIT DFU ******************************************* -The :ref:`nrf54h_suit_sample` sample contains a premade configuration enabling the external memory in SUIT DFU. -To enable the external memory, you must add the ``-DFILE_SUFFIX="extflash"`` argument to the build, or complete the following steps: +The :ref:`nrf54h_suit_sample` sample contains several example configurations that enable the external memory for SUIT DFU. + +The configurations using the push model are the following: + +* ``sample.suit.smp_transfer.cache_push.extflash`` +* ``sample.suit.smp_transfer.cache_push.extflash.bt`` + +The configurations using the fetch model are following: + +* ``sample.suit.smp_transfer.full_processing.extflash`` +* ``sample.suit.smp_transfer.full_processing.extflash.bt`` + +You can find these configurations defined in the :file:`samples/suit/smp_transfer/sample.yaml` file. +This file specifies which options need to be enabled. + +Alternatively, you can follow the following steps to manually enable external memory in SUIT DFU. + +Common steps for both push and fetch models +=========================================== 1. Turn on the external flash chip on the nRF54H20 DK using the `nRF Connect Board Configurator`_ app within `nRF Connect for Desktop`_ . @@ -59,8 +98,6 @@ To enable the external memory, you must add the ``-DFILE_SUFFIX="extflash"`` arg #. Enable the ``SB_CONFIG_SUIT_BUILD_FLASH_COMPANION`` sysbuild Kconfig option, which enables the build of the reference companion image. See the :ref:`suit_flash_companion` user guide for instructions on how to configure the companion image using sysbuild. -#. Enable the :kconfig:option:`CONFIG_SUIT_STREAM_SOURCE_FLASH` Kconfig option, which enables SUIT processor on the application core to read and parse DFU cache partitions. - #. Define a new DFU cache partition in the external memory in the DTS file: .. code-block:: devicetree @@ -86,18 +123,7 @@ To enable the external memory, you must add the ``-DFILE_SUFFIX="extflash"`` arg #. Modify the application manifest file :file:`app_envelope.yaml.jinja2` by completing the following steps: - a. Modify the ``CACHE_POOL`` identifier in the SUIT manifest: - - .. code-block:: yaml - - suit-components: - ... - - - CACHE_POOL - - 1 - - The ``CACHE_POOL`` identifier must match the identifier of the cache partition defined in the DTS file. - - #. Append the ``MEM`` type component that represents the companion image in the same SUIT manifest file: + a. Append the ``MEM`` type component that represents the companion image in the same SUIT manifest file: .. code-block:: yaml @@ -111,7 +137,7 @@ To enable the external memory, you must add the ``-DFILE_SUFFIX="extflash"`` arg In this example, the component index is ``3``. In the following steps, the companion image component is selected with ``suit-directive-set-component-index: 3``. - #. Modify the ``suit-install`` sequence to boot the companion image before accessing the candidate images, which are stored in the external memory: + #. Modify the ``suit-install`` sequence in the application manifest file (:file:`app_envelope.yaml.jinja2`) to boot the companion image before accessing the candidate images stored in the external memory: .. code-block:: yaml @@ -122,12 +148,63 @@ To enable the external memory, you must add the ``-DFILE_SUFFIX="extflash"`` arg The companion image can be optionally upgraded and have its integrity checked. -#. |open_terminal_window_with_environment| +Steps specific for the push model +================================= + +1. Enable the :kconfig:option:`CONFIG_SUIT_DFU_CANDIDATE_PROCESSING_PUSH_TO_CACHE` option to allow the application core to modify cache partitions. + +#. Enable the :kconfig:option:`CONFIG_SUIT_DFU_CACHE_EXTRACT_IMAGE` Kconfig option for every image that needs to be updated from external memory. + +#. Modify the manifest files for all domains by completing the following steps: + + a. Ensure that the URI used by the ``suit-payload-fetch`` sequence to fetch a given image matches the :kconfig:option:`CONFIG_SUIT_DFU_CACHE_EXTRACT_IMAGE_URI` Kconfig option. + + #. Ensure that the envelope integrates the specified image within the envelope integrated payloads section. + This is ensured by default if you use the provided SUIT envelope templates. + +Steps specific for the fetch model +================================== + +1. Enable the :kconfig:option:`CONFIG_SUIT_DFU_CANDIDATE_PROCESSING_FULL` Kconfig option to allow the application core to process SUIT manifests. + +#. Enable the :kconfig:option:`CONFIG_SUIT_STREAM_SOURCE_FLASH` Kconfig option, which allows the SUIT processor on the application core to read and parse DFU cache partitions. + +#. Modify the application manifest file :file:`app_envelope.yaml.jinja2` by completing the following steps: + + a. Modify the ``CACHE_POOL`` identifier in the SUIT manifest: + + .. code-block:: yaml + + suit-components: + ... + - - CACHE_POOL + - 1 + + The ``CACHE_POOL`` identifier must match the identifier of the cache partition defined in the DTS file. + + #. Add the ``suit-payload-fetch`` sequence: + + .. code-block:: yaml + + suit-payload-fetch: + - suit-directive-set-component-index: 2 + - suit-directive-override-parameters: + suit-parameter-uri: 'file://{{ app['binary'] }}' + - suit-directive-fetch: + - suit-send-record-failure + + This snippet assumes that ``CACHE_POOL`` is the third component on the manifest's components list (so its component index is 2) + +Testing the application with external flash support +=================================================== + +1. |open_terminal_window_with_environment| + #. Build and flash the application by completing the following commands: .. code-block:: console - west build -b nrf54h20dk/nrf54h20/cpuapp + west build ./ -b nrf54h20dk/nrf54h20/cpuapp -T west flash The build system will automatically use :ref:`configuration_system_overview_sysbuild` and generate a :file:`build/zephyr/dfu_suit.zip` archive, which contains the SUIT envelope and candidate images. diff --git a/doc/nrf/app_dev/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_suit_push.rst b/doc/nrf/app_dev/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_suit_push.rst new file mode 100644 index 000000000000..4ccbc9f4993a --- /dev/null +++ b/doc/nrf/app_dev/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_suit_push.rst @@ -0,0 +1,108 @@ +.. _ug_nrf54h20_suit_push: + +How to push SUIT payloads to multiple partitions +################################################ + +.. contents:: + :local: + :depth: 2 + +In the Software Updates for Internet of Things (SUIT), you can push certain payloads separately from the SUIT envelope. +The envelope can find them in the device and use them as part of the firmware upgrade process. + +In Nordic Semiconductor's implementation, this functionality is provided by a mechanism called *DFU cache partitions*. + +This guide explains how DFU cache partitions work, and how to configure the build system and SUIT manifests to use them for pushing detached payloads. + + +Reasons to push images separately from the SUIT envelope +******************************************************** + +Pushing images separately from the SUIT envelope can be useful in the following scenarios: + +* Pushing parts of an image to external memory. +* Storing portions of the update package in non-contiguous memory areas, separated by other data. +* Reducing the amount of data that needs to be resent after a communication failure, allowing the update to continue. +* Sending different parts of the image through multiple communication channels. + +DFU Cache Partitions +******************** + +The payloads pushed to the device must be placed in so called “DFU cache partitions”, numbered 0..n. +The DFU cache partitions hold data using a CBOR map format, where the keys are URI strings and the values are binary images. + +When the Secure Domain processes the manifest and encounters a ``suit-directive-fetch`` directive it first checks if a given URI is present in its ``suit-integrated-payloads`` section. +If it is not, it goes through all the DFU cache partitions defined in the device. +If the given URI is found as a map key, the binary data stored in the value field corresponding to that URI is fetched. + +The DFU cache partition 0 is always present in the device. +It takes all of the remaining space from the ``dfu_partition`` that is not occupied by the envelope. +This partition has a limitation: +it can only be used after storing the SUIT envelope. + +The DFU cache partitions from ``1`` to ``n`` are defined in the devicetree, by using the ``dfu_cache_partition_x`` node name, where x is the partition number. +The partitions can be placed both in the internal MRAM as well as in the external flash. + +Extracting images +***************** + +The :ref:`nrf54h_suit_sample` sample uses the SMP protocol for uploading new envelopes and is by default configured to use the push model for firmware upgrades. +To reconfigure the sample to allow for pushing images into DFU cache partitions, complete the following steps: + +1. Enable the :kconfig:option:`CONFIG_SUIT_DFU_CANDIDATE_PROCESSING_PUSH_TO_CACHE` Kconfig option. + This enables the writing to the DFU cache partitions. + Alternatively, you can enable the :kconfig:option:`CONFIG_SUIT_DFU_CANDIDATE_PROCESSING_FULL` option to enable the SUIT envelope processing in the application firmware. + This will enable a superset of options enabled by :kconfig:option:`CONFIG_SUIT_DFU_CANDIDATE_PROCESSING_PUSH_TO_CACHE`, but will occupy more space in both MRAM and RAM memories. + +#. If you intend to use any other cache partition than 0, add the DFU cache partition in the appropriate memory area in the device tree overlay: + + .. code-block:: dts + + dfu_cache_partition_N: partition@a000 { + reg = <0xa000 DT_SIZE_K(1024)>; + }; + + Replace ``N`` with the partition number, ``a000`` with the proper offset inside the memory area, and ``1024`` with the proper size of the cache partition. + + For example, you could add the cache partition 1 with the size of 1024 kilobytes in the external flash at an offset of 0 by adding: + + .. code-block:: dts + + &mx25uw63 { + status = "okay"; + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + dfu_cache_partition_1: partition@0 { + reg = <0x0 DT_SIZE_K(1024)>; + }; + }; + }; + +#. For each image that you want to push separately to the device, do the following: + + * Enable the :kconfig:option:`CONFIG_SUIT_DFU_CACHE_EXTRACT_IMAGE` Kconfig option. + * Optionally, modify :kconfig:option:`CONFIG_SUIT_DFU_CACHE_EXTRACT_IMAGE_PARTITION` to select the partition where the image will be pushed (default is partition 1). + * Optionally, modify the :kconfig:option:`CONFIG_SUIT_DFU_CACHE_EXTRACT_IMAGE_URI` to modify the URI used as key for the given image in the DFU cache. + +#. Ensure that the URI used by the ``suit-payload-fetch`` sequence to fetch a given image matches the :kconfig:option:`CONFIG_SUIT_DFU_CACHE_EXTRACT_IMAGE_URI` Kconfig option. + This is done by default when using the manifest templates provided by Nordic Semiconductor. + For the application image URI, you can do that as follows (assuming the target name ``application`` for the image): + + .. code-block:: yaml + + - suit-directive-override-parameters: + suit-parameter-uri: '{{ application['config']['CONFIG_SUIT_DFU_CACHE_EXTRACT_IMAGE_URI'] }}' + - suit-directive-fetch: + - suit-send-record-failure + +#. Ensure that the envelope does not integrate the given image inside the envelope integrated payloads section. + This is ensured by default when using the provided default SUIT envelope templates. + + +Pushing the images to device +**************************** + +See the :ref:`SUIT SMP Sample documentation ` for an example of how to push an image to a device. diff --git a/doc/nrf/app_dev/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_suit_recovery.rst b/doc/nrf/app_dev/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_suit_recovery.rst new file mode 100644 index 000000000000..0df8acd51bee --- /dev/null +++ b/doc/nrf/app_dev/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_suit_recovery.rst @@ -0,0 +1,238 @@ +.. _ug_nrf54h20_suit_recovery: + +Configuring and programming the SUIT manufacturer application recovery firmware +############################################################################### + +.. contents:: + :local: + :depth: 2 + +During the device lifetime, the device can encounter various issues that lead to boot failure. +In such cases, the device must have a mechanism to recover from the failure and continue operating. + +In SUIT, this requirement is addressed by running a specially prepared recovery firmware. +While the recovery firmware requires some additional space on the device, it is a highly recommended feature for all devices utilizing SUIT. + +This document describes scenarios in which an nRF54H20 device using SUIT can enter recovery mode, as well as the recovery process. + +Entering recovery mode +********************** + +When booting the device, the Secure Domain verifies the currently installed manifests and firmware images. +If the verification fails, the device enters recovery mode. +The reasons for validation failure can include, but are not limited to, the following: + +* An invalid manifest signature. +* A mismatch between the digest of the installed firmware image and the digest in the manifest. +* The manifest attempting to perform unauthorized operations. + +These issues can occur in the following scenarios: + +* Tampering by an attacker. +* Bitflips in the MRAM memory caused by radiation or other external conditions. +* Hardware failures in advanced cases where an in-place update is performed, resulting in a partially overwritten firmware image. +* An incorrectly constructed manifest, leading to a successful update but a failure during boot. + +.. caution:: + The last case must never occur in a production environment, but it is possible during development. + The manufacturer must always ensure that the manifest is correctly constructed and that all images managed by SUIT are compatible with each other after the update. + If any bugs are overlooked during the development phase, this could result in inconsistencies in the firmware. + +Recovery Mode and Recovery Manifests +************************************************* + +The recovery manifests form a separate hierarchy from the normal manifests. +In this hierarchy, the application recovery (``APP_RECOVERY``) manifest is responsible for managing both the application core image and other manifests, such as the radio recovery manifest. + +The following image shows the recovery manifest topology for the nRF54H20 SoC: + +.. figure:: images/nrf54h20_suit_recovery_manifest_topology.png + :alt: Recovery manifest topology for the nRF54H20 SoC + +If a failure during a boot process occurred, the Secure Domain sets the recovery flag and reboots the device. +Upon each boot the Secure Domain checks if the recovery flag is set. +If it is set, the device enters recovery mode. +If it isn't booting proceeds normally by running the root manifest. + +After entering the recovery mode it is verified if MPI configuration for the APP_RECOVERY is present. +If it is, the APP_RECOVERY manifest is processed. +It no MPI configuration is found the Secure Domain performs an attempt to process the normal manufacturer root manifest. +This is needed, as the device might enter recovery mode if it is empty. +The recovery flag is not cleared after flashing the firmware, but the device should proceed as if it would boot normally. + +This flow is shown in the following diagram: + +.. figure:: images/nrf54h20_suit_recovery_boot_path .png + :alt: Booting in recovery mode + +The role of the recovery application is to perform an update of the main application firmware, which does not differ from the normal SUIT update process. +As soon as the update finishes successfully, the recovery flag is cleared and the device proceeds with normal operation. + +.. note:: + The recovery application itself can only be updated from the main application - not when running the recovery application. + +.. _ug_nrf54h20_suit_recovery_default_fw: + +Using the default recovery firmware +*********************************** + +Nordic provides a default recovery firmware that can be used in the recovery process. +This firmware uses Bluetooth LE and SMP as a transport. +It is optimized for memory usage, currently using around 164 kB of MRAM (72 kB of application core and 92 kB radio core). + +.. caution:: + The default recovery firmware does not support :ref:`updating from external flash memory `. + This also means that the recovery firmware is not compatible with a main application that uses external flash for updates. + +To use the firmware: + +1. Create :file:`recovery.overlay` and :file:`recovery_hci_ipc.ovelay` files in the main application's :ref:`configuration_system_overview_sysbuild` directory. + These files must define the ``cpuapp_recovery_partition`` and ``cpurad_recovery_partition`` nodes respectively. + These partitions specify where the images for the recovery firmware are stored and cannot overlap with the main application partitions. + For reference, see the files in the :ref:`SUIT DFU on the nRF54H20 SoC ` sample located in :file:`samples/suit/smp_transfer`. + +#. Set the :kconfig:option:`SB_CONFIG_SUIT_BUILD_RECOVERY` sysbuild configuration option in the main application. + This will cause the recovery firmware to be built automatically as part of the main application build. + +#. :ref:`Program the main application firmware to the device `. +This will automatically program both the main application and the recovery firmware to the device. + +#. To update the recovery firmware perform an update in the same way as described in :ref:`nrf54h_suit_sample`, however using the recovery firmware envelope. + The envelopes needed for the update are located in the build directory of the main application, by default found in :file:`build/DFU/app_recovery.suit` and :file:`build/DFU/rad_recovery.suit`. + +Further information about the default recovery firmware can be found in :ref:`suit_recovery`. +The code for the default recovery firmware can be found in the :file:`samples/suit/recovery` directory. + +.. _ug_nrf54h20_suit_recovery_update_fw: + +Updating the recovery firmware +****************************** + +To update the recovery firmware you can either use: + +* The APP_RECOVERY envelope, found in :file:`/build/DFU/app_recovery.suit` +* The zip file, found in :file:`/build/zephyr/dfu_suit_recovery.zip`` + +These can be used to update the recovery application the same as :file:`root.suit` or :file:`dfu_suit.zip` are used to update the main application - see :ref:`nrf54h_suit_sample` as an example. + +.. note:: + The recovery application can only be updated from the main application - not when running the recovery application itself. + +.. _ug_nrf54h20_suit_recovery_create_images: + +Creating custom recovery images +******************************* + +To turn an application into a recovery application, the following steps have to be performed: + +1. For each of the images defined by the custom recovery application, ensure the following configuration is present: + + * :kconfig:option:`CONFIG_SUIT_RECOVERY` set to ``y`` + * :kconfig:option:`CONFIG_SUIT_MPI_GENERATE` set to ``n`` + * :kconfig:option:`CONFIG_SUIT_ENVELOPE_OUTPUT_MPI_MERGE` set to ``n`` + * :kconfig:option:`CONFIG_NRF_REGTOOL_GENERATE_UICR` set to ``n`` + * :kconfig:option:`CONFIG_NRF_REGTOOL_GENERATE_BICR` set to ``n`` + + To do that you can simply paste the following code snippet into your configuration files: + + .. code-block:: cfg + + CONFIG_SUIT_RECOVERY=y + CONFIG_SUIT_MPI_GENERATE=n + CONFIG_SUIT_ENVELOPE_OUTPUT_MPI_MERGE=n + CONFIG_NRF_REGTOOL_GENERATE_UICR=n + CONFIG_NRF_REGTOOL_GENERATE_BICR=n + +#. Create the overlay files to be used by the recovery application. + In this guide it is assumed that for the application core they are placed in the custom recovery application directory in the :file:`boards/nrf54h20dk_nrf54h20_cpuapp.overlay` file. + + The application core recovery image overlay should contain the following code: + + .. code-block:: dts + + / { + chosen { + zephyr,code-partition = &cpuapp_recovery_partition; + nrf,tz-secure-image = &cpuapp_recovery_partition; + }; + }; + + &cpusec_cpuapp_ipc { + status = "okay"; + }; + + &cpusec_bellboard { + status = "okay"; + }; + + Optionally, if using the radio core recovery image, the radio core recovery image overlay should contain the following code: + + .. code-block:: dts + + / { + chosen { + zephyr,code-partition = &cpurad_recovery_partition; + nrf,tz-secure-image = &cpurad_recovery_partition; + }; + }; + +#. Add :file:`sysbuild.cmake` to the custom recovery application directory. + In this file add the following code: + + .. code-block:: cmake + + add_overlay_dts(recovery ${CMAKE_CURRENT_LIST_DIR}/boards/nrf54h20dk_nrf54h20_cpuapp.overlay) + + This will ensure that when building from the main application directory the overlay file is attached to and not overwritten by the configuration coming from the main application. + +#. If you want to add additional images to the recovery image, you can add it with code similar to the one from the default recovery firmware image: + + .. code-block:: cmake + + ExternalZephyrProject_Add( + APPLICATION recovery_hci_ipc + SOURCE_DIR "${ZEPHYR_BASE}/samples/bluetooth/hci_ipc" + BOARD ${BOARD}/${SB_CONFIG_SOC}/${SB_CONFIG_NETCORE_REMOTE_BOARD_TARGET_CPUCLUSTER} + BOARD_REVISION ${BOARD_REVISION} + ) + + add_overlay_config(recovery_hci_ipc ${CMAKE_CURRENT_LIST_DIR}/sysbuild/hci_ipc.conf) + add_overlay_dts(recovery_hci_ipc ${CMAKE_CURRENT_LIST_DIR}/sysbuild/hci_ipc.overlay) + + Replace recovery_hci_ipc, hci_ipc and ``SOURCE_DIR`` with the appropriate values for your application. + + +#. Optionally - you can modify the recovery manifest templates. + The manifest template defined by the ``CONFIG_SUIT_ENVELOPE_TEMPLATE_FILENAME`` is first searched for in :file:`suit/` in the main application directory. + If it is not found, :file:`suit/` in the recovery app is checked. + If the manifest template is still not found, the default template directory in NCS is checked (:file:`config/suit/templates`). + +#. Extend the ``SUIT_RECOVERY_APPLICATION`` choice with an option for attaching the custom recovery application. + Then, make the ``SB_CONFIG_SUIT_RECOVERY_APPLICATION_PATH`` point to the custom application path. + This is done by adding the following code to a sysbuild Kconfig file visible by the build system - this can be the :file:`Kconfig.sysbuild` file in the main application directory: + + .. code-block:: kconfig + + if SUIT_BUILD_RECOVERY + + choice SUIT_RECOVERY_APPLICATION + prompt "Select SUIT recovery application" + + config SUIT_RECOVERY_APPLICATION_CUSTOM + bool "Use the custom recovery application" + + endchoice + + config SUIT_RECOVERY_APPLICATION_PATH + string + default "" if SUIT_RECOVERY_APPLICATION_CUSTOM + + endif # SUIT_BUILD_RECOVERY + +.. note:: + ``SUIT_RECOVERY_APPLICATION_CUSTOM`` can be changed to any name that is appropriate for the given application. + +.. note:: + The value of ``SUIT_RECOVERY_APPLICATION_PATH`` can contain variables like ``${ZEPHYR_NRF_MODULE_DIR}`` + +#. When building the main application, set ``SB_CONFIG_SUIT_RECOVERY_APPLICATION_CUSTOM`` (or the Kconfig option name if a different one was chosen) to ``y``. diff --git a/doc/nrf/gsg_guides.rst b/doc/nrf/gsg_guides.rst index 1d872bfcd770..a9273b0acb60 100644 --- a/doc/nrf/gsg_guides.rst +++ b/doc/nrf/gsg_guides.rst @@ -1,24 +1,52 @@ .. _gsg_guides: +.. _ug_nrf52_gs: +.. _ug_nrf5340_gs: -Getting started guides -###################### +Quick Start +########### -Use the guides in this section to familiarize yourself with the |NCS| tools and components for some of the devices supported by the SDK. +.. quick_start_table_start -.. important:: - For the full list of devices supported in the |NCS|, see the :ref:`board support pages `. - -These guides do not require installing the |NCS|. -They provide a guided experience using Nordic Semiconductor tools and precompiled binaries. +Use the `Quick Start`_ app, available from `nRF Connect for Desktop`_, to familiarize yourself with the |NCS| tools and components for some of the devices supported by the |NCS|. +The application uses Nordic Semiconductor tools and precompiled binaries and does not require installing the |NCS|. -This is not a comprehensive section that includes all of the available getting started guides for Nordic Semiconductor devices. - -.. note:: - * To get started with the nRF91x1 DKs and the nRF54L15 PDK, complete the steps in the `Quick Start`_ app, available from `nRF Connect for Desktop`_. - * To get started with the nRF54H20 DK, the installation of the |NCS| is required. - See :ref:`ug_nrf54h20_gs`. - * To get started with the nPM1300 EK, see the `Get started `_ section of the nPM1300 EK product page. - * To get started with the nRF7002 EB, see the `Get started `_ section of the nRF7002 EB product page. +.. important:: + The following table does not list all devices supported in the |NCS|. + For the full list, see the :ref:`board support pages `. + ++----------------------+----------------------------------------------------------------+--------------------------------+ +| Device | Getting started method | Device user guide | ++======================+================================================================+================================+ +| nRF9161 DK | | `nRF9161 DK Hardware`_ | ++----------------------+ +--------------------------------+ +| nRF9160 DK | | `nRF9160 DK Hardware`_ | ++----------------------+ +--------------------------------+ +| nRF9151 DK | | `nRF9151 DK Hardware`_ | ++----------------------+ +--------------------------------+ +| nRF54L15 DK | `Quick Start`_ app | *Not yet available* | ++----------------------+ +--------------------------------+ +| nRF5340 DK | | `nRF5340 DK User Guide`_ | ++----------------------+ +--------------------------------+ +| nRF52840 DK | | `nRF52840 DK User Guide`_ | ++----------------------+ +--------------------------------+ +| nRF52833 DK | | `nRF52833 DK User Guide`_ | ++----------------------+ +--------------------------------+ +| nRF52 DK | | `nRF52 DK User Guide`_ | ++----------------------+----------------------------------------------------------------+--------------------------------+ +| nRF54H20 DK | :ref:`ug_nrf54h20_gs` - *Quick Start support coming soon* | *Not yet available* | ++----------------------+----------------------------------------------------------------+--------------------------------+ +| nRF7002 DK | :ref:`ug_nrf7002_gs` | `nRF7002 DK Hardware`_ | ++----------------------+----------------------------------------------------------------+--------------------------------+ +| nRF7002 EB | `Get started `_ on the product page | `nRF7002 EB User Guide`_ | ++----------------------+----------------------------------------------------------------+--------------------------------+ +| Thingy:91 | :ref:`ug_thingy91_gsg` | `Nordic Thingy:91 User Guide`_ | ++----------------------+----------------------------------------------------------------+--------------------------------+ +| Thingy:53 | :ref:`ug_thingy53_gs` | `Nordic Thingy:53 Hardware`_ | ++----------------------+----------------------------------------------------------------+--------------------------------+ +| nPM1300 EK | `Get started `_ on the product page | `nPM1300 EK User Guide`_ | ++----------------------+----------------------------------------------------------------+--------------------------------+ + +.. quick_start_table_end .. toctree:: :maxdepth: 1 @@ -27,7 +55,5 @@ This is not a comprehensive section that includes all of the available getting s gsg_guides/nrf9160_gs gsg_guides/thingy91_gsg gsg_guides/nrf7002_gs - gsg_guides/nrf5340_gs gsg_guides/thingy53_gs - gsg_guides/nrf52_gs gsg_guides/gsg_other diff --git a/doc/nrf/gsg_guides/gsg_other.rst b/doc/nrf/gsg_guides/gsg_other.rst index 2ce87e1615ee..facf8463b16e 100644 --- a/doc/nrf/gsg_guides/gsg_other.rst +++ b/doc/nrf/gsg_guides/gsg_other.rst @@ -1,11 +1,9 @@ .. _gsg_other: + Getting started with other DKs ############################## -Use the following guides to familiarize yourself with the |NCS| tools and components for the following devices supported by the SDK: - - * To get started with the nRF91x1 DKs and the nRF54L15 PDK, complete the steps in the `Quick Start`_ app, available from `nRF Connect for Desktop`_. - * To get started with the nRF54H20 DK, see :ref:`ug_nrf54h20_gs`. - * To get started with the nPM1300 EK, see the `Get started `_ section of the nPM1300 EK product page. - * To get started with the nRF7002 EB, see the `Get started `_ section of the nRF7002 EB product page. +.. include:: ../gsg_guides.rst + :start-after: quick_start_table_start + :end-before: quick_start_table_end diff --git a/doc/nrf/gsg_guides/images/nrf52_connect_client_ios.png b/doc/nrf/gsg_guides/images/nrf52_connect_client_ios.png deleted file mode 100644 index 4c597a489b62..000000000000 Binary files a/doc/nrf/gsg_guides/images/nrf52_connect_client_ios.png and /dev/null differ diff --git a/doc/nrf/gsg_guides/images/nrf52_connect_log.png b/doc/nrf/gsg_guides/images/nrf52_connect_log.png deleted file mode 100644 index c7c16f9a2c10..000000000000 Binary files a/doc/nrf/gsg_guides/images/nrf52_connect_log.png and /dev/null differ diff --git a/doc/nrf/gsg_guides/images/nrf52_connect_log_ios.png b/doc/nrf/gsg_guides/images/nrf52_connect_log_ios.png deleted file mode 100644 index c22cca22228a..000000000000 Binary files a/doc/nrf/gsg_guides/images/nrf52_connect_log_ios.png and /dev/null differ diff --git a/doc/nrf/gsg_guides/images/nrf52_connect_write_ios.png b/doc/nrf/gsg_guides/images/nrf52_connect_write_ios.png deleted file mode 100644 index 67f804c421d0..000000000000 Binary files a/doc/nrf/gsg_guides/images/nrf52_connect_write_ios.png and /dev/null differ diff --git a/doc/nrf/gsg_guides/images/nrf52_enable_cccds.png b/doc/nrf/gsg_guides/images/nrf52_enable_cccds.png deleted file mode 100644 index edcd9525c93b..000000000000 Binary files a/doc/nrf/gsg_guides/images/nrf52_enable_cccds.png and /dev/null differ diff --git a/doc/nrf/gsg_guides/nrf52_gs.rst b/doc/nrf/gsg_guides/nrf52_gs.rst deleted file mode 100644 index a15ddfe035e6..000000000000 --- a/doc/nrf/gsg_guides/nrf52_gs.rst +++ /dev/null @@ -1,236 +0,0 @@ -.. _ug_nrf52_gs: - -Getting started with nRF52 Series -################################# - -.. contents:: - :local: - :depth: 2 - -This guide lets you evaluate the |NCS|'s support for nRF52 Series :term:`Development Kit (DK)` without the need of installing the SDK. -It tells you how to install the :ref:`peripheral_uart` sample and perform a quick test of your DK. - -If you want to go through an online training course to familiarize yourself with Bluetooth Low Energy and the development of Bluetooth LE applications, enroll in the `Bluetooth LE Fundamentals course`_ in the `Nordic Developer Academy`_. - -.. _nrf52_gs_requirements: - -Minimum requirements -******************** - -Make sure you have all the required hardware and that your computer and mobile device both have one of the supported operating systems. - -Hardware -======== - -* One of the following nRF52 Series development kits: - - * nRF52840 DK - * nRF52833 DK - * nRF52 DK - -* Micro-USB 2.0 cable - -Software -======== - -On your computer, one of the following operating systems: - -* Microsoft Windows -* macOS -* Ubuntu Linux - -|Supported OS| - -On your mobile device, one of the following operating systems: - -* Android -* iOS - -.. _nrf52_gs_installing_software: - -Installing the required software -******************************** - -On your computer, install `nRF Connect for Desktop`_. -After installing and starting the application, install the Programmer app. - -You must also install a terminal emulator, such as `nRF Connect Serial Terminal`_, the nRF Terminal (part of the `nRF Connect for Visual Studio Code`_ extension), or PuTTY. -nRF Connect Serial Terminal is the recommended method for :ref:`nrf52_gs_connecting`. - -On your mobile device, install the `nRF Connect for Mobile`_ application from the corresponding application store. - -.. _nrf52_gs_installing_sample: -.. _nrf52_gs_installing_application: - -Installing the sample -********************* - -You must program and run a precompiled version of the :ref:`peripheral_uart` sample on your development kit to test the functions. - -Download the precompiled version of the sample for your DK from the corresponding download page: - -* `nRF52840 DK Downloads`_ -* `nRF52833 DK Downloads`_ -* `nRF52 DK Downloads`_ - -After downloading the zip archive, extract it to a folder of your choice. -The archive contains the HEX file used to program the sample to your DK. - -.. |DK| replace:: nRF52 Series DK - -.. program_dk_sample_start - -To program the precompiled sample to your development kit, complete the following steps: - -1. Open the Programmer app. -#. Connect the |DK| to the computer with a micro-USB cable and turn on the DK. - - **LED1** starts blinking. - -#. Click **SELECT DEVICE** and select the DK from the drop-down list. - - .. figure:: images/programmer_select_device1.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 **Auto read memory** option is selected in the **DEVICE** 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 **Browse**. -#. Navigate to where you extracted the HEX file and select it. -#. 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. - -.. note:: - If you experience any problems during the process, press ``Ctrl+R`` (``command+R`` on macOS) to restart the Programmer app, and try again. - -.. program_dk_sample_end - -After you have programmed the sample to the DK, you can connect to it using a terminal emulator and test the functions. - -.. _nrf52_gs_connecting: - -Connecting to the sample -************************ - -.. uart_dk_connect_start - -You can connect to the sample on the |DK| with a terminal emulator on your computer using :term:`Universal Asynchronous Receiver/Transmitter (UART)`. -This allows you to see the logging information the sample outputs as well as to enter console inputs. - -You can use an external UART to USB bridge. -UART communication through the UART to USB CDC ACM bridge is referred to as CDC-UART. -This is different from communication through the Nordic UART Service (NUS) over Bluetooth® Low Energy (LE). - -If you have problems connecting to the sample, restart the DK and start over. - -To connect using CDC-UART, complete the steps listed on the :ref:`test_and_optimize` page for the chosen terminal emulator. - -.. uart_dk_connect_end - -Once the connection has been established, continue to :ref:`nrf52_gs_testing`. - -.. _nrf52_gs_testing: - -Testing the sample -****************** - -You can test the :ref:`peripheral_uart` sample on your DK using the `nRF Connect for Mobile`_ application. -The test requires that you have :ref:`connected to the sample ` and have the connected terminal emulator open. - -.. testing_dk_start - -To perform tests, complete the following steps: - -.. tabs:: - - .. group-tab:: Android - - 1. Make sure the |DK| is connected to the computer with a micro-USB cable and has been turned on (**LED1** is blinking). - #. Open the nRF Connect for Mobile application on your Android device. - #. In nRF Connect for Mobile, tap :guilabel:`Scan`. - #. Find the DK in the list, select it and tap :guilabel:`Connect`. - - The default device name for the Peripheral UART sample is **Nordic_UART_Service**. - - #. When connected, tap the three-dot menu below the device name, and select **Enable CCCDs**. - - This example communicates over Bluetooth Low Energy using the Nordic UART Service (NUS). - - .. figure:: images/nrf52_enable_cccds.png - :alt: nRF Connect for Mobile - Enable services option - - nRF Connect for Mobile - Enable services option - - #. Tap the three-dot menu next to **Disconnect** and select **Show log**. - #. On your computer, in the terminal emulator connected to the sample through CDC-UART, type ``hello`` and send it to the DK. - - The text is sent through the |DK| to your mobile device over a Bluetooth LE link. - The device displays the text in the nRF Connect for Mobile log: - - .. figure:: images/nrf52_connect_log.png - :alt: nRF Connect for Mobile - Text shown in the log - - nRF Connect for Mobile - Text shown in the log - - .. group-tab:: iOS - - 1. Make sure the |DK| is connected to the computer with a micro-USB cable and has been turned on (**LED1** is blinking). - #. Open the nRF Connect for Mobile application on your iOS device. - #. If the application does not automatically start scanning, tap the **Play** icon in the upper right corner. - #. Find the DK in the list and tap the corresponding :guilabel:`Connect` button. - The default device name for the Peripheral UART sample is **Nordic_UART_Service**. - - This opens a new window with information on the device. - - #. In the new window, select the **Client** tab and scroll to the bottom so you can see the **Client Characteristic Configuration** entry. - - .. figure:: images/nrf52_connect_client_ios.png - :alt: nRF Connect for Mobile - Client tab - - nRF Connect for Mobile - Client tab - - #. Tap the up arrow button under **Client Characteristic Configuration** to write a value to the sample. - - The **Write Value** window opens. - - #. In this window, select the **Bool** tab and set the toggle to **True**. - - This enables messages sent to the DK to show up in nRF Connect for Mobile. - - .. figure:: images/nrf52_connect_write_ios.png - :alt: nRF Connect for Mobile - Write Value window - - nRF Connect for Mobile - Write Value window - - #. Tap **Write** to write the command to the DK. - - The **Write Value** window closes. - - #. Select the **Log** tab. - #. On your computer, in the terminal emulator connected to the sample through CDC-UART, type ``hello`` and send it to the DK. - - The text is sent through the |DK| to your mobile device over a Bluetooth LE link. - The device displays the text in the nRF Connect for Mobile log: - - .. figure:: images/nrf52_connect_log_ios.png - :alt: nRF Connect for Mobile - Text shown in the log - - nRF Connect for Mobile - Text shown in the log - -.. testing_dk_end - -If you have a dongle or a second Nordic Semiconductor DK, you can test the sample :ref:`using a computer ` instead of using this process. - -Next steps -********** - -You have now completed getting started with the nRF52 Series DK. -See the following links for where to go next: - -* :ref:`installation` and :ref:`configuration_and_build` documentation to install the |NCS| and learn more about its development environment. -* :ref:`ug_nrf52` documentation for more advanced topics related to the nRF52 Series. diff --git a/doc/nrf/gsg_guides/nrf5340_gs.rst b/doc/nrf/gsg_guides/nrf5340_gs.rst deleted file mode 100644 index fb34aa9a3856..000000000000 --- a/doc/nrf/gsg_guides/nrf5340_gs.rst +++ /dev/null @@ -1,106 +0,0 @@ -.. _ug_nrf5340_gs: - -Getting started with nRF5340 DK -############################### - -.. contents:: - :local: - :depth: 2 - -This guide lets you evaluate the |NCS|'s support for nRF5340 :term:`Development Kit (DK)` without the need of installing the SDK. -It tells you how to install the :ref:`peripheral_uart` sample and perform a quick test of your DK. - -If you want to go through an online training course to familiarize yourself with Bluetooth Low Energy and the development of Bluetooth LE applications, enroll in the `Bluetooth LE Fundamentals course`_ in the `Nordic Developer Academy`_. - -.. _nrf5340_gs_requirements: - -Minimum requirements -******************** - -Make sure you have all the required hardware and that your computer has one of the supported operating systems. - -Hardware -======== - -* nRF5340 DK -* Micro-USB 2.0 cable - -Software -======== - -On your computer, one of the following operating systems: - -* Microsoft Windows -* macOS -* Ubuntu Linux - -|Supported OS| - -On your mobile device: - -* Android -* iOS - -.. _nrf5340_gs_installing_software: - -Installing the required software -******************************** - -On your computer, install `nRF Connect for Desktop`_. -After installing and starting the application, install the Programmer app. - -You must also install a terminal emulator, such as `nRF Connect Serial Terminal`_, the nRF Terminal (part of the `nRF Connect for Visual Studio Code`_ extension), or PuTTY. -nRF Connect Serial Terminal is the recommended method for :ref:`nrf5340_gs_connecting`. - -On your mobile device, install the `nRF Connect for Mobile`_ application from the corresponding application store. - -.. _nrf5340_gs_programming_sample: - -Programming the sample -********************** - -You must program and run a precompiled version of the :ref:`peripheral_uart` sample on your development kit to test the functions. -Download the precompiled version of the sample from the `nRF5340 DK Downloads`_ page. - -After downloading the zip archive, extract it to a folder of your choice. -The archive contains the HEX file used to program the sample to your DK. - -.. |DK| replace:: nRF5340 DK - -.. include:: /gsg_guides/nrf52_gs.rst - :start-after: program_dk_sample_start - :end-before: program_dk_sample_end - -After you have programmed the sample to the DK, you can connect to it using a terminal emulator and test the functions. - -.. _nrf5340_gs_connecting: - -Connecting to the sample -************************ - -.. include:: /gsg_guides/nrf52_gs.rst - :start-after: uart_dk_connect_start - :end-before: uart_dk_connect_end - -Once the connection has been established, continue to :ref:`nrf5340_gs_testing`. - -.. _nrf5340_gs_testing: - -Testing the sample -****************** - -You can test the :ref:`peripheral_uart` sample on your |DK| using the `nRF Connect for Mobile`_ application. -The test requires that you have :ref:`connected to the sample ` and have the connected terminal emulator open. - -.. include:: /gsg_guides/nrf52_gs.rst - :start-after: testing_dk_start - :end-before: testing_dk_end - -Next steps -********** - -You have now completed getting started with the nRF5340 DK. -See the following links for where to go next: - -* :ref:`installation` and :ref:`configuration_and_build` documentation to install the |NCS| and learn more about its development environment. -* :ref:`ug_nrf5340` documentation for more advanced topics related to the nRF5340 DK. diff --git a/doc/nrf/images/peripheral_sensor_node_assy.png b/doc/nrf/images/peripheral_sensor_node_assy.png deleted file mode 100644 index 94e1f0ab3ea2..000000000000 Binary files a/doc/nrf/images/peripheral_sensor_node_assy.png and /dev/null differ diff --git a/doc/nrf/images/peripheral_sensor_node_shield.png b/doc/nrf/images/peripheral_sensor_node_shield.png deleted file mode 100644 index c773d338c8b2..000000000000 Binary files a/doc/nrf/images/peripheral_sensor_node_shield.png and /dev/null differ diff --git a/doc/nrf/includes/sample_board_rows.txt b/doc/nrf/includes/sample_board_rows.txt index 363622fbbbf0..5b0c3bc1a28e 100644 --- a/doc/nrf/includes/sample_board_rows.txt +++ b/doc/nrf/includes/sample_board_rows.txt @@ -226,14 +226,14 @@ | :ref:`nRF54L15 PDK ` | PCA10156 | :ref:`nrf54l15pdk ` | ``nrf54l15pdk/nrf54l15/cpuapp`` | -.. nrf54l15pdk_nrf54l15_cpuapp_ns - -| :ref:`nRF54L15 PDK ` | PCA10156 | :ref:`nrf54l15pdk ` | ``nrf54l15pdk/nrf54l15/cpuapp/ns`` | - .. nrf54l15pdk@0.3.0_nrf54l15_cpuapp | :ref:`nRF54L15 PDK ` | PCA10156 | :ref:`nrf54l15pdk ` | ``nrf54l15pdk@0.3.0/nrf54l15/cpuapp`` | .. nrf54l15dk_nrf54l15_cpuapp -| nRF54L15 DK | PCA10156 | :ref:`nrf54l15dk ` | ``nrf54l15dk/nrf54l15/cpuapp`` | +| :ref:`nRF54L15 DK ` | PCA10156 | :ref:`nrf54l15dk ` | ``nrf54l15dk/nrf54l15/cpuapp`` | + +.. nrf54l15dk_nrf54l15_cpuapp_ns + +| :ref:`nRF54L15 DK ` | PCA10156 | :ref:`nrf54l15dk ` | ``nrf54l15dk/nrf54l15/cpuapp/ns`` | diff --git a/doc/nrf/includes/sample_fem_support.txt b/doc/nrf/includes/sample_fem_support.txt index 877a56a961a7..f7319bf245c8 100644 --- a/doc/nrf/includes/sample_fem_support.txt +++ b/doc/nrf/includes/sample_fem_support.txt @@ -1,20 +1,20 @@ You can add support for the nRF21540 front-end module to this sample by using one of the following options, depending on your hardware: * Build the sample for one board that contains the nRF21540 FEM, such as :ref:`nrf21540dk/nrf52840 `. -* Manually create a devicetree overlay file that describes how FEM is connected to the nRF5 SoC in your device. - See :ref:`zephyr:set-devicetree-overlays` for different ways of adding the overlay file. -* Provide nRF21540 FEM capabilities by using a :ref:`shield `, for example the :ref:`ug_radio_fem_nrf21540ek` shield that is available in the |NCS|. - In this case, build the project for a board connected to the shield you are using with an appropriate variable included in the build command, for example ``SHIELD=nrf21540ek``. +* Manually create a devicetree overlay file that describes how the nRF21540 FEM is connected to the SoC. + See :ref:`configuring_devicetree` for different ways of adding the overlay file. +* Provide nRF21540 FEM capabilities by using a :ref:`shield `, for example the :ref:`nRF21540 EK ` shield that is available in the |NCS|. + In this case, build the project for a board connected to the shield you are using with an appropriate variable included in the build command, for example ``-DSHIELD=nrf21540ek``. This variable instructs the build system to append the appropriate devicetree overlay file. .. tabs:: .. group-tab:: nRF Connect for VS Code - To build the sample in the nRF Connect for VS Code IDE for an nRF52840 DK with the nRF21540 EK attached, add the shield variable in the build configuration's :guilabel:`Extra CMake arguments` and rebuild the build configuration. + To build the sample in the |nRFVSC| for an nRF52840 DK with the nRF21540 EK attached, add the shield variable in the build configuration's :guilabel:`Extra CMake arguments` and rebuild the build configuration. For example: ``-DSHIELD=nrf21540ek``. - See `nRF Connect for VS Code extension pack `_ documentation for more information. + See `How to work with build configurations`_ in the |nRFVSC| documentation for more information. .. group-tab:: Command line @@ -24,7 +24,7 @@ You can add support for the nRF21540 front-end module to this sample by using on west build -b nrf52840dk/nrf52840 -- -DSHIELD=nrf21540ek - See :ref:`Programming nRF21540 EK ` for information about how to program when you are using a board with a network core, for example nRF5340 DK. + See :ref:`Programming nRF21540 EK ` for information about how to program when you are using a board with a network core, for example the nRF5340 DK. Each of these options adds the description of the nRF21540 FEM to the devicetree. See :ref:`ug_radio_fem` for more information about FEM in the |NCS|. diff --git a/doc/nrf/installation/install_ncs.rst b/doc/nrf/installation/install_ncs.rst index df80b2de93f6..c5238fb4f1c6 100644 --- a/doc/nrf/installation/install_ncs.rst +++ b/doc/nrf/installation/install_ncs.rst @@ -9,7 +9,7 @@ Installing the |NCS| :local: :depth: 2 -There are different ways to install the |NCS|, depending on your preferred development environment and the :ref:`toolchain management tool `: +There are different ways to install the |NCS|, depending on your preferred development environment: * Using |VSC| and the |nRFVSC| (recommended) * Using command line and nRF Util @@ -25,14 +25,12 @@ This includes everything that is required by Zephyr's :ref:`zephyr:getting_start Update operating system *********************** -Before you start setting up the toolchain, install available updates for your operating system. +Before you start setting up the toolchain, install available updates for your :ref:`operating system ` to make sure it supports the |NCS| firmware. .. include:: ./recommended_versions.rst :start-after: os_table_start :end-before: os_table_end -See :ref:`supported_OS` for more information about the tier definitions. - .. _installing_vsc: .. rst-class:: numbered-step @@ -40,37 +38,45 @@ See :ref:`supported_OS` for more information about the tier definitions. Install prerequisites ********************* -Depending on your preferred development environment, install the following required tools: +Depending on your preferred development environment, install the following required tools. + .. tabs:: .. group-tab:: nRF Connect for Visual Studio Code - * The latest version of the :ref:`requirements_clt` package. - Download it from the `nRF Command Line Tools`_ page. - * The |jlink_ver| of :ref:`SEGGER J-Link `. - Download it from the `J-Link Software and Documentation Pack`_ page. - * The latest version of |VSC| for your operating system from the `Visual Studio Code download page`_. - * In |VSC|, the latest version of the `nRF Connect for VS Code Extension Pack`_. - * Linux users: `nrf-udev`_ module with udev rules required to access USB ports on Nordic Semiconductor devices and program the firmware. + * All operating systems: + + * The latest version of the :ref:`requirements_clt` package. + Check :ref:`operating system versions that support this tool ` and download the installer from the `nRF Command Line Tools`_ page. + * The |jlink_ver_vsc| of :ref:`SEGGER J-Link `. + Download it from the `J-Link Software and Documentation Pack`_ page. + * The latest version of |VSC| for your operating system from the `Visual Studio Code download page`_. + * In |VSC|, the latest version of the `nRF Connect for VS Code Extension Pack`_. + + * Additionally for Linux users: the `nrf-udev`_ module with udev rules required to access USB ports on Nordic Semiconductor devices and program the firmware. .. group-tab:: Command line - * The latest version of `nRF Util development tool`_, a unified command line utility for Nordic products. + * All operating systems: + + * The latest version of nRF Util, a unified command-line utility for Nordic Semiconductor products. + Check :ref:`operating system versions that support this tool ` and download the installer from the `nRF Util development tool`_ page. - .. note:: - After downloading the nRF Util executable, move it to a directory that is in the system :envvar:`PATH`. - On macOS and Linux, the downloaded file also needs to be given execute permission by typing `chmod +x nrfutil` or by checking the checkbox in the file properties. + .. note:: + After downloading the nRF Util executable, move it to a directory that is in the system :envvar:`PATH`. + On macOS and Linux, the downloaded file also needs to be given execute permission by typing `chmod +x nrfutil` or by checking the checkbox in the file properties. - * The latest version of the :ref:`requirements_clt` package. - Download it from the `nRF Command Line Tools`_ page. + * The latest version of the :ref:`requirements_clt` package. + Check :ref:`operating system versions that support this tool ` and download the installer from the `nRF Command Line Tools`_ page. - .. note:: - After downloading and installing the tools, add nrfjprog to the system :envvar:`PATH` in the environment variables. + .. note:: + After downloading and installing the tools, add nrfjprog to the system :envvar:`PATH` in the environment variables. - * The latest version of :ref:`SEGGER J-Link `. - Download it from the `J-Link Software and Documentation Pack`_ page. - * Linux users: `nrf-udev`_ module with udev rules required to access USB ports on Nordic Semiconductor devices and program the firmware. + * The |jlink_ver| of :ref:`SEGGER J-Link `. + Download it from the `J-Link Software and Documentation Pack`_ page. + + * Additionally for Linux users: the `nrf-udev`_ module with udev rules required to access USB ports on Nordic Semiconductor devices and program the firmware. .. _gs_installing_toolchain: .. _gs_installing_tools: @@ -83,7 +89,8 @@ Install the |NCS| toolchain The |NCS| :term:`toolchain` includes the Zephyr SDK and then adds tools and modules required to build |NCS| samples and applications on top of it. These include the :ref:`required tools `, the :ref:`Python dependencies `, and the :ref:`GN tool ` for creating :ref:`ug_matter` applications. -When you first install the |NCS|, it is recommended to install the latest released versions of the SDK and the toolchain. +.. note:: + When you first install the |NCS|, it is recommended to install the latest released, stable versions of the SDK and the toolchain. Depending on your preferred development environment, complete the following steps: @@ -186,7 +193,7 @@ Simply put, you can work with the following versions of the |NCS|: - `sdk-nrf`_ repository .. note:: - Unless you are familiar with the :ref:`development process `, you should always work with a specific release of the |NCS|. + Unless you are familiar with the :ref:`development process `, you should always work with a specific, stable release of the |NCS|. For more information about the repository and development model, see the :ref:`dm_code_base` page. @@ -611,21 +618,21 @@ To install the |NCS| system-wide, complete the following steps: Installation with Toolchain Manager *********************************** -.. note:: +Toolchain Manager is a SDK and toolchain installer for the |NCS|. +It is available from `nRF Connect for Desktop`_, a cross-platform tool that provides different development applications for the |NCS| and Nordic Semiconductor products. +Both Toolchain Manager and nRF Connect for Desktop are available for Windows, Linux, and macOS. - The Toolchain Manager installation is recommended only when using the nRF54H20 DK with the |NCS| v2.7.0. - When using any other DK, the Toolchain Manager installation is recommended for the |NCS| v1.9.x and earlier versions. +.. note:: + |toolchain_management_ncs_versions| .. toggle:: - Toolchain Manager is a tool available from `nRF Connect for Desktop`_, a cross-platform tool that provides different applications that simplify installing the |NCS|. - Both the tool and the application are available for Windows, Linux, and macOS. - To install the toolchain and the SDK using the Toolchain Manager app, complete the following steps: 1. Install Toolchain Manager: - a. `Download nRF Connect for Desktop`_ for your operating system. + a. Check :ref:`operating system versions that support this tool `. + #. `Download nRF Connect for Desktop`_ for your operating system. #. Install and run the tool on your machine. #. In the **APPS** section, click :guilabel:`Install` next to Toolchain Manager. diff --git a/doc/nrf/installation/recommended_versions.rst b/doc/nrf/installation/recommended_versions.rst index 1a94b9f27de8..f8e192e492c0 100644 --- a/doc/nrf/installation/recommended_versions.rst +++ b/doc/nrf/installation/recommended_versions.rst @@ -14,83 +14,35 @@ All of these requirements are installed when you :ref:`install the nRF Connect S .. _gs_supported_OS: .. _supported_OS: -Supported operating systems -*************************** +Supported operating systems (firmware) +************************************** The |NCS| supports Microsoft Windows, Linux, and macOS for development. -The following table shows the operating system versions that support the |NCS| tools: + +The following table lists the support levels for the |NCS| firmware. +For OS support for additional software tools from Nordic Semiconductor, see :ref:`the table at the bottom of the page `. .. os_table_start .. list-table:: - :header-rows: 1 - - * - Operating System - - x86 - - x64 - - ARM64 - * - `Windows 11`_ - - Tier 3 - - Tier 3 - - Not supported - * - `Windows 10`_ - - Tier 3 - - Tier 1 - - Not supported - * - `Linux - Ubuntu 22.04 LTS`_ - - Not supported - - Tier 1 - - Not supported - * - `Linux - Ubuntu 20.04 LTS`_ - - Not supported - - Tier 2 - - Not supported - * - `macOS 14`_ - - Not applicable - - Tier 3 - - Tier 3 - * - `macOS 13`_ - - Not applicable - - Tier 1 - - Tier 1 - * - `macOS 12`_ - - Not applicable - - Tier 3 - - Tier 3 - * - `macOS 11`_ - - Not applicable - - Tier 2 - - Tier 2 - * - `macOS 10.15`_ - - Not applicable - - Tier 3 - - Not supported + :header-rows: 1 + + * - Operating System + - x64 + - ARM64 + * - `Windows 10`_ + - Built and tested with :ref:`Twister `. + - Not supported. + * - `Linux - Ubuntu 22.04 LTS`_ + - Built and tested with :ref:`Twister `. Comprehensive testing with Nordic Semiconductor hardware. + - Not supported. + * - `macOS 14`_ + - Built and tested with :ref:`Twister `. + - Only toolchain provided. .. os_table_end -Tier definitions - The table uses several tier definitions to categorize the level of operating system support: - - .. toggle:: Support levels - - Tier 1 - The |NCS| tools will always work. - The automated build and automated testing ensure that the |NCS| tools build and successfully complete tests after each change. - - Tier 2 - The |NCS| tools will always build. - The automated build ensures that the |NCS| tools build successfully after each change. - There is no guarantee that a build will work because the automation tests do not always run. - - Tier 3 - The |NCS| tools are supported by design, but are not built or tested after each change. - Therefore, the application may or may not work. - - Not supported - The |NCS| tools do not work, but it may be supported in the future. - - Not applicable - The specified architecture is not supported for the respective operating system. +For building, Twister uses definitions in :file:`sample.yml` for the default configuration for the given sample or application. Zephyr features only available on Linux There are some Zephyr features that are currently only available on Linux, including: @@ -325,17 +277,6 @@ They can all be installed using the ``doc/requirements.txt`` file using ``pip``. * - west - :ncs-tool-version:`WEST_VERSION` -.. _requirements_clt: - -nRF Command Line Tools -********************** - -`nRF Command Line Tools`_ is a package of tools used for development, programming, and debugging of Nordic Semiconductor's nRF51, nRF52, nRF53, nRF54H, and nRF91 Series devices. -Among others, this package includes the nrfjprog executable and library, which the west command uses by default to program the development kits. -For more information on nrfjprog, see `Programming SoCs with nrfjprog`_. - -It is recommended to use the latest version of the package when you :ref:`installing_vsc`. - .. _requirements_jlink: J-Link Software and Documentation Pack @@ -347,13 +288,95 @@ Among others, this package includes the J-Link RTT Viewer, which can be used for It is recommended to use the |jlink_ver| of the package when you :ref:`installing_vsc`. .. _toolchain_management_tools: +.. _additional_nordic_sw_tools: -|NCS| toolchain management tools -******************************** +Additional software tools +************************* -Nordic Semiconductor provides proprietary |NCS| toolchain management tools that streamline the process of installing the |NCS| and its toolchain. +Nordic Semiconductor provides proprietary tools for working with Nordic Semiconductor devices, as well as different |NCS| toolchain management tools that streamline the process of installing the |NCS| and its toolchain. Depending on your development environment, you need to install only some of them when you :ref:`installing_vsc`. +.. _additional_nordic_sw_tools_os_support: + +Supported operating systems (proprietary tools) +=============================================== + +The following table shows the operating system versions that support the additional software tools from Nordic Semiconductor. +For firmware OS support, see :ref:`the table at the top of the page `. + +.. list-table:: + :header-rows: 1 + + * - Operating System + - x86 + - x64 + - ARM64 + * - `Windows 11`_ + - Tier 3 + - Tier 3 + - Not supported + * - `Windows 10`_ + - Tier 3 + - Tier 1 + - Not supported + * - `Linux - Ubuntu 24.04 LTS`_ + - Not supported + - Tier 2 + - Not supported + * - `Linux - Ubuntu 22.04 LTS`_ + - Not supported + - Tier 1 + - Not supported + * - `Linux - Ubuntu 20.04 LTS`_ + - Not supported + - Tier 2 + - Not supported + * - `macOS 15`_ + - n/a + - Tier 3 + - Tier 3 + * - `macOS 14`_ + - n/a + - Tier 3 + - Tier 3 + * - `macOS 13`_ + - n/a + - Tier 1 + - Tier 1 + +Tier definitions + .. toggle:: Support levels + + Tier 1 + The toolchain management tools will always work. + The automated build and automated testing ensure that the |NCS| tools build and successfully complete tests after each change. + + Tier 2 + The toolchain management tools will always build. + The automated build ensures that the |NCS| tools build successfully after each change. + There is no guarantee that a build will work because the automation tests do not always run. + + Tier 3 + The toolchain management tools are supported by design, but are not built or tested after each change. + Therefore, the application may or may not work. + + Not supported + The toolchain management tools do not work, but it may be supported in the future. + + Not applicable + The specified architecture is not supported for the respective operating system. + +.. _requirements_clt: + +nRF Command Line Tools +====================== + +`nRF Command Line Tools`_ is a package of tools used for development, programming, and debugging of Nordic Semiconductor's nRF51, nRF52, nRF53, nRF54H, and nRF91 Series devices. +Among others, this package includes the nrfjprog executable and library, which the west command uses by default to program the development kits. +For more information on nrfjprog, see `Programming SoCs with nrfjprog`_. + +It is recommended to use the latest version of the package when you :ref:`installing_vsc`. + |nRFVSC| ======== @@ -379,8 +402,19 @@ nRF Util The `nRF Util development tool`_ is a unified command line utility for Nordic products. Its functionality is provided through installable and upgradeable commands that are served on a central package registry on the Internet. -The utility follows its own release cycle. +The utility follows its own release cycle and has its own `operating system requirements `_. Use the latest available release for development. nRF Util provides |NCS| toolchain packages for each |NCS| release through the ``toolchain-manager`` command. See the :ref:`install_ncs` page for information about how to use this command. + +.. _requirements_ncd: + +nRF Connect for Desktop's Toolchain Manager +=========================================== + +`nRF Connect for Desktop`_ is a cross-platform tool that provides different applications that simplify working the |NCS| and Nordic Semiconductor products. +One of those tools is the :ref:`Toolchain Manager `, which allows you to install the toolchain and the SDK. + +.. note:: + |toolchain_management_ncs_versions| diff --git a/doc/nrf/libraries/dfu/dfu_multi_image.rst b/doc/nrf/libraries/dfu/dfu_multi_image.rst index 5cc2d3d79c28..90aa56751061 100644 --- a/doc/nrf/libraries/dfu/dfu_multi_image.rst +++ b/doc/nrf/libraries/dfu/dfu_multi_image.rst @@ -26,17 +26,51 @@ To configure the maximum number of images that the DFU multi-image library is ab To enable building the DFU multi-image package that contains commonly used update images, such as the application core firmware, the network core firmware, or MCUboot images, set the ``SB_CONFIG_DFU_MULTI_IMAGE_PACKAGE_BUILD`` Kconfig option. The following options control which images are included: -+-------------------------------------------------------------------+---------------------------------------+ -| Kconfig | Description | -+===================================================================+=======================================+ -| ``SB_CONFIG_DFU_MULTI_IMAGE_PACKAGE_APP`` | Include application update. | -+-------------------------------------------------------------------+---------------------------------------+ -| ``SB_CONFIG_DFU_MULTI_IMAGE_PACKAGE_NET`` | Include network core image update. | -+-------------------------------------------------------------------+---------------------------------------+ -| ``SB_CONFIG_DFU_MULTI_IMAGE_PACKAGE_MCUBOOT`` | Include MCUboot update. | -+-------------------------------------------------------------------+---------------------------------------+ -| ``SB_CONFIG_DFU_MULTI_IMAGE_PACKAGE_WIFI_FW_PATCH`` | Include nRF700x WiFi firmware patches.| -+-------------------------------------------------------------------+---------------------------------------+ ++-------------------------------------------------------------------+----------------------------------------+ +| Kconfig | Description | ++===================================================================+========================================+ +| ``SB_CONFIG_DFU_MULTI_IMAGE_PACKAGE_APP`` | Include application update. | ++-------------------------------------------------------------------+----------------------------------------+ +| ``SB_CONFIG_DFU_MULTI_IMAGE_PACKAGE_NET`` | Include network core image update. | ++-------------------------------------------------------------------+----------------------------------------+ +| ``SB_CONFIG_DFU_MULTI_IMAGE_PACKAGE_MCUBOOT`` | Include MCUboot update. | ++-------------------------------------------------------------------+----------------------------------------+ +| ``SB_CONFIG_DFU_MULTI_IMAGE_PACKAGE_WIFI_FW_PATCH`` | Include nRF700x Wi-Fi firmware patches.| ++-------------------------------------------------------------------+----------------------------------------+ +| ``SB_CONFIG_SUIT_MULTI_IMAGE_PACKAGE_BUILD`` | Include SUIT envelope and cache images.| ++-------------------------------------------------------------------+----------------------------------------+ + +.. _lib_dfu_multi_image_suit_multi_image_package: + +SUIT multi-image package +======================== + +The DFU multi-image library supports building a SUIT multi-image package that includes a SUIT envelope and cache images. +The SUIT envelope is always included in the package as image 0, while SUIT cache images are included as subsequent images starting from the image 2. + +The SUIT multi-image processing requires the SUIT system to support cache processing. +To enable it, set one of the following Kconfig options to ``y``: + +* :kconfig:option:`CONFIG_SUIT_DFU_CANDIDATE_PROCESSING_FULL` +* :kconfig:option:`SUIT_DFU_CANDIDATE_PROCESSING_PUSH_TO_CACHE` + +The build system merges all application images into a single :file:`dfu_cache_partition_1.bin` partition file and places its content into the multi-image image 2. +This allows all application images to be stored in a single DFU multi-image, as they will be processed by SUIT. + +The :kconfig:option:`SB_CONFIG_SUIT_MULTI_IMAGE_PACKAGE_BUILD` Kconfig option enables building the SUIT multi-image package. +As a result, the multi-image package will contain: + +* Image 0: + - SUIT envelope that contains manifests only. + +* Image 2: + - Application core image. + - Radio core image, if applicable. + - Additional images, if applicable. + +You can add more data to be processed by SUIT to the following images starting from image 3. +This operation will require an additional binary file and the proper :file:`dfu_cache_partition_X` definition in a devicetree configuration file, where ``X`` is the image number minus 1. +So for the image 3, you would need :file:`dfu_cache_partition_2`. Dependencies ************ diff --git a/doc/nrf/libraries/dfu/dfu_target.rst b/doc/nrf/libraries/dfu/dfu_target.rst index dad684e2dcfc..3500445e2fb1 100644 --- a/doc/nrf/libraries/dfu/dfu_target.rst +++ b/doc/nrf/libraries/dfu/dfu_target.rst @@ -48,6 +48,7 @@ The DFU target library supports the following types of firmware upgrades: * MCUboot-style upgrades * Modem delta upgrades * Full modem firmware upgrades +* SUIT-style upgrades MCUboot-style upgrades ---------------------- @@ -103,6 +104,69 @@ This DFU target downloads the serialized modem firmware to an external flash mem Once the modem firmware has been downloaded, the application should use :ref:`lib_fmfu_fdev` to write the firmware to the modem. The DFU target library does not perform the upgrade and calling the :c:func:`dfu_target_schedule_update` function has no effect. +.. _lib_dfu_target_suit_style_update: + +SUIT-style upgrades +------------------- + +SUIT-style firmware upgrades can be used for :ref:`ug_nrf54h20_suit_dfu`. +Depending on the image number and the used SUIT system configuration, this type of DFU writes the data provided to the :c:func:`dfu_target_write` function into the following partitions: + +* Image 0: ``dfu_partition`` +* Image 1: ``dfu_cache_partition_0`` - always located just after the ``dfu_partition`` partition. +* Image 2..n: ``dfu_cache_partition_n`` - located in internal or external memory. + +Before calling the :c:func:`dfu_target_init` and :c:func:`dfu_target_write` functions, the application must call the :c:func:`dfu_target_suit_set_buf` function to allocate the buffer used during the firmware update process. +The buffer size must be at least the size of the largest chunk that will be downloaded at a single time. +The buffer will be used for processing all images, so there is no need to allocate a new buffer for each image. + +You can upgrade your device in several ways depending on your SUIT system configuration: + +.. tabs:: + + .. tab:: SUIT single image processing + + SUIT minimal processing is used for devices that do not have a cache partition. + To enable it, set the :kconfig:option:`CONFIG_SUIT_DFU_CANDIDATE_PROCESSING_MINIMAL` Kconfig option to ``y``. + + In this approach, the SUIT envelope contains the manifests and the firmware image. + The SUIT envelope is stored in the ``dfu_partition`` partition. + After that, the ``dfu_cache_partition_0`` partition will be created automatically just after the ``dfu_partition`` partition and will contain the firmware. + + .. tab:: SUIT cache processing + + The SUIT cache processing requires one of the following SUIT system configurations set to ``y``: + + * :kconfig:option:`CONFIG_SUIT_DFU_CANDIDATE_PROCESSING_FULL` + * :kconfig:option:`SUIT_DFU_CANDIDATE_PROCESSING_PUSH_TO_CACHE` + + With one of these options set, the DFU target SUIT library can process the SUIT envelope and cache images. + In this approach, the SUIT envelope contains the manifests only, while the firmware is stored in the cache images. + + You can disable cache processing by setting the :kconfig:option:`DFU_TARGET_SUIT_CACHE_PROCESSING` Kconfig option to ``n``. + + When this approach is used, the SUIT manifests will be stored in the ``dfu_partition`` partition. + The firmware will be stored in the ``dfu_cache_partition_1`` partition. + This approach can be used for devices that have defined the ``dfu_cache_partition_1`` partition in the internal or external flash memory. + The :ref:`lib_dfu_multi_image_suit_multi_image_package` uses this approach for multi-image updates. + + To read more about SUIT cache processing, see the :ref:`ug_nrf54h20_suit_external_memory` guide. + +Make sure the application calls the :c:func:`dfu_target_init` function for image 0 first and then downloads the SUIT envelope. +When the single image data transfer is completed, the application using the DFU target library must call the :c:func:`dfu_target_done` function for each subsequent image. +After that, the application can call the :c:func:`dfu_target_init` function for another image index. + +When all image data transfers are completed, the application using the DFU target library must do the following: + +1. Call the :c:func:`dfu_target_schedule_update` function to inform SUIT that the manifests can be processed. +2. Automatically reboot the device by calling :c:func:`dfu_target_suit_reboot` with a defined delay. + You can set the delay before rebooting the device by configuring the :kconfig:option:`CONFIG_DFU_TARGET_SUIT_REBOOT_DELAY` Kconfig option. + Alternatively, you can skip this step and reboot the device manually. + +.. note:: + The application must schedule the upgrade of all images at once using the :c:func:`dfu_target_schedule_update` function. + During this operation, the manifests stored in the ``dfu_partition`` partition will be processed. + Configuration ************* diff --git a/doc/nrf/libraries/modem/lte_lc.rst b/doc/nrf/libraries/modem/lte_lc.rst index b821dc1fdc29..5ed1420bf1c0 100644 --- a/doc/nrf/libraries/modem/lte_lc.rst +++ b/doc/nrf/libraries/modem/lte_lc.rst @@ -184,40 +184,6 @@ To enable modem sleep and TAU pre-warning notifications, enable the following op For additional configurations related to these features, see the API documentation. -Functional mode changes callback -================================ - -The library allows the application to define compile-time callbacks to receive the modem's functional mode changes. -These callbacks allow any part of the application to perform certain operations when the modem enters or re-enters a certain functional mode using the library :c:func:`lte_lc_func_mode_set` API. -For example, one kind of operation that the application or a library may need to perform and repeat, whenever the modem enters a certain functional mode is the subscription to AT notifications. -The application can set up a callback for modem`s functional mode changes using the :c:macro:`LTE_LC_ON_CFUN` macro. - -.. important:: - When the :c:macro:`LTE_LC_ON_CFUN` macro is used, the application must not call :c:func:`nrf_modem_at_cfun_handler_set` as that will override the handler set by the modem library integration layer. - -.. note:: - The CFUN callback is not supported with :c:func:`nrf_modem_at_cmd_async`. - -The following code snippet shows how to use the :c:macro:`LTE_LC_ON_CFUN` macro: - -.. code-block:: c - - /* Define a callback */ - LTE_LC_ON_CFUN(cfun_hook, on_cfun, NULL); - - /* Callback implementation */ - static void on_cfun(enum lte_lc_func_mode mode, void *context) - { - printk("Functional mode changed to %d\n", mode); - } - - int main(void) - { - /* Change functional mode using the LTE link control API */ - lte_lc_func_mode_set(LTE_LC_FUNC_MODE_NORMAL); - return 0; - } - Dependencies ************ diff --git a/doc/nrf/libraries/modem/modem_key_mgmt.rst b/doc/nrf/libraries/modem/modem_key_mgmt.rst index 2e950dde45cf..2dd53abcbdd2 100644 --- a/doc/nrf/libraries/modem/modem_key_mgmt.rst +++ b/doc/nrf/libraries/modem/modem_key_mgmt.rst @@ -67,11 +67,12 @@ The following code snippet shows how to write a CA chain certificate to the mode .. code-block:: c int err; + nrf_sec_tag_t sec_tag = 42; static const char cert[] = { #include "YourCert.pem.inc" }; - err = modem_key_mgmt_write(, MODEM_KEY_MGMT_CRED_TYPE_CA_CHAIN, cert, sizeof(cert)); + err = modem_key_mgmt_write(sec_tag, MODEM_KEY_MGMT_CRED_TYPE_CA_CHAIN, cert, sizeof(cert)); if (err) { printk("Failed to provision certificate, err %d\n", err); } @@ -81,9 +82,10 @@ The following code snippet shows how to check if a CA chain certificate exists i .. code-block:: c int err; + nrf_sec_tag_t sec_tag = 42; bool exists; - err = modem_key_mgmt_exists(, MODEM_KEY_MGMT_CRED_TYPE_CA_CHAIN, &exists); + err = modem_key_mgmt_exists(sec_tag, MODEM_KEY_MGMT_CRED_TYPE_CA_CHAIN, &exists); if (err) { printk("Failed to check if credential exists\n"); return; @@ -100,11 +102,12 @@ The following code snippet shows how to check if the CA chain certificate stored .. code-block:: c int mismatch; + nrf_sec_tag_t sec_tag = 42; static const char cert[] = { #include "YourCert.pem.inc" }; - mismatch = modem_key_mgmt_cmp(, MODEM_KEY_MGMT_CRED_TYPE_CA_CHAIN, cert, sizeof(cert)); + mismatch = modem_key_mgmt_cmp(sec_tag, MODEM_KEY_MGMT_CRED_TYPE_CA_CHAIN, cert, sizeof(cert)); if (mismatch) { printk("Certificate mismatch\n"); } else { @@ -116,12 +119,13 @@ The following code snippet shows how to read a CA chain certificate stored in th .. code-block:: c int err; + nrf_sec_tag_t sec_tag = 42; char cert[CERT_SIZE]; size_t len; len = sizeof(cert); - err = modem_key_mgmt_read(, MODEM_KEY_MGMT_CRED_TYPE_CA_CHAIN, cert, &len); + err = modem_key_mgmt_read(sec_tag, MODEM_KEY_MGMT_CRED_TYPE_CA_CHAIN, cert, &len); if (err) { printk("Failed to read certificate\n"); } @@ -131,12 +135,25 @@ The following code snippet shows how to delete a CA chain certificate stored in .. code-block:: c int err; + nrf_sec_tag_t sec_tag = 42; - err = modem_key_mgmt_delete(, MODEM_KEY_MGMT_CRED_TYPE_CA_CHAIN); + err = modem_key_mgmt_delete(sec_tag, MODEM_KEY_MGMT_CRED_TYPE_CA_CHAIN); if (err) { printk("Failed to delete existing certificate, err %d\n", err); } +The following code snippet shows how to delete all credentials associated with a security tag in the modem: + +.. code-block:: c + + int err; + nrf_sec_tag_t sec_tag = 42; + + err = modem_key_mgmt_clear(sec_tag); + if (err) { + printk("Failed to clear credentials on sectag, err %d\n", err); + } + API documentation ***************** diff --git a/doc/nrf/libraries/modem/nrf_modem_lib/nrf_modem_lib_trace.rst b/doc/nrf/libraries/modem/nrf_modem_lib/nrf_modem_lib_trace.rst index 3cb8c0ebcee9..75327e7a4df6 100644 --- a/doc/nrf/libraries/modem/nrf_modem_lib/nrf_modem_lib_trace.rst +++ b/doc/nrf/libraries/modem/nrf_modem_lib/nrf_modem_lib_trace.rst @@ -7,14 +7,17 @@ Modem trace module :local: :depth: 2 -To enable the tracing functionality, enable the :kconfig:option:`CONFIG_NRF_MODEM_LIB_TRACE` Kconfig in your project configuration. The module is implemented in :file:`nrf/lib/nrf_modem_lib/nrf_modem_lib_trace.c` and consists of a thread that initializes, deinitializes, and forwards modem traces to a backend. The trace backend can be selected in one of the following ways: * Adding the ``nrf91-modem-trace-uart`` snippet to send modem traces over UART. See :ref:`nrf91_modem_trace_uart_snippet` for more details. -* Enabling the :kconfig:option:`CONFIG_NRF_MODEM_LIB_TRACE_BACKEND_RTT` Kconfig option to send modem traces over SEGGER RTT. -* Enabling the :kconfig:option:`CONFIG_NRF_MODEM_LIB_TRACE_BACKEND_FLASH` Kconfig option to write modem traces to external flash. +* Adding the ``nrf91-modem-trace-rtt`` snippet to send modem traces over RTT. + See :ref:`nrf91_modem_trace_rtt_snippet` for more details. +* Adding the ``nrf91-modem-trace-ext-flash`` snippet to store modem traces in external flash. + See :ref:`nrf91_modem_trace_ext_flash_snippet` for more details. +* Adding the ``nrf91-modem-trace-ram`` snippet to store modem traces in RAM. + See :ref:`nrf91_modem_trace_ram_snippet` for more details. To reduce the amount of trace data sent from the modem, a different trace level can be selected. Complete the following steps to configure the modem trace level at compile time: diff --git a/doc/nrf/libraries/modem/nrf_modem_lib/nrf_modem_lib_wrapper.rst b/doc/nrf/libraries/modem/nrf_modem_lib/nrf_modem_lib_wrapper.rst index 1331ebcc9ab9..eda3866a08d1 100644 --- a/doc/nrf/libraries/modem/nrf_modem_lib/nrf_modem_lib_wrapper.rst +++ b/doc/nrf/libraries/modem/nrf_modem_lib/nrf_modem_lib_wrapper.rst @@ -40,7 +40,7 @@ The result of the initialization and the callback context are provided to these The callback can be used to perform modem and library configurations that require the modem to be turned on in offline mode. The callback cannot be used to change the modem's functional mode. Calls to :c:func:`lte_lc_connect` and ``CFUN`` AT calls are not allowed, and must be done after :c:func:`nrf_modem_lib_init` has returned. - If a library needs to perform operations after the link is up, it can use the :ref:`lte_lc_readme` and subscribe to a :c:macro:`LTE_LC_ON_CFUN` callback. + If a library needs to perform operations after the link is up, it can use the :c:macro:`NRF_MODEM_LIB_ON_CFUN` callback. Callbacks for the macro :c:macro:`NRF_MODEM_LIB_ON_INIT` must have the signature ``void callback_name(int ret, void *ctx)``, where ``ret`` is the result of the initialization and ``ctx`` is the context passed to the macro. The callbacks registered using the :c:macro:`NRF_MODEM_LIB_ON_SHUTDOWN` macro are executed before the library is shut down. diff --git a/doc/nrf/libraries/modem/uicc_lwm2m.rst b/doc/nrf/libraries/modem/uicc_lwm2m.rst new file mode 100644 index 000000000000..0056c4f7ae4a --- /dev/null +++ b/doc/nrf/libraries/modem/uicc_lwm2m.rst @@ -0,0 +1,28 @@ +.. _lib_uicc_lwm2m: + +UICC LwM2M +########## + +.. contents:: + :local: + :depth: 2 + +The UICC LwM2M library provides functionality to read LwM2M bootstrap configuration from SIM. + +Configuration +************* + +To enable the UICC LwM2M library, configure the :kconfig:option:`CONFIG_UICC_LWM2M` Kconfig option. + +Dependencies +************ + +The UICC LwM2M library requires the :ref:`nrfxlib:nrf_modem` library to use AT commands. + +API documentation +***************** + +| Header file: :file:`include/modem/uicc_lwm2m.h` +| Source file: :file:`lib/uicc_lwm2m/uicc_lwm2m.c` + +.. doxygengroup:: uicc_lwm2m diff --git a/doc/nrf/libraries/networking/nrf_cloud.rst b/doc/nrf/libraries/networking/nrf_cloud.rst index bfeb2e07a101..a308c68daee3 100644 --- a/doc/nrf/libraries/networking/nrf_cloud.rst +++ b/doc/nrf/libraries/networking/nrf_cloud.rst @@ -154,6 +154,7 @@ Firmware over-the-air (FOTA) updates The nRF Cloud library supports FOTA updates for your nRF91 Series device. The :kconfig:option:`CONFIG_NRF_CLOUD_FOTA` Kconfig option is enabled by default when :kconfig:option:`CONFIG_NRF_CLOUD_MQTT` is set. This enables FOTA functionality in the application. +FOTA support for applications using CoAP or REST is enabled with the :kconfig:option:`CONFIG_NRF_CLOUD_FOTA_POLL` Kconfig option. nRF Cloud FOTA enables the following additional features and libraries: @@ -181,6 +182,7 @@ Following are the supported FOTA types: Consider the power and network costs before deploying full modem FOTA updates. * ``"MODEM"`` - :ref:`Delta modem FOTA ` applies incremental changes between specific versions of the modem firmware. Delta modem updates are much smaller in size and do not require external memory. +* ``"SMP"`` - Updates an auxiliary device's firmware using the :ref:`Simple Management Protocol `. For example, a device that supports all the FOTA types writes the following data into the device shadow: diff --git a/doc/nrf/libraries/others/date_time.rst b/doc/nrf/libraries/others/date_time.rst index 51351395cbb9..456715cd6de9 100644 --- a/doc/nrf/libraries/others/date_time.rst +++ b/doc/nrf/libraries/others/date_time.rst @@ -57,6 +57,14 @@ See the API documentation for more information on these functions. If an application has time-dependent operations immediately after connecting to the LTE network, it should wait for a confirmation indicating that time has been updated. If the :kconfig:option:`CONFIG_DATE_TIME_AUTO_UPDATE` option is not set, the first date-time update cycle (after boot) does not occur until the time set by the :kconfig:option:`CONFIG_DATE_TIME_UPDATE_INTERVAL_SECONDS` option has elapsed. +.. note:: + + Exceptions to the regular date-time update interval set by the :kconfig:option:`CONFIG_DATE_TIME_UPDATE_INTERVAL_SECONDS` Kconfig option occur when + the :c:func:`date_time_update_async` function is called and a new date-time update is triggered and scheduled. + Either retry or regular update interval is used depending on the outcome of the date-time update procedure. + Date-time update from modem through an ``AT%XTIME`` notification, + or from the client through the :c:func:`date_time_set` function does not disturb the regular update interval. + Configuration ************* diff --git a/doc/nrf/libraries/others/images/nrf_compression_image.png b/doc/nrf/libraries/others/images/nrf_compression_image.png new file mode 100644 index 000000000000..7e088942cbfb Binary files /dev/null and b/doc/nrf/libraries/others/images/nrf_compression_image.png differ diff --git a/doc/nrf/libraries/others/nrf_compression.rst b/doc/nrf/libraries/others/nrf_compression.rst new file mode 100644 index 000000000000..08349ceac2a3 --- /dev/null +++ b/doc/nrf/libraries/others/nrf_compression.rst @@ -0,0 +1,184 @@ +.. _nrf_compression: + +nRF Compression +############### + +.. contents:: + :local: + :depth: 2 + +The nRF Compression library in the |NCS| provides a streamlined API for data compression and decompression on devices. + +.. _nrf_compression_config: + +Configuration +************* + +You can enable different compression types by configuring the appropriate Kconfig options. +See :ref:`configuring_kconfig` for information about the different ways you can set Kconfig options in the |NCS|. + +To enable this library, set the :kconfig:option:`CONFIG_NRF_COMPRESS` Kconfig option. +For decompression, set the :kconfig:option:`CONFIG_NRF_COMPRESS_DECOMPRESSION` Kconfig option. + +.. note:: + The compression functionality is not currently supported. + +.. _nrf_compression_config_compression_types: + +Compression types configuration +=============================== + +You can use the available compression types by enabling their respective Kconfig options: + +.. list-table:: + :header-rows: 1 + + * - Name + - Kconfig options + - Implementation details + * - LZMA version 1 + - :kconfig:option:`CONFIG_NRF_COMPRESS_LZMA` and :kconfig:option:`CONFIG_NRF_COMPRESS_LZMA_VERSION_LZMA1` + - | Exclusive: cannot be enabled with LZMA version 2. + | Fixed probability size of 14272 bytes. + | Fixed dictionary size of 128 KiB. + * - LZMA version 2 + - :kconfig:option:`CONFIG_NRF_COMPRESS_LZMA` and :kconfig:option:`CONFIG_NRF_COMPRESS_LZMA_VERSION_LZMA2` + - | Exclusive: cannot be enabled with LZMA version 1. + | Fixed probability size of 14272 bytes. + | Fixed dictionary size of 128 KiB. + * - ARM thumb filter + - :kconfig:option:`NRF_COMPRESS_ARM_THUMB` + - --- + +Memory allocation configuration options +======================================= + +Compression and decompression can use a significant amount of memory. +To manage this, use the following Kconfig options to choose between static and dynamic (malloc) allocations from the system heap: + +:kconfig:option:`CONFIG_NRF_COMPRESS_MEMORY_TYPE_STATIC` + This is the default option that uses static buffers, ensuring their availability but preventing other uses of the memory. + +:kconfig:option:`CONFIG_NRF_COMPRESS_MEMORY_TYPE_MALLOC` + The option uses dynamic memory allocation, requiring the heap to have sufficient contiguous free memory for buffer allocation upon initializing the compression type. + This allows other parts of the application to utilize the memory when the compression system is not in use. + +Other configuration options +=========================== + +:kconfig:option:`CONFIG_NRF_COMPRESS_CHUNK_SIZE` + This option specifies the chunk size, which is the maximum amount of data that can be input to a compression library. + It determines the size of buffers that are statically or dynamically allocated, unless the compression type has a different memory allocation due to how it works. + +:kconfig:option:`CONFIG_NRF_COMPRESS_CLEANUP` + This option enables memory buffer cleanup upon calling the :c:func:`nrf_compress_deinit_func_t` function. + It is performed to prevent possible leakage of sensitive data. + If data security is not a concern, this option can be disabled to reduce flash usage. + +Samples using the library +************************* + +The :ref:`nrf_compression_mcuboot_compressed_update` sample uses this library. + +Application integration +*********************** + +The following sections describe how to integrate the nRF Compression library in your application. + +Implementing a compression type +=============================== + +You can implement custom compression types by using a shim over the compression source files. + +.. note:: + + Currently, due to the large memory requirements when compressing, the subsystem only supports data decompression. + +.. note:: + + The function definitions include ``inst`` as the first argument, which is reserved for future use. + It should be set to ``NULL`` when initializing the compression library. + +Initialization and deinitialization +=================================== + +The following initialization and deinitialization functions are necessary for managing the lifecycle of the compression library within your application or module: + +* :c:func:`nrf_compress_init_func_t` - The ``init`` function is used when an application or module initiates the use of the compression library. + It sets up the required buffers and reset all internal variables to their default values. +* :c:func:`nrf_compress_deinit_func_t` - The ``deinit`` function is used for cleaning up and releasing the buffers. + If the :kconfig:option:`CONFIG_NRF_COMPRESS_CLEANUP` Kconfig option is enabled, it also ensures that all buffers are cleared prior to releasing them to prevent any possible data leakage. + +Reset +===== + +The :c:func:`nrf_compress_reset_func_t` function is used to reset the compression library if it is partially used. +It resets the internal variables and buffers without performing deinitialization, which allows the compression library to be reused with a new file. + +Decompression +============= + +There are two functions for decompression: + +* :c:type:`nrf_compress_decompress_bytes_needed_t` - This function determines the ideal amount of data to supply for decompression. + It typically matches the value of the :kconfig:option:`CONFIG_NRF_COMPRESS_CHUNK_SIZE` Kconfig option, unless limited by a header or the final amount of data required is predetermined. +* :c:func:`nrf_compress_decompress_func_t` - This function processes input data and, if decompressed output data is available, returns a buffer containing that data along with its size. + Not all input data may be consumed when this function is called. + The compression library might require complete blocks and might not process the final block if it is incomplete, especially if multiple blocks are provided. + In such cases, the ``offset`` value will be updated to reflect the amount of data that was read from the input buffer + The application or module must monitor the amount of data it intends to decompress. + It will set the ``last_part`` value to true when submitting the final segment of the data stream for decompression. + This is crucial as some compression libraries require this information. + +Defining compression type +========================= + +Once the code is developed, the library must be defined in an iterable section using the :c:macro:`NRF_COMPRESS_IMPLEMENTATION_DEFINE` macro, located in the header file :file:`include/nrf_compress/implementation.h`. +There are following requirements depending on the library's capabilities: + +* If a library only supports compression, the compression function must be defined, and two decompression functions must be set to ``NULL``. +* If a library only supports decompression, the two decompression functions must be defined, and the compression function must be set to ``NULL``. +* If a library supports both compression and decompression, all three functions must be defined. + +All other functions are always mandatory and must always be defined. +Additionally, you must define a unique ID for the compression library. +It should be globally available, allowing applications or modules use it. + +Integrating the compression subsystem +===================================== + +To decompress data using the nRF Compression library, complete the following steps: + +1. Use the :c:func:`nrf_compress_implementation_find` function with the ID of the desired compression type. + If it returns ``NULL``, the compression type is not supported. +#. Check the ``init``, ``deinit`` and ``reset`` core function pointers. + If any return ``NULL``, there is an implementation issue with the compression type. +#. For decompression support, check the :c:type:`nrf_compress_decompress_bytes_needed_t` and :c:func:`nrf_compress_decompress_func_t` function pointers. + If either is ``NULL``, there is an implementation issue with the compression type. +#. Call the :c:func:`nrf_compress_init_func_t` function to set up the compression library. + If a non-zero error is returned, the library cannot be initialized, possibly due to insufficient memory or other issues. +#. Call the :c:type:`nrf_compress_decompress_bytes_needed_t` function to determine how many bytes of data should be specified for decompression. + If a non-zero error is returned, there is an issue with the compression library. +#. Call the :c:func:`nrf_compress_decompress_func_t` function with the requested amount of data (or the maximum available, if less is available). + In case there is no more data to process, set the ``last_part`` value to true, otherwise set it to false. + If a non-zero error is returned, the provided data might be invalid. +#. Ensure that if the ``offset`` updated value is not equal to the size of the input data provided, the next call to :c:func:`nrf_compress_decompress_func_t` function includes the unused bytes from the buffer at its start. +#. Verify if the ``output_size`` value is greater than ``0``. + In such a case, the specified amount of data is available in the ``output`` buffer and you should copy it or move it to its intended destination. +#. Repeat the process of calling the :c:type:`nrf_compress_decompress_bytes_needed_t` function followed by :c:func:`nrf_compress_decompress_func_t` until all the data has been processed. +#. Call the :c:func:`nrf_compress_deinit_func_t` function to clean up the compression library. + +See the following figure for the overview of the decompression flow: + +.. figure:: images/nrf_compression_image.png + :alt: nRF Compression library decompression flowchart + + nRF Compression library decompression flowchart + +API documentation +***************** + +| Header file: :file:`include/nrf_compress/implementation.h` +| Source files: :file:`subsys/nrf_compress/src/` + +.. doxygengroup:: compression_decompression_subsystem diff --git a/doc/nrf/libraries/security/identity_key.rst b/doc/nrf/libraries/security/identity_key.rst index b38f08d95a5f..cd6b944fdb57 100644 --- a/doc/nrf/libraries/security/identity_key.rst +++ b/doc/nrf/libraries/security/identity_key.rst @@ -11,7 +11,7 @@ The identity key library manages an asymmetric key used for identity services on It's used to provision identity keys and can only be used by a Zephyr image in Secure Processing Environment (SPE). It is not supported from images for Non-Secure Processing Environment (NSPE), from a Trusted Firmware-M image, or from MCUboot. -The identity key is equivalent to the Initial Attestation Key (IAK), as described in the ARM Platform Security Model 1.1, when Trusted Firmware-M (TF-M) is enabled. +The identity key is equivalent to the Initial Attestation Key (IAK), as described in the `ARM Platform Security Model 1.1`_, when Trusted Firmware-M (TF-M) is enabled. TF-M has access to the identity key using internal APIs and does not need to use this library. Functionality diff --git a/doc/nrf/links.txt b/doc/nrf/links.txt index 08b0e185af1f..da00faf28954 100644 --- a/doc/nrf/links.txt +++ b/doc/nrf/links.txt @@ -213,6 +213,8 @@ .. _`Memfault WebBluetooth Client`: https://memfault.github.io/web-ble-example/ .. _`PSA Cryptography API 1.0.1`: https://armmbed.github.io/mbed-crypto/1.0.1/html/index.html +.. _`PSA Certified Crypto API 1.2.1`: https://arm-software.github.io/psa-api/crypto/1.2/ +.. _`PSA Certified Crypto API 1.2 PAKE Extension Final 1`: https://arm-software.github.io/psa-api/crypto/1.2/ext-pake/ .. _`PSA functions for key management`: https://arm-software.github.io/psa-api/crypto/1.1/api/keys/management.html .. _`Memfault WebBluetooth Client`: https://memfault.github.io/web-ble-example/ @@ -598,7 +600,6 @@ .. _`nRF Connect Serial Terminal`: https://docs.nordicsemi.com/bundle/nrf-connect-serial-terminal/page/index.html .. _`Connecting using Serial Terminal`: https://docs.nordicsemi.com/bundle/nrf-connect-serial-terminal/page/connecting.html .. _`Serial Terminal configuration`: https://docs.nordicsemi.com/bundle/nrf-connect-serial-terminal/page/configuration.html -.. _`nRF Sniffer for Bluetooth LE`: https://docs.nordicsemi.com/bundle/nrfutil/page/nrfutil-ble-sniffer/guides/overview.html .. _`nRF Connect Bluetooth Low Energy`: https://docs.nordicsemi.com/bundle/nrf-connect-ble/page/index.html .. _`Cellular Monitor`: https://docs.nordicsemi.com/bundle/nrf-connect-cellularmonitor/page/index.html .. _`nPM PowerUP`: https://docs.nordicsemi.com/bundle/nrf-connect-npm/page/index.html @@ -613,8 +614,6 @@ .. _`Programming the nRF52840 Dongle`: .. _`Programming a Development Kit`: https://docs.nordicsemi.com/bundle/nrf-connect-programmer/page/programming_dk.html -.. _`nRF Sniffer for Bluetooth LE`: https://docs.nordicsemi.com/bundle/nrfutil/page/nrfutil-ble-sniffer/guides/overview.html - .. _`nRF Thread Topology Monitor`: https://docs.nordicsemi.com/bundle/ug_nrf_ttm/page/UG/nrf_ttm/ttm_introduction.html .. _`nRF Sniffer for 802.15.4`: https://docs.nordicsemi.com/bundle/ug_sniffer_802154/page/UG/sniffer_802154/intro_802154.html .. _`Configuring Wireshark for Zigbee`: https://docs.nordicsemi.com/bundle/ug_sniffer_802154/page/UG/sniffer_802154/configuring_sniffer_802154_zigbee.html @@ -810,6 +809,8 @@ .. _`Toolchain Manager command`: https://docs.nordicsemi.com/bundle/nrfutil/page/nrfutil-toolchain-manager/nrfutil-toolchain-manager_0.14.1.html#available-subcommands .. _`Recovering the device`: https://docs.nordicsemi.com/bundle/nrfutil/page/nrfutil-device/guides/programming_recovery.html .. _`nrfutil-trace`: https://docs.nordicsemi.com/bundle/nrfutil/page/nrfutil-trace/CHANGELOG.html +.. _`nRF Sniffer for Bluetooth LE`: https://docs.nordicsemi.com/bundle/nrfutil/page/nrfutil-ble-sniffer/guides/overview.html +.. _`Device command overview`: https://docs.nordicsemi.com/bundle/nrfutil/page/nrfutil-device/guides/programming.html .. _`anomaly 19`: https://docs.nordicsemi.com/bundle/errata_nRF5340_EngA/page/ERR/nRF5340/EngineeringA/latest/anomaly_340_19.html @@ -1397,16 +1398,15 @@ .. ### Source: ubuntu.com +.. _`Linux - Ubuntu 24.04 LTS`: https://releases.ubuntu.com/24.04/ .. _`Linux - Ubuntu 22.04 LTS`: https://releases.ubuntu.com/22.04/ .. _`Linux - Ubuntu 20.04 LTS`: https://releases.ubuntu.com/20.04/ .. ### Source: apple.com +.. _`macOS 15`: https://www.apple.com/macos/macos-sequoia/ .. _`macOS 14`: https://www.apple.com/macos/sonoma/ .. _`macOS 13`: https://www.apple.com/macos/ventura/ -.. _`macOS 12`: https://www.apple.com/macos/monterey/ -.. _`macOS 11`: https://support.apple.com/en-us/HT211896 -.. _`macOS 10.15`: https://support.apple.com/en-us/HT210642 .. _`Apple Notification Center Service Specification`: https://developer.apple.com/library/archive/documentation/CoreBluetooth/Reference/AppleNotificationCenterServiceSpecification/Introduction/Introduction.html .. _`Apple Media Service Reference`: https://developer.apple.com/library/ios/documentation/CoreBluetooth/Reference/AppleMediaService_Reference/Introduction/Introduction.html @@ -1419,6 +1419,7 @@ .. _`GNU Arm Embedded Toolchain`: https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads .. _`IDAU`: https://developer.arm.com/docs/100690/latest/attribution-units-sau-and-idau .. _`ARM CoreSight`: https://developer.arm.com/documentation/100536/0302 +.. _`ARM Platform Security Model 1.1`: https://developer.arm.com/documentation/den0128/0101b/ .. ### Source: etsi.org @@ -1690,10 +1691,9 @@ .. _`curl`: https://curl.se/ -.. _`nRF54H20 firmware bundle`: https://files.nordicsemi.com/artifactory/SDSC/external/nrf54h20_soc_binaries_v0.5.0.zip -.. _`nRF54H20 firmware bundle v0.3.3`: https://files.nordicsemi.com/artifactory/SDSC/external/nrf54h20_soc_binaries_v0.3.3.zip -.. _`nRF54H20 firmware bundle v0.5.0`: https://files.nordicsemi.com/artifactory/SDSC/external/nrf54h20_soc_binaries_v0.5.0.zip -.. _`nRF54H20 firmware bundle v0.6.2`: https://files.nordicsemi.com/artifactory/SDSC/external/nrf54h20_soc_binaries_v0.6.2.zip +.. _`nRF54H20 SoC Binaries v0.3.3`: https://files.nordicsemi.com/artifactory/SDSC/external/nrf54h20_soc_binaries_v0.3.3.zip +.. _`nRF54H20 SoC Binaries v0.5.0`: https://files.nordicsemi.com/artifactory/SDSC/external/nrf54h20_soc_binaries_v0.5.0.zip +.. _`nRF54H20 SoC Binaries v0.6.2`: https://files.nordicsemi.com/artifactory/SDSC/external/nrf54h20_soc_binaries_v0.6.2.zip .. _`nRF54H20 SoC binaries v0.6.5`: https://files.nordicsemi.com/artifactory/SDSC/external/nrf54h20_soc_binaries_v0.6.5.zip .. _`BICR binary file`: https://files.nordicsemi.com/artifactory/SDSC/external/bicr_ext_loadcap.hex diff --git a/doc/nrf/protocols/matter/end_product/bootloader.rst b/doc/nrf/protocols/matter/end_product/bootloader.rst index 93d5ee39b1df..edc24066e9ad 100644 --- a/doc/nrf/protocols/matter/end_product/bootloader.rst +++ b/doc/nrf/protocols/matter/end_product/bootloader.rst @@ -66,9 +66,19 @@ The nRF Connect platform in Matter uses Zephyr's :ref:`zephyr:settings_api` API This requires that you define the ``settings_storage`` partition in the flash. The recommended minimum size of the partition is 32 kB, but you can reserve even more space if your application uses the storage extensively. -The Zephyr settings storage is implemented by the Zephyr NVS (Non-Volatile Storage) module. -The NVS uses multiple sectors of 4 kB each and it has to use the appropriate number of sectors to cover all settings partition area. -To configure the number of sectors used by the NVS, set the :kconfig:option:`CONFIG_SETTINGS_NVS_SECTOR_COUNT` Kconfig option to the desired value. +The Zephyr settings storage is implemented by the :ref:`Zephyr NVS (Non-Volatile Storage) ` or :ref:`ZMS (Zephyr Memory Storage) ` backends. +You can select either backend, and the selection affects several factors, such as the operational performance or memory lifetime. +To achieve the optimal experience, it is recommended to use: + +* NVS backend for the flash-based nRF52 and nRF53 SoC families. +* ZMS backend for the RRAM- and MRAM-based nRF54 SoC families. + +The settings backend uses multiple sectors of 4 kB each, and it must use the appropriate number of sectors to cover the entire settings partition area. +To configure the number of sectors used by the backend, set the corresponding Kconfig option to the desired value: + +* :kconfig:option:`CONFIG_SETTINGS_NVS_SECTOR_COUNT` for the NVS +* :kconfig:option:`CONFIG_SETTINGS_ZMS_SECTOR_COUNT` for the ZMS + For example, to cover a settings partition of 32 kB in size, you require 8 sectors. As you can see in :ref:`ug_matter_hw_requirements_layouts`, Matter samples in the |NCS| reserve exactly 32 kB for the ``settings_storage`` partition. diff --git a/doc/nrf/protocols/matter/end_product/security.rst b/doc/nrf/protocols/matter/end_product/security.rst index bb8d0a81dcce..fffb990d79fe 100644 --- a/doc/nrf/protocols/matter/end_product/security.rst +++ b/doc/nrf/protocols/matter/end_product/security.rst @@ -120,11 +120,13 @@ This is a reference configuration that can be modified in the production firmwar - Trusted Firmware-M (TF-M) .. [1] The CryptoCell backend is used in parallel with the Oberon backend. - It is only used to implement Random Nuber Generation (RNG), and the AED keys derivation driver (only for Thread networking). - For all other cryptographic operations, the Oberon backend is used. + By default, the CryptoCell backend is used only for Random Number Generation (RNG) and the AEAD key derivation driver. + To enable the CryptoCell backend for additional operations, set the :kconfig:option:`CONFIG_PSA_CRYPTO_DRIVER_CC3XX` Kconfig option to true. -.. [2] When the CRACEN driver is used in parallel with the Oberon driver, you need to disable specific CRACEN cryptographic operations to use the Oberon ones. - This is because the CRACEN driver has priority when both are enabled. +.. [2] The CRACEN backend is used in parallel with the Oberon backend. + The CRACEN backend is used by default for any supported cryptographic operations. + For all other operations not supported by CRACEN, the Oberon backend is used. + To use the Oberon backend for specific cryptographic operations supported by both drivers, disable those operations in the CRACEN driver, as it takes priority when both are enabled. See the :ref:`nrf_security_drivers` documentation for more information. Securing production devices diff --git a/doc/nrf/protocols/matter/getting_started/advanced_kconfigs.rst b/doc/nrf/protocols/matter/getting_started/advanced_kconfigs.rst index b6c957e7ed36..02511ce1a18c 100644 --- a/doc/nrf/protocols/matter/getting_started/advanced_kconfigs.rst +++ b/doc/nrf/protocols/matter/getting_started/advanced_kconfigs.rst @@ -98,7 +98,7 @@ See :doc:`matter:nrfconnect_examples_cli` in the Matter documentation for the li Matter Settings shell commands ------------------------------ -You can enable the Matter Settings shell commands to monitor the current usage of the Zephyr Settings NVS. +You can enable the Matter Settings shell commands to monitor the current usage of the Zephyr Settings using :ref:`NVS (Non-Volatile Storage) ` or :ref:`ZMS (Zephyr Memory Storage) ` backends. These commands are useful for verifying that the ``settings`` partition has the proper size and meets the application requirements. To enable the Matter Settings shell module, set the :kconfig:option:`CONFIG_NCS_SAMPLE_MATTER_SETTINGS_SHELL` Kconfig option to ``y``. @@ -111,10 +111,6 @@ You can use the following shell commands: * ``matter_settings current`` - Get the size of the current settings usage. * ``matter_settings free`` - Get the size of the current free settings space. -.. note:: - - The Matter Settings shell module is available only for the NVS Zephyr Settings backend. - .. _ug_matter_configuring_device_identification: Matter device identification @@ -183,15 +179,15 @@ To enable one of the reactions to the last fabric removal, set the corresponding * :kconfig:option:`CONFIG_CHIP_LAST_FABRIC_REMOVED_ERASE_AND_REBOOT` - Remove all saved network credentials and reboot the device. This option is selected by default. - When the :kconfig:option:`CONFIG_CHIP_FACTORY_RESET_ERASE_NVS` Kconfig option is also set to ``y``, the device will also remove all non-volatile data stored on the device, including application-specific entries. + When the :kconfig:option:`CONFIG_CHIP_FACTORY_RESET_ERASE_SETTINGS` Kconfig option is also set to ``y``, the device will also remove all non-volatile data stored on the device, including application-specific entries. This means the device is restored to the factory settings. To create a delay between the chosen reaction and the last fabric being removed, set the :kconfig:option:`CONFIG_CHIP_LAST_FABRIC_REMOVED_ACTION_DELAY` Kconfig option to a specific time in milliseconds. By default this Kconfig option is set to 1 second. .. note:: - The :kconfig:option:`CONFIG_CHIP_FACTORY_RESET_ERASE_NVS` Kconfig option is set to ``y`` by default. - To disable removing application-specific non-volatile data when the :kconfig:option:`CONFIG_CHIP_LAST_FABRIC_REMOVED_ERASE_AND_REBOOT` Kconfig option is selected, set the :kconfig:option:`CONFIG_CHIP_FACTORY_RESET_ERASE_NVS` Kconfig option to ``n``. + The :kconfig:option:`CONFIG_CHIP_FACTORY_RESET_ERASE_SETTINGS` Kconfig option is set to ``y`` by default. + To disable removing application-specific non-volatile data when the :kconfig:option:`CONFIG_CHIP_LAST_FABRIC_REMOVED_ERASE_AND_REBOOT` Kconfig option is selected, set the :kconfig:option:`CONFIG_CHIP_FACTORY_RESET_ERASE_SETTINGS` Kconfig option to ``n``. .. _ug_matter_configuring_read_client: diff --git a/doc/nrf/protocols/thread/overview/memory_tables/nrf52840.txt b/doc/nrf/protocols/thread/overview/memory_tables/nrf52840.txt index 29a53cf28cad..bd6c9988bc5d 100644 --- a/doc/nrf/protocols/thread/overview/memory_tables/nrf52840.txt +++ b/doc/nrf/protocols/thread/overview/memory_tables/nrf52840.txt @@ -7,19 +7,19 @@ +-----------------------------+----------+-------+-------+ | | master | FTD | MTD | +=============================+==========+=======+=======+ - | ROM OT stack + App [kB] | 455 | 360 | 306 | + | ROM OT stack + App [kB] | 443 | 358 | 303 | +-----------------------------+----------+-------+-------+ | ROM Bluetooth LE stack [kB] | 0 | 0 | 0 | +-----------------------------+----------+-------+-------+ | Persistent storage [kB] | 32 | 32 | 32 | +-----------------------------+----------+-------+-------+ - | Free ROM [kB] | 537 | 632 | 686 | + | Free ROM [kB] | 549 | 634 | 689 | +-----------------------------+----------+-------+-------+ - | RAM OT stack + App [kB] | 101 | 93 | 83 | + | RAM OT stack + App [kB] | 102 | 93 | 83 | +-----------------------------+----------+-------+-------+ | RAM Bluetooth LE stack [kB] | 0 | 0 | 0 | +-----------------------------+----------+-------+-------+ - | Free RAM [kB] | 155 | 163 | 173 | + | Free RAM [kB] | 154 | 163 | 173 | +-----------------------------+----------+-------+-------+ @@ -30,17 +30,17 @@ +-----------------------------+----------+-------+-------+ | | master | FTD | MTD | +=============================+==========+=======+=======+ - | ROM OT stack + App [kB] | 455 | 360 | 306 | + | ROM OT stack + App [kB] | 443 | 358 | 303 | +-----------------------------+----------+-------+-------+ - | ROM Bluetooth LE stack [kB] | 76 | 77 | 76 | + | ROM Bluetooth LE stack [kB] | 75 | 75 | 76 | +-----------------------------+----------+-------+-------+ | Persistent storage [kB] | 32 | 32 | 32 | +-----------------------------+----------+-------+-------+ - | Free ROM [kB] | 461 | 555 | 610 | + | Free ROM [kB] | 474 | 559 | 613 | +-----------------------------+----------+-------+-------+ - | RAM OT stack + App [kB] | 101 | 93 | 83 | + | RAM OT stack + App [kB] | 102 | 93 | 83 | +-----------------------------+----------+-------+-------+ - | RAM Bluetooth LE stack [kB] | 12 | 12 | 12 | + | RAM Bluetooth LE stack [kB] | 12 | 13 | 13 | +-----------------------------+----------+-------+-------+ - | Free RAM [kB] | 143 | 151 | 161 | + | Free RAM [kB] | 142 | 150 | 160 | +-----------------------------+----------+-------+-------+ diff --git a/doc/nrf/protocols/thread/overview/memory_tables/nrf5340.txt b/doc/nrf/protocols/thread/overview/memory_tables/nrf5340.txt index ea87ff2b12ed..0331a3c0daf6 100644 --- a/doc/nrf/protocols/thread/overview/memory_tables/nrf5340.txt +++ b/doc/nrf/protocols/thread/overview/memory_tables/nrf5340.txt @@ -7,19 +7,19 @@ +-----------------------------+-------+-------+ | | FTD | MTD | +=============================+=======+=======+ - | ROM OT stack + App [kB] | 330 | 276 | + | ROM OT stack + App [kB] | 329 | 275 | +-----------------------------+-------+-------+ | ROM Bluetooth LE stack [kB] | 0 | 0 | +-----------------------------+-------+-------+ | Persistent storage [kB] | 32 | 32 | +-----------------------------+-------+-------+ - | Free ROM [kB] | 662 | 716 | + | Free ROM [kB] | 663 | 717 | +-----------------------------+-------+-------+ - | RAM OT stack + App [kB] | 100 | 90 | + | RAM OT stack + App [kB] | 101 | 90 | +-----------------------------+-------+-------+ | RAM Bluetooth LE stack [kB] | 0 | 0 | +-----------------------------+-------+-------+ - | Free RAM [kB] | 412 | 422 | + | Free RAM [kB] | 411 | 422 | +-----------------------------+-------+-------+ @@ -30,17 +30,17 @@ +-----------------------------+-------+-------+ | | FTD | MTD | +=============================+=======+=======+ - | ROM OT stack + App [kB] | 330 | 276 | + | ROM OT stack + App [kB] | 329 | 275 | +-----------------------------+-------+-------+ - | ROM Bluetooth LE stack [kB] | 31 | 30 | + | ROM Bluetooth LE stack [kB] | 30 | 30 | +-----------------------------+-------+-------+ | Persistent storage [kB] | 32 | 32 | +-----------------------------+-------+-------+ - | Free ROM [kB] | 631 | 686 | + | Free ROM [kB] | 633 | 687 | +-----------------------------+-------+-------+ - | RAM OT stack + App [kB] | 100 | 90 | + | RAM OT stack + App [kB] | 101 | 90 | +-----------------------------+-------+-------+ - | RAM Bluetooth LE stack [kB] | 14 | 14 | + | RAM Bluetooth LE stack [kB] | 13 | 14 | +-----------------------------+-------+-------+ | Free RAM [kB] | 398 | 408 | +-----------------------------+-------+-------+ diff --git a/doc/nrf/protocols/thread/overview/memory_tables/nrf54l15.txt b/doc/nrf/protocols/thread/overview/memory_tables/nrf54l15.txt index 1d1fd295b64c..566f7ee16bb2 100644 --- a/doc/nrf/protocols/thread/overview/memory_tables/nrf54l15.txt +++ b/doc/nrf/protocols/thread/overview/memory_tables/nrf54l15.txt @@ -7,19 +7,19 @@ +-----------------------------+----------+-------+-------+ | | master | FTD | MTD | +=============================+==========+=======+=======+ - | ROM OT stack + App [kB] | 461 | 364 | 310 | + | ROM OT stack + App [kB] | 453 | 366 | 313 | +-----------------------------+----------+-------+-------+ | ROM Bluetooth LE stack [kB] | 0 | 0 | 0 | +-----------------------------+----------+-------+-------+ | Persistent storage [kB] | 32 | 32 | 32 | +-----------------------------+----------+-------+-------+ - | Free ROM [kB] | 1031 | 1128 | 1182 | + | Free ROM [kB] | 1039 | 1126 | 1179 | +-----------------------------+----------+-------+-------+ - | RAM OT stack + App [kB] | 98 | 92 | 82 | + | RAM OT stack + App [kB] | 104 | 97 | 87 | +-----------------------------+----------+-------+-------+ | RAM Bluetooth LE stack [kB] | 0 | 0 | 0 | +-----------------------------+----------+-------+-------+ - | Free RAM [kB] | 158 | 164 | 174 | + | Free RAM [kB] | 152 | 159 | 169 | +-----------------------------+----------+-------+-------+ @@ -30,17 +30,17 @@ +-----------------------------+----------+-------+-------+ | | master | FTD | MTD | +=============================+==========+=======+=======+ - | ROM OT stack + App [kB] | 461 | 364 | 310 | + | ROM OT stack + App [kB] | 453 | 366 | 313 | +-----------------------------+----------+-------+-------+ - | ROM Bluetooth LE stack [kB] | 93 | 93 | 93 | + | ROM Bluetooth LE stack [kB] | 91 | 91 | 91 | +-----------------------------+----------+-------+-------+ | Persistent storage [kB] | 32 | 32 | 32 | +-----------------------------+----------+-------+-------+ - | Free ROM [kB] | 938 | 1035 | 1089 | + | Free ROM [kB] | 948 | 1035 | 1088 | +-----------------------------+----------+-------+-------+ - | RAM OT stack + App [kB] | 98 | 92 | 82 | + | RAM OT stack + App [kB] | 104 | 97 | 87 | +-----------------------------+----------+-------+-------+ - | RAM Bluetooth LE stack [kB] | 13 | 13 | 13 | + | RAM Bluetooth LE stack [kB] | 14 | 14 | 14 | +-----------------------------+----------+-------+-------+ - | Free RAM [kB] | 145 | 151 | 161 | + | Free RAM [kB] | 138 | 145 | 155 | +-----------------------------+----------+-------+-------+ diff --git a/doc/nrf/protocols/wifi/station_mode/images/nRF70_ug_twt_wake_interval.svg b/doc/nrf/protocols/wifi/station_mode/images/nRF70_ug_twt_wake_interval.svg index 5ecb7f4059bf..8179364482a9 100644 --- a/doc/nrf/protocols/wifi/station_mode/images/nRF70_ug_twt_wake_interval.svg +++ b/doc/nrf/protocols/wifi/station_mode/images/nRF70_ug_twt_wake_interval.svg @@ -57,50 +57,49 @@ Dynamic connector.20 - + Sheet.20 - TWT Wake Duration/Service Period + TWT Wake Interval/Service Period - - - TWT Wake Duration/Service Period - + + + TWT Wake Interval/Service Period + Nordic Blue.24 Sleep Sleep - + Nordic Blue.29 Active Active - + Nordic Blue.30 Sleep Sleep - + Dynamic connector.31 - + Dynamic connector.34 - + Sheet.36 - TWT Wake Interval + TWT Interval - TWT Wake Interval + TWT Interval diff --git a/doc/nrf/releases_and_maturity/abi_compatibility.rst b/doc/nrf/releases_and_maturity/abi_compatibility.rst index b08de2eaad74..420cf9df5798 100644 --- a/doc/nrf/releases_and_maturity/abi_compatibility.rst +++ b/doc/nrf/releases_and_maturity/abi_compatibility.rst @@ -18,10 +18,10 @@ When ABI compatibility is maintained, binaries of one component can interface co For example, adding a new function to a library is typically an ABI-compatible change, as existing binaries remain functional. However, changes that affect data structure layouts, such as altering field order or size, break ABI compatibility as they change the memory layout expected by existing binaries. -ABI Compatibility Matrix for the nrf54h20_soc_binary bundle -=========================================================== +ABI Compatibility Matrix for the nRF54H20 SoC Binaries +====================================================== -The following table illustrates ABI compatibility between different versions of the nRF54H20 SoC binaries bundle and the |NCS|: +The following table illustrates ABI compatibility between different versions of the nRF54H20 SoC binaries and the |NCS|: .. list-table:: :header-rows: 1 @@ -29,13 +29,13 @@ The following table illustrates ABI compatibility between different versions of * - |NCS| versions - Compatible nRF54H20 SoC binaries version * - |NCS| v2.7.99-cs2 - - nrf54h20_soc_binaries v0.6.5 + - `nRF54H20 SoC Binaries v0.6.5`_ * - |NCS| v2.7.99-cs1 - - nrf54h20_soc_binaries v0.6.2 + - `nRF54H20 SoC Binaries v0.6.2`_ * - |NCS| v2.7.0 - - nrf54h20_soc_binaries v0.5.0 + - `nRF54H20 SoC Binaries v0.5.0`_ * - |NCS| v2.6.99-cs2 - - nrf54h20_soc_binaries v0.3.3 + - `nRF54H20 SoC Binaries v0.3.3`_ ABI compatibility ensures that the Secure Domain and System Controller firmware binaries do not need to be recompiled each time the Application, Radio binaries, or both are recompiled, as long as they are based on a compatible NCS version. Additionally, maintaining ABI compatibility allows the nRF54H20 SoC binaries components to work together without recompilation when updating to newer |NCS| versions. diff --git a/doc/nrf/releases_and_maturity/known_issues.rst b/doc/nrf/releases_and_maturity/known_issues.rst index 8fda6e8dd6ce..a50e6e7929b4 100644 --- a/doc/nrf/releases_and_maturity/known_issues.rst +++ b/doc/nrf/releases_and_maturity/known_issues.rst @@ -144,7 +144,14 @@ KRKNWK-14299: NRPA MAC address cannot be set in Zephyr Bluetooth LE ============ -The issues in this section are related to :ref:`ug_ble_controller`. +.. rst-class:: v2-7-0 v2-6-2 v2-6-1 v2-6-0 v2-5-3 v2-5-2 v2-4-4 v2-4-3 + +DRGN-23231: The Bluetooth subsystem may sometimes deadlock when a Bluetooth link is lost during data transfer + When this happens, the disconnected event is never delivered to the application. + The issue occurs when the :kconfig:option:`CONFIG_BT_HCI_ACL_FLOW_CONTROL` Kconfig option is enabled. + This option is enabled by default on the nRF5340 DK. + + **Affected platforms:** nRF5340 .. rst-class:: v2-7-0 @@ -268,6 +275,13 @@ DRGN-21390: The `disconnected` callback might not get called on nRF5340 **Workaround:** Either disable host flow control (:kconfig:option:`CONFIG_BT_HCI_ACL_FLOW_CONTROL`) or cherry-pick commits from the upstream: `Zephyr PR #65272 `_. +.. rst-class:: v2-7-0 v2-6-2 v2-6-1 v2-6-0 v2-5-3 v2-5-2 v2-5-1 v2-5-0 v2-4-4 v2-4-3 v2-4-2 v2-4-1 v2-4-0 v2-3-0 v2-2-0 v2-1-4 v2-1-3 v2-1-2 v2-1-1 v2-1-0 v2-0-2 v2-0-1 v2-0-0 v1-9-1 v1-9-0 v1-8-0 v1-7-1 + +DRGN-23518: ACL reassembly may deadlock + This can happen if the value of :kconfig:option:`CONFIG_BT_BUF_ACL_RX_COUNT` Kconfig option is less than or equal to the value of :kconfig:option:`CONFIG_BT_MAX_CONN`. + + **Workaround:** Ensure that the value of :kconfig:option:`CONFIG_BT_BUF_ACL_RX_COUNT` is greater than the value of :kconfig:option:`CONFIG_BT_MAX_CONN`. + Bluetooth Mesh ============== @@ -380,6 +394,15 @@ Matter The issues in this section are related to the :ref:`ug_matter` protocol. +.. rst-class:: v2-7-0 v2-6-2 v2-6-1 v2-6-0 v2-5-3 v2-5-2 v2-5-1 v2-5-0 v2-4-4 v2-4-3 v2-4-2 v2-4-1 v2-4-0 + +KRKNWK-19524: Reliability issues with multicast message delivery for certain Access Points. + Certain Access Points require Wi-Fi devices to send Multicast Listener Discovery version 2 (MLDv2) Report messages for multicast packets to be properly delivered to a given address. + Matter over Wi-Fi devices only subscribed to multicast addresses within the internal IPv6 stack, without notifying the Access Points, leading to reliability issues with multicast message delivery. + + **Workaround:** To ensure reliable multicast communication, use the :c:func:`net_ipv6_mld_join` and :c:func:`net_ipv6_mld_leave` functions to explicitly subscribe or unsubscribe to multicast addresses. + For reference, see the commit with the fix in the ``sdk-connectedhomeip`` repository (commit hash: ``TBD``). + .. rst-class:: v2-7-0 KRKNWK-19443: The device commissioning window can be opened for longer than 900 seconds, which violates the Matter specification. @@ -1052,6 +1075,13 @@ Zigbee The issues in this section are related to the :ref:`ug_zigbee` protocol. +.. rst-class:: v2-7-0 + +KRKNWK-19263: FOTA DFU on the nRF5340 DK fails due to an invalid update image + Performing FOTA DFU throws an error during an attempt to install the new image. + + **Workaround:** Manually cherry-pick and apply the commit with the fix from ``main`` (commit hash: ``cc5ae95668566b47b9f6bfccb99b3796de8cb076``). + .. rst-class:: v2-6-2 v2-6-1 v2-6-0 v2-5-3 v2-5-2 v2-5-1 v2-5-0 v2-4-4 v2-4-3 v2-4-2 v2-4-1 v2-4-0 v2-3-0 v2-2-0 v2-1-4 v2-1-3 v2-1-2 v2-1-1 v2-1-0 v2-0-2 v2-0-1 v2-0-0 v1-9-2 v1-9-1 v1-9-0 NCSISB-1204: Corrupted ZBOSS NVRAM causes an infinite boot loop 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 b0a9ca02b9d4..49bf2e572dda 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 @@ -16,7 +16,7 @@ The main development environment changes introduced by 2.6.99-cs2 for the nRF54H * nRF Util has now replaced nRF Command Line Tools. The bootstrap script will now install and update nRF Util. * SDFW and SCFW are now provided as precompiled binaries. - The Secure Domain Firmware (SDFW) and System Controller Firmware (SCFW) are no longer built from the source during the application build process, but they must be provisioned as binaries from the provided firmware bundle before the DK can be used. + The Secure Domain Firmware (SDFW) and System Controller Firmware (SCFW) are no longer built from the source during the application build process, but they must be provisioned as binaries from the provided SoC binaries before the DK can be used. See the details in the `nRF54H20 DK bring-up`_ section below. * The nRF54H20 SoC lifecycle state must now be set to Root of Trust (RoT). See the details in the `Transitioning the nRF54H20 SoC to RoT`_ section. @@ -272,9 +272,9 @@ Programming the SDFW and SCFW ============================= After programming the BICR, the nRF54H20 SoC requires the provisioning of a bundle ( :file:`nrf54h20_soc_binaries_v0.3.3.zip`) containing the precompiled firmware for the Secure Domain and System Controller. -To program the Secure Domain Firmware (SDFW, also known as ``urot``) and the System Controller Firmware (SCFW) from the firmware bundle to the nRF54H20 DK, do the following: +To program the Secure Domain Firmware (SDFW, also known as ``urot``) and the System Controller Firmware (SCFW) from the SoC binaries to the nRF54H20 DK, do the following: -1. Download the `nRF54H20 firmware bundle`_. +1. Download the `nRF54H20 SoC binaries v0.3.3`_. #. Move the :file:`ZIP` bundle to a folder of your choice, then run nRF Util to program the binaries using the following command:: nrfutil device x-provision-nrf54h --firmware --serial-number @@ -284,7 +284,7 @@ To program the Secure Domain Firmware (SDFW, also known as ``urot``) and the Sys Updating the FICR ================= -After programming the SDFW and SCFW from the firmware bundle, you must update the Factory Information Configuration Registers (FICR) to correctly configure some trims of the nRF54H20 SoC. +After programming the SDFW and SCFW from the SoC binaries, you must update the Factory Information Configuration Registers (FICR) to correctly configure some trims of the nRF54H20 SoC. To update the FICR, you must run a J-Link script: 1. Get the Jlink script that updates the FICR:: diff --git a/doc/nrf/releases_and_maturity/migration/migration_guide_2.8.rst b/doc/nrf/releases_and_maturity/migration/migration_guide_2.8.rst index 7da38d1fdce5..650522d09faa 100644 --- a/doc/nrf/releases_and_maturity/migration/migration_guide_2.8.rst +++ b/doc/nrf/releases_and_maturity/migration/migration_guide_2.8.rst @@ -134,6 +134,7 @@ LTE link control library * Replace the use of the :c:func:`lte_lc_deinit` function with the :c:func:`lte_lc_power_off` function. * Replace the use of the :c:func:`lte_lc_init_and_connect` function with the :c:func:`lte_lc_connect` function. * Replace the use of the :c:func:`lte_lc_init_and_connect_async` function with the :c:func:`lte_lc_connect_async` function. + * Replace the use of the :c:macro:`LTE_LC_ON_CFUN` macro with the :c:macro:`NRF_MODEM_LIB_ON_CFUN` macro. * Remove the use of the ``CONFIG_LTE_NETWORK_USE_FALLBACK`` Kconfig option. Use the :kconfig:option:`CONFIG_LTE_NETWORK_MODE_LTE_M_NBIOT` or :kconfig:option:`CONFIG_LTE_NETWORK_MODE_LTE_M_NBIOT_GPS` Kconfig option instead. In addition, you can control the priority between LTE-M and NB-IoT using the :kconfig:option:`CONFIG_LTE_MODE_PREFERENCE` Kconfig option. @@ -145,22 +146,24 @@ AT command parser * The :c:func:`at_parser_cmd_type_get` has been renamed to :c:func:`at_parser_at_cmd_type_get`. -nRF Security ------------- +nRF Cloud +--------- .. toggle:: - * The ``CONFIG_CRACEN_LOAD_KMU_SEED`` Kconfig option was renamed to :kconfig:option:`CONFIG_CRACEN_IKG_SEED_LOAD`. - -.. _migration_2.8_recommended: + * The :kconfig:option:`CONFIG_NRF_CLOUD_COAP_DOWNLOADS` Kconfig option has been enabled by default for nRF Cloud CoAP projects using the :kconfig:option:`CONFIG_NRF_CLOUD_FOTA_POLL` or :kconfig:option:`CONFIG_NRF_CLOUD_PGPS` Kconfig option. + Set the :kconfig:option:`CONFIG_COAP_EXTENDED_OPTIONS_LEN_VALUE` Kconfig option to at least ``80`` for P-GPS and ``192`` for FOTA. nRF Security ------------ .. toggle:: - * The ``CONFIG_MBEDTLS_CIPHER_MODE_CFB`` and ``CONFIG_MBEDTLS_CIPHER_MODE_OFB`` Kconfig options have been removed. - Use other cipher modes instead. + * The ``CONFIG_CRACEN_LOAD_KMU_SEED`` Kconfig option was renamed to :kconfig:option:`CONFIG_CRACEN_IKG_SEED_LOAD`. + * The ``CONFIG_MBEDTLS_CIPHER_MODE_CFB`` and ``CONFIG_MBEDTLS_CIPHER_MODE_OFB`` Kconfig options have been removed. + Use other cipher modes instead. + +.. _migration_2.8_recommended: Recommended changes ******************* @@ -376,6 +379,72 @@ AT command parser */ at_parser_cmd_type_get(&at_parser, &type); +LTE link control library +------------------------ + +.. toggle:: + + * For applications using :ref:`lte_lc_readme`: + + * Replace the use of the :c:func:`lte_lc_factory_reset` function with the following: + + * If the :c:enumerator:`LTE_LC_FACTORY_RESET_ALL` value is used with the :c:func:`lte_lc_factory_reset` function: + + .. code-block:: C + + #include + + err = nrf_modem_at_printf("AT%%XFACTORYRESET=0"); + + * If the :c:enumerator:`LTE_LC_FACTORY_RESET_USER` value is used with the :c:func:`lte_lc_factory_reset` function: + + .. code-block:: C + + #include + + err = nrf_modem_at_printf("AT%%XFACTORYRESET=1"); + + * Replace the use of the :c:func:`lte_lc_reduced_mobility_get` function with the following: + + .. code-block:: C + + #include + + uint16_t mode; + + ret = nrf_modem_at_scanf("AT%REDMOB?", "%%REDMOB: %hu", &mode); + if (ret != 1) { + /* Handle failure. */ + } else { + /* Handle success. */ + } + + * Replace the use of the :c:func:`lte_lc_reduced_mobility_set` function with the following: + + * If the :c:enumerator:`LTE_LC_REDUCED_MOBILITY_DEFAULT` value is used with the :c:func:`lte_lc_reduced_mobility_set` function: + + .. code-block:: C + + #include + + err = nrf_modem_at_printf("AT%%REDMOB=0"); + + * If the :c:enumerator:`LTE_LC_REDUCED_MOBILITY_NORDIC` value is used with the :c:func:`lte_lc_reduced_mobility_set` function: + + .. code-block:: C + + #include + + err = nrf_modem_at_printf("AT%%REDMOB=1"); + + * If the :c:enumerator:`LTE_LC_REDUCED_MOBILITY_DISABLED` value is used with the :c:func:`lte_lc_reduced_mobility_set` function: + + .. code-block:: C + + #include + + err = nrf_modem_at_printf("AT%%REDMOB=2"); + Snippets ======== diff --git a/doc/nrf/releases_and_maturity/migration/migration_guide_nRF54H20_cs_to_2_7.rst b/doc/nrf/releases_and_maturity/migration/migration_guide_nRF54H20_cs_to_2_7.rst index 76b759273996..faeeff027ef1 100644 --- a/doc/nrf/releases_and_maturity/migration/migration_guide_nRF54H20_cs_to_2_7.rst +++ b/doc/nrf/releases_and_maturity/migration/migration_guide_nRF54H20_cs_to_2_7.rst @@ -29,9 +29,8 @@ See the following documents, based on the version you are migrating from. nRF54H20_migration_2.7/migration_guide_2.6.99-cs2_to_2_7_environment nRF54H20_migration_2.7/migration_guide_2.6.99-cs2_to_2.7_application -.. toctree:: - :maxdepth: 1 - :caption: Other relevant migration documents - migration_hwmv2 - migration_sysbuild +Consult also the following pages about *Hardware model v2* and *Sysbuild*: + +* :ref:`hwmv1_to_v2_migration` +* :ref:`child_parent_to_sysbuild_migration` diff --git a/doc/nrf/releases_and_maturity/migration/migration_guide_nRF54H20_cs_to_2_7_99-cs1.rst b/doc/nrf/releases_and_maturity/migration/migration_guide_nRF54H20_cs_to_2_7_99-cs1.rst index ff22d0bb91cc..615f6086bf7c 100644 --- a/doc/nrf/releases_and_maturity/migration/migration_guide_nRF54H20_cs_to_2_7_99-cs1.rst +++ b/doc/nrf/releases_and_maturity/migration/migration_guide_nRF54H20_cs_to_2_7_99-cs1.rst @@ -47,14 +47,14 @@ nRF54H20 BICR nrfutil device program --options chip_erase_mode=ERASE_NONE --firmware --core Application --serial-number SDFW and SCFW firmwares - The *nRF54H20 firmware bundle* has been updated to version 0.6.2. + The *nRF54H20 SoC binaries* have been updated to version 0.6.2. .. caution:: - Before proceeding with the firmware bundle update, you must first update the BICR as described in the previous chapter. + Before proceeding with the SoC binaries update, you must first update the BICR as described in the previous chapter. - To update the firmware bundle of your development kit while in Root of Trust, do the following: + To update the SoC binaries of your development kit while in Root of Trust, do the following: - 1. Download the `nRF54H20 firmware bundle v0.6.2`_. + 1. Download the `nRF54H20 SoC binaries v0.6.2`_. .. note:: On MacOS, ensure that the ZIP file is not unpacked automatically upon download. diff --git a/doc/nrf/releases_and_maturity/migration/migration_guide_nRF54H20_cs_to_2_7_99-cs2.rst b/doc/nrf/releases_and_maturity/migration/migration_guide_nRF54H20_cs_to_2_7_99-cs2.rst index 03f0db45c37e..fdc471bc30c7 100644 --- a/doc/nrf/releases_and_maturity/migration/migration_guide_nRF54H20_cs_to_2_7_99-cs2.rst +++ b/doc/nrf/releases_and_maturity/migration/migration_guide_nRF54H20_cs_to_2_7_99-cs2.rst @@ -62,7 +62,7 @@ SDFW and SCFW firmwares The *nRF54H20 SoC binaries* bundle has been updated to version 0.6.5. .. caution:: - If migrating from |NCS| v2.7.0, before proceeding with the firmware bundle update, you must first update the BICR as described in the previous chapter. + If migrating from |NCS| v2.7.0, before proceeding with the SoC binaries update, you must first update the BICR as described in the previous chapter. To update the SoC binaries bundle of your development kit while in Root of Trust, do the following: diff --git a/doc/nrf/releases_and_maturity/migration/nRF54H20_migration_2.7/migration_guide_2.4.99-cs3_to_2.7_application.rst b/doc/nrf/releases_and_maturity/migration/nRF54H20_migration_2.7/migration_guide_2.4.99-cs3_to_2.7_application.rst index 3921f49180ab..af72d0beeca0 100644 --- a/doc/nrf/releases_and_maturity/migration/nRF54H20_migration_2.7/migration_guide_2.4.99-cs3_to_2.7_application.rst +++ b/doc/nrf/releases_and_maturity/migration/nRF54H20_migration_2.7/migration_guide_2.4.99-cs3_to_2.7_application.rst @@ -31,10 +31,10 @@ DTS changes The layout of DTS files and the names of DTS nodes related to the updated board names have been updated, which also affects overlay files from applications and samples. If your application required a specific custom board, you must update the custom board files to match the changes done to the nRF54H20 SoC DTS files. -SDFW and SCFW firmware bundle +nRF54H20 SoC binaries The Secure Domain Firmware (SDFW) and System Controller Firmware (SCFW) are no longer built from the source during the application build process. - They are provided as a firmware bundle (v0.5.0) and provisioned to the nRF54H20 during the bring-up steps. - The nRF54H20 DK must be in lifecycle state ``EMPTY`` to be provisioned with the new firmware bundle. + They are provided as a SoC binaries bundle (v0.5.0) and provisioned to the nRF54H20 during the bring-up steps. + The nRF54H20 DK must be in lifecycle state ``EMPTY`` to be provisioned with the new SoC binaries. For additional details, see :ref:`transition_cs3_to_2_7_env_bringup`. nRF Util is now the main command line backend utility. diff --git a/doc/nrf/releases_and_maturity/migration/nRF54H20_migration_2.7/migration_guide_2.6.99-cs2_to_2.7_application.rst b/doc/nrf/releases_and_maturity/migration/nRF54H20_migration_2.7/migration_guide_2.6.99-cs2_to_2.7_application.rst index 89a2c4ec0749..61a8934855ce 100644 --- a/doc/nrf/releases_and_maturity/migration/nRF54H20_migration_2.7/migration_guide_2.6.99-cs2_to_2.7_application.rst +++ b/doc/nrf/releases_and_maturity/migration/nRF54H20_migration_2.7/migration_guide_2.6.99-cs2_to_2.7_application.rst @@ -28,10 +28,10 @@ Hardware Model v2 A new hardware model was recently introduced in the |NCS|. For more information, see :ref:`hwmv1_to_v2_migration`. -SDFW and SCFW firmware bundle - A new version (v0.5.0) of the SDFW and SCFW firmware bundle was released. +nRF54H20 SoC binaries + A new version (v0.5.0) of the nRF54H20 SoC binaries was released. This is the only version compatible with the |NCS| v2.7.0. - The nRF54H20 DK must be in lifecycle state ``EMPTY`` to be provisioned with the new firmware bundle. + The nRF54H20 DK must be in lifecycle state ``EMPTY`` to be provisioned with the new SoC binaries. DTS changes The layout of DTS files and the names of DTS nodes related to the updated board names have been updated, which also affects overlay files from applications and samples. 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 8bb949de0779..babb48d150ab 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 @@ -18,10 +18,10 @@ The following is a summary of the most important ones: Updated |NCS| toolchain The |NCS| toolchain has been updated. -SDFW and SCFW firmware bundle - A new version (v0.5.0) of the SDFW and SCFW firmware bundle was released. +SDFW and SCFW SoC binaries + A new version (v0.5.0) of the nRF54H20 SoC binaries bundle was released. This is the only version compatible with the |NCS| v2.7.0. - The nRF54H20 DK must be in lifecycle state ``EMPTY`` to be provisioned with the new firmware bundle. + The nRF54H20 DK must be in lifecycle state ``EMPTY`` to be provisioned with the new SoC binaries. Minimum requirements ******************** @@ -45,7 +45,7 @@ On your computer, one of the following operating systems: :start-after: os_table_start :end-before: os_table_end -See :ref:`supported_OS` for more information about the tier definitions. +See :ref:`supported_OS` for more information. |supported OS| @@ -155,7 +155,7 @@ Verify the LCS of the device The current nRF54H20 DK is delivered with its lifecycle state (LCS) set to ``EMPTY``. To correctly operate, its lifecycle state must be transitioned to Root of Trust (``RoT``) through the bring-up steps. -To be compatible with |NCS| v2.7.0, the SDFW and SCFW firmware bundle programmed on the nRF54H20 DK during through the bring-up steps must be v0.5.0. +To be compatible with |NCS| v2.7.0, the nRF54H20 SoC binaries programmed on the nRF54H20 DK during through the bring-up steps must be v0.5.0. .. note:: The forward transition to LCS ``RoT`` is permanent. @@ -187,11 +187,11 @@ The output will look similar to the following:: If the lifecycle state (``psa_lifecycle``) shown is not ``RoT`` (``LIFECYCLE_EMPTY (0x1000)`` means the LCS is set to ``EMPTY``) you can follow the bring-up steps in the next chapter. If the lifecycle state (``psa_lifecycle``) shown is ``RoT`` (``LIFECYCLE_ROT (0x2000)``), the device is in Root of Trust: -* If your nRF54H20 DK was already programmed with the SDFW and SCFW firmware bundle version 0.5.0, you can jump to the :ref:`migration_cs2_to_2_7_env_nextsteps` chapter. -* If your current nRF54H20 DK was programmed with a firmware bundle version 0.3.x: +* If your nRF54H20 DK was already programmed with the nRF54H20 SoC binaries version 0.5.0, you can jump to the :ref:`migration_cs2_to_2_7_env_nextsteps` chapter. +* If your current nRF54H20 DK was programmed with the SoC binaries version 0.3.x: * Use a different nRF54H20 DK with LCS ``EMPTY`` and continue to the nRF54H20 bring-up. - * Use a different nRF54H20 DK with LCS ``RoT`` and already programmed with the firmware bundle version 0.5.0. + * Use a different nRF54H20 DK with LCS ``RoT`` and already programmed with the SoC binaries version 0.5.0. nRF54H20 DK bring-up ******************** @@ -231,9 +231,9 @@ Provisioning the SDFW and SCFW ============================== After programming the BICR, the nRF54H20 SoC requires the provisioning of a bundle ( :file:`nrf54h20_soc_binaries_v0.5.0.zip`) containing the precompiled firmware for the Secure Domain and System Controller. -To program the Secure Domain Firmware (SDFW, also known as ``urot``) and the System Controller Firmware (SCFW) from the firmware bundle to the nRF54H20 DK, do the following: +To program the Secure Domain Firmware (SDFW, also known as ``urot``) and the System Controller Firmware (SCFW) from the SoC binaries to the nRF54H20 DK, do the following: -1. Download the `nRF54H20 firmware bundle v0.5.0`_. +1. Download the `nRF54H20 SoC binaries v0.5.0`_. .. note:: On MacOS, ensure that the ZIP file is not unpacked automatically upon download. @@ -251,7 +251,7 @@ Updating the FICR This step is required only if your nRF54H20 DK is version PCA10175 v0.7.2 or v0.8.0 ES3.3. Jump to the next step if your DK is version ES4, meaning v0.8.0 with no ES markings. -After programming the SDFW and SCFW from the firmware bundle, you must update the Factory Information Configuration Registers (FICR) to correctly configure some trims of the nRF54H20 SoC. +After programming the SDFW and SCFW from the SoC binaries, you must update the Factory Information Configuration Registers (FICR) to correctly configure some trims of the nRF54H20 SoC. To update the FICR, you must run a J-Link script: 1. Get the Jlink script that updates the FICR:: 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 cd142644ac5f..341c8d45f6be 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 @@ -14,8 +14,8 @@ The main development environment changes introduced by v2.7.0 for the nRF54H20 D * The |NCS| toolchain has been updated. * nRF Util is now used by the build system. * The Secure Domain Firmware (SDFW) and System Controller Firmware (SCFW) are no longer built from the source during the application build process. - They are provided as a firmware bundle (v0.5.0) and provisioned to the nRF54H20 during the bring-up steps. - The nRF54H20 DK must be in lifecycle state ``EMPTY`` to be provisioned with the new firmware bundle. + They are provided as a SoC binaries bundle (v0.5.0) and provisioned to the nRF54H20 during the bring-up steps. + The nRF54H20 DK must be in lifecycle state ``EMPTY`` to be provisioned with the new SoC binaries. For additional details, see :ref:`transition_cs3_to_2_7_env_bringup`. See the details in the `nRF54H20 DK bring-up`_ section below. * To correctly operate the nRF54H20 DK, its lifecycle state must be set to ``RoT`` after the bring-up. @@ -45,7 +45,7 @@ On your computer, one of the following operating systems: :start-after: os_table_start :end-before: os_table_end -See :ref:`supported_OS` for more information about the tier definitions. +See :ref:`supported_OS` for more information. |supported OS| @@ -236,9 +236,9 @@ Programming the SDFW and SCFW ============================= After programming the BICR, the nRF54H20 SoC requires the provisioning of a bundle ( :file:`nrf54h20_soc_binaries_v0.5.0.zip`) containing the precompiled firmware for the Secure Domain and System Controller. -To program the Secure Domain Firmware (SDFW, also known as ``urot``) and the System Controller Firmware (SCFW) from the firmware bundle to the nRF54H20 DK, do the following: +To program the Secure Domain Firmware (SDFW, also known as ``urot``) and the System Controller Firmware (SCFW) from the SoC binaries to the nRF54H20 DK, do the following: -1. Download the `nRF54H20 firmware bundle v0.5.0`_. +1. Download the `nRF54H20 SoC binaries v0.5.0`_. .. note:: On MacOS, ensure that the ZIP file is not unpacked automatically upon download. @@ -258,7 +258,7 @@ Updating the FICR This step is required only if your nRF54H20 DK is version PCA10175 v0.7.2 or v0.8.0 ES3.3. Jump to the next step if your DK is version ES4, meaning v0.8.0 with no ES markings. -After programming the SDFW and SCFW from the firmware bundle, you must update the Factory Information Configuration Registers (FICR) to correctly configure some trims of the nRF54H20 SoC. +After programming the SDFW and SCFW from the SoC binaries, you must update the Factory Information Configuration Registers (FICR) to correctly configure some trims of the nRF54H20 SoC. To update the FICR, you must run a J-Link script: 1. Get the J-Link script that updates the FICR:: 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 e1bb0c2d452f..8efa09f9b1a5 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst @@ -30,11 +30,18 @@ Changelog The following sections provide detailed lists of changes by component. -IDE, and tool support -===================== +IDE, OS, and tool support +========================= * Added explicit mention of the :ref:`requirements_jlink` being required in the :ref:`installing_vsc` section of the installation page. -* Updated the required `SEGGER J-Link`_ version to v7.94i. +* Updated: + + * The required `SEGGER J-Link`_ version to v7.94i. + * The :ref:`supported_OS` table on the :ref:`gs_recommended_versions` page: + + * Linux 24.04 and macOS 15 have been added to the list. + * macOS 10.15, macOS 11, macOS 12 have been removed from the list. + * Tier descriptions have been updated. Board support ============= @@ -53,6 +60,13 @@ Build and configuration system * Added the ``SB_CONFIG_MCUBOOT_NRF53_MULTI_IMAGE_UPDATE`` sysbuild Kconfig option that enables updating the network core on the nRF5340 SoC from external flash. +* Removed the non-working support for configuring the NSIB signing key through the environmental or command line variable (``SB_SIGNING_KEY_FILE``) along with child image. + + .. note:: + This feature has never been functional. + To configure the signing key, use any available Kconfig method. + + Bootloaders and DFU =================== @@ -71,7 +85,10 @@ See also the `MCUboot`_ section. Developing with nRF91 Series ============================ -|no_changes_yet_note| +* Added: + + * The :ref:`nRF91 modem tracing with RTT backend snippet ` to enable modem tracing using the RTT trace backend. + * The :ref:`nRF91 modem tracing with RAM backend snippet ` to enable modem tracing using the RAM trace backend. Developing with nRF70 Series ============================ @@ -83,9 +100,10 @@ Working with nRF54H Series |no_changes_yet_note| -Working with nRF54L Series -========================== +Developing with nRF54L Series +============================= +* Added the :ref:`ug_nrf54l_cryptography` page, providing more information about the cryptographic peripherals of the nRF54L Series devices, the programming model for referencing keys, and the configuration. * Updated the name and the structure of the section, with :ref:`ug_nrf54l` as the landing page. * Removed the Getting started with the nRF54L15 PDK page, and instead included the information about the `Quick Start`_ app support. @@ -112,7 +130,14 @@ Developing with PMICs Security ======== -* The :kconfig:option:`CONFIG_CRACEN_IKG_SEED_KMU_SLOT` Kconfig option was added to allow customization of the KMU slot used to store CRACEN's Internal Key Generator (IKG) seed. +Added: + +* The :kconfig:option:`CONFIG_CRACEN_IKG_SEED_KMU_SLOT` Kconfig option to allow customization of the KMU slot used to store CRACEN's Internal Key Generator (IKG) seed. The default IKG seed slot is now 183 (previously 0). +* TF-M support to the :ref:`zephyr:nrf54l15dk_nrf54l15` (board target ``nrf54l15dk/nrf54l15/cpuapp/ns``). + +Removed: + +* TF-M support from the :ref:`zephyr:nrf54l15pdk_nrf54l15` (board target ``nrf54l15pdk/nrf54l15/cpuapp/ns``). Protocols ========= @@ -128,6 +153,10 @@ Amazon Sidewalk Bluetooth® LE ------------- +* Fixed an issue where the Bluetooth subsystem deadlocked when a Bluetooth link was lost during data transfer. + In this scenario, the disconnected event was never delivered to the application. + The issue only occurred when the :kconfig:option:`CONFIG_BT_HCI_ACL_FLOW_CONTROL` Kconfig option was enabled. + This option is enabled by default on the nRF5340 DK. * The correct SoftDevice Controller library :kconfig:option:`CONFIG_BT_LL_SOFTDEVICE_MULTIROLE` will now be selected automatically when using coexistence based on :kconfig:option:`CONFIG_MPSL_CX` for nRF52-series devices. * Added the APIs :c:func:`bt_hci_err_to_str` and :c:func:`bt_security_err_to_str` to allow printing error codes as strings. Each API 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. @@ -177,8 +206,13 @@ Matter * The :ref:`ug_matter_device_memory_profiling` section to the :ref:`ug_matter_device_optimizing_memory` page. The section contains useful commands for measuring memory and troubleshooting tips. + * The ZMS file subsystem to all devices that contain RRAM, such as the nRF54L Series devices. -* Changed the default Trusted Storage AEAD key to Hardware Unique Key (HUK) for supported nRF54L Series devices. +* Changed: + + * The default Trusted Storage AEAD key to Hardware Unique Key (HUK) for supported nRF54L Series devices. + * Renamed the ``CONFIG_CHIP_FACTORY_RESET_ERASE_NVS`` Kconfig option to :kconfig:option:`CONFIG_CHIP_FACTORY_RESET_ERASE_SETTINGS`. + The new Kconfig option now works for both NVS and ZMS file system backends. Matter fork +++++++++++ @@ -225,7 +259,7 @@ Machine learning Asset Tracker v2 ---------------- -|no_changes_yet_note| +* Added a note that the :ref:`asset_tracker_v2` application is in the maintenance mode and recommended to use the :ref:`nrf_cloud_multi_service` sample instead. Connectivity Bridge ------------------- @@ -278,6 +312,9 @@ nRF Desktop * Manifest semantic version information to the firmware information response in :ref:`nrf_desktop_dfu` when the module is used for SUIT DFU and the SDFW supports semantic versioning (requires v0.6.2 and higher). * A missing DTS node compatible with ``zephyr,hid-device`` to the nRF52840 DK in the MCUboot QSPI configuration. This ensures support for HID over USB when the USB next stack is selected. + * The USB next stack (:ref:`CONFIG_DESKTOP_USB_STACK_NEXT `) implies partial erase feature of the nRF SoC flash driver (:kconfig:option:`CONFIG_SOC_FLASH_NRF_PARTIAL_ERASE`). + This is done to improve stability of the USB next stack. + The partial erase feature works around device errors that might be reported by Windows USB host in Device Manager if USB cable is connected while erasing secondary image slot in the background. * Updated: @@ -290,7 +327,9 @@ nRF Desktop Removed the ``CONFIG_DESKTOP_HWINFO_BLE_ADDRESS_FICR_POSTFIX`` Kconfig option as a postfix constant is no longer needed for the Zephyr native driver. The driver uses ``BLE.ADDR``, ``BLE.IR``, and ``BLE.ER`` fields of the Factory Information Configuration Registers (FICR) to provide 8 bytes of unique hardware ID. * The :ref:`nrf_desktop_dfu_mcumgr` to recognize the MCUmgr custom group ID (:kconfig:option:`CONFIG_MGMT_GROUP_ID_SUIT`) from the SUITFU subsystem (:kconfig:option:`CONFIG_MGMT_SUITFU`) as a DFU-related command group. - + * All build configurations with the DFU over MCUmgr support to require encryption for operations on the Bluetooth GATT SMP service (see the :kconfig:option:`CONFIG_MCUMGR_TRANSPORT_BT_PERM_RW_ENCRYPT` Kconfig option). + The Bluetooth pairing procedure of the unpaired Bluetooth peers must now be performed before the DFU operation. + * The :ref:`nrf_desktop_dfu_mcumgr` to enable the MCUmgr handler that is used to report the bootloader information (see the :kconfig:option:`CONFIG_MCUMGR_GRP_OS_BOOTLOADER_INFO` Kconfig option). nRF Machine Learning (Edge Impulse) ----------------------------------- @@ -305,6 +344,7 @@ Serial LTE modem * DTLS support for the ``#XUDPSVR`` and ``#XSSOCKET`` (UDP server sockets) AT commands when the :file:`overlay-native_tls.conf` configuration file is used. * The :kconfig:option:`CONFIG_SLM_PPP_FALLBACK_MTU` Kconfig option that is used to control the MTU used by PPP when the cellular link MTU is not returned by the modem in response to the ``AT+CGCONTRDP=0`` AT command. * Handler for new nRF Cloud event type ``NRF_CLOUD_EVT_RX_DATA_DISCON``. + * Support for socket option ``AT_SO_IPV6_DELAYED_ADDR_REFRESH``. * Removed: @@ -355,6 +395,28 @@ Bluetooth samples * Fixed an issue where the HCI LE Set Extended Advertising Enable command was called with a NULL pointer. +* Added support for the :ref:`zephyr:nrf54l15dk_nrf54l15` board in the following samples: + + * :ref:`central_bas` + * :ref:`bluetooth_central_hr_coded` + * :ref:`multiple_adv_sets` + * :ref:`peripheral_bms` + * :ref:`peripheral_cgms` + * :ref:`peripheral_cts_client` + * :ref:`peripheral_gatt_dm` + * :ref:`peripheral_hr_coded` + * :ref:`peripheral_mds` + * :ref:`peripheral_nfc_pairing` + * :ref:`power_profiling` + * :ref:`peripheral_rscs` + * :ref:`shell_bt_nus` + * :ref:`ble_throughput` + +* :ref:`peripheral_mds` sample: + + * Fixed an issue where device ID was incorrectly set during system initialization because MAC address was not available at that time. + The device ID is now set to ``ncs-ble-testdevice`` by default using the :kconfig:option:`CONFIG_MEMFAULT_NCS_DEVICE_ID` Kconfig option. + Bluetooth Fast Pair samples --------------------------- @@ -396,9 +458,16 @@ Bluetooth Mesh samples * :ref:`ble_mesh_dfu_target` * :ref:`ble_mesh_dfu_distributor` +* :ref:`bluetooth_ble_peripheral_lbs_coex` sample: + + * Updated the usage of the :c:macro:`BT_LE_ADV_CONN` macro. + See the Bluetooth Host section in Zephyr's :ref:`zephyr:migration_3.7`. + Cellular samples ---------------- +* Added the :ref:`uicc_lwm2m_sample` sample. + * :ref:`fmfu_smp_svr_sample` sample: * Removed the unused :ref:`at_cmd_parser_readme` library. @@ -422,6 +491,7 @@ Cellular samples * Board support files to enable Wi-Fi scanning for the Thingy:91 X. * The :kconfig:option:`CONFIG_SEND_ONLINE_ALERT` Kconfig option to enable calling the :c:func:`nrf_cloud_alert` function on startup. * Logging of the `reset reason code `_. + * The :kconfig:option:`CONFIG_POST_PROVISIONING_INTERVAL_M` Kconfig option to reduce the provisioning connection interval once the device successfully connects. * Updated: @@ -429,6 +499,9 @@ Cellular samples * Handling of JITP association to improve speed and reliability. * Renamed the :file:`overlay_nrf7002ek_wifi_no_lte.conf` overlay to :file:`overlay_nrf700x_wifi_mqtt_no_lte.conf`. * Renamed the :file:`overlay_nrf7002ek_wifi_coap_no_lte.conf` overlay to :file:`overlay_nrf700x_wifi_coap_no_lte.conf`. + * The value of the :kconfig:option:`CONFIG_COAP_EXTENDED_OPTIONS_LEN_VALUE` Kconfig option in the :file:`overlay_coap.conf` file. + A larger value is required now that the :kconfig:option:`CONFIG_NRF_CLOUD_COAP_DOWNLOADS` Kconfig option is enabled. + * Handling of credentials check to disable network if not using the provisioning service. * Fixed an issue where the accepted shadow was not marked as received because the config section did not yet exist in the shadow. * Removed redundant logging now done by the :ref:`lib_nrf_cloud` library. @@ -441,16 +514,25 @@ Cellular samples * The :kconfig:option:`CONFIG_SEND_ONLINE_ALERT` Kconfig option to enable calling the :c:func:`nrf_cloud_alert` function on startup. * Logging of the `reset reason code `_. + * Updated: + + * Credentials check to also see if AWS root CA cert is likely present. + * Credentials check failure to disable network if not using the provisioning service. + * Removed redundant logging now done by the :ref:`lib_nrf_cloud` library. * :ref:`nrf_cloud_rest_cell_pos_sample` sample: * Removed redundant logging now done by the :ref:`lib_nrf_cloud` library. +* :ref:`smp_svr` sample: + + * Added sysbuild configuration files. + Cryptography samples -------------------- -|no_changes_yet_note| +* Added support for the ``nrf54l15dk/nrf54l15/cpuapp/ns`` board target, replacing ``nrf54l15pdk/nrf54l15/cpuapp/ns``. Debug samples ------------- @@ -502,7 +584,7 @@ Matter samples * Added :ref:`Matter Lock schedule snippet `, and updated the documentation to use the snippet. * Enabled the :ref:`ug_thread_build_report` generation in all samples. -* Removed support for the nRF54L15 PDK in all samples, except for the ``*/ns`` :ref:`variant `. +* Removed support for the nRF54L15 PDK in all samples. Networking samples ------------------ @@ -550,7 +632,9 @@ Peripheral samples PMIC samples ------------ -* Added support for the :ref:`zephyr:nrf54l15pdk_nrf54l15` to the PMIC samples. +* Added: + + * Support for the :ref:`zephyr:nrf54l15dk_nrf54l15` and :ref:`zephyr:nrf54h20dk_nrf54h20` to the PMIC samples. * :ref:`npm1300_fuel_gauge` sample: @@ -574,7 +658,7 @@ SUIT samples Trusted Firmware-M (TF-M) samples --------------------------------- -|no_changes_yet_note| +* Replaced support for the ``nrf54l15pdk/nrf54l15/cpuapp/ns`` board target with ``nrf54l15dk/nrf54l15/cpuapp/ns``. Thread samples -------------- @@ -591,6 +675,7 @@ Zigbee samples * :ref:`zigbee_light_switch_sample` sample: * Added the option to configure transmission power. + * Fixed the FOTA configuration for the nRF5340 DK. Wi-Fi samples ------------- @@ -687,12 +772,18 @@ Common Application Framework Debug libraries --------------- -|no_changes_yet_note| +* :ref:`mod_memfault` library: + + * Added location metrics, including GNSS, cellular, and Wi-Fi specific metrics. + The metrics are enabled with the :kconfig:option:`CONFIG_MEMFAULT_NCS_LOCATION_METRICS` Kconfig option. DFU libraries ------------- -|no_changes_yet_note| +* :ref:`lib_dfu_target` library: + + * Updated the DFU Target SUIT implementation to the newest version of the SUIT. + * Added SUIT cache processing to the DFU Target SUIT library, as described in the :ref:`lib_dfu_target_suit_style_update` section. Gazell libraries ---------------- @@ -708,6 +799,8 @@ Modem libraries The :ref:`at_parser_readme` is a library that parses AT command responses, notifications, and events. Compared to the deprecated :ref:`at_cmd_parser_readme` library, it does not allocate memory dynamically and has a smaller footprint. For more information on how to transition from the :ref:`at_cmd_parser_readme` library to the :ref:`at_parser_readme` library, see the :ref:`migration guide `. + * The :ref:`lib_uicc_lwm2m` library. + This library reads the LwM2M bootstrap configuration from SIM. * :ref:`at_cmd_parser_readme` library: @@ -737,14 +830,23 @@ Modem libraries Use the :kconfig:option:`CONFIG_LTE_NETWORK_MODE_LTE_M_NBIOT` or :kconfig:option:`CONFIG_LTE_NETWORK_MODE_LTE_M_NBIOT_GPS` Kconfig option instead. In addition, you can control the priority between LTE-M and NB-IoT using the :kconfig:option:`CONFIG_LTE_MODE_PREFERENCE` Kconfig option. - * Added: + * Deprecated the :c:macro:`LTE_LC_ON_CFUN` macro. + Use the :c:macro:`NRF_MODEM_LIB_ON_CFUN` macro instead. - * A new :c:enum:`LTE_LC_EVT_RAI_UPDATE` event that is enabled with the :kconfig:option:`CONFIG_LTE_RAI_REQ` Kconfig option. + * Added a new :c:enumerator:`LTE_LC_EVT_RAI_UPDATE` event that is enabled with the :kconfig:option:`CONFIG_LTE_RAI_REQ` Kconfig option. * Updated: * To use the :ref:`at_parser_readme` library instead of the :ref:`at_cmd_parser_readme` library. * The :c:func:`lte_lc_neighbor_cell_measurement` function to return an error for invalid GCI count. + * The :c:func:`lte_lc_factory_reset` function has been deprecated. + Use the ``AT%XFACTORYRESET`` AT command instead. + Refer to the :ref:`migration guide ` for more details. + * The :c:enum:`lte_lc_factory_reset_type` type has been deprecated. + * The :c:func:`lte_lc_reduced_mobility_get` and :c:func:`lte_lc_reduced_mobility_set` functions have been deprecated. + Refer to the :ref:`migration guide ` for more details. + * The :c:enum:`lte_lc_reduced_mobility_mode` type has been deprecated. + Refer to the :ref:`migration guide ` for more details. * :ref:`lib_location` library: @@ -778,14 +880,34 @@ Modem libraries * :ref:`nrf_modem_lib_readme`: - * Updated the RTT trace backend to allocate the RTT channel at boot, instead of when the modem is activated. + * Added support for socket option ``SO_IPV6_DELAYED_ADDR_REFRESH``. + + * Updated: + + * The RTT trace backend to allocate the RTT channel at boot, instead of when the modem is activated. + * The flash trace backend to solve concurrency issues when reading traces while writing, and when reinitializing the application (warm start). + * Renamed the nRF91 socket offload layer from ``nrf91_sockets`` to ``nrf9x_sockets`` to reflect that the offload layer is not exclusive to the nRF91 Series SiPs. + * The :ref:`modem_trace_module` to let the trace thread sleep when the modem trace level is set to :c:enumerator:`NRF_MODEM_LIB_TRACE_LEVEL_OFF` using the :c:func:`nrf_modem_lib_trace_level_set` function, and the trace backend returns ``-ENOSPC``. + The trace thread wakes up when another trace level is set. + * The RTT trace backend to return ``-ENOSPC`` when the RTT buffer is full. + This allows the trace thread to sleep to save power. + + * Rename the nRF91 socket offload layer from ``nrf91_sockets`` to ``nrf9x_sockets`` to reflect that the offload layer is not exclusive to the nRF91 Series SiPs. - * Removed support for deprecated RAI socket options ``SO_RAI_LAST``, ``SO_RAI_NO_DATA``, ``SO_RAI_ONE_RESP``, ``SO_RAI_ONGOING``, and ``SO_RAI_WAIT_MORE``. + + * Removed: + + * Support for deprecated RAI socket options ``SO_RAI_LAST``, ``SO_RAI_NO_DATA``, ``SO_RAI_ONE_RESP``, ``SO_RAI_ONGOING``, and ``SO_RAI_WAIT_MORE``. + * The mutex in the :c:func:`nrf9x_socket_offload_getaddrinfo` function after updating the :c:func:`nrf_getaddrinfo` function to handle concurrent requests. * :ref:`modem_info_readme` library: * Fixed a potential issue with scanf in the :c:func:`modem_info_get_current_band` function, which could lead to memory corruption. +* :ref:`modem_key_mgmt` library: + + * Added the :c:func:`modem_key_mgmt_clear` function to delete all credentials associated with a security tag. + * :ref:`pdn_readme` library: * Added the event ``PDN_EVENT_CTX_DESTROYED`` to indicate when a PDP context is destroyed. @@ -805,6 +927,10 @@ Modem libraries * Added the :kconfig:option:`CONFIG_AT_SHELL_UNESCAPE_LF` Kconfig option to enable reception of multiline AT commands. * Updated the :c:func:`at_shell` function to replace ``\n`` with ```` if :kconfig:option:`CONFIG_AT_SHELL_UNESCAPE_LF` is enabled. +* :ref:`modem_key_mgmt` library: + + * Updated the :c:func:`modem_key_mgmt_read()` function to return the actual size buffer required to read the certificate if the size provided is too small. + Multiprotocol Service Layer libraries ------------------------------------- @@ -841,6 +967,8 @@ Libraries for networking * The :kconfig:option:`CONFIG_NRF_CLOUD_VERBOSE_DETAILS` Kconfig option to print all details instead of only the device ID. * Experimental support for shadow transform requests over MQTT using the :c:func:`nrf_cloud_shadow_transform_request` function. This functionality is enabled by the :kconfig:option:`CONFIG_NRF_CLOUD_MQTT_SHADOW_TRANSFORMS` Kconfig option. + * The :kconfig:option:`CONFIG_NRF_CLOUD_COMBINED_CA_CERT_SIZE_THRESHOLD` and :kconfig:option:`CONFIG_NRF_CLOUD_COAP_CA_CERT_SIZE_THRESHOLD` Kconfig options to compare with the current root CA certificate size. + * The functions :c:func:`nrf_cloud_sec_tag_coap_jwt_set` and :c:func:`nrf_cloud_sec_tag_coap_jwt_get` to set and get the sec tag used for nRF Cloud CoAP JWT signing. * Updated: @@ -851,6 +979,8 @@ Libraries for networking * To use nRF Cloud's custom MQTT topics instead of the default AWS topics. * MQTT and CoAP transports to use a single unified DNS lookup mechanism that supports IPv4 and IPv6, fallback to IPv4, and handling of multiple addresses returned by :c:func:`getaddrinfo`. * The log module in the :file:`nrf_cloud_fota_common.c` file from ``NRF_CLOUD`` to ``NRF_CLOUD_FOTA``. + * The :c:func:`nrf_cloud_credentials_configured_check` function to retrieve the size of the root CA, and compare it to thresholds to decide whether the CoAP, AWS, or both root CA certs are present. + Use this information to log helpful information and decide whether the root CA certificates are compatible with the configured connection type. * Deprecated: @@ -860,7 +990,10 @@ Libraries for networking Support for statically configured nRF Cloud IP Addresses will soon be removed. Leave :kconfig:option:`CONFIG_NRF_CLOUD_STATIC_IPV4` disabled to instead use automatic DNS lookup. - * Fixed an issue in the :c:func:`nrf_cloud_send` function that prevented data in the provided :c:struct:`nrf_cloud_obj` structure from being sent to the bulk and bin topics. + * Fixed: + + * An issue in the :c:func:`nrf_cloud_send` function that prevented data in the provided :c:struct:`nrf_cloud_obj` structure from being sent to the bulk and bin topics. + * An issue where the modem was not shut down from bootloader mode before attempting to initialize in normal mode after an unsuccessful update. * :ref:`lib_nrf_cloud_coap` library: @@ -873,6 +1006,12 @@ Libraries for networking * To use a shorter resource string for the ``d2c/bulk`` resource. * The function :c:func:`nrf_cloud_coap_shadow_get` to return ``-E2BIG`` if the received shadow data was truncated because the provided buffer was not big enough. + * The :kconfig:option:`CONFIG_NRF_CLOUD_COAP_DOWNLOADS` Kconfig option to be enabled by default if either the :kconfig:option:`CONFIG_NRF_CLOUD_FOTA_POLL` or :kconfig:option:`CONFIG_NRF_CLOUD_PGPS` Kconfig option is enabled. + + * Removed the experimental status (:kconfig:option:`CONFIG_EXPERIMENTAL`) from the :kconfig:option:`CONFIG_NRF_CLOUD_COAP_DOWNLOADS` Kconfig option. + + * Added the :kconfig:option:`CONFIG_NRF_CLOUD_COAP_DISCONNECT_ON_FAILED_REQUEST` Kconfig option to disconnect the CoAP client on a failed request. + * Added the :kconfig:option:`CONFIG_NRF_CLOUD_COAP_JWT_SEC_TAG` Kconfig option to allow for a separate sec tag to be used for nRF Cloud CoAP JWT signing. * :ref:`lib_lwm2m_client_utils` library: @@ -889,13 +1028,14 @@ Libraries for networking * Fixed the missing log source when passing a direct log call to the nRF Cloud logging backend. This caused the log parser to incorrectly use the first declared log source with direct logs when using dictionary mode. + * Updated to use INF log level when the cloud side changes the log level. + * :ref:`lib_nrf_cloud_fota` library: * Added: * FOTA status callback. - * The :kconfig:option:`CONFIG_NRF_CLOUD_COAP_DISCONNECT_ON_FAILED_REQUEST` Kconfig option to disconnect the CoAP client on a failed request. - * The :kconfig:option:`CONFIG_NRF_CLOUD_FOTA_SMP` Kconfig option to enable experimental support for SMP FOTA using MQTT. + * The :kconfig:option:`CONFIG_NRF_CLOUD_FOTA_SMP` Kconfig option to enable experimental support for SMP FOTA. * Updated: @@ -903,9 +1043,18 @@ Libraries for networking The range of the option is now from 128 to 1900 bytes, and the default value is 1700 bytes. * The function :c:func:`nrf_cloud_fota_poll_process` to be used asynchrounously if a callback to handle errors is provided. +* :ref:`lib_mqtt_helper` library: + + * Updated the :kconfig:option:`CONFIG_MQTT_HELPER_PROVISION_CERTIFICATES` Kconfig option to depend on :kconfig:option:`CONFIG_TLS_CREDENTIALS` instead of specific boards. + * :ref:`lib_nrf_provisioning` library: * Added support for the ``SO_KEEPOPEN`` socket option to keep the socket open even during PDN disconnect and reconnect. + * Updated the check interval logging to use INF to improve customer experience. + +* :ref:`lib_nrf_cloud_alert` library: + + * Updated to use INF log level when cloud side changes the alert enable flag. Libraries for NFC ----------------- @@ -1067,9 +1216,9 @@ Documentation * Added: * The :ref:`ug_app_dev` section, which includes pages from the :ref:`configuration_and_build` section and from the removed Device configuration guides section. - * The :ref:`peripheral_sensor_node_shield` page. * The :ref:`dfu_tools_mcumgr_cli` page after it was removed from the Zephyr repository. * The :ref:`ug_nrf54h20_suit_soc_binaries` page. + * The :ref:`ug_nrf54h20_suit_push` page documentating the SUIT push model-based update process. * Restructured the :ref:`app_bootloaders` documentation and combined the DFU and bootloader articles. Additionally, created a new bootloader :ref:`bootloader_quick_start`. @@ -1081,6 +1230,8 @@ Documentation * The Device configuration guides section and moved its contents to :ref:`ug_app_dev`. * The Advanced building procedures page and moved its contents to the :ref:`building` page. * nRF70 Series support is upstreamed to Zephyr, hence the documentation is removed from the |NCS|. + * The standalone pages for getting started with nRF52 Series and with the nRF5340 DK. + These pages have been replaced by the `Quick Start`_ app, which now supports the nRF52 Series devices and the nRF5340 DK. * Updated: diff --git a/doc/nrf/samples/other.rst b/doc/nrf/samples/other.rst index d7e4ba380729..c4f4e3936503 100644 --- a/doc/nrf/samples/other.rst +++ b/doc/nrf/samples/other.rst @@ -12,4 +12,5 @@ Other samples ../../../samples/ipc/*/README ../../../samples/mpsl/*/README ../../../samples/benchmarks/*/README + ../../../samples/nrf_compress/*/README ../../../tests/benchmarks/multicore/*/README diff --git a/doc/nrf/samples/wifi_zephyr.rst b/doc/nrf/samples/wifi_zephyr.rst index 1cdd1cda5af0..e994b665cbe1 100644 --- a/doc/nrf/samples/wifi_zephyr.rst +++ b/doc/nrf/samples/wifi_zephyr.rst @@ -10,15 +10,12 @@ Wi-Fi: Zephyr networking samples In addition to |NCS| samples, it is possible to run selected networking samples with Wi-Fi®, provided and maintained as part of the upstream Zephyr project. The following list specifies samples that are currently supported with the Wi-Fi driver: -* :zephyr:code-sample:`dhcpv4-client` * :zephyr:code-sample:`dns-resolve` * :zephyr:code-sample:`ipv4-autoconf` * :zephyr:code-sample:`mdns-responder` * :zephyr:code-sample:`mqtt-publisher` * :zephyr:code-sample:`mqtt-sn-publisher` -* :zephyr:code-sample:`coap-client` * :zephyr:code-sample:`coap-server` -* :zephyr:code-sample:`sockets-echo` * :zephyr:code-sample:`async-sockets-echo` * :zephyr:code-sample:`sockets-echo-client` * :zephyr:code-sample:`sockets-echo-server` @@ -27,42 +24,26 @@ The following list specifies samples that are currently supported with the Wi-Fi * :zephyr:code-sample:`syslog-net` * :zephyr:code-sample:`telnet-console` -Configuration -************* - -|config| - -Before you build a sample, you must configure the following Wi-Fi credentials in the :file:`overlay-nrf700x.conf` file: - -* :kconfig:option:`CONFIG_WIFI_CREDENTIALS_STATIC_SSID` - Network name (SSID) -* :kconfig:option:`CONFIG_WIFI_CREDENTIALS_STATIC_PASSWORD` - Password -* :kconfig:option:`CONFIG_WIFI_CREDENTIALS_STATIC_TYPE` - Security type (Optional) - -.. note:: - You can also use ``menuconfig`` to configure Wi-Fi credentials. - -See :ref:`zephyr:menuconfig` in the Zephyr documentation for instructions on how to run ``menuconfig``. - Building and running ******************** To build the sample with |VSC|, follow the steps listed on the `How to build an application`_ page in the |nRFVSC| documentation. See :ref:`building` for other building scenarios, :ref:`programming` for programming steps, and :ref:`testing` for general information about testing and debugging in the |NCS|. -An overlay file, ``overlay-nrf700x.conf`` is provided to all Zephyr samples, which configures the sample to run with the Wi-Fi driver. +A :ref:`Wi-Fi snippet ` configuration is provided to all Zephyr samples, which configures the sample to run with the Wi-Fi driver. To build Zephyr samples for the nRF7002 DK, use the ``nrf7002dk/nrf5340/cpuapp`` board target. The following is an example of the CLI command: .. code-block:: console - west build -b nrf7002dk/nrf5340/cpuapp -- -DEXTRA_CONF_FILE=overlay-nrf700x.conf + west build -b nrf7002dk/nrf5340/cpuapp -S wifi-ipv4 To build for the nRF7002 EK with nRF5340 DK, use the ``nrf5340dk/nrf5340/cpuapp`` board target with the ``SHIELD`` CMake option set to ``nrf7002ek``. The following is an example of the CLI command: .. code-block:: console - west build -b nrf5340dk/nrf5340/cpuapp -- -DSHIELD=nrf7002ek -DEXTRA_CONF_FILE=overlay-nrf700x.conf + west build -b nrf5340dk/nrf5340/cpuapp -S wifi-ipv4 -- -DSHIELD=nrf7002ek -DSB_CONFIG_WIFI_NRF70=y -For additional details about running a sample, refer to the respective sample in Zephyr’s Samples and Demos documentation. +For additional details about running a sample, refer to the respective sample in Zephyr’s :ref:`Samples and Demos documentation `. diff --git a/doc/nrf/security/tfm.rst b/doc/nrf/security/tfm.rst index 3342a40e49ef..e9185546ef61 100644 --- a/doc/nrf/security/tfm.rst +++ b/doc/nrf/security/tfm.rst @@ -126,6 +126,22 @@ By using the :kconfig:option:`CONFIG_TFM_SECURE_UART0`. the TF-M UART instance b When the TF-M and application use the same UART, the TF-M will disable logging after it has booted and it will only re-enable it again to log a fatal error. +Provisioning +************ + +For the devices that need provisioning, TF-M implements the following Platform Root of Trust (PRoT) Security Lifecycle states that conform to the `ARM Platform Security Model 1.1`_: + +* Device Assembly and Test +* PRoT Provisioning +* Secured + +The device starts in the **Device Assembly and Test** state. +The :ref:`provisioning_image` sample shows how to move the device from the **Device Assembly and Test** state to the **PRoT Provisioning** state, and how to provision the device with hardware unique keys (HUKs) and an identity key. + +To move the device from the **PRoT Provisioning** state to the **Secured** state, set the :kconfig:option:`CONFIG_TFM_NRF_PROVISIONING` Kconfig option for your application. +In the first boot, TF-M will ensure that the keys are stored in the Key Management Unit (KMU) and move the device to the **Secured** state. +The :ref:`tfm_psa_template` sample shows how to achieve this. + .. _ug_tfm_manual_VCOM_connection: Manual connection to Virtual COM ports on the nRF5340 DK diff --git a/doc/nrf/shortcuts.txt b/doc/nrf/shortcuts.txt index eca25b503067..ffbf3d599994 100644 --- a/doc/nrf/shortcuts.txt +++ b/doc/nrf/shortcuts.txt @@ -7,6 +7,7 @@ .. |release_number_tt| replace:: ``2.7.0`` .. |jlink_ver| replace:: v7.94i +.. |jlink_ver_vsc| replace:: v7.94i .. ### Config shortcuts @@ -207,7 +208,8 @@ The NFCT driver is part of the nrfx driver package. For more information about this driver, see the NFCT driver page in the `nrfx`_ repository. -.. |Supported OS| replace:: The operating system versions that support the |NCS| tools are listed in the :ref:`supported_OS` section. +.. |Supported OS| replace:: The operating system versions that support the |NCS| firmware are listed in the :ref:`supported_OS` section. + Some additional tools for working with Nordic Semiconductor devices might have :ref:`different OS requirements `. .. |no_changes_yet_note| replace:: No changes since the latest |NCS| release. @@ -239,3 +241,9 @@ .. |nrf54_buttons_leds_numbering| replace:: The nRF54 DKs use a different numbering pattern for LED and buttons. See the User interface section for full overview. + +.. |ATv2_maintenance_note| replace:: The Asset Tracker v2 application is in maintenance mode. + For new projects, it is recommended to use the :ref:`nrf_cloud_multi_service` sample instead. + +.. |toolchain_management_ncs_versions| replace:: The Toolchain Manager installation is recommended only when using the nRF54H20 DK with the |NCS| v2.7.0. + When using any other DK, the Toolchain Manager installation is recommended for the |NCS| v1.9.x and earlier versions. diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig index 8c2452d9e5c4..58998b09c493 100644 --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig @@ -2,16 +2,16 @@ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause menuconfig GPIO_NRFE - bool "Emulated GPIO" + bool "Software Defined GPIO" default y - depends on DT_HAS_NORDIC_NRF_EGPIO_ENABLED + depends on DT_HAS_NORDIC_NRFE_GPIO_ENABLED select IPC_SERVICE select MBOX help - Use emulated GPIO driver. + Use Software Defined GPIO driver. config GPIO_NRFE_INIT_PRIORITY - int "Emulated GPIO init priority" + int "Software Defined GPIO init priority" depends on GPIO_NRFE default 48 help diff --git a/drivers/gpio/gpio_nrfe.c b/drivers/gpio/gpio_nrfe.c index fd443b5ca7d0..fcaa4cb4bc49 100644 --- a/drivers/gpio/gpio_nrfe.c +++ b/drivers/gpio/gpio_nrfe.c @@ -4,7 +4,7 @@ * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause */ -#define DT_DRV_COMPAT nordic_nrf_egpio +#define DT_DRV_COMPAT nordic_nrfe_gpio #include #include diff --git a/dts/bindings/gpio/nordic,nrf-egpio.yaml b/dts/bindings/gpio/nordic,nrfe-gpio.yaml similarity index 84% rename from dts/bindings/gpio/nordic,nrf-egpio.yaml rename to dts/bindings/gpio/nordic,nrfe-gpio.yaml index d221eb0dafa6..899d77d8f08a 100644 --- a/dts/bindings/gpio/nordic,nrf-egpio.yaml +++ b/dts/bindings/gpio/nordic,nrfe-gpio.yaml @@ -1,8 +1,8 @@ # Copyright (c) 2024 Nordic Semiconductor # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -description: Emulated GPIO node +description: Software defined GPIO node -compatible: "nordic,nrf-egpio" +compatible: "nordic,nrfe-gpio" include: [gpio-controller.yaml, base.yaml] diff --git a/include/dfu/dfu_target_suit.h b/include/dfu/dfu_target_suit.h index 2c53bcae17e9..b3584a250ce8 100644 --- a/include/dfu/dfu_target_suit.h +++ b/include/dfu/dfu_target_suit.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Nordic Semiconductor ASA + * Copyright (c) 2024 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause */ @@ -29,23 +29,23 @@ extern "C" { int dfu_target_suit_set_buf(uint8_t *buf, size_t len); /** - * @brief See if data in buf indicates SUIT style upgrade. + * @brief Initialize the DFU target for the specific image and perform the necessary steps to + * receive the firmware. * - * Not implemented as it does not currently have any use cases. - * Currently always returns -ENOSYS. - * - * @retval -ENOSYS - */ -bool dfu_target_suit_identify(const void *const buf); - -/** - * @brief Initialize dfu target, perform steps necessary to receive firmware. + * If you call this function, you must call dfu_target_suit_done() to finalize the firmware upgrade + * before initializing any other images. * * @param[in] file_size Size of the current file being downloaded. - * @param[in] img_num Image pair index. + * @param[in] img_num Image index. * @param[in] cb Callback for signaling events(unused). * - * @retval 0 If successful, negative errno otherwise. + * @return 0 If successful. + * @return -ENODEV errno code if the buffer has not been initialized. + * @return -ENXIO errno code if the partition dedicated for provided image is not found. + * @return -ENOMEM errno code if the buffer is not large enough. + * @return -EFAULT errno code if flash device assigned to the image is not available on the device. + * @return -EBUSY errno code if the any image is already initialized and stream flash is in use. + * @return other negative errno code if the initialization failed. */ int dfu_target_suit_init(size_t file_size, int img_num, dfu_target_callback_t cb); @@ -54,7 +54,7 @@ int dfu_target_suit_init(size_t file_size, int img_num, dfu_target_callback_t cb * * @param[out] offset Returns the offset of the firmware upgrade. * - * @return 0 if success, otherwise negative value if unable to get the offset + * @retval 0 If success. Otherwise, a negative value if unable to get the offset. */ int dfu_target_suit_offset_get(size_t *offset); @@ -64,7 +64,9 @@ int dfu_target_suit_offset_get(size_t *offset); * @param[in] buf Pointer to data that should be written. * @param[in] len Length of data to write. * - * @return 0 on success, negative errno otherwise. + * @return 0 If successful. + * @return -EFAULT errno code if the stream flash has not been initialized for any dfu image. + * @return other negative errno code if the initialization failed. */ int dfu_target_suit_write(const void *const buf, size_t len); @@ -73,21 +75,24 @@ int dfu_target_suit_write(const void *const buf, size_t len); * @param[in] successful Indicate whether the firmware was successfully recived. * - * @return 0 on success, negative errno otherwise. + * @retval 0 on success, negative errno otherwise. */ int dfu_target_suit_done(bool successful); /** - * @brief Schedule update and reset the device. + * @brief Schedule an update. + * + * This call processes SUIT envelope and requests images update. * - * This call requests images update and immediately starts it - * by resetting the device. + * Firmware update will start after the device reboot. + * You can reboot device, for example, by calling dfu_target_suit_reboot(). * * @param[in] img_num Given image pair index or -1 for all * of image pair indexes. * - * @return 0 for a successful request or a negative error - * code identicating reason of failure. + * @retval 0 Successful request. + * @retval negative_errno_code Negative error + * code indicating the reason of failure. **/ int dfu_target_suit_schedule_update(int img_num); @@ -96,10 +101,21 @@ int dfu_target_suit_schedule_update(int img_num); * * Cancels any ongoing updates. * - * @return 0 on success, negative errno otherwise. + * @retval negative_errno_code Negative error + * code indicating the reason of failure. */ int dfu_target_suit_reset(void); +/** + * @brief Reboot the device and apply the new image. + * + * The reboot can be delayed by setting the + * CONFIG_DFU_TARGET_REBOOT_RESET_DELAY_MS Kconfig option value to the desired delay value. + * + * @retval negative_errno_code Negative error + * code indicating the reason of failure. + */ +int dfu_target_suit_reboot(void); #ifdef __cplusplus } diff --git a/include/esb.h b/include/esb.h index bb490a008f12..af762abed9e5 100644 --- a/include/esb.h +++ b/include/esb.h @@ -126,6 +126,11 @@ enum esb_bitrate { /** 4 Mb radio mode. */ ESB_BITRATE_4MBPS = NRF_RADIO_MODE_NRF_4MBIT_H_0_5, #endif /* defined(RADIO_MODE_MODE_Nrf_4Mbit0_5) */ + +#if defined(RADIO_MODE_MODE_Nrf_4Mbit_0BT6) + /** 4 Mb radio mode. */ + ESB_BITRATE_4MBPS = RADIO_MODE_MODE_Nrf_4Mbit_0BT6, +#endif /* defined(RADIO_MODE_MODE_Nrf_4Mbit_0BT6) */ }; /** @brief Enhanced ShockBurst CRC modes. */ diff --git a/include/flash_map_pm.h b/include/flash_map_pm.h index 4232f646ccff..baa5cfdb7476 100644 --- a/include/flash_map_pm.h +++ b/include/flash_map_pm.h @@ -29,7 +29,8 @@ #define image_scratch mcuboot_scratch #define image_scratch mcuboot_scratch -#if (CONFIG_SETTINGS_FCB || CONFIG_SETTINGS_NVS || defined(PM_SETTINGS_STORAGE_ID)) +#if (CONFIG_SETTINGS_FCB || CONFIG_SETTINGS_NVS || defined(PM_SETTINGS_STORAGE_ID) ||\ + CONFIG_SETTINGS_ZMS) #define storage settings_storage #define storage_partition settings_storage #elif CONFIG_FILE_SYSTEM_LITTLEFS @@ -38,6 +39,9 @@ #elif CONFIG_NVS #define storage nvs_storage #define storage_partition nvs_storage +#elif CONFIG_ZMS +#define storage zms_storage +#define storage_partition zms_storage #endif #define PM_ID(label) PM_##label##_ID diff --git a/include/modem/lte_lc.h b/include/modem/lte_lc.h index 094119026a77..abb42a32db97 100644 --- a/include/modem/lte_lc.h +++ b/include/modem/lte_lc.h @@ -652,7 +652,10 @@ enum lte_lc_ce_level { LTE_LC_CE_LEVEL_UNKNOWN = UINT8_MAX, }; -/** Reduced mobility mode. */ +/** Reduced mobility mode. + * + * @deprecated since v2.8.0. + */ enum lte_lc_reduced_mobility_mode { /** Functionality according to the 3GPP relaxed monitoring feature. */ LTE_LC_REDUCED_MOBILITY_DEFAULT = 0, @@ -742,7 +745,11 @@ enum lte_lc_modem_evt { LTE_LC_MODEM_EVT_CE_LEVEL_3, }; -/** Type of factory reset to perform. */ +/** + * Type of factory reset to perform. + * + * @deprecated since v2.8.0. + */ enum lte_lc_factory_reset_type { /** Reset all modem data to factory settings. */ LTE_LC_FACTORY_RESET_ALL = 0, @@ -1186,6 +1193,8 @@ struct lte_lc_cfun_cb { * @param name Callback name. * @param _callback Callback function. * @param _context User-defined context. + * + * @deprecated since v2.8.0, use @ref NRF_MODEM_LIB_ON_CFUN instead. */ #define LTE_LC_ON_CFUN(name, _callback, _context) \ static void _callback(enum lte_lc_func_mode, void *ctx); \ @@ -1763,6 +1772,8 @@ int lte_lc_periodic_search_request(void); * @retval 0 if a mode was found and written to the provided pointer. * @retval -EINVAL if input parameter was @c NULL. * @retval -EFAULT if an AT command failed. + * + * @deprecated since v2.8.0. */ int lte_lc_reduced_mobility_get(enum lte_lc_reduced_mobility_mode *mode); @@ -1775,6 +1786,8 @@ int lte_lc_reduced_mobility_get(enum lte_lc_reduced_mobility_mode *mode); * * @retval 0 if the new reduced mobility mode was accepted by the modem. * @retval -EFAULT if an AT command failed. + * + * @deprecated since v2.8.0. */ int lte_lc_reduced_mobility_set(enum lte_lc_reduced_mobility_mode mode); @@ -1789,6 +1802,8 @@ int lte_lc_reduced_mobility_set(enum lte_lc_reduced_mobility_mode mode); * * @retval 0 if factory reset was performed successfully. * @retval -EFAULT if an AT command failed. + * + * @deprecated since v2.8.0. */ int lte_lc_factory_reset(enum lte_lc_factory_reset_type type); diff --git a/include/modem/modem_jwt.h b/include/modem/modem_jwt.h index 9f604fb6be2f..178a70795800 100644 --- a/include/modem/modem_jwt.h +++ b/include/modem/modem_jwt.h @@ -74,8 +74,8 @@ struct jwt_data { * Subject and audience fields may be NULL in which case those fields are left out * from generated JWT token. * - * If sec_tag value is given as zero, JWT is signed with Nordic's own keys that - * already exist in the modem. + * If sec_tag value is given as zero, JWT is signed with the device's identity key that + * already exists in the modem. * * @param[in,out] jwt Pointer to struct containing JWT parameters and result. * @@ -87,6 +87,9 @@ int modem_jwt_generate(struct jwt_data *const jwt); /** * @brief Gets the device and/or modem firmware UUID from the modem * and returns it as a NULL terminated string in the supplied struct(s). + * The device UUID can be used as a device identifier for cloud services and + * for secure device management using the nRF Cloud Identity Service. + * The modem firmware UUID represents the installed modem firmware version. * * Uses internally @ref modem_jwt_generate and parses JWT token for "iss" * "jti" fields which contains given UUID values. diff --git a/include/modem/modem_key_mgmt.h b/include/modem/modem_key_mgmt.h index 952123c49ba2..3f79df015d6f 100644 --- a/include/modem/modem_key_mgmt.h +++ b/include/modem/modem_key_mgmt.h @@ -79,6 +79,22 @@ int modem_key_mgmt_write(nrf_sec_tag_t sec_tag, int modem_key_mgmt_delete(nrf_sec_tag_t sec_tag, enum modem_key_mgmt_cred_type cred_type); +/** + * @brief Delete all credentials for a given sectag from persistent storage. + * + * @note If used when the LTE link is active, the function will return + * an error and the credentials will not be deleted. + * + * @param[in] sec_tag The security tag of the credential to delete. + * + * @retval 0 On success. + * @retval -ENOBUFS Internal buffer is too small. + * @retval -EACCES Access to credential not allowed. + * @retval -EPERM Not permitted when the LTE link is active. + * @retval -ECANCELED Canceled because voltage is low (power off warning). + */ +int modem_key_mgmt_clear(nrf_sec_tag_t sec_tag); + /** * @brief Read a credential from persistent storage. * @@ -90,7 +106,8 @@ int modem_key_mgmt_delete(nrf_sec_tag_t sec_tag, * * @retval 0 On success. * @retval -ENOBUFS Internal buffer is too small. - * @retval -ENOMEM Credential does not fit in @p buf. + * @retval -ENOMEM Credential does not fit in @p buf. Check *len for + * required size. * @retval -ENOENT No credential associated with the given * @p sec_tag and @p cred_type. * @retval -EACCES Access to credential not allowed. diff --git a/include/modem/nrf_modem_lib.h b/include/modem/nrf_modem_lib.h index 936034431f08..9127a0310695 100644 --- a/include/modem/nrf_modem_lib.h +++ b/include/modem/nrf_modem_lib.h @@ -166,8 +166,7 @@ struct nrf_modem_lib_at_cfun_cb { * configurations that require the modem to be turned on in offline mode. It cannot be used to * change the modem functional mode. Calls to @c lte_lc_connect and CFUN AT calls are not * allowed, and must be done after @c nrf_modem_lib_init has returned. If a library needs to - * perform operations after the link is up, it can use the link controller and subscribe to a - * @c LTE_LC_ON_CFUN callback. + * perform operations after the link is up, it can subscribe to a @c NRF_MODEM_LIB_ON_CFUN callback. * * @param name Callback name * @param _callback Callback function name diff --git a/include/modem/trace_backend.h b/include/modem/trace_backend.h index fc6c7e9a99f8..f3c42fe705c1 100644 --- a/include/modem/trace_backend.h +++ b/include/modem/trace_backend.h @@ -58,6 +58,9 @@ struct nrf_modem_lib_trace_backend { * -ENOSPC if no space is available and the backend has to be cleared before * tracing can continue. For some trace backends, space is also cleared * when performing the read operation. + * -ENOSR if no space is available and the backend has aborted the write. If + * modem trace level is off, the trace thread will suspend itself until + * modem traces are enabled. Else, the thread wil re-attempt the write. * -EAGAIN if no data were written due to e.g. flow control and the operation * should be retried. */ diff --git a/include/modem/uicc_lwm2m.h b/include/modem/uicc_lwm2m.h new file mode 100644 index 000000000000..0cbe39bfd5f1 --- /dev/null +++ b/include/modem/uicc_lwm2m.h @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef UICC_LWM2M_H_ +#define UICC_LWM2M_H_ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @file uicc_lwm2m.h + * + * @defgroup uicc_lwm2m UICC LwM2M + * + * @{ + * + * @brief Public APIs of the UICC LwM2M library. + */ + +/** UICC record max size is 256 bytes. The buffer size needed for the AT response is + * (256 * 2) + 4 bytes for SW + 1 byte for NUL. Using 516 bytes is adequate to read + * a full UICC record. + */ +#define UICC_RECORD_BUFFER_MAX ((256 * 2) + 4 + 1) + +/** + * @brief Read UICC LwM2M bootstrap record. + * + * @param[inout] buffer Buffer to store UICC LwM2M bootstrap record. This buffer is also + * used internally by the function reading the AT response, so it must + * be twice the size of expected LwM2M content + 4 bytes for UICC SW. + * @param[in] buffer_size Total size of buffer. + * + * @return Length of UICC LwM2M bootstrap record, -errno on error. + */ +int uicc_lwm2m_bootstrap_read(uint8_t *buffer, int buffer_size); + +/** @} */ + +#ifdef __cplusplus +} +#endif + +#endif /* UICC_LWM2M_H_ */ diff --git a/include/net/nrf_cloud.h b/include/net/nrf_cloud.h index 383f3931772a..ee9949c9821b 100644 --- a/include/net/nrf_cloud.h +++ b/include/net/nrf_cloud.h @@ -451,7 +451,12 @@ struct nrf_cloud_svc_info_fota { uint8_t _rsvd:3; }; -/** @brief DEPRECATED - No longer used by nRF Cloud */ +/** @brief DEPRECATED - No longer used by nRF Cloud + * The device data cards on the nRF Cloud portal automatically appear when the device + * sends messages with the proper schema: + * https://github.com/nRFCloud/application-protocols/tree/v1/schemas/deviceToCloud + * Custom cards are generated for appIds that are not present in the schema. + */ struct nrf_cloud_svc_info_ui { /* Items with UI support on nRF Cloud */ /** Temperature */ @@ -517,7 +522,9 @@ struct nrf_cloud_svc_info { /** Specify FOTA components to enable, set to NULL to remove the FOTA entry */ struct nrf_cloud_svc_info_fota *fota; - /** DEPRECATED - nRF Cloud no longer requires the device to set UI values in the shadow */ + /** DEPRECATED - nRF Cloud no longer requires the device to set UI values in the shadow. + * See @ref nrf_cloud_svc_info_ui for more information. + */ struct nrf_cloud_svc_info_ui *ui; }; @@ -575,9 +582,12 @@ struct nrf_cloud_gnss_pvt { struct nrf_cloud_credentials_status { /* Configured sec_tag for nRF Cloud */ uint32_t sec_tag; + size_t ca_size; /* Flags to indicate if the specified credentials exist */ uint8_t ca:1; + uint8_t ca_coap:1; + uint8_t ca_aws:1; uint8_t client_cert:1; uint8_t prv_key:1; }; @@ -632,10 +642,11 @@ struct nrf_cloud_ctrl_data { * If false, alerts will be suppressed. */ bool alerts_enabled; - /** If 0, the nrf_cloud library logging backend will be disabled. - * If values from 1 to 4, this level and any lower levels will - * be sent to the cloud. Level 1 is most urgent (LOG_ERR), - * level 4 least (LOG_DBG). + /** If 0: None - the nrf_cloud library logging backend is disabled. + * 4: LOG_DBG (least urgent) and all levels below are sent to the cloud. + * 3: LOG_INF and all levels below are sent to the cloud. + * 2: LOG_WRN and all levels below are sent to the cloud. + * 1: only LOG_ERR (most urgent) is sent to the cloud. */ int log_level; }; @@ -1124,6 +1135,20 @@ bool nrf_cloud_fota_is_type_enabled(const enum nrf_cloud_fota_type type); */ int nrf_cloud_fota_job_start(void); +/** + * @brief Initialize the SMP client. + * Called automatically if @kconfig{CONFIG_NRF_CLOUD_FOTA} or + * @kconfig{CONFIG_NRF_CLOUD_FOTA_POLL} is enabled. + * + * @param smp_reset_cb Callback of type @ref dfu_target_reset_cb_t for resetting the SMP device to + * enter MCUboot recovery mode. + * + * @retval 0 SMP client successfully initialized. + * @retval -ENOTSUP Error; @kconfig{CONFIG_NRF_CLOUD_FOTA_SMP} is not enabled. + * @return A negative value indicates an error. + */ +int nrf_cloud_fota_smp_client_init(const void *smp_reset_cb); + /** * @brief Install a downloaded SMP FOTA job. * Called automatically if @kconfig{CONFIG_NRF_CLOUD_FOTA} is enabled (MQTT FOTA). @@ -1171,11 +1196,14 @@ int nrf_cloud_credentials_check(struct nrf_cloud_credentials_status *const cs); /** * @brief Check if the credentials required for connecting to nRF Cloud exist. * The application's configuration is used to determine which credentials - * are required. + * are required. Check the size of the root CA certificates installed + * and return an error code if the size of the root CA certificate(s) is not + * appropriate for the configured transport type. * * @retval 0 Required credentials exist. * @retval -EIO Error checking if credentials exists. * @retval -ENOTSUP Required credentials do not exist. + * @retval -ENOPROTOOPT Size of root CA is not appropriate for the configured transport type. * @return A negative value indicates an error. */ int nrf_cloud_credentials_configured_check(void); @@ -1188,6 +1216,10 @@ int nrf_cloud_credentials_configured_check(void); * @note This API only needs to be called if the default configured sec tag value is no * longer applicable. This function does not perform any management of the * device's connection to nRF Cloud. + * For CoAP, changing this value will change the sec tag used for the DTLS connection only. + * Use @ref nrf_cloud_sec_tag_coap_jwt_set to set the sec tag used for JWT signing. + * For normal operation, the DTLS and JWT sec tags should be the same. They should only + * differ for debugging purposes (network traffic decryption). * * @param sec_tag The sec tag. * @@ -1201,6 +1233,31 @@ void nrf_cloud_sec_tag_set(const sec_tag_t sec_tag); */ sec_tag_t nrf_cloud_sec_tag_get(void); +/** + * @brief Set the sec tag containing the private key used to sign CoAP JWTs for nRF Cloud + * authentication. + * The default sec tag value is @kconfig{CONFIG_NRF_CLOUD_COAP_JWT_SEC_TAG}. + * + * @note This API requires @kconfig{CONFIG_NRF_CLOUD_COAP} to be enabled. + * This API only needs to be called if the default configured sec tag value is no + * longer applicable. This function does not perform any management of the + * device's authentication status with nRF Cloud. + * + * @param sec_tag The sec tag. + * + */ +void nrf_cloud_sec_tag_coap_jwt_set(const sec_tag_t sec_tag); + +/** + * @brief Get the sec tag containing the private key used to sign CoAP JWTs for nRF Cloud + * authentication. + * + * @note This API requires @kconfig{CONFIG_NRF_CLOUD_COAP} to be enabled. + * + * @return The sec tag. + */ +sec_tag_t nrf_cloud_sec_tag_coap_jwt_get(void); + /** @} */ #ifdef __cplusplus diff --git a/include/net/nrf_cloud_coap.h b/include/net/nrf_cloud_coap.h index e7f7df0704da..e25c6b26c30c 100644 --- a/include/net/nrf_cloud_coap.h +++ b/include/net/nrf_cloud_coap.h @@ -61,6 +61,11 @@ int nrf_cloud_coap_init(void); /** * @brief Connect to and obtain authorization to access the nRF Cloud CoAP server. + * The full DTLS handshake is performed, and on success, a connection ID (CID) is + * obtained. The CID allows the connection to be paused with @ref nrf_cloud_coap_pause and resumed + * with @ref nrf_cloud_coap_resume without redoing the full handshake. + * Use @ref nrf_cloud_coap_keepopen_is_supported to check if network conditions allow the pause and + * resume actions. * * This function must return 0 indicating success so that the other functions below, * other than nrf_cloud_coap_disconnect(), will not immediately return an error when called. @@ -269,7 +274,7 @@ int nrf_cloud_coap_location_get(struct nrf_cloud_rest_location_request const *co struct nrf_cloud_location_result *const result); /** - * @brief Request current nRF Cloud FOTA job info for the specified device. + * @brief Request current nRF Cloud FOTA job info for the device. * * @param[out] job Parsed job info. If no job exists, type will * be set to invalid. If a job exists, user must call @@ -310,7 +315,10 @@ int nrf_cloud_coap_fota_job_update(const char *const job_id, const enum nrf_cloud_fota_status status, const char * const details); /** - * @brief Query the device's delta or desired shadow section. + * @brief Query the device's delta or desired shadow section. The delta section indicates + * differences between the desired and reported sections. Clear the delta by aligning the + * desired and reported sections using @ref nrf_cloud_coap_shadow_desired_update or + * @ref nrf_cloud_coap_shadow_state_update, respectively. * * @param[in,out] buf Pointer to memory in which to receive the delta. * @param[in,out] buf_len Size of buffer, will be set to the incoming length. @@ -364,7 +372,8 @@ int nrf_cloud_coap_shadow_state_update(const char * const shadow_json); int nrf_cloud_coap_shadow_desired_update(const char * const shadow_json); /** - * @brief Update the device status in the shadow's reported state section. + * @brief Update the device's reported shadow section with information about the device, network, + * modem, SIM card, and FOTA capabilities. * * @param[in] dev_status Device status to be encoded. * @@ -378,7 +387,8 @@ int nrf_cloud_coap_shadow_device_status_update(const struct nrf_cloud_device_sta *const dev_status); /** - * @brief Update the device's "serviceInfo" in the shadow. + * @brief Update the device's "serviceInfo" section in the shadow. This section informs nRF Cloud + * of the device's FOTA capabilities. * * @param[in] svc_inf Service info items to be updated in the shadow. * diff --git a/include/net/nrf_cloud_fota_poll.h b/include/net/nrf_cloud_fota_poll.h index 29e34566cff1..fcd6944af1d8 100644 --- a/include/net/nrf_cloud_fota_poll.h +++ b/include/net/nrf_cloud_fota_poll.h @@ -79,6 +79,12 @@ struct nrf_cloud_fota_poll_ctx { * If the function is not provided, @ref nrf_cloud_fota_poll_process will be blocking. */ nrf_cloud_fota_poll_handler_t status_fn; + + /** Callback of type @ref dfu_target_reset_cb_t for resetting the SMP device to enter + * MCUboot recovery mode. + * Used if @kconfig{CONFIG_NRF_CLOUD_FOTA_SMP} is enabled. + */ + void *smp_reset_cb; }; /** diff --git a/include/net/nrf_cloud_location.h b/include/net/nrf_cloud_location.h index 9b9dfccb8cc7..9ff1af4cd850 100644 --- a/include/net/nrf_cloud_location.h +++ b/include/net/nrf_cloud_location.h @@ -95,7 +95,9 @@ struct nrf_cloud_location_result { /** @brief Location request config */ struct nrf_cloud_location_config { - /** If true, nRF Cloud will send the location to the device. */ + /** If true, nRF Cloud will send the location to the device. + * The location info is always stored in nRF Cloud, regardless of this flag's value. + */ bool do_reply; /** If true, uncertainty of result will be 95%, otherwise 68%. */ bool hi_conf; diff --git a/include/nrf_compress/implementation.h b/include/nrf_compress/implementation.h index f895e3c8fab1..3749b2006738 100644 --- a/include/nrf_compress/implementation.h +++ b/include/nrf_compress/implementation.h @@ -29,23 +29,90 @@ extern "C" { #endif /** - * @cond INTERNAL_HIDDEN + * @typedef nrf_compress_init_func_t + * @brief Initialize compression implementation. * - * For internal use only, skip these in public documentation. + * @param[in] inst Reserved for future use, must be NULL. + * + * @retval 0 Success. + * @retval -errno Negative errno code on other failure. + */ +typedef int (*nrf_compress_init_func_t)(void *inst); + +/** + * @typedef nrf_compress_deinit_func_t + * @brief De-initialize compression implementation. + * + * @param[in] inst Reserved for future use, must be NULL. + * + * @retval 0 Success. + * @retval -errno Negative errno code on other failure. */ +typedef int (*nrf_compress_deinit_func_t)(void *inst); -typedef int (*nrf_compress_init_deinit_func_t)(void *inst); +/** + * @typedef nrf_compress_reset_func_t + * @brief Reset compression state function. Used to abort current compression or + * decompression task before starting a new one. + * + * @param[in] inst Reserved for future use, must be NULL. + * + * @retval 0 Success. + * @retval -errno Negative errno code on other failure. + */ typedef int (*nrf_compress_reset_func_t)(void *inst); -/** Compression support is not implemented, placeholder for future use */ + +/** + * @typedef nrf_compress_compress_func_t + * @brief Placeholder function for future use, do not use. + * + * @param[in] inst Reserved for future use, must be NULL. + * + * @retval 0 Success. + * @retval -errno Negative errno code on other failure. + */ typedef int (*nrf_compress_compress_func_t)(void *inst); + +/** + * @brief Return chunk size of data to provide to next call of + * #nrf_compress_decompress_func_t function. This is the ideal amount of data + * that should be provided to the next function call. Less data than this may + * be provided if more is not available (for example, end of data or data is + * is being streamed). + * + * @param[in] inst Reserved for future use, must be NULL. + * + * @retval Positive value Success indicating chunk size. + * @retval -errno Negative errno code on other failure. + */ typedef size_t (*nrf_compress_decompress_bytes_needed_t)(void *inst); -typedef int (*nrf_compress_decompress_func_t)(void *inst, const uint8_t *input, size_t input_size, - bool last_part, uint32_t *offset, uint8_t **output, - size_t *output_size); /** - * @endcond + * @brief Decompress portion of compressed data. This function will need to + * be called one or more times with compressed data to decompress it + * into its natural form. + * + * @param[in] inst Reserved for future use, must be NULL. + * @param[in] input Input data buffer, containing the compressed data. + * @param[in] input_size Size of the input data buffer. + * @param[in] last_part Last part of compressed data. This should be set to true if this is + * the final part of the input data. + * @param[out] offset Input data offset pointer. This will be updated with the amount of + * bytes used from the input buffer. If this is not the last + * decompression call, then the next call to this function should be + * offset the input data buffer by this amount of bytes. + * @param[out] output Output data buffer pointer to pointer. This will be set to the + * compression's output buffer when decompressed data is available to + * be used or copied. + * @param[out] output_size Size of data in output data buffer pointer. Data should only be + * read when the value in this pointer is greater than 0. + * + * @retval 0 Success. + * @retval -errno Negative errno code on other failure. */ +typedef int (*nrf_compress_decompress_func_t)(void *inst, const uint8_t *input, size_t input_size, + bool last_part, uint32_t *offset, uint8_t **output, + size_t *output_size); /** @brief Supported compression types */ enum nrf_compress_types { @@ -55,111 +122,49 @@ enum nrf_compress_types { /** ARM thumb filter */ NRF_COMPRESS_TYPE_ARM_THUMB, - NRF_COMPRESS_TYPE_COUNT + /** Marks end/count of nRF supported filters */ + NRF_COMPRESS_TYPE_COUNT, + + /** Start of freely usable IDs with custom out-of-tree implementations */ + NRF_COMPRESS_TYPE_USER_CUSTOM_START = 32768 }; struct nrf_compress_implementation { - /** ID of implementation (nrf_compress_types) */ + /** @brief ID of implementation #nrf_compress_types. */ const uint16_t id; - /** - * @brief Initialize compression implementation. - * - * @param[in] inst Reserved for future use, must be NULL. - * - * @retval 0 Success. - * @retval -errno Negative errno code on other failure. - */ - const nrf_compress_init_deinit_func_t init; - - /** - * @brief Deinitialize compression implementation. - * - * @param[in] inst Reserved for future use, must be NULL. - * - * @retval 0 Success. - * @retval -errno Negative errno code on other failure. - */ - const nrf_compress_init_deinit_func_t deinit; - - /** - * @brief Reset compression state function. Used to abort current compression - * or decompression task before starting a new one. - * - * @param[in] inst Reserved for future use, must be NULL. - * - * @retval 0 Success. - * @retval -errno Negative errno code on other failure. - */ + const nrf_compress_init_func_t init; + const nrf_compress_deinit_func_t deinit; const nrf_compress_reset_func_t reset; #if defined(CONFIG_NRF_COMPRESS_COMPRESSION) || defined(__DOXYGEN__) - /** @brief Placeholder function for future use, do not use. */ const nrf_compress_compress_func_t compress; #endif #if defined(CONFIG_NRF_COMPRESS_DECOMPRESSION) || defined(__DOXYGEN__) - /** - * @brief Return chunk size of data to provide to next call of - * nrf_compress_decompress_func_t function. This is the ideal amount - * of data that should be provided to the next function call. Less - * data than this may be provided if more is not available (for - * example, end of data or data is being streamed). - * - * @param[in] inst Reserved for future use, must be NULL. - * - * @retval Positive value Success indicating chunk size. - * @retval -errno Negative errno code on other failure. - */ const nrf_compress_decompress_bytes_needed_t decompress_bytes_needed; - - /** - * @brief Decompress portion of compressed data. This function will - * need to be called one or more times with compressed data to - * decompress it into its natural form. - * - * @param[in] inst Reserved for future use, must be NULL. - * @param[in] input Input data buffer, containing the compressed data. - * @param[in] input_size Size of the input data buffer. - * @param[in] last_part Last part of compressed data. This should be set to true if - * this is the final part of the input data. - * @param[out] offset Input data offset pointer. This will be updated with the - * amount of bytes used from the input buffer. If this is not - * the last decompression call, then the next call to this - * function should offset the input data buffer by this - * amount of bytes. - * @param[out] output Output data buffer pointer to pointer. This will be set to - * the compression's output buffer when decompressed data is - * available to be used or copied. - * @ param[out] output_size Size of data in output data buffer pointer. Data should - * only be read when the value in this pointer is greater than - * 0. - * - * @retval 0 Success. - * @retval -errno Negative errno code on other failure. - */ const nrf_compress_decompress_func_t decompress; #endif }; /** - * @brief Define a compression implementation. - * - * This adds a new entry to the iterable section linker list of compression implementations. + * @brief Define a compression implementation. + * This adds a new entry to the iterable section linker list + * of compression implementations. * * @param name Name of the compression type. - * @param _id ID of the compression type (nrf_compress_types). - * @param _init Initialization function (nrf_compress_init_deinit_func_t). + * @param _id ID of the compression type #nrf_compress_types. + * @param _init Initialization function #nrf_compress_init_func_t. * @param _deinit Deinitialization function - * (nrf_compress_init_deinit_func_t). - * @param _reset Reset function (nrf_compress_reset_func_t). + * #nrf_compress_deinit_func_t. + * @param _reset Reset function #nrf_compress_reset_func_t. * @param _compress Compress function or NULL if no compression support - * (nrf_compress_compress_func_t). + * #nrf_compress_compress_func_t. * @param _decompress_bytes_needed Decompression bytes needed function or NULL if no * decompression support - * (nrf_compress_decompress_bytes_needed_t). + * #nrf_compress_decompress_bytes_needed_t. * @param _decompress Decompression function or NULL if no decompression support - * (nrf_compress_decompress_func_t). + * #nrf_compress_decompress_func_t. */ #define NRF_COMPRESS_IMPLEMENTATION_DEFINE(name, _id, _init, _deinit, _reset, _compress, \ _decompress_bytes_needed, _decompress) \ @@ -176,10 +181,11 @@ struct nrf_compress_implementation { .decompress = _decompress, \ ), ()) \ } + /** * @brief Find a compression implementation. * - * @param[in] id Type of compression (nrf_compress_types). + * @param[in] id Type of compression #nrf_compress_types. * * @retval non-NULL Success. * @retval NULL Compression type not found/supported. diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 203f79c4369e..b74915671bec 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -50,3 +50,4 @@ add_subdirectory_ifdef(CONFIG_DATA_FIFO data_fifo) add_subdirectory_ifdef(CONFIG_FEM_AL_LIB fem_al) add_subdirectory_ifdef(CONFIG_SAMPLE_RATE_CONVERTER sample_rate_converter) add_subdirectory_ifdef(CONFIG_NCS_BOOT_BANNER boot_banner) +add_subdirectory_ifdef(CONFIG_UICC_LWM2M uicc_lwm2m) diff --git a/lib/Kconfig b/lib/Kconfig index b55ce44a052c..bb2f65d2f077 100644 --- a/lib/Kconfig +++ b/lib/Kconfig @@ -51,5 +51,6 @@ rsource "data_fifo/Kconfig" rsource "fem_al/Kconfig" rsource "sample_rate_converter/Kconfig" rsource "boot_banner/Kconfig" +rsource "uicc_lwm2m/Kconfig" endmenu diff --git a/lib/date_time/date_time_core.c b/lib/date_time/date_time_core.c index 0953e6e062b5..dbcbcfdba44d 100644 --- a/lib/date_time/date_time_core.c +++ b/lib/date_time/date_time_core.c @@ -59,11 +59,18 @@ static void date_time_core_notify_event(enum date_time_evt_type time_source) if (app_evt_handler != NULL) { app_evt_handler(&evt); + } else { + LOG_DBG("No date-time event handler registered"); } } static int date_time_core_schedule_work(int interval) { + if (!IS_ENABLED(CONFIG_DATE_TIME_MODEM) && !IS_ENABLED(CONFIG_DATE_TIME_NTP)) { + LOG_DBG("Skipping requested date time update, modem and NTP are disabled"); + return -ENOTSUP; + } + /* If a scheduled update is blocking reschedules, exit. * Otherwise set the reschedule_blocked flag to true, then proceed with the reschedule. */ @@ -104,10 +111,11 @@ static void date_time_core_schedule_retry(void) return; } - if (date_time_core_schedule_work(CONFIG_DATE_TIME_RETRY_INTERVAL_SECONDS) == 0) { - LOG_DBG("Date time update retry in: %d seconds", - CONFIG_DATE_TIME_RETRY_INTERVAL_SECONDS); - } + /* Scheduling new update cannot fail because we are never doing retries + * if we have fresh enough time + */ + date_time_core_schedule_work(CONFIG_DATE_TIME_RETRY_INTERVAL_SECONDS); + LOG_DBG("Date time update retry in: %d seconds", CONFIG_DATE_TIME_RETRY_INTERVAL_SECONDS); } static void date_time_update_work_fn(struct k_work *work) @@ -169,6 +177,8 @@ void date_time_lte_ind_handler(const struct lte_lc_evt *const evt) case LTE_LC_NW_REG_REGISTERED_HOME: case LTE_LC_NW_REG_REGISTERED_ROAMING: if (!date_time_is_valid()) { + LOG_DBG("Date time update scheduled in 1 second " + "due to LTE registration"); k_work_reschedule_for_queue( &date_time_work_q, &date_time_update_work, @@ -241,6 +251,8 @@ int date_time_core_now_local(int64_t *local_time_ms) int date_time_core_update_async(date_time_evt_handler_t evt_handler) { + LOG_DBG("Requesting date-time update asynchronously"); + if (evt_handler) { app_evt_handler = evt_handler; } else if (app_evt_handler == NULL) { diff --git a/lib/date_time/date_time_modem.c b/lib/date_time/date_time_modem.c index 17fb8fb1b8d8..23c63eafd0a8 100644 --- a/lib/date_time/date_time_modem.c +++ b/lib/date_time/date_time_modem.c @@ -22,6 +22,9 @@ LOG_MODULE_DECLARE(date_time, CONFIG_DATE_TIME_LOG_LEVEL); extern struct k_work_q date_time_work_q; +#define MODEM_CFUN_NORMAL 1 +#define MODEM_CFUN_ACTIVATE_LTE 21 + #if defined(CONFIG_DATE_TIME_AUTO_UPDATE) /* AT monitor for %XTIME notifications */ AT_MONITOR(xtime, "%XTIME", date_time_at_xtime_handler); @@ -73,7 +76,7 @@ int date_time_modem_get(int64_t *date_time_ms, int *date_time_tz) /* Want to match 6 or 7 args */ if (rc != 6 && rc != 7) { LOG_WRN("Did not get time from cellular network (error: %d). " - "This is normal as some cellular networks don't provide it or " + "This may be normal as some cellular networks don't provide it or " "time may not be available yet.", rc); return -ENODATA; } @@ -122,9 +125,6 @@ static void date_time_at_xtime_handler(const char *notif) int err; int tz; - if (notif == NULL) { - return; - } modem_valid_network_time = true; /* Check if current time is valid */ @@ -160,7 +160,8 @@ static void date_time_at_xtime_handler(const char *notif) time_buf_len = hex2bin(time_str_start, 14, time_buf, sizeof(time_buf)); if (time_buf_len < sizeof(time_buf)) { - LOG_ERR("%%XTIME notification decoding failed (ret=%d): %s", time_buf_len, notif); + LOG_ERR("Time value decoding failed from %%XTIME notification (ret=%d): %s", + time_buf_len, notif); return; } @@ -171,6 +172,12 @@ static void date_time_at_xtime_handler(const char *notif) date_time.tm_min = semioctet_to_dec(time_buf[4]); date_time.tm_sec = semioctet_to_dec(time_buf[5]); + /* 3GPP TS 23.040 Section 9.2.3.11 says about the time zone as follows: + * The Time Zone indicates the difference, expressed in quarters of an hour, + * between the local time and GMT. In the first of the two semi octets, + * the first bit (bit 3 of the seventh octet of the TP Service Centre Time Stamp field) + * represents the algebraic sign of this difference (0: positive, 1: negative). + */ tz = semioctet_to_dec(time_buf[6] & 0xF7); if (time_buf[6] & 0x08) { tz = -tz; @@ -235,13 +242,17 @@ void date_time_modem_xtime_subscribe_work_fn(struct k_work *work_item) } } +#if defined(CONFIG_UNITY) +void date_time_modem_on_cfun(int mode, void *ctx) +#else NRF_MODEM_LIB_ON_CFUN(date_time_cfun_hook, date_time_modem_on_cfun, NULL); static void date_time_modem_on_cfun(int mode, void *ctx) +#endif { ARG_UNUSED(ctx); - if (mode == LTE_LC_FUNC_MODE_NORMAL || mode == LTE_LC_FUNC_MODE_ACTIVATE_LTE) { + if (mode == MODEM_CFUN_NORMAL || mode == MODEM_CFUN_ACTIVATE_LTE) { k_work_submit_to_queue(&date_time_work_q, &date_time_modem_xtime_subscribe_work); } } diff --git a/lib/edge_impulse/CMakeLists.txt b/lib/edge_impulse/CMakeLists.txt index dcc4c0752d4b..5b69061aa620 100644 --- a/lib/edge_impulse/CMakeLists.txt +++ b/lib/edge_impulse/CMakeLists.txt @@ -59,8 +59,8 @@ include(ExternalProject) ExternalProject_Add(edge_impulse_project URL ${EI_URI_LIST} HTTP_HEADER "Accept: application/zip" - DOWNLOAD_EXTRACT_TIMESTAMP True ${EI_API_KEY_HEADER} + DOWNLOAD_EXTRACT_TIMESTAMP True PREFIX ${EDGE_IMPULSE_DIR} SOURCE_DIR ${EDGE_IMPULSE_SOURCE_DIR} BINARY_DIR ${EDGE_IMPULSE_BINARY_DIR} diff --git a/lib/gcf_sms/gcf_sms.c b/lib/gcf_sms/gcf_sms.c index 404a8a9f4a7f..9435987960e2 100644 --- a/lib/gcf_sms/gcf_sms.c +++ b/lib/gcf_sms/gcf_sms.c @@ -192,7 +192,7 @@ int gcf_sms_filter_callback(char *buf, size_t len, char *at_cmd) /* AT command is filtered. */ err = (*callback)(buf_remaining, len_remaining, msg); } else { - err = nrf_modem_at_cmd(buf_remaining, len_remaining, msg); + err = nrf_modem_at_cmd(buf_remaining, len_remaining, "%s", msg); } if (err != 0) { @@ -370,7 +370,7 @@ static int at_cmd_callback_cmss(char *buf, size_t len, char *at_cmd) } /* Send AT+CMGS command to modem. */ - err = nrf_modem_at_cmd(buf, len, "AT+CMGS=%d\r%s\x1a\0", + err = nrf_modem_at_cmd(buf, len, "AT+CMGS=%d\r%s\x1a", sms_buffers[sms_buffer_index].pdu_size, sms_buffers[sms_buffer_index].data); if (err) { @@ -393,7 +393,7 @@ static int at_cmd_callback_cmms(char *buf, size_t len, char *at_cmd) int err; /* Send to modem without buffer. */ - err = nrf_modem_at_printf(at_cmd); + err = nrf_modem_at_printf("%s", at_cmd); if (err) { if (err > 0) { LOG_ERR("%s failed, error_type: %d, error_value: %d", at_cmd, diff --git a/lib/hw_unique_key/CMakeLists.txt b/lib/hw_unique_key/CMakeLists.txt index 18de28e677bb..fc629496ff82 100644 --- a/lib/hw_unique_key/CMakeLists.txt +++ b/lib/hw_unique_key/CMakeLists.txt @@ -7,15 +7,15 @@ zephyr_library() if (CONFIG_CRACEN_HW_PRESENT) - zephyr_library_sources(hw_unique_key_cracen.c) + zephyr_library_sources(hw_unique_key_cracen_kmu.c) else() - zephyr_library_sources(hw_unique_key.c) + zephyr_library_sources(hw_unique_key_cc3xx.c) if (DEFINED CONFIG_HAS_HW_NRF_ACL) - zephyr_library_sources(hw_unique_key_acl.c) + zephyr_library_sources(hw_unique_key_cc3xx_acl.c) else() - zephyr_library_sources(hw_unique_key_kmu.c) + zephyr_library_sources(hw_unique_key_cc3xx_kmu.c) endif() - ncs_add_partition_manager_config(pm.yml.huk) + ncs_add_partition_manager_config(pm.yml.huk_cc3xx) endif() diff --git a/lib/hw_unique_key/hw_unique_key.c b/lib/hw_unique_key/hw_unique_key_cc3xx.c similarity index 100% rename from lib/hw_unique_key/hw_unique_key.c rename to lib/hw_unique_key/hw_unique_key_cc3xx.c diff --git a/lib/hw_unique_key/hw_unique_key_acl.c b/lib/hw_unique_key/hw_unique_key_cc3xx_acl.c similarity index 100% rename from lib/hw_unique_key/hw_unique_key_acl.c rename to lib/hw_unique_key/hw_unique_key_cc3xx_acl.c diff --git a/lib/hw_unique_key/hw_unique_key_kmu.c b/lib/hw_unique_key/hw_unique_key_cc3xx_kmu.c similarity index 100% rename from lib/hw_unique_key/hw_unique_key_kmu.c rename to lib/hw_unique_key/hw_unique_key_cc3xx_kmu.c diff --git a/lib/hw_unique_key/hw_unique_key_cracen.c b/lib/hw_unique_key/hw_unique_key_cracen_kmu.c similarity index 100% rename from lib/hw_unique_key/hw_unique_key_cracen.c rename to lib/hw_unique_key/hw_unique_key_cracen_kmu.c diff --git a/lib/hw_unique_key/pm.yml.huk b/lib/hw_unique_key/pm.yml.huk_cc3xx similarity index 100% rename from lib/hw_unique_key/pm.yml.huk rename to lib/hw_unique_key/pm.yml.huk_cc3xx diff --git a/lib/modem_attest_token/modem_attest_token.c b/lib/modem_attest_token/modem_attest_token.c index 0082133d9be9..6a2bdb3b3143 100644 --- a/lib/modem_attest_token/modem_attest_token.c +++ b/lib/modem_attest_token/modem_attest_token.c @@ -43,7 +43,7 @@ int modem_attest_token_get(struct nrf_attestation_token *const token) /* Execute AT command to get attestation token */ ret = nrf_modem_at_scanf(AT_ATTEST_CMD, - "%%ATTESTTOKEN: \"%127[^.].%127[^\"]\"", &attest, &cose); + "%%ATTESTTOKEN: \"%127[^.].%127[^\"]\"", attest, cose); if (ret != 2) { return -EBADMSG; } diff --git a/lib/modem_info/CMakeLists.txt b/lib/modem_info/CMakeLists.txt index d3bcbc891388..4971dcd32179 100644 --- a/lib/modem_info/CMakeLists.txt +++ b/lib/modem_info/CMakeLists.txt @@ -8,30 +8,6 @@ zephyr_library() zephyr_library_sources(modem_info.c) zephyr_library_sources(modem_info_params.c) -find_package(Git QUIET) -if(NOT APP_VERSION AND GIT_FOUND) - execute_process( - COMMAND ${GIT_EXECUTABLE} describe --abbrev=12 - WORKING_DIRECTORY ${ZEPHYR_NRF_MODULE_DIR} - OUTPUT_VARIABLE APP_VERSION - OUTPUT_STRIP_TRAILING_WHITESPACE - ERROR_STRIP_TRAILING_WHITESPACE - ERROR_VARIABLE stderr - RESULT_VARIABLE return_code - ) - if(return_code) - message(STATUS "git describe failed: ${stderr}; ${KERNEL_VERSION_STRING} will be used instead") - elseif(CMAKE_VERBOSE_MAKEFILE) - message(STATUS "git describe stderr: ${stderr}") - endif() -endif() - -if(APP_VERSION) - zephyr_compile_definitions( - APP_VERSION=${APP_VERSION} - ) -endif() - if(NOT PROJECT_NAME) zephyr_compile_definitions( PROJECT_NAME=${CMAKE_PROJECT_NAME} diff --git a/lib/modem_info/modem_info_params.c b/lib/modem_info/modem_info_params.c index 2cbd1cee9a62..d0797d232255 100644 --- a/lib/modem_info/modem_info_params.c +++ b/lib/modem_info/modem_info_params.c @@ -8,6 +8,8 @@ #include #include #include +#include +#include #include LOG_MODULE_REGISTER(modem_info_params); @@ -42,7 +44,7 @@ int modem_info_params_init(struct modem_param_info *modem) modem->device.battery.type = MODEM_INFO_BATTERY; modem->device.imei.type = MODEM_INFO_IMEI; modem->device.board = CONFIG_BOARD; - modem->device.app_version = STRINGIFY(APP_VERSION); + modem->device.app_version = NCS_VERSION_STRING "-" NCS_COMMIT_STRING; #ifdef PROJECT_NAME modem->device.app_name = STRINGIFY(PROJECT_NAME); diff --git a/lib/modem_key_mgmt/modem_key_mgmt.c b/lib/modem_key_mgmt/modem_key_mgmt.c index 3c6c06107260..28af79e12ccc 100644 --- a/lib/modem_key_mgmt/modem_key_mgmt.c +++ b/lib/modem_key_mgmt/modem_key_mgmt.c @@ -179,6 +179,7 @@ int modem_key_mgmt_read(nrf_sec_tag_t sec_tag, } if (end - begin > *len) { + *len = end - begin; /* Let caller know how large their buffer should be. */ err = -ENOMEM; goto end; } @@ -272,6 +273,41 @@ int modem_key_mgmt_delete(nrf_sec_tag_t sec_tag, return 0; } +int modem_key_mgmt_clear(nrf_sec_tag_t sec_tag) +{ + int err; + bool cmee_was_enabled; + char *token; + uint32_t tag, type; + + cmee_enable(&cmee_was_enabled); + + err = nrf_modem_at_cmd(scratch_buf, sizeof(scratch_buf), "AT%%CMNG=1, %d", sec_tag); + if (err) { + return translate_error(err); + } + + token = strtok(scratch_buf, "\n"); + + while (token != NULL) { + err = sscanf(token, "%%CMNG: %u,%u,\"", &tag, &type); + if (tag == sec_tag) { + err = nrf_modem_at_printf("AT%%CMNG=3,%u,%u", sec_tag, type); + } + token = strtok(NULL, "\n"); + } + + if (!cmee_was_enabled) { + cmee_disable(); + } + + if (err) { + return translate_error(err); + } + + return 0; +} + int modem_key_mgmt_exists(nrf_sec_tag_t sec_tag, enum modem_key_mgmt_cred_type cred_type, bool *exists) diff --git a/lib/nrf_modem_lib/CMakeLists.txt b/lib/nrf_modem_lib/CMakeLists.txt index 20318cd4ca14..217cec7f6eca 100644 --- a/lib/nrf_modem_lib/CMakeLists.txt +++ b/lib/nrf_modem_lib/CMakeLists.txt @@ -7,6 +7,7 @@ zephyr_library() zephyr_library_sources(nrf_modem_lib.c) zephyr_library_sources(nrf_modem_os.c) +zephyr_library_sources_ifdef(CONFIG_SOC_SERIES_NRF92X nrf_modem_os_rpc.c) zephyr_library_sources_ifdef(CONFIG_NRF_MODEM_LIB_CFUN_HOOKS cfun_hooks.c) zephyr_library_sources_ifdef(CONFIG_NRF_MODEM_LIB_MEM_DIAG diag.c) zephyr_library_sources_ifdef(CONFIG_NET_SOCKETS nrf9x_sockets.c) diff --git a/lib/nrf_modem_lib/Kconfig b/lib/nrf_modem_lib/Kconfig index c8fe1d183508..c7098f138a04 100644 --- a/lib/nrf_modem_lib/Kconfig +++ b/lib/nrf_modem_lib/Kconfig @@ -5,8 +5,8 @@ menuconfig NRF_MODEM_LIB bool "Modem library" - depends on SOC_SERIES_NRF91X - depends on TRUSTED_EXECUTION_NONSECURE + depends on (SOC_SERIES_NRF91X && TRUSTED_EXECUTION_NONSECURE) || SOC_NRF9280_CPUAPP + select EXPERIMENTAL if SOC_NRF9280_CPUAPP select NRF_MODEM imply NET_SOCKETS_OFFLOAD imply NET_SOCKETS_POSIX_NAMES if !POSIX_API diff --git a/lib/nrf_modem_lib/Kconfig.modemlib b/lib/nrf_modem_lib/Kconfig.modemlib index 7fd74700a40c..720fc66af6ef 100644 --- a/lib/nrf_modem_lib/Kconfig.modemlib +++ b/lib/nrf_modem_lib/Kconfig.modemlib @@ -10,6 +10,12 @@ config HEAP_MEM_POOL_SIZE int default 512 +# Redefine this symbol as Zephyr defines this as y by +# default, but the offloading layer does not support it. +config COAP_CLIENT_TRUNCATE_MSGS + bool + default n if NRF_MODEM_LIB + menu "Memory configuration" config NRF_MODEM_LIB_HEAP_SIZE @@ -28,6 +34,8 @@ config NRF_MODEM_LIB_SHMEM_CTRL_SIZE This is a constant for a given library build, and is exported by the library via NRF_MODEM_SHMEM_CTRL_SIZE. +if SOC_SERIES_NRF91X || UNITY + config NRF_MODEM_LIB_SHMEM_TX_SIZE int "TX region size" range 1024 32768 @@ -61,6 +69,20 @@ config NRF_MODEM_LIB_SHMEM_TRACE_SIZE help Size of the shared memory region used to receive modem traces. +endif # SOC_SERIES_NRF91X || UNITY + +if SOC_SERIES_NRF92X + +config NRF_MODEM_LIB_TRANSPORT_MBOX + bool + default y + select MBOX + select IPC_SERVICE + select IPC_SERVICE_ICMSG + select IPC_SERVICE_ICMSG_SHMEM_ACCESS_SYNC + +endif # SOC_SERIES_NRF92X + config NRF_MODEM_LIB_SENDMSG_BUF_SIZE int "Size of the sendmsg intermediate buffer" default 128 @@ -102,6 +124,7 @@ endmenu # Memory config menuconfig NRF_MODEM_LIB_TRACE bool "Tracing" + depends on SOC_SERIES_NRF91X || UNITY help When enabled, a portion of RAM (called Trace region) will be shared with the modem to receive modem's trace data. The size of the Trace region is defined by the NRF_MODEM_LIB_SHMEM_TRACE_SIZE option. diff --git a/lib/nrf_modem_lib/nrf9x_sockets.c b/lib/nrf_modem_lib/nrf9x_sockets.c index 663d56bd2d49..a593b22222f0 100644 --- a/lib/nrf_modem_lib/nrf9x_sockets.c +++ b/lib/nrf_modem_lib/nrf9x_sockets.c @@ -241,6 +241,9 @@ static int z_to_nrf_optname(int z_in_level, int z_in_optname, case SO_IPV6_ECHO_REPLY: *nrf_out_optname = NRF_SO_IPV6_ECHO_REPLY; break; + case SO_IPV6_DELAYED_ADDR_REFRESH: + *nrf_out_optname = NRF_SO_IPV6_DELAYED_ADDR_REFRESH; + break; default: retval = -1; break; @@ -760,7 +763,6 @@ static int nrf9x_socket_offload_getaddrinfo(const char *node, struct nrf_addrinfo nrf_hints; struct nrf_addrinfo *nrf_res = NULL; struct nrf_addrinfo *nrf_hints_ptr = NULL; - static K_MUTEX_DEFINE(getaddrinfo_lock); memset(&nrf_hints, 0, sizeof(struct nrf_addrinfo)); @@ -769,11 +771,10 @@ static int nrf9x_socket_offload_getaddrinfo(const char *node, nrf_hints_ptr = &nrf_hints; } - k_mutex_lock(&getaddrinfo_lock, K_FOREVER); int retval = nrf_getaddrinfo(node, service, nrf_hints_ptr, &nrf_res); if (retval != 0) { - goto error; + return retval; } struct nrf_addrinfo *next_nrf_res = nrf_res; @@ -817,8 +818,6 @@ static int nrf9x_socket_offload_getaddrinfo(const char *node, } nrf_freeaddrinfo(nrf_res); -error: - k_mutex_unlock(&getaddrinfo_lock); return retval; } diff --git a/lib/nrf_modem_lib/nrf_modem_lib.c b/lib/nrf_modem_lib/nrf_modem_lib.c index db3f0d735044..a07d60c24983 100644 --- a/lib/nrf_modem_lib/nrf_modem_lib.c +++ b/lib/nrf_modem_lib/nrf_modem_lib.c @@ -4,16 +4,26 @@ * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause */ -#include +#include #include #include #include #include #include -#include #include -#include + +#include +LOG_MODULE_DECLARE(nrf_modem, CONFIG_NRF_MODEM_LIB_LOG_LEVEL); + +#define AT_CFUN_READ "AT+CFUN?" +#define AT_CFUN0_VAL 0 +#define AT_CFUN4_VAL 4 + +static void nrf_modem_lib_dfu_handler(uint32_t dfu_res); + +#ifdef CONFIG_SOC_SERIES_NRF91X #include +#include #include #ifndef CONFIG_TRUSTED_EXECUTION_NONSECURE @@ -21,23 +31,15 @@ Are you building for the correct board ? #endif /* CONFIG_TRUSTED_EXECUTION_NONSECURE */ -LOG_MODULE_DECLARE(nrf_modem, CONFIG_NRF_MODEM_LIB_LOG_LEVEL); - /* Interrupt used for communication with the network layer. */ #define NRF_MODEM_IPC_IRQ DT_IRQ_BY_IDX(DT_NODELABEL(ipc), 0, irq) BUILD_ASSERT(IPC_IRQn == NRF_MODEM_IPC_IRQ, "NRF_MODEM_IPC_IRQ mismatch"); -#define AT_CFUN_READ "AT+CFUN?" -#define AT_CFUN0_VAL 0 -#define AT_CFUN4_VAL 4 - /* The heap implementation in `nrf_modem_os.c` require some overhead * to allow allocating up to `NRF_MODEM_LIB_SHMEM_TX_SIZE` bytes. */ #define NRF_MODEM_LIB_SHMEM_TX_HEAP_OVERHEAD_SIZE 128 -static void nrf_modem_lib_dfu_handler(uint32_t dfu_res); - static const struct nrf_modem_init_params init_params = { .ipc_irq_prio = CONFIG_NRF_MODEM_LIB_IPC_IRQ_PRIO, .shmem.ctrl = { @@ -69,6 +71,27 @@ static const struct nrf_modem_bootloader_init_params bootloader_init_params = { .shmem.size = PM_NRF_MODEM_LIB_SRAM_SIZE, .fault_handler = nrf_modem_fault_handler }; +#endif /* CONFIG_SOC_SERIES_NRF91X */ + +#ifdef CONFIG_SOC_SERIES_NRF92X + +static const struct nrf_modem_init_params init_params = { + .shmem.ctrl = { + .base = DT_REG_ADDR(DT_NODELABEL(cpuapp_cpucell_ipc_shm)), + .size = CONFIG_NRF_MODEM_LIB_SHMEM_CTRL_SIZE, + }, + .shmem.tx = { + .base = DT_REG_ADDR(DT_NODELABEL(cpuapp_cpucell_ipc_shm_heap)), + .size = DT_REG_SIZE(DT_NODELABEL(cpuapp_cpucell_ipc_shm_heap)), + }, + .shmem.rx = { + .base = DT_REG_ADDR(DT_NODELABEL(cpucell_cpuapp_ipc_shm_heap)), + .size = DT_REG_SIZE(DT_NODELABEL(cpucell_cpuapp_ipc_shm_heap)), + }, + .fault_handler = nrf_modem_fault_handler, + .dfu_handler = nrf_modem_lib_dfu_handler, +}; +#endif /* CONFIG_SOC_SERIES_NRF92X */ #if CONFIG_NRF_MODEM_LIB_TRACE extern void nrf_modem_lib_trace_init(void); @@ -129,11 +152,13 @@ int nrf_modem_lib_init(void) { int err; +#ifdef CONFIG_SOC_SERIES_NRF91X /* Setup the network IRQ used by the Modem library. * Note: No call to irq_enable() here, that is done through nrf_modem_init(). */ IRQ_CONNECT(NRF_MODEM_IPC_IRQ, CONFIG_NRF_MODEM_LIB_IPC_IRQ_PRIO, nrfx_isr, nrfx_ipc_irq_handler, 0); +#endif /* CONFIG_SOC_SERIES_NRF91X */ err = nrf_modem_init(&init_params); if (err) { @@ -161,7 +186,11 @@ int nrf_modem_lib_init(void) int nrf_modem_lib_bootloader_init(void) { +#ifdef CONFIG_SOC_SERIES_NRF91X return nrf_modem_bootloader_init(&bootloader_init_params); +#else + return -ENOSYS; +#endif } int nrf_modem_lib_shutdown(void) diff --git a/lib/nrf_modem_lib/nrf_modem_lib_trace.c b/lib/nrf_modem_lib/nrf_modem_lib_trace.c index 81c5f807a0ec..e631eed26083 100644 --- a/lib/nrf_modem_lib/nrf_modem_lib_trace.c +++ b/lib/nrf_modem_lib/nrf_modem_lib_trace.c @@ -21,6 +21,7 @@ LOG_MODULE_REGISTER(nrf_modem_lib_trace, CONFIG_NRF_MODEM_LIB_LOG_LEVEL); K_SEM_DEFINE(trace_sem, 0, 1); K_SEM_DEFINE(trace_clear_sem, 0, 1); K_SEM_DEFINE(trace_done_sem, 1, 1); +K_SEM_DEFINE(modem_trace_level_sem, 1, 1); extern struct nrf_modem_lib_trace_backend trace_backend; static bool has_space = true; @@ -234,13 +235,11 @@ int nrf_modem_lib_trace_processing_done_wait(k_timeout_t timeout) static int trace_fragment_write(struct nrf_modem_trace_data *frag) { int ret; - size_t remaining = frag->len; - while (remaining) { + while (frag->len) { PERF_START(); - ret = trace_backend.write((void *)((uint8_t *)frag->data + frag->len - remaining), - remaining); + ret = trace_backend.write(frag->data, frag->len); PERF_END(ret); @@ -266,7 +265,9 @@ static int trace_fragment_write(struct nrf_modem_trace_data *frag) return ret; } - remaining -= ret; + /* Alter trace fragment to contain what is not written */ + frag->data = (void *)((uint8_t *)frag->data + ret); + frag->len -= ret; } return 0; @@ -320,7 +321,6 @@ void trace_thread_handler(void) break; case -ENOSPC: nrf_modem_lib_trace_callback(NRF_MODEM_LIB_TRACE_EVT_FULL); - if (!trace_backend.clear) { goto deinit; } @@ -331,6 +331,26 @@ void trace_thread_handler(void) /* Try the same fragment again */ i--; continue; + + case -ENOSR: + if (k_sem_take(&modem_trace_level_sem, K_NO_WAIT) != 0) { + /** If modem trace level is off, we wait for modem + * trace level semaphore, indicating modem traces + * are enabled. This is always available unless + * nrf_modem_lib_trace_level_set() is called with + * level 0 (off). + */ + k_sem_give(&trace_done_sem); + k_sem_take(&modem_trace_level_sem, K_FOREVER); + k_sem_take(&trace_done_sem, K_FOREVER); + } + + k_sem_give(&modem_trace_level_sem); + + /* Try the same fragment again */ + i--; + continue; + default: /* Irrecoverable error */ goto deinit; @@ -441,8 +461,10 @@ int nrf_modem_lib_trace_level_set(enum nrf_modem_lib_trace_level trace_level) if (tl) { err = nrf_modem_at_printf("AT%%XMODEMTRACE=1,%d", tl); + k_sem_give(&modem_trace_level_sem); } else { err = nrf_modem_at_printf("AT%%XMODEMTRACE=0"); + k_sem_take(&modem_trace_level_sem, K_NO_WAIT); } if (err) { @@ -473,6 +495,9 @@ int nrf_modem_lib_trace_read(uint8_t *buf, size_t len) read = trace_backend.read(buf, len); if (read > 0) { UPDATE_TRACE_BYTES_READ(read); + /* Traces are read, we can attempt to write more. */ + has_space = true; + k_sem_give(&trace_clear_sem); } return read; diff --git a/lib/nrf_modem_lib/nrf_modem_os.c b/lib/nrf_modem_lib/nrf_modem_os.c index fc1ce239f17d..7c76cc750f39 100644 --- a/lib/nrf_modem_lib/nrf_modem_os.c +++ b/lib/nrf_modem_lib/nrf_modem_os.c @@ -12,14 +12,23 @@ #include #include #include -#include + #include +LOG_MODULE_REGISTER(nrf_modem, CONFIG_NRF_MODEM_LIB_LOG_LEVEL); + +#if CONFIG_SOC_SERIES_NRF91X +#include +#define SHMEM_TX_HEAP_ADDR (PM_NRF_MODEM_LIB_TX_ADDRESS) +#define SHMEM_TX_HEAP_SIZE (CONFIG_NRF_MODEM_LIB_SHMEM_TX_SIZE) +#elif CONFIG_SOC_SERIES_NRF92X +#define SHMEM_TX_HEAP_ADDR (DT_REG_ADDR(DT_NODELABEL(cpuapp_cpucell_ipc_shm_heap))) +#define SHMEM_TX_HEAP_SIZE (DT_REG_SIZE(DT_NODELABEL(cpuapp_cpucell_ipc_shm_heap))) +#endif + #define UNUSED_FLAGS 0 #define THREAD_MONITOR_ENTRIES 10 -LOG_MODULE_REGISTER(nrf_modem, CONFIG_NRF_MODEM_LIB_LOG_LEVEL); - struct sleeping_thread { sys_snode_t node; struct k_sem sem; @@ -375,7 +384,14 @@ void nrf_modem_os_free(void *mem) void *nrf_modem_os_shm_tx_alloc(size_t bytes) { extern uint32_t nrf_modem_lib_shmem_failed_allocs; + +#if (CONFIG_SOC_SERIES_NRF92X && CONFIG_DCACHE) + /* Allocate cache line aligned memory. */ + void * const addr = k_heap_aligned_alloc(&nrf_modem_lib_shmem_heap, CONFIG_DCACHE_LINE_SIZE, + ROUND_UP(bytes, CONFIG_DCACHE_LINE_SIZE), K_NO_WAIT); +#else void * const addr = k_heap_alloc(&nrf_modem_lib_shmem_heap, bytes, K_NO_WAIT); +#endif if (IS_ENABLED(CONFIG_NRF_MODEM_LIB_MEM_DIAG_ALLOC) && !addr) { nrf_modem_lib_shmem_failed_allocs++; @@ -487,8 +503,7 @@ void nrf_modem_os_init(void) { /* Initialize heaps */ k_heap_init(&nrf_modem_lib_heap, library_heap_buf, sizeof(library_heap_buf)); - k_heap_init(&nrf_modem_lib_shmem_heap, (void *)PM_NRF_MODEM_LIB_TX_ADDRESS, - CONFIG_NRF_MODEM_LIB_SHMEM_TX_SIZE); + k_heap_init(&nrf_modem_lib_shmem_heap, (void *)SHMEM_TX_HEAP_ADDR, SHMEM_TX_HEAP_SIZE); } void nrf_modem_os_shutdown(void) diff --git a/lib/nrf_modem_lib/nrf_modem_os_rpc.c b/lib/nrf_modem_lib/nrf_modem_os_rpc.c new file mode 100644 index 000000000000..e6a1bb1740d2 --- /dev/null +++ b/lib/nrf_modem_lib/nrf_modem_os_rpc.c @@ -0,0 +1,269 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include + +#define DCACHE_LINE_SIZE 0 + +/** Structure to hold pbuf configuration and data. */ +struct nrf_modem_pbuf { + struct pbuf_cfg pb_cfg; + struct pbuf pb; +}; + +/** + * Structure nrf_modem_os_rpc was only declared in nrf_modem_os_rpc.h. + * Define the members of the struct here. Populating it with the required IPC data. + */ +struct nrf_modem_os_rpc { + /** ICMsg internal data. */ + struct icmsg_data_t data; + /** ICMsg configuration. */ + struct icmsg_config_t conf; + /** ICMsg callbacks to nrf_modem. */ + struct ipc_service_cb cb; + /** TX pbuf. */ + struct nrf_modem_pbuf tx; + /** RX pbuf. */ + struct nrf_modem_pbuf rx; +}; + +/** + * Structure nrf_modem_os_rpc_signal was only declared in nrf_modem_os_rpc.h. + * Define the members of the struct here. Populating it with the required mbox data. + */ +struct nrf_modem_os_rpc_signal { + /** MBOX instance data. */ + struct mbox_dt_spec mbox; + /** Callback to nrf_modem. */ + nrf_modem_os_rpc_signal_cb_t recv; + /** Private context data usable by nrf_modem. */ + void *priv; +}; + +/** + * Macro to initialize an instance of struct nrf_modem_os_rpc. + * + * @param _inst RPC instance to be initialized. + * @param _dcache_line_size cache line size in bytes. + * + * @return Initializer list for initializing the instance. + */ +#define NRF_MODEM_OS_RPC_INIT(_inst, _dcache_line_size) \ + { \ + .data.tx_pb = &(_inst).tx.pb, \ + .data.rx_pb = &(_inst).rx.pb, \ + .tx.pb.cfg = &(_inst).tx.pb_cfg, \ + .rx.pb.cfg = &(_inst).rx.pb_cfg, \ + .tx.pb_cfg.dcache_alignment = (_dcache_line_size), \ + .rx.pb_cfg.dcache_alignment = (_dcache_line_size), \ + } + +/** + * Define and initialize the RPC instances used by nrf_modem. + * These are declared extern in nrf_modem_os_rpc.h. + */ +struct nrf_modem_os_rpc inst_ctrl = NRF_MODEM_OS_RPC_INIT(inst_ctrl, DCACHE_LINE_SIZE); +struct nrf_modem_os_rpc inst_data = NRF_MODEM_OS_RPC_INIT(inst_data, DCACHE_LINE_SIZE); + +/** + * Define and initialize the signaling instances used by nrf_modem. + * These are declared extern in nrf_modem_os_rpc.h. + */ +struct nrf_modem_os_rpc_signal inst_app_fault; +struct nrf_modem_os_rpc_signal inst_modem_fault; +struct nrf_modem_os_rpc_signal inst_modem_sysoff; + +uintptr_t nrf_modem_os_rpc_sigdev_app_get(void) +{ + const struct device *app_bellboard = DEVICE_DT_GET(DT_NODELABEL(cpuapp_bellboard)); + + return (uintptr_t)app_bellboard; +} + +uintptr_t nrf_modem_os_rpc_sigdev_modem_get(void) +{ + const struct device *modem_bellboard = DEVICE_DT_GET(DT_NODELABEL(cpucell_bellboard)); + + return (uintptr_t)modem_bellboard; +} + +static inline void pbuf_configure(struct pbuf_cfg *pb_cfg, uintptr_t mem_addr, size_t size) +{ + const uint32_t wr_idx_offset = MAX(pb_cfg->dcache_alignment, _PBUF_IDX_SIZE); + + pb_cfg->rd_idx_loc = (uint32_t *)(mem_addr); + pb_cfg->wr_idx_loc = (uint32_t *)(mem_addr + wr_idx_offset); + pb_cfg->len = (uint32_t)((uint32_t)size - wr_idx_offset - _PBUF_IDX_SIZE); + pb_cfg->data_loc = (uint8_t *)(mem_addr + wr_idx_offset + _PBUF_IDX_SIZE); +} + +int nrf_modem_os_rpc_open(struct nrf_modem_os_rpc *instance, + const struct nrf_modem_os_rpc_config *config) +{ + if (instance == NULL || config == NULL) { + return -NRF_EINVAL; + } + + pbuf_configure(&instance->tx.pb_cfg, config->tx.addr, config->tx.size); + pbuf_configure(&instance->rx.pb_cfg, config->rx.addr, config->rx.size); + + instance->conf.mbox_tx.dev = (struct device *)config->tx.sigdev; + instance->conf.mbox_rx.dev = (struct device *)config->rx.sigdev; + instance->conf.mbox_tx.channel_id = config->tx.ch; + instance->conf.mbox_rx.channel_id = config->rx.ch; + + instance->cb.bound = config->cb.bound; + instance->cb.received = config->cb.received; + + return icmsg_open(&instance->conf, &instance->data, &instance->cb, config->cb.priv); +} + +int nrf_modem_os_rpc_send(struct nrf_modem_os_rpc *instance, const void *msg, size_t len) +{ + int ret; + + ret = icmsg_send(&instance->conf, &instance->data, msg, len); + if (ret < 0) { + switch (ret) { + case -EBUSY: + case -EINVAL: + return -NRF_EBUSY; + case -ENOBUFS: + case -ENOMEM: + return -NRF_ENOMEM; + default: + return ret; + } + } + + return 0; +} + +int nrf_modem_os_rpc_close(struct nrf_modem_os_rpc *instance) +{ + return icmsg_close(&instance->conf, &instance->data); +} + +int nrf_modem_os_rpc_rx_suspend(struct nrf_modem_os_rpc *instance) +{ + return mbox_set_enabled_dt(&instance->conf.mbox_rx, false); +} + +int nrf_modem_os_rpc_rx_resume(struct nrf_modem_os_rpc *instance) +{ + return mbox_set_enabled_dt(&instance->conf.mbox_rx, true); +} + +static void mbox_common_callback(const struct device *dev, mbox_channel_id_t ch, void *ctx, + struct mbox_msg *data) +{ + struct nrf_modem_os_rpc_signal *inst = (struct nrf_modem_os_rpc_signal *)ctx; + + ARG_UNUSED(dev); + ARG_UNUSED(data); + + if (inst->recv != NULL) { + inst->recv(ch, inst->priv); + } +} + +int nrf_modem_os_rpc_signal_init(struct nrf_modem_os_rpc_signal *instance, + struct nrf_modem_os_rpc_signal_config *conf) +{ + int err; + + instance->mbox.dev = (struct device *)conf->sigdev; + instance->mbox.channel_id = (mbox_channel_id_t)conf->ch; + instance->priv = conf->priv; + instance->recv = conf->recv; + + if (instance->recv == NULL) { + return 0; + } + + err = mbox_register_callback_dt(&instance->mbox, mbox_common_callback, (void *)instance); + if (err) { + goto errout; + } + + err = mbox_set_enabled_dt(&instance->mbox, true); + if (err) { + goto errout; + } + + return 0; + +errout: + instance->recv = NULL; + return err; +} + +int nrf_modem_os_rpc_signal_send(struct nrf_modem_os_rpc_signal *instance) +{ + if (instance->recv != NULL) { + return -ENOSYS; + } + + return mbox_send_dt(&instance->mbox, NULL); +} + +int nrf_modem_os_rpc_signal_deinit(struct nrf_modem_os_rpc_signal *instance) +{ + if (instance->recv == NULL) { + return 0; + } + + return mbox_set_enabled_dt(&instance->mbox, false); +} + +int nrf_modem_os_rpc_cache_data_flush(void *addr, size_t size) +{ +#if CONFIG_DCACHE + /* Separate heaps are used for data payloads to and from the modem. + * Cache flush is only used on the tx heap. Therefore, cache coherency is + * maintained even when start address and size are not aligned with cache lines. + */ + addr = (void *)ROUND_DOWN((uint32_t)addr, CONFIG_DCACHE_LINE_SIZE); + size = ROUND_UP(size, CONFIG_DCACHE_LINE_SIZE); + + return sys_cache_data_flush_range(addr, size); +#else + ARG_UNUSED(addr); + ARG_UNUSED(size); + return 0; +#endif +} + +int nrf_modem_os_rpc_cache_data_invalidate(void *addr, size_t size) +{ +#if CONFIG_DCACHE + /* Separate heaps are used for data payloads to and from the modem. + * Cache invalidation is only used on the rx heap. Therefore, cache coherency is + * maintained even when start address and size are not aligned with cache lines. + */ + addr = (void *)ROUND_DOWN((uint32_t)addr, CONFIG_DCACHE_LINE_SIZE); + size = ROUND_UP(size, CONFIG_DCACHE_LINE_SIZE); + + return sys_cache_data_invd_range(addr, size); +#else + ARG_UNUSED(addr); + ARG_UNUSED(size); + return 0; +#endif +} diff --git a/lib/nrf_modem_lib/sanity.c b/lib/nrf_modem_lib/sanity.c index 64f6feaa13ae..226e36f5516c 100644 --- a/lib/nrf_modem_lib/sanity.c +++ b/lib/nrf_modem_lib/sanity.c @@ -6,7 +6,9 @@ #include #include +#ifdef CONFIG_SOC_SERIES_NRF91X #include +#endif /* CONFIG_SOC_SERIES_NRF91X */ #include #include @@ -110,6 +112,7 @@ BUILD_ASSERT(ETOOMANYREFS == NRF_ETOOMANYREFS, "Errno not aligned with nrf /* Shared memory sanity check */ +#ifdef CONFIG_SOC_SERIES_NRF91X #define SRAM_BASE 0x20000000 #define SHMEM_RANGE KB(128) #define SHMEM_END (SRAM_BASE + SHMEM_RANGE) @@ -131,6 +134,7 @@ BUILD_ASSERT(PM_NRF_MODEM_LIB_RX_ADDRESS % 4 == 0, BUILD_ASSERT(PM_NRF_MODEM_LIB_TRACE_ADDRESS % 4 == 0, "libmodem Trace region base address must be word aligned"); #endif +#endif /* CONFIG_SOC_SERIES_NRF91X */ /* Socket values sanity check */ diff --git a/lib/nrf_modem_lib/trace_backends/flash/flash.c b/lib/nrf_modem_lib/trace_backends/flash/flash.c index 0eb6d4b32163..4184dcf5f69c 100644 --- a/lib/nrf_modem_lib/trace_backends/flash/flash.c +++ b/lib/nrf_modem_lib/trace_backends/flash/flash.c @@ -42,13 +42,13 @@ static __noinit size_t read_offset; static __noinit struct fcb_entry loc; static __noinit struct flash_sector *sector; -static size_t trace_bytes_unread; -static size_t flash_buf_written; -static uint8_t flash_buf[BUF_SIZE]; +static __noinit size_t trace_bytes_unread; +static __noinit size_t flash_buf_written; +static __noinit uint8_t flash_buf[BUF_SIZE]; static bool is_initialized; -static int trace_backend_clear(void); +static struct k_sem fcb_sem; static size_t buffer_append(const void *data, size_t len) { @@ -87,6 +87,8 @@ static int buffer_flush_to_flash(void) return -ENODATA; } + k_sem_take(&fcb_sem, K_FOREVER); + err = fcb_append(&trace_fcb, flash_buf_written, &loc_flush); if (err) { if (IS_ENABLED(CONFIG_NRF_MODEM_TRACE_FLASH_NOSPACE_ERASE_OLDEST)) { @@ -101,21 +103,22 @@ static int buffer_flush_to_flash(void) err = fcb_walk(&trace_fcb, loc_flush.fe_sector, fcb_walk_callback, NULL); if (err) { LOG_ERR("fcb_walk failed, err %d", err); - return err; + goto out; } /* Erase the oldest sector and append again. */ err = fcb_rotate(&trace_fcb); if (err) { LOG_ERR("fcb_rotate failed, err %d", err); - return err; + goto out; } err = fcb_append(&trace_fcb, flash_buf_written, &loc_flush); } if (err) { LOG_ERR("fcb_append failed, err %d", err); - return -ENOSPC; + err = -ENOSPC; + goto out; } } @@ -123,18 +126,20 @@ static int buffer_flush_to_flash(void) trace_fcb.fap, FCB_ENTRY_FA_DATA_OFF(loc_flush), flash_buf, flash_buf_written); if (err) { LOG_ERR("flash_area_write failed, err %d", err); - return err; + goto out; } err = fcb_append_finish(&trace_fcb, &loc_flush); if (err) { LOG_ERR("fcb_append_finish failed, err %d", err); - return err; + goto out; } flash_buf_written = 0; - return 0; +out: + k_sem_give(&fcb_sem); + return err; } static int trace_flash_erase(void) @@ -160,6 +165,8 @@ int trace_backend_init(trace_backend_processed_cb trace_processed_cb) return -EFAULT; } + k_sem_init(&fcb_sem, 0, 1); + trace_processed_callback = trace_processed_cb; err = flash_area_open(FIXED_PARTITION_ID(MODEM_TRACE), &modem_trace_area); @@ -184,6 +191,8 @@ int trace_backend_init(trace_backend_processed_cb trace_processed_cb) if (magic != TRACE_MAGIC_INITIALIZED) { LOG_DBG("Initializing"); read_offset = 0; + trace_bytes_unread = 0; + flash_buf_written = 0; memset(&loc, 0, sizeof(loc)); sector = NULL; magic = TRACE_MAGIC_INITIALIZED; @@ -215,20 +224,11 @@ int trace_backend_init(trace_backend_processed_cb trace_processed_cb) return err; } - /* Get trace size */ - err = fcb_getnext(&trace_fcb, &loc); - while (!err) { - trace_bytes_unread += loc.fe_data_len; - err = fcb_getnext(&trace_fcb, &loc); - } - - loc.fe_sector = 0; - loc.fe_elem_off = 0; - is_initialized = true; LOG_DBG("Modem trace flash storage initialized\n"); + k_sem_give(&fcb_sem); return 0; } @@ -237,6 +237,9 @@ size_t trace_backend_data_size(void) return trace_bytes_unread; } +/* Read from offset + * FCB sem has to be taken before calling this function! + */ static int read_from_offset(void *buf, size_t len) { int err; @@ -257,23 +260,13 @@ static int read_from_offset(void *buf, size_t len) read_offset = 0; } - /* Erase if done with previous sector. */ - if (sector && (sector != loc.fe_sector)) { - err = fcb_rotate(&trace_fcb); - if (err) { - return to_read; - } - } - - sector = loc.fe_sector; - return to_read; } int trace_backend_read(void *buf, size_t len) { int err; - size_t to_read; + size_t to_read = 0; if (!is_initialized) { return -EPERM; @@ -283,8 +276,11 @@ int trace_backend_read(void *buf, size_t len) return -EINVAL; } - if (read_offset != 0) { - return read_from_offset(buf, len); + k_sem_take(&fcb_sem, K_FOREVER); + + if (read_offset != 0 && loc.fe_sector) { + err = read_from_offset(buf, len); + goto out; } err = fcb_getnext(&trace_fcb, &loc); @@ -292,8 +288,10 @@ int trace_backend_read(void *buf, size_t len) /* Nothing to read */ loc.fe_sector = 0; loc.fe_elem_off = 0; + read_offset = 0; sector = NULL; - return -ENODATA; + err = -ENODATA; + goto out; } else if (err == -ENOTSUP && flash_buf_written) { to_read = MIN(flash_buf_written, len); memcpy(buf, flash_buf, to_read); @@ -306,21 +304,29 @@ int trace_backend_read(void *buf, size_t len) flash_buf_written -= to_read; trace_bytes_unread -= to_read; - if (sector) { - err = fcb_rotate(&trace_fcb); - if (err) { - return to_read; - } - sector = NULL; - } - - return to_read; + err = to_read; + goto out; } else if (err) { - return err; + goto out; + } + + err = read_from_offset(buf, len); + +out: + /* Erase if done with previous sector. */ + if (sector && (sector != loc.fe_sector)) { + err = fcb_rotate(&trace_fcb); + if (err) { + k_sem_give(&fcb_sem); + return err; + } } - return read_from_offset(buf, len); + sector = loc.fe_sector; + + k_sem_give(&fcb_sem); + return err; } static int stream_write(const void *buf, size_t len) @@ -376,6 +382,7 @@ int trace_backend_clear(void) return -EPERM; } + k_sem_take(&fcb_sem, K_FOREVER); LOG_DBG("Clearing trace storage"); flash_buf_written = 0; err = fcb_clear(&trace_fcb); @@ -386,6 +393,8 @@ int trace_backend_clear(void) read_offset = 0; sector = NULL; + k_sem_give(&fcb_sem); + return err; } diff --git a/lib/nrf_modem_lib/trace_backends/rtt/rtt.c b/lib/nrf_modem_lib/trace_backends/rtt/rtt.c index c45ab81f130b..525423610909 100644 --- a/lib/nrf_modem_lib/trace_backends/rtt/rtt.c +++ b/lib/nrf_modem_lib/trace_backends/rtt/rtt.c @@ -9,6 +9,7 @@ #include #include #include +#include LOG_MODULE_REGISTER(modem_trace_backend, CONFIG_MODEM_TRACE_BACKEND_LOG_LEVEL); @@ -28,6 +29,8 @@ int trace_backend_init(trace_backend_processed_cb trace_processed_cb) trace_processed_callback = trace_processed_cb; + LOG_INF("Modem_trace RTT backend channel %d", trace_rtt_channel); + return 0; } @@ -43,6 +46,7 @@ int trace_backend_write(const void *data, size_t len) uint8_t *buf = (uint8_t *)data; size_t remaining_bytes = len; + uint8_t failed_write_count = 0; while (remaining_bytes) { uint16_t transfer_len = MIN(remaining_bytes, @@ -50,11 +54,22 @@ int trace_backend_write(const void *data, size_t len) size_t idx = len - remaining_bytes; ret = SEGGER_RTT_WriteNoLock(trace_rtt_channel, &buf[idx], transfer_len); + if (!ret) { + if (failed_write_count < 10) { + failed_write_count++; + k_msleep(10); + continue; + } + + return (remaining_bytes == len ? -ENOSR : (len - remaining_bytes)); + } + failed_write_count = 0; remaining_bytes -= ret; err = trace_processed_callback(ret); if (err) { + LOG_ERR("Trace processed callback failed, err %d", err); return err; } } @@ -72,7 +87,7 @@ struct nrf_modem_lib_trace_backend trace_backend = { IF_DISABLED(CONFIG_UNITY, (static)) int nrf_modem_lib_trace_rtt_channel_alloc(void) { - const int segger_rtt_mode = SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL; + const int segger_rtt_mode = SEGGER_RTT_MODE_NO_BLOCK_TRIM; trace_rtt_channel = SEGGER_RTT_AllocUpBuffer("modem_trace", rtt_buffer, sizeof(rtt_buffer), segger_rtt_mode); diff --git a/lib/sms/sms.c b/lib/sms/sms.c index 28338894c265..1f9f689e7f7c 100644 --- a/lib/sms/sms.c +++ b/lib/sms/sms.c @@ -16,6 +16,7 @@ #include #endif #include +#include #include "sms_submit.h" #include "sms_deliver.h" @@ -41,6 +42,9 @@ LOG_MODULE_REGISTER(sms, CONFIG_SMS_LOG_LEVEL); /** @brief AT notification informing that SMS client has been unregistered. */ #define AT_SMS_UNREGISTERED_NTF "+CMS ERROR: 524" +#define MODEM_CFUN_NORMAL 1 +#define MODEM_CFUN_ACTIVATE_LTE 21 + /** @brief SMS structure where received SMS is parsed. */ static struct sms_data sms_data_info; @@ -174,7 +178,7 @@ static void sms_at_cmd_handler_cmt(const char *at_notif) __ASSERT_NO_MSG(at_notif != NULL); - memset(&sms_data_info, 0, sizeof(struct sms_data)); + k_work_reschedule(&sms_ack_work, K_NO_WAIT); /* Parse AT command and SMS PDU */ err = sscanf( @@ -184,20 +188,18 @@ static void sms_at_cmd_handler_cmt(const char *at_notif) sms_buf_tmp); if (err < 1) { LOG_ERR("Unable to parse CMT notification, err=%d: %s", err, at_notif); - goto sms_ack_send; + return; } + memset(&sms_data_info, 0, sizeof(struct sms_data)); sms_data_info.type = SMS_TYPE_DELIVER; err = sms_deliver_pdu_parse(sms_buf_tmp, &sms_data_info); if (err) { - goto sms_ack_send; + return; } LOG_DBG("Valid SMS notification decoded"); k_work_submit(&sms_notify_work); - -sms_ack_send: - k_work_reschedule(&sms_ack_work, K_NO_WAIT); } #if defined(CONFIG_SMS_STATUS_REPORT) @@ -215,8 +217,8 @@ static void sms_at_cmd_handler_cds(const char *at_notif) memset(&sms_data_info, 0, sizeof(struct sms_data)); sms_data_info.type = SMS_TYPE_STATUS_REPORT; - k_work_submit(&sms_notify_work); k_work_reschedule(&sms_ack_work, K_NO_WAIT); + k_work_submit(&sms_notify_work); } #endif @@ -420,11 +422,12 @@ int sms_send(const char *number, const uint8_t *data, uint16_t data_len, enum sm } return sms_submit_send(number, data, data_len, type); } - -#if defined(CONFIG_LTE_LINK_CONTROL) -LTE_LC_ON_CFUN(sms_cfun_hook, sms_on_cfun, NULL); - -static void sms_on_cfun(enum lte_lc_func_mode mode, void *ctx) +#ifdef CONFIG_UNITY +void sms_on_cfun(int mode, void *ctx) +#else +NRF_MODEM_LIB_ON_CFUN(sms_cfun_hook, sms_on_cfun, NULL) +static void sms_on_cfun(int mode, void *ctx) +#endif { int err; @@ -432,8 +435,8 @@ static void sms_on_cfun(enum lte_lc_func_mode mode, void *ctx) * if it had been registered earlier. */ if (sms_client_registered) { - if (mode == LTE_LC_FUNC_MODE_NORMAL || - mode == LTE_LC_FUNC_MODE_ACTIVATE_LTE) { + if (mode == MODEM_CFUN_NORMAL || + mode == MODEM_CFUN_ACTIVATE_LTE) { LOG_DBG("Reinitialize SMS subscription when LTE is set ON"); @@ -444,4 +447,3 @@ static void sms_on_cfun(enum lte_lc_func_mode mode, void *ctx) } } } -#endif /* CONFIG_LTE_LINK_CONTROL */ diff --git a/lib/uicc_lwm2m/CMakeLists.txt b/lib/uicc_lwm2m/CMakeLists.txt new file mode 100644 index 000000000000..f21707656ca6 --- /dev/null +++ b/lib/uicc_lwm2m/CMakeLists.txt @@ -0,0 +1,17 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +zephyr_library() + +zephyr_include_directories( + ${ZEPHYR_NRFXLIB_MODULE_DIR}/nrf_modem/include/ +) + +zephyr_library_sources( + asn1_decode.c + pkcs15_decode.c + uicc_lwm2m.c +) diff --git a/lib/uicc_lwm2m/Kconfig b/lib/uicc_lwm2m/Kconfig new file mode 100644 index 000000000000..cbacbc4b689d --- /dev/null +++ b/lib/uicc_lwm2m/Kconfig @@ -0,0 +1,11 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +config UICC_LWM2M + bool "UICC LwM2M bootstrap support" + depends on NRF_MODEM_LIB + help + Enable UICC LwM2M bootstrap library diff --git a/lib/uicc_lwm2m/asn1_decode.c b/lib/uicc_lwm2m/asn1_decode.c new file mode 100644 index 000000000000..4ced0369a705 --- /dev/null +++ b/lib/uicc_lwm2m/asn1_decode.c @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include + +#include "asn1_decode.h" + +#define ASN1_MAX_LENGTH_BYTES 3 + +bool asn1_dec_head(asn1_ctx_t *ctx, uint8_t *tag, size_t *len) +{ + uint32_t hlen = 2; /* Minimum two bytes for header */ + + if (ctx->error || ((ctx->offset + hlen) > ctx->length)) { + /* Error detected or out of data (happens at end of sequence) */ + return false; + } + + *tag = ctx->asnbuf[ctx->offset++]; + *len = ctx->asnbuf[ctx->offset++]; + + if ((*tag & 0x1F) == 0x1F) { + /* Extended tag number is unsupported */ + ctx->error = true; + return false; + } + + if (*len & 0x80) { + int n = *len & 0x7F; + + hlen += n; + if (n > ASN1_MAX_LENGTH_BYTES || (ctx->offset + hlen) > ctx->length) { + /* Unsupported header length or out of data (header is past buffer) */ + ctx->error = true; + return false; + } + + *len = 0; + for (int i = 0; i < n; i++) { + *len = (*len << 8) + ctx->asnbuf[ctx->offset++]; + } + } + + if ((ctx->offset + *len) > ctx->length) { + /* Out of data (value is past buffer) */ + ctx->error = true; + return false; + } + + return true; +} + +void asn1_dec_octet_string(asn1_ctx_t *ctx, size_t len, uint8_t *value, size_t max_len) +{ + if (bin2hex(&ctx->asnbuf[ctx->offset], len, value, max_len) == 0) { + /* OCTET STRING too long for buffer */ + ctx->error = true; + return; + } + + ctx->offset += len; +} + +void asn1_dec_sequence(asn1_ctx_t *ctx, size_t len, void *data, asn1_sequence_func_t sequence_func) +{ + /* Create a subset from the buffer */ + asn1_ctx_t seq_ctx = { + .asnbuf = &ctx->asnbuf[ctx->offset], + .length = len + }; + + sequence_func(&seq_ctx, data); + ctx->offset += len; + + /* Copy error from subset */ + ctx->error = seq_ctx.error; +} + +void asn1_dec_skip(asn1_ctx_t *ctx, size_t len) +{ + ctx->offset += len; +} diff --git a/lib/uicc_lwm2m/asn1_decode.h b/lib/uicc_lwm2m/asn1_decode.h new file mode 100644 index 000000000000..605678a0e13e --- /dev/null +++ b/lib/uicc_lwm2m/asn1_decode.h @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/* A minimalistic ASN.1 BER/DER decoder (X.690). + * + * Supported types: + * OCTET STRING + * SEQUENCE / SEQUENCE OF + */ + +#ifndef ASN1_DECODE_H_ +#define ASN1_DECODE_H_ + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** Commonly used ASN.1 tags. */ +#define UP4 0x04 +#define UP6 0x06 +#define UC16 0x30 +#define AP15 0x4F +#define AP16 0x50 +#define CC1 0xA1 +#define CC7 0xA7 + +/** ASN.1 context values */ +typedef struct { + const uint8_t *asnbuf; /**< ASN.1 BER/DER encoded buffer */ + size_t length; /**< Length of the data buffer */ + uint32_t offset; /**< Current offset into asnbuf */ + bool error; /**< Error detected in ASN.1 syntax */ +} asn1_ctx_t; + +/** Function called to handle elements in a SEQUENCE */ +typedef void (*asn1_sequence_func_t)(asn1_ctx_t *ctx, void *data); + +/** + * @brief Decode ASN.1 header. + * + * @param[in] ctx ASN.1 context values. + * @param[out] tag ASN.1 TAG. + * @param[out] len Length of ASN.1 value. + * + * @return true when valid ASN.1 and a value exists + */ +bool asn1_dec_head(asn1_ctx_t *ctx, uint8_t *tag, size_t *len); + +/** + * @brief Decode ASN.1 OCTET STRING. + * + * @param[in] ctx ASN.1 context values. + * @param[in] len Length of octet string to decode. + * @param[out] value Decoded octet string. + * @param[in] max_len Maximum length of octet string to decode. + */ +void asn1_dec_octet_string(asn1_ctx_t *ctx, size_t len, uint8_t *value, size_t max_len); + +/** + * @brief Decode ASN.1 SEQUENCE. + * + * @param[in] ctx ASN.1 context values. + * @param[in] len Length of sequence to decode. + * @param[inout] data Pointer to application specific values. + * @param[in] sequence_func Function to be called to handle sequence elements. + */ +void asn1_dec_sequence(asn1_ctx_t *ctx, size_t len, void *data, asn1_sequence_func_t sequence_func); + +/** + * @brief Skip a subset of ASN.1 content. + * This is used to skip parts of the content which is not of interest. + * + * @param[in] ctx ASN.1 context values. + * @param[in] len Length of data to skip. + */ +void asn1_dec_skip(asn1_ctx_t *ctx, size_t len); + +#ifdef __cplusplus +} +#endif + +#endif /* ASN1_DECODE_H_ */ diff --git a/lib/uicc_lwm2m/pkcs15_decode.c b/lib/uicc_lwm2m/pkcs15_decode.c new file mode 100644 index 000000000000..31e4e637493f --- /dev/null +++ b/lib/uicc_lwm2m/pkcs15_decode.c @@ -0,0 +1,245 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include + +#include "asn1_decode.h" +#include "pkcs15_decode.h" + +/* ASN.1 Object Identifier 2.23.43.9.1 in encoded form. */ +#define ASN1_LWM2M_BOOTSTRAP_OID "672b0901" +#define ASN1_OMA_TS_LWM2M_BOOTSTRAP_OID "0604672b0901" + +static void asn1_dec_Path(asn1_ctx_t *ctx, void *data) +{ + pkcs15_object_t *object = (pkcs15_object_t *)data; + uint8_t tag; + size_t len; + + /* Here only path is handled. + * + * PKCS15Path ::= SEQUENCE { + * path OCTET STRING, + * index INTEGER (0..pkcs15-ub-index) OPTIONAL, + * length [0] INTEGER (0..pkcs15-ub-index) OPTIONAL + * } (WITH COMPONENTS {..., index PRESENT, length PRESENT} | + * WITH COMPONENTS {..., index ABSENT, length ABSENT}) + */ + + while (asn1_dec_head(ctx, &tag, &len)) { + switch (tag) { + case UP4: + asn1_dec_octet_string(ctx, len, object->path, sizeof(object->path)); + break; + default: + asn1_dec_skip(ctx, len); + break; + } + } +} + +static void asn1_dec_PathOrObjects_Data(asn1_ctx_t *ctx, void *data) +{ + pkcs15_object_t *object = (pkcs15_object_t *)data; + uint8_t tag; + size_t len; + + /* Here only the PKCS15Path choice is handled. + * + * PKCS15PathOrObjects {ObjectType} ::= CHOICE { + * path PKCS15Path, + * objects [0] SEQUENCE OF ObjectType, + * ..., + * indirect-protected [1] ReferencedValue {EnvelopedData {SEQUENCE OF ObjectType}}, + * direct-protected [2] EnvelopedData {SEQUENCE OF ObjectType}, + * } + */ + + while (asn1_dec_head(ctx, &tag, &len)) { + switch (tag) { + case UC16: /* PKCS15Path */ + asn1_dec_sequence(ctx, len, &object->path, asn1_dec_Path); + break; + default: + asn1_dec_skip(ctx, len); + break; + } + } +} + +static void asn1_dec_OidDO(asn1_ctx_t *ctx, void *data) +{ + pkcs15_object_t *object = (pkcs15_object_t *)data; + uint8_t tag; + size_t len; + + /* Here only decode value when OID match 2.23.43.9.1 "lwm2m_bootstrap". + * + * Because of a bug in the OMA-TS-LwM2M_Core spec example this + * variant must also be checked. + * + * PKCS15OidDO ::= SEQUENCE { + * id OBJECT IDENTIFIER, + * value ObjectValue {PKCS15-OPAQUE.&Type} + * } + */ + + uint8_t oid[32]; + bool decode_path = false; + + while (asn1_dec_head(ctx, &tag, &len)) { + switch (tag) { + case UP6: /* id */ + /* Using octet string decoder to simplify code using string matching */ + asn1_dec_octet_string(ctx, len, oid, sizeof(oid)); + + /* Check for Object Identifier 2.23.43.9.1 or the OMA-TS variant */ + if ((strcmp(oid, ASN1_LWM2M_BOOTSTRAP_OID) == 0) || + (strcmp(oid, ASN1_OMA_TS_LWM2M_BOOTSTRAP_OID) == 0)) { + decode_path = true; + } else { + decode_path = false; + } + break; + case UC16: /* value (Path) */ + if (decode_path) { + asn1_dec_sequence(ctx, len, &object->path, asn1_dec_Path); + } else { + asn1_dec_skip(ctx, len); + } + break; + default: + asn1_dec_skip(ctx, len); + break; + } + } +} + +static void asn1_dec_TypeAttributes_OidDO(asn1_ctx_t *ctx, void *data) +{ + uint8_t tag; + size_t len; + + while (asn1_dec_head(ctx, &tag, &len)) { + switch (tag) { + case UC16: /* PKCS15OidDO */ + asn1_dec_sequence(ctx, len, data, asn1_dec_OidDO); + break; + default: + asn1_dec_skip(ctx, len); + break; + } + } +} + +static void asn1_dec_DataObject_OidDO(asn1_ctx_t *ctx, void *data) +{ + uint8_t tag; + size_t len; + + /* Here only TypeAttributes{OidDO} is handled. + * + * PKCS15Object {ClassAttributes, SubClassAttributes, TypeAttributes} ::= SEQUENCE { + * commonObjectAttributes PKCS15CommonObjectAttributes, + * classAttributes ClassAttributes + * subClassAttributes [0] SubClassAttributes OPTIONAL, + * typeAttributes [1] TypeAttributes + * } + * + * PKCS15DataObject {DataObjectAttributes} ::= PKCS15Object { + * PKCS15CommonDataObjectAttributes, NULL, DataObjectAttributes + * } + */ + + while (asn1_dec_head(ctx, &tag, &len)) { + switch (tag) { + case CC1: /* TypeAttributes {OidDO} */ + asn1_dec_sequence(ctx, len, data, asn1_dec_TypeAttributes_OidDO); + break; + default: + asn1_dec_skip(ctx, len); + break; + } + } +} + +bool pkcs15_ef_odf_path_decode(const uint8_t *bytes, size_t bytes_len, pkcs15_object_t *object) +{ + asn1_ctx_t asn1_ctx = { + .asnbuf = bytes, + .length = bytes_len + }; + uint8_t tag; + size_t len; + + /* The EF(ODF) (Elementary File - Object Directory File) may contain pointers + * to multiple Directory Files. Here only the PKCS15DataObjects choice is handled. + * + * PKCS15Objects ::= CHOICE { + * privateKeys [0] PKCS15PrivateKeys, + * publicKeys [1] PKCS15PublicKeys, + * trustedPublicKeys [2] PKCS15PublicKeys, + * secretKeys [3] PKCS15SecretKeys, + * certificates [4] PKCS15Certificates, + * trustedCertificates [5] PKCS15Certificates, + * usefulCertificates [6] PKCS15Certificates, + * dataObjects [7] PKCS15DataObjects, + * authObjects [8] PKCS15AuthObjects, + * ... -- For future extensions + * } + * + * PKCS15DataObjects ::= PKCS15PathOrObjects {PKCS15Data} + */ + + while (asn1_dec_head(&asn1_ctx, &tag, &len)) { + switch (tag) { + case CC7: /* PKCS15DataObjects (PKCS15PathOrObjects {PKCS15Data}) */ + asn1_dec_sequence(&asn1_ctx, len, object, asn1_dec_PathOrObjects_Data); + break; + default: /* Other PKCS15Objects choices */ + asn1_dec_skip(&asn1_ctx, len); + break; + } + } + + /* The UICC record may be padded with 0xFF, this is no error */ + return !(asn1_ctx.error && tag != 0xFF && len != 0xFF); +} + +bool pkcs15_ef_dodf_path_decode(const uint8_t *bytes, size_t bytes_len, pkcs15_object_t *object) +{ + asn1_ctx_t asn1_ctx = { + .asnbuf = bytes, + .length = bytes_len + }; + uint8_t tag; + size_t len; + + /* The EF(DODF) (Elementary File - Data Object Directory File) may contain + * multiple Data Objects. Here only the PKCS15OidDO choice is handled. + * + * PKCS15Data ::= CHOICE { + * opaqueDO PKCS15DataObject {PKCS15Opaque}, + * externalIDO [0] PKCS15DataObject {PKCS15ExternalIDO}, + * oidDO [1] PKCS15DataObject {PKCS15OidDO}, + * ... -- For future extensions + * } + */ + + while (asn1_dec_head(&asn1_ctx, &tag, &len)) { + switch (tag) { + case CC1: /* PKCS15DataObject {PKCS15OidDO} */ + asn1_dec_sequence(&asn1_ctx, len, object, asn1_dec_DataObject_OidDO); + break; + default: /* Other PKCS15Data choices */ + asn1_dec_skip(&asn1_ctx, len); + break; + } + } + + /* The UICC record may be padded with 0xFF, this is no error */ + return !(asn1_ctx.error && tag != 0xFF && len != 0xFF); +} diff --git a/lib/uicc_lwm2m/pkcs15_decode.h b/lib/uicc_lwm2m/pkcs15_decode.h new file mode 100644 index 000000000000..cdec5f996f92 --- /dev/null +++ b/lib/uicc_lwm2m/pkcs15_decode.h @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/* A minimalistic PKCS #15 Elementary File (EF) decoder. + * + * Supported objects: + * EF(ODF) (Object Directory File) - Path element + * EF(DODF) (Data Object Directory File) - Path element + */ + +#ifndef PKCS15_DECODE_H_ +#define PKCS15_DECODE_H_ + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** Maximum Path size supported in this decoder. */ +#define PATH_SIZE 16 + +/** PKCS#15 object with values of interest. */ +typedef struct { + uint8_t path[PATH_SIZE]; +} pkcs15_object_t; + +/** + * @brief Decode PKCS #15 EF(ODF) Path. + * + * @param[in] bytes Array of bytes containing ASN.1. + * @param[in] len Length of bytes array. + * @param[out] object PKCS #15 object with decoded values. + * + * @return true on success. + */ +bool pkcs15_ef_odf_path_decode(const uint8_t *bytes, size_t len, pkcs15_object_t *object); + +/** + * @brief Decode PKCS #15 EF(DODF) Path. + * + * @param[in] bytes Array of bytes containing ASN.1. + * @param[in] len Length of bytes array. + * @param[out] object PKCS #15 object with decoded values. + * + * @return true on success. + */ +bool pkcs15_ef_dodf_path_decode(const uint8_t *bytes, size_t len, pkcs15_object_t *object); + +#ifdef __cplusplus +} +#endif + +#endif /* PKCS15_DECODE_H_ */ diff --git a/lib/uicc_lwm2m/uicc_lwm2m.c b/lib/uicc_lwm2m/uicc_lwm2m.c new file mode 100644 index 000000000000..3f61a1746ff4 --- /dev/null +++ b/lib/uicc_lwm2m/uicc_lwm2m.c @@ -0,0 +1,153 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include +#include +#include + +#include "pkcs15_decode.h" + +static int csim_send(const uint8_t *csim_command, uint8_t *response, int buffer_size) +{ + uint8_t csim_fmt[20]; + int length, rc; + + /* Create csim_fmt based on buffer size */ + rc = snprintf(csim_fmt, sizeof(csim_fmt), "+CSIM: %%d,\"%%%ds\"", buffer_size - 1); + if (rc >= (int)sizeof(csim_fmt)) { + return -EINVAL; + } + + /* Use response buffer for both command and response */ + rc = snprintf(response, buffer_size, "AT+CSIM=%u,\"%s\"", + (unsigned int)strlen(csim_command), csim_command); + if (rc >= buffer_size) { + return -EINVAL; + } + + /* Send AT command */ + rc = nrf_modem_at_scanf(response, csim_fmt, &length, response); + if (rc < 0) { + return rc; + } + + /* Check for success and trailing status word 9000 in response */ + if ((rc != 2) || (length < 4) || (memcmp(&response[length - 4], "9000", 4) != 0)) { + return -EINVAL; + } + + /* Remove status word from response */ + return length - 4; +} + +static int csim_read_file(const uint8_t *path, uint8_t *response, int buffer_size) +{ + uint8_t csim_select[] = "01A40804047FFF****00"; + uint8_t csim_read[] = "01B0000000"; + int length; + + /* Select path */ + memcpy(&csim_select[14], path, 4); + length = csim_send(csim_select, response, buffer_size); + if (length <= 0) { + return length; + } + + /* Check buffer size, needs to be max*2 + 4 bytes for SW for AT response */ + if (buffer_size < UICC_RECORD_BUFFER_MAX) { + /* Expected maximum response length: 1-255, 0=256 */ + snprintf(&csim_read[8], 3, "%2.2X", (uint8_t)((buffer_size - 4) / 2)); + } + + /* Read path */ + length = csim_send(csim_read, response, buffer_size); + if (length <= 0) { + return length; + } + + /* Convert from hex to binary (inplace) */ + length = hex2bin(response, length, response, length); + + return length; +} + +static int uicc_bootstrap_read_records(uint8_t *buffer, int buffer_size) +{ + pkcs15_object_t pkcs15_object; + int length; + + /* Read EF(ODF) */ + length = csim_read_file("5031", buffer, buffer_size); + if (length <= 0) { + return length; + } + + /* Decode PKCS #15 EF(ODF) Path */ + memset(&pkcs15_object, 0, sizeof(pkcs15_object)); + if (!pkcs15_ef_odf_path_decode(buffer, length, &pkcs15_object)) { + return -ENOENT; + } + + /* Check if EF(DODF) Path is found */ + if (pkcs15_object.path[0] == 0) { + return -ENOENT; + } + + /* Read EF(DODF) */ + length = csim_read_file(pkcs15_object.path, buffer, buffer_size); + if (length <= 0) { + return length; + } + + /* Decode PKCS #15 EF(DODF) Path */ + memset(&pkcs15_object, 0, sizeof(pkcs15_object)); + if (!pkcs15_ef_dodf_path_decode(buffer, length, &pkcs15_object)) { + return -ENOENT; + } + + /* Check if EF(DODF-bootstrap) Path is found */ + if (pkcs15_object.path[0] == 0) { + return -ENOENT; + } + + /* Read EF(DODF-bootstrap) */ + length = csim_read_file(pkcs15_object.path, buffer, buffer_size); + + return length; +} + +int uicc_lwm2m_bootstrap_read(uint8_t *buffer, int buffer_size) +{ + int length; + + /* Open a logical channel 1 */ + length = csim_send("0070000001", buffer, buffer_size); + if (length <= 0) { + return length; + } + + /* Select PKCS#15 on channel 1 using the default AID */ + length = csim_send("01A404040CA000000063504B43532D313500", buffer, buffer_size); + + if (length > 0) { + /* Read bootstrap records */ + length = uicc_bootstrap_read_records(buffer, buffer_size); + } + + /* Close the logical channel (using separate buffer to keep content from last file) */ + uint8_t close_response[21]; + int close_length; + + close_length = csim_send("01708001", close_response, sizeof(close_response)); + if (length >= 0 && close_length < 0) { + return close_length; + } + + return length; +} diff --git a/modules/memfault-firmware-sdk/config/memfault_metrics_heartbeat_extra.def b/modules/memfault-firmware-sdk/config/memfault_metrics_heartbeat_extra.def index e93f37cb2c2b..876deec70baf 100644 --- a/modules/memfault-firmware-sdk/config/memfault_metrics_heartbeat_extra.def +++ b/modules/memfault-firmware-sdk/config/memfault_metrics_heartbeat_extra.def @@ -31,6 +31,8 @@ MEMFAULT_METRICS_KEY_DEFINE(ncs_lte_edrx_ptw_ms, kMemfaultMetricType_Unsigned) MEMFAULT_METRICS_KEY_DEFINE(ncs_lte_mode, kMemfaultMetricType_Unsigned) MEMFAULT_METRICS_KEY_DEFINE(ncs_lte_on_time_ms, kMemfaultMetricType_Timer) MEMFAULT_METRICS_KEY_DEFINE(ncs_lte_reset_loop_detected_count, kMemfaultMetricType_Unsigned) +MEMFAULT_METRICS_KEY_DEFINE(ncs_lte_cell_id, kMemfaultMetricType_Signed) +MEMFAULT_METRICS_KEY_DEFINE(ncs_lte_tracking_area_code, kMemfaultMetricType_Signed) #endif /* CONFIG_MEMFAULT_NCS_LTE_METRICS */ #ifdef CONFIG_MEMFAULT_NCS_BT_METRICS diff --git a/modules/memfault-firmware-sdk/memfault_location_metrics.c b/modules/memfault-firmware-sdk/memfault_location_metrics.c index 0189749b8cdd..c98713aa3934 100644 --- a/modules/memfault-firmware-sdk/memfault_location_metrics.c +++ b/modules/memfault-firmware-sdk/memfault_location_metrics.c @@ -82,7 +82,7 @@ static void prv_location_method_results_record(enum location_method method, MEMFAULT_METRIC_SESSION_SET_UNSIGNED(ncs_loc_lte_method_time_ms, ncs_loc, details->elapsed_time_method); MEMFAULT_METRIC_SESSION_SET_UNSIGNED(ncs_loc_lte_method_result, ncs_loc, id); - MEMFAULT_METRIC_SESSION_SET_UNSIGNED(ncs_loc_lte_neighbor_cells_count, + MEMFAULT_METRIC_SESSION_SET_UNSIGNED(ncs_loc_lte_neighbor_cells_count, ncs_loc, details->cellular.ncells_count); MEMFAULT_METRIC_SESSION_SET_UNSIGNED(ncs_loc_lte_gci_cells_count, ncs_loc, details->cellular.gci_cells_count); @@ -91,6 +91,7 @@ static void prv_location_method_results_record(enum location_method method, MEMFAULT_METRIC_SESSION_SET_UNSIGNED(ncs_loc_wifi_method_result, ncs_loc, id); MEMFAULT_METRIC_SESSION_SET_UNSIGNED(ncs_loc_wifi_ap_count, ncs_loc, details->wifi.ap_count); + break; #endif /* CONFIG_LOCATION_METHOD_CELLULAR && CONFIG_LOCATION_METHOD_WIFI */ default: LOG_ERR("Unsupported location method id=%d", method); diff --git a/modules/memfault-firmware-sdk/memfault_lte_metrics.c b/modules/memfault-firmware-sdk/memfault_lte_metrics.c index 4c50328b1b80..ed204f800430 100644 --- a/modules/memfault-firmware-sdk/memfault_lte_metrics.c +++ b/modules/memfault-firmware-sdk/memfault_lte_metrics.c @@ -75,6 +75,7 @@ static void modem_params_get(void) err = modem_info_get_rsrp(&rsrp); if (err) { + LOG_DBG("Failed to get RSRP"); return; } @@ -86,6 +87,7 @@ static void modem_params_get(void) err = modem_info_get_current_band(&band); if (err) { + LOG_DBG("Failed to get band"); return; } @@ -97,6 +99,7 @@ static void modem_params_get(void) err = modem_info_get_snr(&snr); if (err) { + LOG_DBG("Failed to get SNR"); return; } @@ -117,6 +120,17 @@ static void lte_handler(const struct lte_lc_evt *const evt) } switch (evt->type) { + case LTE_LC_EVT_CELL_UPDATE: + err = MEMFAULT_METRIC_SET_SIGNED(ncs_lte_cell_id, evt->cell.id); + if (err) { + LOG_ERR("Failed to set ncs_lte_cell_id"); + } + + err = MEMFAULT_METRIC_SET_SIGNED(ncs_lte_tracking_area_code, evt->cell.tac); + if (err) { + LOG_ERR("Failed to set ncs_lte_tracking_area_code"); + } + break; case LTE_LC_EVT_NW_REG_STATUS: switch (evt->nw_reg_status) { diff --git a/modules/trusted-firmware-m/CMakeLists.txt b/modules/trusted-firmware-m/CMakeLists.txt index f437f63a378b..6c3814ece5ad 100644 --- a/modules/trusted-firmware-m/CMakeLists.txt +++ b/modules/trusted-firmware-m/CMakeLists.txt @@ -8,7 +8,7 @@ zephyr_library() zephyr_include_directories(.) zephyr_library_sources_ifdef(CONFIG_TFM_ALLOW_NON_SECURE_FAULT_HANDLING fault.c) -if (CONFIG_TFM_PARTITION_PLATFORM AND CONFIG_SOC_FAMILY_NORDIC_NRF) +if(CONFIG_TFM_PARTITION_PLATFORM AND CONFIG_SOC_FAMILY_NORDIC_NRF) zephyr_library_named(tfm_api_nrf) # The non-secure API files are located in a folder associated with the TF-M @@ -25,10 +25,10 @@ endif() if(CONFIG_TFM_USE_NS_APP) set_property(GLOBAL PROPERTY app_PM_HEX_FILE $ - ) + ) endif() -if (CONFIG_BOOTLOADER_MCUBOOT AND NOT CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY) +if(CONFIG_BOOTLOADER_MCUBOOT AND NOT CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY) # Configure the secondary partition to be non-secure if(SYSBUILD) function(mcuboot_single_check val) @@ -41,11 +41,13 @@ if (CONFIG_BOOTLOADER_MCUBOOT AND NOT CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY if(mcuboot_single_slot) set_property(TARGET zephyr_property_target - APPEND PROPERTY TFM_CMAKE_OPTIONS -DNRF_NS_SECONDARY=n + APPEND PROPERTY TFM_CMAKE_OPTIONS + -DNRF_NS_SECONDARY=n ) else() set_property(TARGET zephyr_property_target - APPEND PROPERTY TFM_CMAKE_OPTIONS -DNRF_NS_SECONDARY=y + APPEND PROPERTY TFM_CMAKE_OPTIONS + -DNRF_NS_SECONDARY=y ) endif() else() @@ -56,116 +58,131 @@ if (CONFIG_BOOTLOADER_MCUBOOT AND NOT CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY endif() endif() -if (CONFIG_TFM_HW_INIT_RESET_ON_BOOT) +if(CONFIG_TFM_HW_INIT_RESET_ON_BOOT) set_property(TARGET zephyr_property_target - APPEND PROPERTY TFM_CMAKE_OPTIONS -DNRF_HW_INIT_RESET_ON_BOOT=ON + APPEND PROPERTY TFM_CMAKE_OPTIONS + -DNRF_HW_INIT_RESET_ON_BOOT=ON ) - if (CONFIG_TFM_HW_INIT_NRF_PERIPHERALS) + if(CONFIG_TFM_HW_INIT_NRF_PERIPHERALS) set_property(TARGET zephyr_property_target - APPEND PROPERTY TFM_CMAKE_OPTIONS -DNRF_HW_INIT_NRF_PERIPHERALS=ON + APPEND PROPERTY TFM_CMAKE_OPTIONS + -DNRF_HW_INIT_NRF_PERIPHERALS=ON ) endif() endif() -if (CONFIG_TFM_ALLOW_NON_SECURE_RESET) +if(CONFIG_TFM_ALLOW_NON_SECURE_RESET) set_property(TARGET zephyr_property_target - APPEND PROPERTY TFM_CMAKE_OPTIONS -DNRF_ALLOW_NON_SECURE_RESET=ON) + APPEND PROPERTY TFM_CMAKE_OPTIONS + -DNRF_ALLOW_NON_SECURE_RESET=ON) endif() set_property(TARGET zephyr_property_target APPEND PROPERTY TFM_CMAKE_OPTIONS - -DCONFIG_TFM_HALT_ON_CORE_PANIC=${CONFIG_TFM_HALT_ON_CORE_PANIC} + -DCONFIG_TFM_HALT_ON_CORE_PANIC=${CONFIG_TFM_HALT_ON_CORE_PANIC} ) set_property(TARGET zephyr_property_target APPEND PROPERTY TFM_CMAKE_OPTIONS - -DCONFIG_HW_UNIQUE_KEY=${CONFIG_HW_UNIQUE_KEY} - -DCONFIG_HW_UNIQUE_KEY_RANDOM=${CONFIG_HW_UNIQUE_KEY_RANDOM} - -DCRYPTO_TFM_BUILTIN_KEYS_DRIVER=${CONFIG_TFM_CRYPTO_BUILTIN_KEYS} + -DCONFIG_HW_UNIQUE_KEY=${CONFIG_HW_UNIQUE_KEY} + -DCONFIG_HW_UNIQUE_KEY_RANDOM=${CONFIG_HW_UNIQUE_KEY_RANDOM} + -DCRYPTO_TFM_BUILTIN_KEYS_DRIVER=${CONFIG_TFM_CRYPTO_BUILTIN_KEYS} ) set_property(TARGET zephyr_property_target - APPEND PROPERTY TFM_CMAKE_OPTIONS -DSECURE_UART1=${CONFIG_TFM_SECURE_UART} + APPEND PROPERTY TFM_CMAKE_OPTIONS + -DSECURE_UART1=${CONFIG_TFM_SECURE_UART} ) -if (CONFIG_TFM_SECURE_UART0) +if(CONFIG_TFM_SECURE_UART0) set_property(TARGET zephyr_property_target - APPEND PROPERTY TFM_CMAKE_OPTIONS -DNRF_SECURE_UART_INSTANCE=0 + APPEND PROPERTY TFM_CMAKE_OPTIONS + -DNRF_SECURE_UART_INSTANCE=0 ) endif() -if (CONFIG_TFM_SECURE_UART1) +if(CONFIG_TFM_SECURE_UART1) set_property(TARGET zephyr_property_target - APPEND PROPERTY TFM_CMAKE_OPTIONS -DNRF_SECURE_UART_INSTANCE=1 + APPEND PROPERTY TFM_CMAKE_OPTIONS + -DNRF_SECURE_UART_INSTANCE=1 ) endif() -if (CONFIG_TFM_SECURE_UART00) +if(CONFIG_TFM_SECURE_UART00) set_property(TARGET zephyr_property_target - APPEND PROPERTY TFM_CMAKE_OPTIONS -DNRF_SECURE_UART_INSTANCE=00 + APPEND PROPERTY TFM_CMAKE_OPTIONS + -DNRF_SECURE_UART_INSTANCE=00 ) endif() -if (CONFIG_TFM_SECURE_UART20) +if(CONFIG_TFM_SECURE_UART20) set_property(TARGET zephyr_property_target - APPEND PROPERTY TFM_CMAKE_OPTIONS -DNRF_SECURE_UART_INSTANCE=20 + APPEND PROPERTY TFM_CMAKE_OPTIONS + -DNRF_SECURE_UART_INSTANCE=20 ) endif() -if (CONFIG_TFM_SECURE_UART21) +if(CONFIG_TFM_SECURE_UART21) set_property(TARGET zephyr_property_target - APPEND PROPERTY TFM_CMAKE_OPTIONS -DNRF_SECURE_UART_INSTANCE=21 + APPEND PROPERTY TFM_CMAKE_OPTIONS + -DNRF_SECURE_UART_INSTANCE=21 ) endif() -if (CONFIG_TFM_SECURE_UART22) +if(CONFIG_TFM_SECURE_UART22) set_property(TARGET zephyr_property_target - APPEND PROPERTY TFM_CMAKE_OPTIONS -DNRF_SECURE_UART_INSTANCE=22 + APPEND PROPERTY TFM_CMAKE_OPTIONS + -DNRF_SECURE_UART_INSTANCE=22 ) endif() -if (CONFIG_TFM_SECURE_UART30) +if(CONFIG_TFM_SECURE_UART30) set_property(TARGET zephyr_property_target - APPEND PROPERTY TFM_CMAKE_OPTIONS -DNRF_SECURE_UART_INSTANCE=30 + APPEND PROPERTY TFM_CMAKE_OPTIONS + -DNRF_SECURE_UART_INSTANCE=30 ) endif() set_property(TARGET zephyr_property_target APPEND PROPERTY TFM_CMAKE_OPTIONS - -DCONFIG_TFM_LOG_SHARE_UART=${CONFIG_TFM_SECURE_UART_SHARE_INSTANCE} + -DCONFIG_TFM_LOG_SHARE_UART=${CONFIG_TFM_SECURE_UART_SHARE_INSTANCE} ) set_property(GLOBAL PROPERTY tfm_PM_HEX_FILE $ - ) +) set_property(TARGET zephyr_property_target - APPEND PROPERTY TFM_CMAKE_OPTIONS -DZEPHYR_NRF_MODULE_DIR=${ZEPHYR_NRF_MODULE_DIR} - ) + APPEND PROPERTY TFM_CMAKE_OPTIONS + -DZEPHYR_NRF_MODULE_DIR=${ZEPHYR_NRF_MODULE_DIR} +) set_property(TARGET zephyr_property_target - APPEND PROPERTY TFM_CMAKE_OPTIONS -DZEPHYR_BASE=${ZEPHYR_BASE} - ) + APPEND PROPERTY TFM_CMAKE_OPTIONS + -DZEPHYR_BASE=${ZEPHYR_BASE} +) set_property(TARGET zephyr_property_target - APPEND PROPERTY TFM_CMAKE_OPTIONS -DCRYPTO_HW_ACCELERATOR=True - ) - + APPEND PROPERTY TFM_CMAKE_OPTIONS + -DCRYPTO_HW_ACCELERATOR=True +) -if (CONFIG_TFM_ALLOW_NON_SECURE_FAULT_HANDLING) +if(CONFIG_TFM_ALLOW_NON_SECURE_FAULT_HANDLING) set_property(TARGET zephyr_property_target - APPEND PROPERTY TFM_CMAKE_OPTIONS -DNRF_ALLOW_NON_SECURE_FAULT_HANDLING=True + APPEND PROPERTY TFM_CMAKE_OPTIONS + -DNRF_ALLOW_NON_SECURE_FAULT_HANDLING=True ) endif() -if (CONFIG_TFM_LOG_LEVEL_SILENCE) +if(CONFIG_TFM_LOG_LEVEL_SILENCE) set_property(TARGET zephyr_property_target - APPEND PROPERTY TFM_CMAKE_OPTIONS -DPLATFORM_DEFAULT_UART_STDOUT=OFF - ) + APPEND PROPERTY TFM_CMAKE_OPTIONS + -DPLATFORM_DEFAULT_UART_STDOUT=OFF + ) endif() -if (CONFIG_TFM_PROFILE_TYPE_MINIMAL) +if(CONFIG_TFM_PROFILE_TYPE_MINIMAL) set_property(TARGET zephyr_property_target APPEND PROPERTY TFM_CMAKE_OPTIONS -DPLATFORM_DEFAULT_ROTPK=OFF @@ -174,30 +191,30 @@ if (CONFIG_TFM_PROFILE_TYPE_MINIMAL) -DPLATFORM_DEFAULT_OTP=OFF -DPLATFORM_DEFAULT_OTP_WRITEABLE=OFF -DPLATFORM_DEFAULT_NV_COUNTERS=OFF - ) + ) endif() -if (NOT CONFIG_MBEDTLS_PSA_CRYPTO_STORAGE_C) +if(NOT CONFIG_MBEDTLS_PSA_CRYPTO_STORAGE_C) # Workaround: NCSDK-13530 # Allow TF-M crypto to not depend on ITS when PSA crypto storage is disabled. set_property(TARGET zephyr_property_target APPEND PROPERTY TFM_CMAKE_OPTIONS -DCRYPTO_STORAGE_DISABLED=TRUE - ) + ) endif() -if (CONFIG_BOOTLOADER_MCUBOOT) +if(CONFIG_BOOTLOADER_MCUBOOT) set_property(TARGET zephyr_property_target APPEND PROPERTY TFM_CMAKE_OPTIONS -DCONFIG_BOOTLOADER_MCUBOOT=TRUE - ) + ) endif() -if (CONFIG_TFM_NRF_PROVISIONING) +if(CONFIG_TFM_NRF_PROVISIONING) set_property(TARGET zephyr_property_target APPEND PROPERTY TFM_CMAKE_OPTIONS -DNRF_PROVISIONING=ON - ) + ) message(" TF-M Provisioning has been enabled @@ -206,56 +223,70 @@ if (CONFIG_TFM_NRF_PROVISIONING) ") endif() -if (CONFIG_TFM_PSA_FRAMEWORK_HAS_MM_IOVEC) +if(CONFIG_TFM_PSA_FRAMEWORK_HAS_MM_IOVEC) set_property(TARGET zephyr_property_target APPEND PROPERTY TFM_CMAKE_OPTIONS -DPSA_FRAMEWORK_HAS_MM_IOVEC=ON - ) + ) endif() -if (CONFIG_NFCT_PINS_AS_GPIOS OR CONFIG_TFM_NFCT_PINS_AS_GPIOS) +if(CONFIG_NFCT_PINS_AS_GPIOS OR CONFIG_TFM_NFCT_PINS_AS_GPIOS) set_property(TARGET zephyr_property_target - APPEND PROPERTY TFM_CMAKE_OPTIONS + APPEND PROPERTY TFM_CMAKE_OPTIONS -DCONFIG_NFCT_PINS_AS_GPIOS=ON ) endif() -if (CONFIG_NRF_TRACE_PORT) +if(CONFIG_NRF_TRACE_PORT) set_property(TARGET zephyr_property_target - APPEND PROPERTY TFM_CMAKE_OPTIONS + APPEND PROPERTY TFM_CMAKE_OPTIONS -DCONFIG_NRF_TRACE_PORT=${CONFIG_NRF_TRACE_PORT} ) endif() set_property(TARGET zephyr_property_target APPEND PROPERTY TFM_CMAKE_OPTIONS - # Pass Zephyr Python to TF-M so both uses identical Python. - -DPython3_EXECUTABLE=${Python3_EXECUTABLE} + # Pass Zephyr Python to TF-M so both uses identical Python. + -DPython3_EXECUTABLE=${Python3_EXECUTABLE} ) # CONN_HANDLE_MAX_NUM is only needed if IPC mode is used # The maximal number of secure services that are connected or requested at the same time -if (CONFIG_TFM_CONN_HANDLE_MAX_NUM) +if(CONFIG_TFM_CONN_HANDLE_MAX_NUM) set_property(TARGET zephyr_property_target - APPEND PROPERTY TFM_CMAKE_OPTIONS + APPEND PROPERTY TFM_CMAKE_OPTIONS -DCONFIG_TFM_DOORBELL_API=${CONFIG_TFM_CONN_HANDLE_MAX_NUM} ) endif() -if (CONFIG_NRF_APPROTECT_LOCK) +if(CONFIG_NRF_APPROTECT_LOCK) set_property(TARGET zephyr_property_target - APPEND PROPERTY TFM_CMAKE_OPTIONS + APPEND PROPERTY TFM_CMAKE_OPTIONS -DCONFIG_NRF_APPROTECT_LOCK=ON ) endif() -if (CONFIG_NRF_SECURE_APPROTECT_LOCK) +if(CONFIG_NRF_APPROTECT_USER_HANDLING) set_property(TARGET zephyr_property_target - APPEND PROPERTY TFM_CMAKE_OPTIONS + APPEND PROPERTY TFM_CMAKE_OPTIONS + -DCONFIG_NRF_APPROTECT_USER_HANDLING=ON + ) +endif() + +if(CONFIG_NRF_SECURE_APPROTECT_LOCK) + set_property(TARGET zephyr_property_target + APPEND PROPERTY TFM_CMAKE_OPTIONS -DCONFIG_NRF_SECURE_APPROTECT_LOCK=ON ) endif() +if(CONFIG_NRF_SECURE_APPROTECT_USER_HANDLING) + set_property(TARGET zephyr_property_target + APPEND PROPERTY TFM_CMAKE_OPTIONS + -DCONFIG_NRF_SECURE_APPROTECT_USER_HANDLING=ON + ) +endif() + zephyr_include_directories(${ZEPHYR_NRF_MODULE_DIR}/include/tfm) # Default values from config_base.h in TF-M. @@ -308,7 +339,7 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/tfm_config.h.in set_property(TARGET zephyr_property_target APPEND PROPERTY TFM_CMAKE_OPTIONS - -DPROJECT_CONFIG_HEADER_FILE=${CMAKE_CURRENT_BINARY_DIR}/tfm_config.h + -DPROJECT_CONFIG_HEADER_FILE=${CMAKE_CURRENT_BINARY_DIR}/tfm_config.h ) configure_file(${NRF_DIR}/subsys/nrf_security/configs/config_extra.cmake.in @@ -316,7 +347,8 @@ configure_file(${NRF_DIR}/subsys/nrf_security/configs/config_extra.cmake.in ) set_property(TARGET zephyr_property_target - APPEND PROPERTY TFM_CMAKE_OPTIONS -DTFM_EXTRA_CONFIG_PATH="${CMAKE_CURRENT_BINARY_DIR}/config_extra.cmake" + APPEND PROPERTY TFM_CMAKE_OPTIONS + -DTFM_EXTRA_CONFIG_PATH="${CMAKE_CURRENT_BINARY_DIR}/config_extra.cmake" ) if(SYSBUILD) diff --git a/modules/trusted-firmware-m/Kconfig b/modules/trusted-firmware-m/Kconfig index 48b5c4f073ba..7021d6771d49 100644 --- a/modules/trusted-firmware-m/Kconfig +++ b/modules/trusted-firmware-m/Kconfig @@ -468,8 +468,8 @@ config TFM_NRF_PROVISIONING select SECURE_BOOT_STORAGE help Provision the TF-M image. When enabled, TF-M must be in the PSA - provisioning lifecycle state in order to boot. See provisioning - guide for more details. + provisioning lifecycle state in order to boot. Find more information + about provisioning in Running applications with Trusted Firmware-M. config TFM_PSA_FRAMEWORK_HAS_MM_IOVEC bool diff --git a/modules/trusted-firmware-m/Kconfig.tfm.defconfig b/modules/trusted-firmware-m/Kconfig.tfm.defconfig index b652be73cde2..d0e37c1e676e 100644 --- a/modules/trusted-firmware-m/Kconfig.tfm.defconfig +++ b/modules/trusted-firmware-m/Kconfig.tfm.defconfig @@ -10,7 +10,7 @@ config TFM_BOARD default "${ZEPHYR_NRF_MODULE_DIR}/modules/trusted-firmware-m/tfm_boards/nrf9160" if SOC_NRF9160 default "${ZEPHYR_NRF_MODULE_DIR}/modules/trusted-firmware-m/tfm_boards/nrf9120" if SOC_NRF9120 default "${ZEPHYR_NRF_MODULE_DIR}/modules/trusted-firmware-m/tfm_boards/nrf5340_cpuapp" if SOC_NRF5340_CPUAPP - default "${ZEPHYR_NRF_MODULE_DIR}/modules/trusted-firmware-m/tfm_boards/nrf54l15_cpuapp" if SOC_SERIES_NRF54LX + default "${ZEPHYR_NRF_MODULE_DIR}/modules/trusted-firmware-m/tfm_boards/nrf54l15_cpuapp" if SOC_NRF54L15_CPUAPP depends on TRUSTED_EXECUTION_NONSECURE if BUILD_WITH_TFM diff --git a/modules/trusted-firmware-m/Kconfig.tfm.pm b/modules/trusted-firmware-m/Kconfig.tfm.pm index 4c68468a47a3..3a4e35b771a2 100644 --- a/modules/trusted-firmware-m/Kconfig.tfm.pm +++ b/modules/trusted-firmware-m/Kconfig.tfm.pm @@ -28,14 +28,14 @@ config PM_PARTITION_SIZE_TFM default 0xFE00 if TFM_PROFILE_TYPE_MINIMAL && TFM_CMAKE_BUILD_TYPE_DEBUG && \ BOOTLOADER_MCUBOOT default 0x10000 if TFM_PROFILE_TYPE_MINIMAL && TFM_CMAKE_BUILD_TYPE_DEBUG - default 0x6800 if TFM_PROFILE_TYPE_MINIMAL && BOOTLOADER_MCUBOOT && (SOC_NRF54L15_ENGA_CPUAPP || SOC_NRF54L15_CPUAPP) + default 0x6800 if TFM_PROFILE_TYPE_MINIMAL && BOOTLOADER_MCUBOOT && SOC_NRF54L15_CPUAPP default 0x7E00 if TFM_PROFILE_TYPE_MINIMAL && BOOTLOADER_MCUBOOT default 0x8000 if TFM_PROFILE_TYPE_MINIMAL # NCSDK-13503: Temporarily bump size while regressions are being fixed default 0x60000 if TFM_REGRESSION_S default 0x4FE00 if TFM_CMAKE_BUILD_TYPE_DEBUG && BOOTLOADER_MCUBOOT default 0x50000 if TFM_CMAKE_BUILD_TYPE_DEBUG - default 0x3F800 if BOOTLOADER_MCUBOOT && (SOC_NRF54L15_ENGA_CPUAPP || SOC_NRF54L15_CPUAPP) + default 0x3F800 if BOOTLOADER_MCUBOOT && SOC_NRF54L15_CPUAPP default 0x3FE00 if BOOTLOADER_MCUBOOT default 0x40000 help diff --git a/modules/trusted-firmware-m/tfm_boards/CMakeLists.txt b/modules/trusted-firmware-m/tfm_boards/CMakeLists.txt index 7b136ec855bb..4cf9a85bb92c 100644 --- a/modules/trusted-firmware-m/tfm_boards/CMakeLists.txt +++ b/modules/trusted-firmware-m/tfm_boards/CMakeLists.txt @@ -86,10 +86,10 @@ if (${TFM_PARTITION_CRYPTO}) $<$:CONFIG_HW_UNIQUE_KEY_RANDOM> ) - # nrf54l15 uses the PSA headers in the hw_unique_key_cracen.c file, which means + # nrf54l15 uses the PSA headers in the hw_unique_key_cracen_kmu.c file, which means # that we need to make sure that the nrf_security PSA headers are included # before any other PSA-related headers. - if((NRF_SOC_VARIANT STREQUAL nrf54l15) OR (target STREQUAL nrf54l15)) + if(NRF_SOC_VARIANT STREQUAL nrf54l15) target_link_libraries(platform_crypto_keys PRIVATE psa_crypto_library_config @@ -97,13 +97,13 @@ if (${TFM_PARTITION_CRYPTO}) target_sources(platform_crypto_keys PRIVATE - ${ZEPHYR_NRF_MODULE_DIR}/lib/hw_unique_key/hw_unique_key_cracen.c + ${ZEPHYR_NRF_MODULE_DIR}/lib/hw_unique_key/hw_unique_key_cracen_kmu.c ) else() target_sources(platform_s PRIVATE - ${ZEPHYR_NRF_MODULE_DIR}/lib/hw_unique_key/hw_unique_key.c - ${ZEPHYR_NRF_MODULE_DIR}/lib/hw_unique_key/hw_unique_key_kmu.c + ${ZEPHYR_NRF_MODULE_DIR}/lib/hw_unique_key/hw_unique_key_cc3xx.c + ${ZEPHYR_NRF_MODULE_DIR}/lib/hw_unique_key/hw_unique_key_cc3xx_kmu.c ) endif() endif() @@ -198,6 +198,10 @@ if(LOG_MEMORY_PROTECTION) ) endif() +if(PSA_CRYPTO_EXTERNAL_CORE) + include(${TARGET_PLATFORM_PATH}/../external_core.cmake) +endif() + #======================= Non Secure image =========================== install(FILES ns/CMakeLists.txt @@ -213,7 +217,7 @@ file(COPY ${CMAKE_CURRENT_LIST_DIR}/common DESTINATION ${INSTALL_PLATFORM_NS_DIR}) -if((NRF_SOC_VARIANT STREQUAL nrf54l15) OR (target STREQUAL nrf54l15)) +if(NRF_SOC_VARIANT STREQUAL nrf54l15) file(COPY ${ZEPHYR_NRF_MODULE_DIR}/subsys/nrf_security/src/drivers/cracen/cracenpsa/include/cracen_psa_key_ids.h DESTINATION ${INSTALL_INTERFACE_INC_DIR}) file(COPY ${ZEPHYR_NRF_MODULE_DIR}/subsys/nrf_security/src/drivers/cracen/cracenpsa/include/cracen_psa_kmu.h diff --git a/modules/trusted-firmware-m/tfm_boards/board/device_cfg.h b/modules/trusted-firmware-m/tfm_boards/board/device_cfg.h index d22a2ab73eb7..e969b7a87c95 100644 --- a/modules/trusted-firmware-m/tfm_boards/board/device_cfg.h +++ b/modules/trusted-firmware-m/tfm_boards/board/device_cfg.h @@ -13,7 +13,8 @@ #undef ARRAY_SIZE #include -#if !defined(NRF54L15_ENGA_XXAA) +#if !defined(NRF54L15_XXAA) + #if defined(CONFIG_TFM_SECURE_UART0) || DOMAIN_NS == 1U #define TFM_UART uart0 #endif /* defined(CONFIG_TFM_SECURE_UART0) || DOMAIN_NS == 1U */ @@ -22,7 +23,8 @@ #define TFM_UART uart1 #endif /* defined(CONFIG_TFM_SECURE_UART1) */ -#else /* NRF54L15_ENGA_XXAA */ +#else /* NRF54L15_XXAA */ + #if defined(CONFIG_TFM_SECURE_UART00) && DOMAIN_NS != 1U #define TFM_UART uart00 #endif /* defined(CONFIG_TFM_SECURE_UART00) */ @@ -42,7 +44,8 @@ #if defined(CONFIG_TFM_SECURE_UART30) && DOMAIN_NS != 1U #define TFM_UART uart30 #endif /* defined(CONFIG_TFM_SECURE_UART30) */ -#endif /* NRF54L15_ENGA_XXAA */ + +#endif /* NRF54L15_XXAA */ #define DEFAULT_UART_BAUDRATE DT_PROP_OR(DT_NODELABEL(TFM_UART), current_speed, 115200) diff --git a/modules/trusted-firmware-m/tfm_boards/common/config.cmake b/modules/trusted-firmware-m/tfm_boards/common/config.cmake index 1701b1379085..01a8bc33b2cb 100644 --- a/modules/trusted-firmware-m/tfm_boards/common/config.cmake +++ b/modules/trusted-firmware-m/tfm_boards/common/config.cmake @@ -5,29 +5,31 @@ # # Override the platform crypto key handling -set(PLATFORM_DEFAULT_CRYPTO_KEYS FALSE CACHE BOOL "Use default crypto keys implementation.") +set(PLATFORM_DEFAULT_CRYPTO_KEYS FALSE CACHE BOOL "Use default crypto keys implementation.") -set(PLATFORM_DEFAULT_SYSTEM_RESET_HALT OFF CACHE BOOL "Use default system reset/halt implementation") +set(PLATFORM_DEFAULT_SYSTEM_RESET_HALT OFF CACHE BOOL "Use default system reset/halt implementation") # Disable crypto regression tests that are not supported -set(TFM_CRYPTO_TEST_ALG_CFB OFF CACHE BOOL "Test CFB cryptography mode") -set(TFM_CRYPTO_TEST_ALG_OFB OFF CACHE BOOL "Test OFB cryptography mode") +set(TFM_CRYPTO_TEST_ALG_CFB OFF CACHE BOOL "Test CFB cryptography mode") +set(TFM_CRYPTO_TEST_ALG_OFB OFF CACHE BOOL "Test OFB cryptography mode") # Always enable the nonsecure storage partition. # It will still be excluded if the partition manager excludes it. -set(NRF_NS_STORAGE ON CACHE BOOL "Enable non-secure storage partition") -set(PLATFORM_DEFAULT_ATTEST_HAL OFF CACHE BOOL "Use default attest hal implementation.") +set(NRF_NS_STORAGE ON CACHE BOOL "Enable non-secure storage partition") +set(PLATFORM_DEFAULT_ATTEST_HAL OFF CACHE BOOL "Use default attest hal implementation.") -set(NRF_ALLOW_NON_SECURE_RESET OFF CACHE BOOL "Allow system reset calls from Non-Secure") -set(NRF_ALLOW_NON_SECURE_FAULT_HANDLING OFF CACHE BOOL "Allow Non-Secure to handle Secure faults triggered by Non-Secure") +set(NRF_ALLOW_NON_SECURE_RESET OFF CACHE BOOL "Allow system reset calls from Non-Secure") +set(NRF_ALLOW_NON_SECURE_FAULT_HANDLING OFF CACHE BOOL "Allow Non-Secure to handle Secure faults triggered by Non-Secure") -set(TFM_DUMMY_PROVISIONING OFF CACHE BOOL "Provision with dummy values. NOT to be used in production") -set(PLATFORM_DEFAULT_PROVISIONING OFF CACHE BOOL "Use default provisioning implementation") -set(NRF_PROVISIONING OFF CACHE BOOL "Use Nordic provisioning implementation") -set(CONFIG_NFCT_PINS_AS_GPIOS OFF CACHE BOOL "Use NFCT pins as GPIOs.") -set(CONFIG_NRF_TRACE_PORT OFF CACHE BOOL "Enable trace port.") -set(CONFIG_NRF_APPROTECT_LOCK OFF CACHE BOOL "Enable approtect.") -set(CONFIG_NRF_SECURE_APPROTECT_LOCK OFF CACHE BOOL "Enable secure approtect.") +set(TFM_DUMMY_PROVISIONING OFF CACHE BOOL "Provision with dummy values. NOT to be used in production") +set(PLATFORM_DEFAULT_PROVISIONING OFF CACHE BOOL "Use default provisioning implementation") +set(NRF_PROVISIONING OFF CACHE BOOL "Use Nordic provisioning implementation") +set(CONFIG_NFCT_PINS_AS_GPIOS OFF CACHE BOOL "Use NFCT pins as GPIOs.") +set(CONFIG_NRF_TRACE_PORT OFF CACHE BOOL "Enable trace port.") +set(CONFIG_NRF_APPROTECT_LOCK OFF CACHE BOOL "Enable approtect.") +set(CONFIG_NRF_APPROTECT_USER_HANDLING OFF CACHE BOOL "Enable approtect user handling.") +set(CONFIG_NRF_SECURE_APPROTECT_LOCK OFF CACHE BOOL "Enable secure approtect.") +set(CONFIG_NRF_SECURE_APPROTECT_USER_HANDLING OFF CACHE BOOL "Enable secure approtect user handling.") -set(CONFIG_HW_UNIQUE_KEY ON CACHE BOOL "Enable Hardware Unique Key") -set(CONFIG_HW_UNIQUE_KEY_RANDOM ON CACHE BOOL "Write a new Hardware Unique Key if none exists") +set(CONFIG_HW_UNIQUE_KEY ON CACHE BOOL "Enable Hardware Unique Key") +set(CONFIG_HW_UNIQUE_KEY_RANDOM ON CACHE BOOL "Write a new Hardware Unique Key if none exists") diff --git a/modules/trusted-firmware-m/tfm_boards/common/crypto_keys.c b/modules/trusted-firmware-m/tfm_boards/common/crypto_keys.c index e3d5119778f8..694210e5f5ae 100644 --- a/modules/trusted-firmware-m/tfm_boards/common/crypto_keys.c +++ b/modules/trusted-firmware-m/tfm_boards/common/crypto_keys.c @@ -19,7 +19,8 @@ #include -#define TFM_NS_PARTITION_ID -1 +#define MAPPED_TZ_NS_AGENT_DEFAULT_CLIENT_ID -0x3c000000 +#define TFM_NS_PARTITION_ID MAPPED_TZ_NS_AGENT_DEFAULT_CLIENT_ID #ifdef CONFIG_HW_UNIQUE_KEY static enum tfm_plat_err_t tfm_plat_get_huk(uint8_t *buf, size_t buf_len, size_t *key_len, diff --git a/modules/trusted-firmware-m/tfm_boards/common/tfm_hal_platform.c b/modules/trusted-firmware-m/tfm_boards/common/tfm_hal_platform.c index c8d2da1a19a0..8e1250871ddb 100644 --- a/modules/trusted-firmware-m/tfm_boards/common/tfm_hal_platform.c +++ b/modules/trusted-firmware-m/tfm_boards/common/tfm_hal_platform.c @@ -147,6 +147,8 @@ enum tfm_hal_status_t tfm_hal_platform_init(void) enum tfm_security_lifecycle_t lcs = tfm_attest_hal_get_security_lifecycle(); if (lcs != TFM_SLC_PSA_ROT_PROVISIONING && lcs != TFM_SLC_SECURED) { + SPMLOG_ERRMSGVAL("Invalid LCS: ", lcs); + SPMLOG_DBGMSG("Ensure that the device has been provisioned.\r\n"); return TFM_HAL_ERROR_BAD_STATE; } #endif /* defined(NRF_PROVISIONING) */ diff --git a/modules/trusted-firmware-m/tfm_boards/external_core.cmake b/modules/trusted-firmware-m/tfm_boards/external_core.cmake index a88ffd672cf7..d57680500020 100644 --- a/modules/trusted-firmware-m/tfm_boards/external_core.cmake +++ b/modules/trusted-firmware-m/tfm_boards/external_core.cmake @@ -2,7 +2,7 @@ # Copyright (c) 2024, Arm Limited. All rights reserved. # Copyright (c) 2024, Nordic Semiconductor ASA. # -# SPDX-License-Identifier: BSD-3-Clause +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # #------------------------------------------------------------------------------- @@ -131,3 +131,14 @@ if(TARGET tfm_sprt) psa_interface ) endif() + +if(TARGET platform_s) + target_compile_definitions(platform_s + PRIVATE + # Required for system_nrfxx_approtect.h. + $<$:ENABLE_APPROTECT> + $<$:ENABLE_APPROTECT_USER_HANDLING> + $<$:ENABLE_SECURE_APPROTECT> + $<$:ENABLE_SECURE_APPROTECT_USER_HANDLING> + ) +endif() diff --git a/modules/trusted-firmware-m/tfm_boards/nrf54l15_cpuapp/CMakeLists.txt b/modules/trusted-firmware-m/tfm_boards/nrf54l15_cpuapp/CMakeLists.txt index f81e9cee1853..996e57a74c84 100644 --- a/modules/trusted-firmware-m/tfm_boards/nrf54l15_cpuapp/CMakeLists.txt +++ b/modules/trusted-firmware-m/tfm_boards/nrf54l15_cpuapp/CMakeLists.txt @@ -27,7 +27,7 @@ target_include_directories(platform_s ${ZEPHYR_BASE}/soc/nordic/common ) -# nrf54l15_enga_application.h should be defining __ICACHE_PRESENT, but +# nrf54l15_application.h should be defining __ICACHE_PRESENT, but # it is not, until this is fixed we define it here. target_compile_definitions(platform_s PRIVATE diff --git a/samples/bluetooth/broadcast_config_tool/README.rst b/samples/bluetooth/broadcast_config_tool/README.rst index 01767f001cc4..f38b81cc0693 100644 --- a/samples/bluetooth/broadcast_config_tool/README.rst +++ b/samples/bluetooth/broadcast_config_tool/README.rst @@ -15,6 +15,7 @@ In the BIS gateway mode, transmitting audio from the broadcast source happens us The following limitations apply to this sample: * Audio input: Pre-encoded LC3 data from an SD-card. + See :ref:`broadcast_configuration_tool_configuration_sd` for more information. * Maximum two BIG with four BIS streams each. .. _broadcast_configuration_tool_requirements: @@ -761,6 +762,15 @@ The sample is pre-configured with a generous default memory allocation, suitable You can modify these default settings in the :file:`prj.conf` file. Using aggressive configurations can reduce air time availability for all streams, depending on the combination of options selected (like high bitrates, increased re-transmits, specific PHY settings). +.. _broadcast_configuration_tool_configuration_sd: + +SD card setup +************* + +The sample only supports pre-encoded LC3 data stored as LC3 files on an SD card. + +Make sure you format the SD card with a FAT file system. + .. _broadcast_configuration_tool_building: Building and running @@ -782,6 +792,7 @@ In this testing procedure, the development kit is programmed with the Broadcast To test the Broadcast Configuration Tool sample, complete the following steps: +1. Insert the SD card loaded with the pre-encoded LC3 data. #. Turn on the development kit. #. Set up the serial connection with the development kit. #. Configure a BIG using use case 1: diff --git a/samples/bluetooth/broadcast_config_tool/include/broadcast_config_tool.h b/samples/bluetooth/broadcast_config_tool/include/broadcast_config_tool.h index da244545a7b3..64d84da6850c 100644 --- a/samples/bluetooth/broadcast_config_tool/include/broadcast_config_tool.h +++ b/samples/bluetooth/broadcast_config_tool/include/broadcast_config_tool.h @@ -78,18 +78,6 @@ struct bap_preset { char name[PRESET_NAME_MAX]; }; -#define CONTEXT_NAME_LEN_MAX 20 -struct audio_context { - enum bt_audio_context context; - char name[CONTEXT_NAME_LEN_MAX]; -}; - -#define LOCATION_NAME_LEN_MAX 5 -struct audio_location { - enum bt_audio_location location; - char name[5]; -}; - static struct bap_preset bap_presets[] = { {.preset = &lc3_preset_8_1_1, .name = "8_1_1"}, {.preset = &lc3_preset_8_2_1, .name = "8_2_1"}, @@ -121,22 +109,15 @@ static struct bap_preset bap_presets[] = { {.preset = &lc3_preset_48_6_2, .name = "48_6_2"}, }; -static struct audio_context contexts[] = { - {.context = BT_AUDIO_CONTEXT_TYPE_PROHIBITED, .name = "Prohibited"}, - {.context = BT_AUDIO_CONTEXT_TYPE_UNSPECIFIED, .name = "Unspecified"}, - {.context = BT_AUDIO_CONTEXT_TYPE_CONVERSATIONAL, .name = "Conversational"}, - {.context = BT_AUDIO_CONTEXT_TYPE_MEDIA, .name = "Media"}, - {.context = BT_AUDIO_CONTEXT_TYPE_GAME, .name = "Game"}, - {.context = BT_AUDIO_CONTEXT_TYPE_INSTRUCTIONAL, .name = "Instructional"}, - {.context = BT_AUDIO_CONTEXT_TYPE_VOICE_ASSISTANTS, .name = "Voice assistants"}, - {.context = BT_AUDIO_CONTEXT_TYPE_LIVE, .name = "Live"}, - {.context = BT_AUDIO_CONTEXT_TYPE_SOUND_EFFECTS, .name = "Sound effects"}, - {.context = BT_AUDIO_CONTEXT_TYPE_NOTIFICATIONS, .name = "Notifications"}, - {.context = BT_AUDIO_CONTEXT_TYPE_RINGTONE, .name = "Ringtone"}, - {.context = BT_AUDIO_CONTEXT_TYPE_ALERTS, .name = "Alerts"}, - {.context = BT_AUDIO_CONTEXT_TYPE_EMERGENCY_ALARM, .name = "Emergency alarm"}, +#define LOCATION_NAME_LEN_MAX 4 +struct audio_location { + enum bt_audio_location location; + char name[LOCATION_NAME_LEN_MAX + 1]; }; +/* Note: If there is any change to the specification of audio + * locations then this structure must be checked for conformance. + */ static struct audio_location locations[] = { {.location = BT_AUDIO_LOCATION_MONO_AUDIO, .name = "MA"}, {.location = BT_AUDIO_LOCATION_FRONT_LEFT, .name = "FL"}, @@ -192,104 +173,4 @@ static struct usecase_info pre_defined_use_cases[] = { {.use_case = PERSONAL_MULTI_LANGUAGE, .name = "Personal multi-language"}, }; -static inline char *location_bit_to_str(enum bt_audio_location location) -{ - switch (location) { - case BT_AUDIO_LOCATION_MONO_AUDIO: - return "Mono Audio"; - case BT_AUDIO_LOCATION_FRONT_LEFT: - return "Front Left"; - case BT_AUDIO_LOCATION_FRONT_RIGHT: - return "Front Right"; - case BT_AUDIO_LOCATION_FRONT_CENTER: - return "Front Center"; - case BT_AUDIO_LOCATION_LOW_FREQ_EFFECTS_1: - return "Low Frequency 1"; - case BT_AUDIO_LOCATION_BACK_LEFT: - return "Back Left"; - case BT_AUDIO_LOCATION_BACK_RIGHT: - return "Back Right"; - case BT_AUDIO_LOCATION_FRONT_LEFT_OF_CENTER: - return "Front Left of Center"; - case BT_AUDIO_LOCATION_FRONT_RIGHT_OF_CENTER: - return "Front Right of Center"; - case BT_AUDIO_LOCATION_BACK_CENTER: - return "Back Center"; - case BT_AUDIO_LOCATION_LOW_FREQ_EFFECTS_2: - return "Low Frequency 2"; - case BT_AUDIO_LOCATION_SIDE_LEFT: - return "Side Left"; - case BT_AUDIO_LOCATION_SIDE_RIGHT: - return "Side Right"; - case BT_AUDIO_LOCATION_TOP_FRONT_LEFT: - return "Top Front Left"; - case BT_AUDIO_LOCATION_TOP_FRONT_RIGHT: - return "Top Front Right"; - case BT_AUDIO_LOCATION_TOP_FRONT_CENTER: - return "Top Front Center"; - case BT_AUDIO_LOCATION_TOP_CENTER: - return "Top Center"; - case BT_AUDIO_LOCATION_TOP_BACK_LEFT: - return "Top Back Left"; - case BT_AUDIO_LOCATION_TOP_BACK_RIGHT: - return "Top Back Right"; - case BT_AUDIO_LOCATION_TOP_SIDE_LEFT: - return "Top Side Left"; - case BT_AUDIO_LOCATION_TOP_SIDE_RIGHT: - return "Top Side Right"; - case BT_AUDIO_LOCATION_TOP_BACK_CENTER: - return "Top Back Center"; - case BT_AUDIO_LOCATION_BOTTOM_FRONT_CENTER: - return "Bottom Front Center"; - case BT_AUDIO_LOCATION_BOTTOM_FRONT_LEFT: - return "Bottom Front Left"; - case BT_AUDIO_LOCATION_BOTTOM_FRONT_RIGHT: - return "Bottom Front Right"; - case BT_AUDIO_LOCATION_FRONT_LEFT_WIDE: - return "Front Left Wide"; - case BT_AUDIO_LOCATION_FRONT_RIGHT_WIDE: - return "Front Right Wide"; - case BT_AUDIO_LOCATION_LEFT_SURROUND: - return "Left Surround"; - case BT_AUDIO_LOCATION_RIGHT_SURROUND: - return "Right Surround"; - default: - return "Unknown"; - } -} - -static inline char *context_bit_to_str(enum bt_audio_context context) -{ - switch (context) { - case BT_AUDIO_CONTEXT_TYPE_PROHIBITED: - return "Prohibited"; - case BT_AUDIO_CONTEXT_TYPE_UNSPECIFIED: - return "Unspecified"; - case BT_AUDIO_CONTEXT_TYPE_CONVERSATIONAL: - return "Conversational"; - case BT_AUDIO_CONTEXT_TYPE_MEDIA: - return "Media"; - case BT_AUDIO_CONTEXT_TYPE_GAME: - return "Game"; - case BT_AUDIO_CONTEXT_TYPE_INSTRUCTIONAL: - return "Instructional"; - case BT_AUDIO_CONTEXT_TYPE_VOICE_ASSISTANTS: - return "Voice assistant"; - case BT_AUDIO_CONTEXT_TYPE_LIVE: - return "Live"; - case BT_AUDIO_CONTEXT_TYPE_SOUND_EFFECTS: - return "Sound effects"; - case BT_AUDIO_CONTEXT_TYPE_NOTIFICATIONS: - return "Notifications"; - case BT_AUDIO_CONTEXT_TYPE_RINGTONE: - return "Ringtone"; - case BT_AUDIO_CONTEXT_TYPE_ALERTS: - return "Alerts"; - case BT_AUDIO_CONTEXT_TYPE_EMERGENCY_ALARM: - return "Emergency alarm"; - default: - return "Unknown"; - } -} - #endif /* _BROADCAST_CONFIG_TOOL_H_ */ diff --git a/samples/bluetooth/broadcast_config_tool/src/main.c b/samples/bluetooth/broadcast_config_tool/src/main.c index e629b105d8a9..e4a69d17be9b 100644 --- a/samples/bluetooth/broadcast_config_tool/src/main.c +++ b/samples/bluetooth/broadcast_config_tool/src/main.c @@ -106,6 +106,18 @@ struct subgroup_lc3_stream_info { static struct subgroup_lc3_stream_info lc3_stream_infos[CONFIG_BT_ISO_MAX_BIG] [CONFIG_BT_BAP_BROADCAST_SRC_SUBGROUP_COUNT]; +/* Find the most significant 1 in bits, bits will not be 0. */ +static int8_t context_msb_one(uint16_t bits) +{ + uint8_t pos = 0; + + while (bits >>= 1) { + pos++; + } + + return pos; +} + static struct bt_bap_lc3_preset *preset_find(const char *name) { for (size_t i = 0; i < ARRAY_SIZE(bap_presets); i++) { @@ -615,8 +627,10 @@ int main(void) static void context_print(const struct shell *shell) { - for (size_t i = 0; i < ARRAY_SIZE(contexts); i++) { - shell_print(shell, "%s", contexts[i].name); + shell_print(shell, "%s", bt_audio_context_bit_to_str(0)); + + for (int i = 0; i <= context_msb_one(BT_AUDIO_CONTEXT_TYPE_ANY); i++) { + shell_print(shell, "%s", bt_audio_context_bit_to_str(BIT(i))); } } @@ -732,12 +746,13 @@ static void broadcast_config_print(const struct shell *shell, uint8_t group_inde shell_print(shell, "\t\tContext(s):"); - /* Context container is a bit field with length 16 */ - for (size_t j = 0U; j < 16; j++) { + /* Context container is a bit field */ + for (size_t j = 0U; j <= context_msb_one(BT_AUDIO_CONTEXT_TYPE_ANY); j++) { const uint16_t bit_val = BIT(j); if (brdcst_param->subgroups[i].context & bit_val) { - shell_print(shell, "\t\t\t%s", context_bit_to_str(bit_val)); + shell_print(shell, "\t\t\t%s", + bt_audio_context_bit_to_str(bit_val)); } } @@ -758,7 +773,8 @@ static void broadcast_config_print(const struct shell *shell, uint8_t group_inde for (size_t j = 0; j < brdcst_param->subgroups[i].num_bises; j++) { shell_print(shell, "\t\t\tBIS %d: %s", j, - location_bit_to_str(brdcst_param->subgroups[i].location[j])); + bt_audio_location_bit_to_str( + brdcst_param->subgroups[i].location[j])); } shell_print(shell, "\t\tFiles:"); @@ -1347,9 +1363,10 @@ static int cmd_context(const struct shell *shell, size_t argc, char **argv) return -EINVAL; } - for (size_t i = 0; i < ARRAY_SIZE(contexts); i++) { - if (strcasecmp(argv[1], contexts[i].name) == 0) { - context = contexts[i].context; + /* Context container is a bit field */ + for (size_t i = 0U; i <= context_msb_one(BT_AUDIO_CONTEXT_TYPE_ANY); i++) { + if (strcasecmp(argv[1], bt_audio_context_bit_to_str(BIT(i))) == 0) { + context = BIT(i); break; } } @@ -1387,7 +1404,7 @@ static void location_print(const struct shell *shell) { for (size_t i = 0; i < ARRAY_SIZE(locations); i++) { shell_print(shell, "%s - %s", locations[i].name, - location_bit_to_str(locations[i].location)); + bt_audio_location_bit_to_str(locations[i].location)); } } @@ -1429,6 +1446,7 @@ static int cmd_location(const struct shell *shell, size_t argc, char **argv) int location = location_find(shell, argv[1]); if (location < 0) { + shell_error(shell, "Location not found"); return -EINVAL; } diff --git a/samples/bluetooth/central_and_peripheral_hr/Kconfig b/samples/bluetooth/central_and_peripheral_hr/Kconfig new file mode 100644 index 000000000000..587856d89b2b --- /dev/null +++ b/samples/bluetooth/central_and_peripheral_hr/Kconfig @@ -0,0 +1,16 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +source "Kconfig.zephyr" + +config SETTINGS + default y + +config ZMS + default y if SOC_FLASH_NRF_RRAM + +config NVS + default y if !SOC_FLASH_NRF_RRAM diff --git a/samples/bluetooth/central_and_peripheral_hr/prj.conf b/samples/bluetooth/central_and_peripheral_hr/prj.conf index 1b40906651a8..f1aeaba65e5c 100644 --- a/samples/bluetooth/central_and_peripheral_hr/prj.conf +++ b/samples/bluetooth/central_and_peripheral_hr/prj.conf @@ -31,8 +31,6 @@ CONFIG_BT_SETTINGS=y CONFIG_FLASH=y CONFIG_FLASH_PAGE_LAYOUT=y CONFIG_FLASH_MAP=y -CONFIG_NVS=y -CONFIG_SETTINGS=y CONFIG_HEAP_MEM_POOL_SIZE=1024 diff --git a/samples/bluetooth/central_bas/Kconfig b/samples/bluetooth/central_bas/Kconfig new file mode 100644 index 000000000000..587856d89b2b --- /dev/null +++ b/samples/bluetooth/central_bas/Kconfig @@ -0,0 +1,16 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +source "Kconfig.zephyr" + +config SETTINGS + default y + +config ZMS + default y if SOC_FLASH_NRF_RRAM + +config NVS + default y if !SOC_FLASH_NRF_RRAM diff --git a/samples/bluetooth/central_bas/prj.conf b/samples/bluetooth/central_bas/prj.conf index eb0d3394336c..3deae57b598a 100644 --- a/samples/bluetooth/central_bas/prj.conf +++ b/samples/bluetooth/central_bas/prj.conf @@ -22,7 +22,5 @@ CONFIG_BT_SETTINGS=y CONFIG_FLASH=y CONFIG_FLASH_PAGE_LAYOUT=y CONFIG_FLASH_MAP=y -CONFIG_NVS=y -CONFIG_SETTINGS=y CONFIG_DK_LIBRARY=y diff --git a/samples/bluetooth/central_bas/sample.yaml b/samples/bluetooth/central_bas/sample.yaml index 167051e377ce..e69be107a982 100644 --- a/samples/bluetooth/central_bas/sample.yaml +++ b/samples/bluetooth/central_bas/sample.yaml @@ -18,7 +18,8 @@ tests: - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp - nrf5340dk/nrf5340/cpuapp/ns + - nrf54l15dk/nrf54l15/cpuapp - nrf54h20dk/nrf54h20/cpuapp platform_allow: nrf52dk/nrf52832 nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp - nrf5340dk/nrf5340/cpuapp/ns nrf54h20dk/nrf54h20/cpuapp + nrf5340dk/nrf5340/cpuapp/ns nrf54l15dk/nrf54l15/cpuapp nrf54h20dk/nrf54h20/cpuapp tags: bluetooth ci_build sysbuild diff --git a/samples/bluetooth/central_hids/Kconfig b/samples/bluetooth/central_hids/Kconfig new file mode 100644 index 000000000000..587856d89b2b --- /dev/null +++ b/samples/bluetooth/central_hids/Kconfig @@ -0,0 +1,16 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +source "Kconfig.zephyr" + +config SETTINGS + default y + +config ZMS + default y if SOC_FLASH_NRF_RRAM + +config NVS + default y if !SOC_FLASH_NRF_RRAM diff --git a/samples/bluetooth/central_hids/prj.conf b/samples/bluetooth/central_hids/prj.conf index fbf6615f2c78..11feb1bae423 100644 --- a/samples/bluetooth/central_hids/prj.conf +++ b/samples/bluetooth/central_hids/prj.conf @@ -25,7 +25,5 @@ CONFIG_BT_SETTINGS=y CONFIG_FLASH=y CONFIG_FLASH_PAGE_LAYOUT=y CONFIG_FLASH_MAP=y -CONFIG_NVS=y -CONFIG_SETTINGS=y CONFIG_DK_LIBRARY=y diff --git a/samples/bluetooth/central_hids/src/main.c b/samples/bluetooth/central_hids/src/main.c index 9d1610bb51d6..4cebb4df0757 100644 --- a/samples/bluetooth/central_hids/src/main.c +++ b/samples/bluetooth/central_hids/src/main.c @@ -591,7 +591,12 @@ static void auth_passkey_confirm(struct bt_conn *conn, unsigned int passkey) bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr)); printk("Passkey for %s: %06u\n", addr, passkey); - printk("Press Button 1 to confirm, Button 2 to reject.\n"); + + if (IS_ENABLED(CONFIG_SOC_SERIES_NRF54HX) || IS_ENABLED(CONFIG_SOC_SERIES_NRF54LX)) { + printk("Press Button 0 to confirm, Button 1 to reject.\n"); + } else { + printk("Press Button 1 to confirm, Button 2 to reject.\n"); + } } diff --git a/samples/bluetooth/central_hr_coded/sample.yaml b/samples/bluetooth/central_hr_coded/sample.yaml index 8dc632c322da..a4fff6ee8e4c 100644 --- a/samples/bluetooth/central_hr_coded/sample.yaml +++ b/samples/bluetooth/central_hr_coded/sample.yaml @@ -9,6 +9,8 @@ tests: integration_platforms: - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp + - nrf54l15dk/nrf54l15/cpuapp - nrf54h20dk/nrf54h20/cpuapp - platform_allow: nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp nrf54h20dk/nrf54h20/cpuapp + platform_allow: nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp nrf54l15dk/nrf54l15/cpuapp + nrf54h20dk/nrf54h20/cpuapp tags: bluetooth ci_build sysbuild diff --git a/samples/bluetooth/central_nfc_pairing/Kconfig b/samples/bluetooth/central_nfc_pairing/Kconfig new file mode 100644 index 000000000000..587856d89b2b --- /dev/null +++ b/samples/bluetooth/central_nfc_pairing/Kconfig @@ -0,0 +1,16 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +source "Kconfig.zephyr" + +config SETTINGS + default y + +config ZMS + default y if SOC_FLASH_NRF_RRAM + +config NVS + default y if !SOC_FLASH_NRF_RRAM diff --git a/samples/bluetooth/central_nfc_pairing/prj.conf b/samples/bluetooth/central_nfc_pairing/prj.conf index 49abce0c2d8b..f8a095497e1a 100644 --- a/samples/bluetooth/central_nfc_pairing/prj.conf +++ b/samples/bluetooth/central_nfc_pairing/prj.conf @@ -57,8 +57,6 @@ CONFIG_BT_SETTINGS=y CONFIG_FLASH=y CONFIG_FLASH_PAGE_LAYOUT=y CONFIG_FLASH_MAP=y -CONFIG_NVS=y -CONFIG_SETTINGS=y # Config logger CONFIG_LOG=y diff --git a/samples/bluetooth/central_uart/Kconfig b/samples/bluetooth/central_uart/Kconfig new file mode 100644 index 000000000000..587856d89b2b --- /dev/null +++ b/samples/bluetooth/central_uart/Kconfig @@ -0,0 +1,16 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +source "Kconfig.zephyr" + +config SETTINGS + default y + +config ZMS + default y if SOC_FLASH_NRF_RRAM + +config NVS + default y if !SOC_FLASH_NRF_RRAM diff --git a/samples/bluetooth/central_uart/prj.conf b/samples/bluetooth/central_uart/prj.conf index e7c8a2549b67..3a93cc882c27 100644 --- a/samples/bluetooth/central_uart/prj.conf +++ b/samples/bluetooth/central_uart/prj.conf @@ -34,8 +34,6 @@ CONFIG_BT_SETTINGS=y CONFIG_FLASH=y CONFIG_FLASH_PAGE_LAYOUT=y CONFIG_FLASH_MAP=y -CONFIG_NVS=y -CONFIG_SETTINGS=y # Config logger CONFIG_LOG=y diff --git a/samples/bluetooth/conn_time_sync/README.rst b/samples/bluetooth/conn_time_sync/README.rst index a96013379a08..949f1330e7c9 100644 --- a/samples/bluetooth/conn_time_sync/README.rst +++ b/samples/bluetooth/conn_time_sync/README.rst @@ -29,8 +29,16 @@ To observe that the LEDs are toggled synchronously, use a logic analyzer or an o Overview ******** +.. tabs:: + + .. group-tab:: nRF52 and nRF53 DKs + + The Central and Peripheral devices toggle **LED 2** synchronously and within a few microseconds of one another. + + .. group-tab:: nRF54 DKs + + The Central and Peripheral devices toggle **LED 1** synchronously and within a few microseconds of one another. -The Central and Peripheral devices toggle **LED 1** synchronously and within a few microseconds of one another. The LEDs are toggled at the timestamp specified by the Central device. Clock synchronization @@ -99,9 +107,17 @@ On nRF52 and nRF53 Series devices, you also need one RTC peripheral, one TIMER p User interface ************** +.. tabs:: + + .. group-tab:: nRF52 and nRF53 DKs + + LED 2: + Blinks simultaneously on all devices after synchronization takes place. + + .. group-tab:: nRF54 DKs -LED 1: - Blinks simultaneously on all devices after synchronization takes place. + LED 1: + Blinks simultaneously on all devices after synchronization takes place. Building and running ******************** diff --git a/samples/bluetooth/conn_time_sync/src/timed_led_toggle.c b/samples/bluetooth/conn_time_sync/src/timed_led_toggle.c index 76aff7f050c0..34e8779d537f 100644 --- a/samples/bluetooth/conn_time_sync/src/timed_led_toggle.c +++ b/samples/bluetooth/conn_time_sync/src/timed_led_toggle.c @@ -54,8 +54,8 @@ int timed_led_toggle_init(void) const nrfx_gpiote_task_config_t task_cfg_led_toggle = { .task_ch = gpiote_chan_led_toggle, .polarity = NRF_GPIOTE_POLARITY_TOGGLE, - .init_val = (led.dt_flags & GPIO_ACTIVE_HIGH) ? - NRF_GPIOTE_INITIAL_VALUE_LOW : NRF_GPIOTE_INITIAL_VALUE_HIGH, + .init_val = (led.dt_flags & GPIO_ACTIVE_LOW) ? + NRF_GPIOTE_INITIAL_VALUE_HIGH : NRF_GPIOTE_INITIAL_VALUE_LOW, }; if (nrfx_gpiote_output_configure(&gpiote, LED_PIN, &gpiote_output_cfg, diff --git a/samples/bluetooth/direct_test_mode/src/dtm.c b/samples/bluetooth/direct_test_mode/src/dtm.c index 9fad67aae606..b9665647dfaf 100644 --- a/samples/bluetooth/direct_test_mode/src/dtm.c +++ b/samples/bluetooth/direct_test_mode/src/dtm.c @@ -746,6 +746,11 @@ static nrf_radio_txpower_t dbm_to_nrf_radio_txpower(int8_t tx_power) * to the appropriate radio register enumerator. */ switch (tx_power) { +#if defined(RADIO_TXPOWER_TXPOWER_Neg100dBm) + case -100: + return RADIO_TXPOWER_TXPOWER_Neg100dBm; +#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg100dBm) */ + #if defined(RADIO_TXPOWER_TXPOWER_Neg70dBm) case -70: return RADIO_TXPOWER_TXPOWER_Neg70dBm; @@ -766,14 +771,24 @@ static nrf_radio_txpower_t dbm_to_nrf_radio_txpower(int8_t tx_power) return RADIO_TXPOWER_TXPOWER_Neg30dBm; #endif /* defined(RADIO_TXPOWER_TXPOWER_Neg30dBm) */ -#if defined(RADIO_TXPOWER_TXPOWER_Neg26dBm) - case -26: - return RADIO_TXPOWER_TXPOWER_Neg26dBm; -#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg26dBm) */ +#if defined(RADIO_TXPOWER_TXPOWER_Neg28dBm) + case -28: + return RADIO_TXPOWER_TXPOWER_Neg28dBm; +#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg28dBm) */ + +#if defined(RADIO_TXPOWER_TXPOWER_Neg22dBm) + case -22: + return RADIO_TXPOWER_TXPOWER_Neg22dBm; +#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg22dBm) */ case -20: return RADIO_TXPOWER_TXPOWER_Neg20dBm; +#if defined(RADIO_TXPOWER_TXPOWER_Neg18dBm) + case -18: + return RADIO_TXPOWER_TXPOWER_Neg18dBm; +#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg18dBm) */ + case -16: return RADIO_TXPOWER_TXPOWER_Neg16dBm; @@ -1094,6 +1109,12 @@ int dtm_init(dtm_iq_report_callback_t callback) } #endif /* defined(CONFIG_CLOCK_CONTROL_NRF) */ +#if defined(CONFIG_SOC_SERIES_NRF54HX) + /* Apply HMPAN-102 workaround for nRF54H series */ + *(volatile uint32_t *)0x5302C7E4 = + (((*((volatile uint32_t *)0x5302C7E4)) & 0xFF000FFF) | 0x0012C000); +#endif + err = timer_init(); if (err) { return err; diff --git a/samples/bluetooth/direct_test_mode/src/dtm_hw.c b/samples/bluetooth/direct_test_mode/src/dtm_hw.c index 705a1d73361c..5f181182e455 100644 --- a/samples/bluetooth/direct_test_mode/src/dtm_hw.c +++ b/samples/bluetooth/direct_test_mode/src/dtm_hw.c @@ -11,6 +11,9 @@ /* All valid power levels (in dBm) supported by the SoC. */ const int8_t nrf_power_value[] = { +#if defined(RADIO_TXPOWER_TXPOWER_Neg100dBm) + -100, +#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg100dBm) */ #if defined(RADIO_TXPOWER_TXPOWER_Neg70dBm) -70, #endif /* defined(RADIO_TXPOWER_TXPOWER_Neg70dBm) */ @@ -23,10 +26,16 @@ const int8_t nrf_power_value[] = { #if defined(RADIO_TXPOWER_TXPOWER_Neg30dBm) -30, #endif /* defined(RADIO_TXPOWER_TXPOWER_Neg30dBm) */ -#if defined(RADIO_TXPOWER_TXPOWER_Neg26dBm) - -26, -#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg26dBm) */ +#if defined(RADIO_TXPOWER_TXPOWER_Neg28dBm) + -28, +#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg28dBm) */ +#if defined(RADIO_TXPOWER_TXPOWER_Neg22dBm) + -22, +#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg22dBm) */ -20, +#if defined(RADIO_TXPOWER_TXPOWER_Neg18dBm) + -18, +#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg18dBm) */ -16, #if defined(RADIO_TXPOWER_TXPOWER_Neg14dBm) -14, diff --git a/samples/bluetooth/direction_finding_connectionless_tx/README.rst b/samples/bluetooth/direction_finding_connectionless_tx/README.rst index e8e730d66f9f..ff18f1f8fd58 100644 --- a/samples/bluetooth/direction_finding_connectionless_tx/README.rst +++ b/samples/bluetooth/direction_finding_connectionless_tx/README.rst @@ -52,8 +52,6 @@ To build this sample with AoA mode only, set :makevar:`EXTRA_CONF_FILE` to the : For more information about configuration files in the |NCS|, see :ref:`app_build_system`. -To build this sample for :ref:`nRF5340 DK `, with AoA mode only, add content of :file:`overlay-aoa.conf` file to :file:`child_image/hci_ipc.conf` file. - .. bt_dir_finding_tx_aoa_mode_end .. bt_dir_finding_tx_ant_aod_start diff --git a/samples/bluetooth/direction_finding_connectionless_tx/boards/nrf52833dk_nrf52820.conf b/samples/bluetooth/direction_finding_connectionless_tx/boards/nrf52833dk_nrf52820.conf index 0ad2b92a3612..1c1e952454c6 100644 --- a/samples/bluetooth/direction_finding_connectionless_tx/boards/nrf52833dk_nrf52820.conf +++ b/samples/bluetooth/direction_finding_connectionless_tx/boards/nrf52833dk_nrf52820.conf @@ -4,20 +4,9 @@ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # -CONFIG_BT_CTLR=y -CONFIG_BT_LL_SW_SPLIT=y - -CONFIG_BT_CTLR_ADV_EXT=y -CONFIG_BT_CTLR_ADV_PERIODIC=y - # Enable Direction Finding TX Feature including AoA and AoD CONFIG_BT_CTLR_DF=y # Disable Direction Finding RX mode CONFIG_BT_CTLR_DF_ANT_SWITCH_RX=n CONFIG_BT_CTLR_DF_SCAN_CTE_RX=n - -# Enable chaining of multiple CTEs in periodic advertising -CONFIG_BT_CTLR_ADVANCED_FEATURES=y -CONFIG_BT_CTLR_ADV_SYNC_PDU_BACK2BACK=y -CONFIG_BT_CTLR_DF_PER_ADV_CTE_NUM_MAX=16 diff --git a/samples/bluetooth/direction_finding_connectionless_tx/boards/nrf52833dk_nrf52833.conf b/samples/bluetooth/direction_finding_connectionless_tx/boards/nrf52833dk_nrf52833.conf index 37341ecaee5a..4d2b2330509a 100644 --- a/samples/bluetooth/direction_finding_connectionless_tx/boards/nrf52833dk_nrf52833.conf +++ b/samples/bluetooth/direction_finding_connectionless_tx/boards/nrf52833dk_nrf52833.conf @@ -3,21 +3,9 @@ # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # - -CONFIG_BT_CTLR=y -CONFIG_BT_LL_SW_SPLIT=y - -CONFIG_BT_CTLR_ADV_EXT=y -CONFIG_BT_CTLR_ADV_PERIODIC=y - # Enable Direction Finding Feature including AoA and AoD CONFIG_BT_CTLR_DF=y # Disable Direction Finding RX mode CONFIG_BT_CTLR_DF_SCAN_CTE_RX=n CONFIG_BT_CTLR_DF_ANT_SWITCH_RX=n - -# Enable chaining of multiple CTEs in periodic advertising -CONFIG_BT_CTLR_ADVANCED_FEATURES=y -CONFIG_BT_CTLR_ADV_SYNC_PDU_BACK2BACK=y -CONFIG_BT_CTLR_DF_PER_ADV_CTE_NUM_MAX=16 diff --git a/samples/bluetooth/direction_finding_connectionless_tx/overlay-bt_ll_sw_split.conf b/samples/bluetooth/direction_finding_connectionless_tx/overlay-bt_ll_sw_split.conf new file mode 100644 index 000000000000..0ad2b92a3612 --- /dev/null +++ b/samples/bluetooth/direction_finding_connectionless_tx/overlay-bt_ll_sw_split.conf @@ -0,0 +1,23 @@ +# +# Copyright (c) 2021 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_BT_CTLR=y +CONFIG_BT_LL_SW_SPLIT=y + +CONFIG_BT_CTLR_ADV_EXT=y +CONFIG_BT_CTLR_ADV_PERIODIC=y + +# Enable Direction Finding TX Feature including AoA and AoD +CONFIG_BT_CTLR_DF=y + +# Disable Direction Finding RX mode +CONFIG_BT_CTLR_DF_ANT_SWITCH_RX=n +CONFIG_BT_CTLR_DF_SCAN_CTE_RX=n + +# Enable chaining of multiple CTEs in periodic advertising +CONFIG_BT_CTLR_ADVANCED_FEATURES=y +CONFIG_BT_CTLR_ADV_SYNC_PDU_BACK2BACK=y +CONFIG_BT_CTLR_DF_PER_ADV_CTE_NUM_MAX=16 diff --git a/samples/bluetooth/direction_finding_connectionless_tx/sample.yaml b/samples/bluetooth/direction_finding_connectionless_tx/sample.yaml index 3667c26112e3..fec3df6d63eb 100644 --- a/samples/bluetooth/direction_finding_connectionless_tx/sample.yaml +++ b/samples/bluetooth/direction_finding_connectionless_tx/sample.yaml @@ -2,22 +2,66 @@ sample: name: Direction Finding Connectionless Beacon description: Sample application showing connectionless Direction Finding transmission tests: - sample.bluetooth.direction_finding_connectionless_nrf: + sample.bluetooth.direction_finding_connectionless_tx.aoa.sdc.nrf52_nrf53: sysbuild: true + extra_args: + - OVERLAY_CONFIG="overlay-aoa.conf" build_only: true - platform_allow: nrf52833dk/nrf52833 nrf52833dk/nrf52820 nrf5340dk/nrf5340/cpuapp + platform_allow: + - nrf52833dk/nrf52833 + - nrf52833dk/nrf52820 + - nrf5340dk/nrf5340/cpuapp tags: bluetooth sysbuild integration_platforms: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 - nrf5340dk/nrf5340/cpuapp - sample.bluetooth.direction_finding_connectionless_nrf.aoa: + sample.bluetooth.direction_finding_connectionless_tx.aoa.bt_ll_sw_split.nrf52: + sysbuild: false + build_only: true + extra_args: + - OVERLAY_CONFIG="overlay-aoa.conf;overlay-bt_ll_sw_split.conf" + - SNIPPET="bt-ll-sw-split" + platform_allow: + - nrf52833dk/nrf52833 + - nrf52833dk/nrf52820 + tags: bluetooth + integration_platforms: + - nrf52833dk/nrf52833 + - nrf52833dk/nrf52820 + sample.bluetooth.direction_finding_connectionless_tx.aoa.bt_ll_sw_split.nrf53: sysbuild: true - extra_args: OVERLAY_CONFIG="overlay-aoa.conf" build_only: true - platform_allow: nrf52833dk/nrf52833 nrf52833dk/nrf52820 nrf5340dk/nrf5340/cpuapp + extra_args: + - OVERLAY_CONFIG="overlay-aoa.conf" + - ipc_radio_OVERLAY_CONFIG="../../overlay-bt_ll_sw_split.conf" + - ipc_radio_SNIPPET="bt-ll-sw-split" + platform_allow: + - nrf5340dk/nrf5340/cpuapp tags: bluetooth sysbuild + integration_platforms: + - nrf5340dk/nrf5340/cpuapp + sample.bluetooth.direction_finding_connectionless_tx.aod.bt_ll_sw_split.nrf52: + sysbuild: false + build_only: true + extra_args: + - OVERLAY_CONFIG="overlay-bt_ll_sw_split.conf" + - SNIPPET="bt-ll-sw-split" + platform_allow: + - nrf52833dk/nrf52833 + - nrf52833dk/nrf52820 + tags: bluetooth integration_platforms: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 + sample.bluetooth.direction_finding_connectionless_tx.aod.bt_ll_sw_split.nrf53: + sysbuild: true + build_only: true + extra_args: + - ipc_radio_OVERLAY_CONFIG="../../overlay-bt_ll_sw_split.conf" + - ipc_radio_SNIPPET="bt-ll-sw-split" + platform_allow: + - nrf5340dk/nrf5340/cpuapp + tags: bluetooth sysbuild + integration_platforms: - nrf5340dk/nrf5340/cpuapp diff --git a/samples/bluetooth/direction_finding_connectionless_tx/sysbuild.cmake b/samples/bluetooth/direction_finding_connectionless_tx/sysbuild.cmake deleted file mode 100644 index a534bd0b9e3f..000000000000 --- a/samples/bluetooth/direction_finding_connectionless_tx/sysbuild.cmake +++ /dev/null @@ -1,24 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -if(NOT SB_CONFIG_SOC_NRF5340_CPUAPP) - if(NOT "bt-ll-sw-split" IN_LIST ${DEFAULT_IMAGE}_SNIPPET) - list(APPEND ${DEFAULT_IMAGE}_SNIPPET ${SNIPPET}) - list(APPEND ${DEFAULT_IMAGE}_SNIPPET bt-ll-sw-split) - set(${DEFAULT_IMAGE}_SNIPPET ${${DEFAULT_IMAGE}_SNIPPET} CACHE STRING "" FORCE) - endif() - if(SB_CONFIG_SECURE_BOOT_BUILD_S1_VARIANT_IMAGE AND NOT "bt-ll-sw-split" IN_LIST s1_image_SNIPPET) - list(APPEND s1_image_SNIPPET ${SNIPPET}) - list(APPEND s1_image_SNIPPET bt-ll-sw-split) - set(s1_image_SNIPPET ${s1_image_SNIPPET} CACHE STRING "" FORCE) - endif() -endif() - -if(NOT "bt-ll-sw-split" IN_LIST ipc_radio_SNIPPET) - list(APPEND ipc_radio_SNIPPET ${SNIPPET}) - list(APPEND ipc_radio_SNIPPET bt-ll-sw-split) - set(ipc_radio_SNIPPET ${ipc_radio_SNIPPET} CACHE STRING "" FORCE) -endif() diff --git a/samples/bluetooth/direction_finding_connectionless_tx/sysbuild/ipc_radio/prj.conf b/samples/bluetooth/direction_finding_connectionless_tx/sysbuild/ipc_radio/prj.conf index 0444e30bbb91..61a5ea8b180b 100644 --- a/samples/bluetooth/direction_finding_connectionless_tx/sysbuild/ipc_radio/prj.conf +++ b/samples/bluetooth/direction_finding_connectionless_tx/sysbuild/ipc_radio/prj.conf @@ -7,7 +7,9 @@ CONFIG_IPC_SERVICE=y CONFIG_BT=y CONFIG_BT_HCI_RAW=y -#CONFIG_BT_MAX_CONN=16 + +# Limit number of possible connection to decrease memory usage +CONFIG_BT_MAX_CONN=1 # Enable and adjust the below value as necessary # CONFIG_BT_BUF_EVT_RX_COUNT=16 @@ -18,12 +20,7 @@ CONFIG_BT_HCI_RAW=y # Reguired to enable BT_BUF_CMD_TX_SIZE for LE Set Extended Advertising Data command CONFIG_BT_EXT_ADV=y - -CONFIG_BT_CTLR=y -CONFIG_BT_LL_SW_SPLIT=y - -CONFIG_BT_CTLR_ADV_EXT=y -CONFIG_BT_CTLR_ADV_PERIODIC=y +CONFIG_BT_PER_ADV=y # Enable Direction Finding Feature including AoA and AoD CONFIG_BT_CTLR_DF=y @@ -33,13 +30,8 @@ CONFIG_BT_CTLR_DF_SCAN_CTE_RX=n CONFIG_BT_CTLR_DF_ANT_SWITCH_RX=n CONFIG_BT_CTLR_DF_CTE_RX=n -# Limit number of possible connection to decrease memory usage -CONFIG_BT_MAX_CONN=1 - -# Enable chaining of multiple CTEs in periodic advertising -CONFIG_BT_CTLR_ADVANCED_FEATURES=y -CONFIG_BT_CTLR_ADV_SYNC_PDU_BACK2BACK=y -CONFIG_BT_CTLR_DF_PER_ADV_CTE_NUM_MAX=16 +CONFIG_LOG=y CONFIG_IPC_RADIO_BT=y CONFIG_IPC_RADIO_BT_HCI_IPC=y +CONFIG_IPC_RADIO_LOG_LEVEL_ERR=y diff --git a/samples/bluetooth/enocean/Kconfig b/samples/bluetooth/enocean/Kconfig new file mode 100644 index 000000000000..587856d89b2b --- /dev/null +++ b/samples/bluetooth/enocean/Kconfig @@ -0,0 +1,16 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +source "Kconfig.zephyr" + +config SETTINGS + default y + +config ZMS + default y if SOC_FLASH_NRF_RRAM + +config NVS + default y if !SOC_FLASH_NRF_RRAM diff --git a/samples/bluetooth/enocean/prj.conf b/samples/bluetooth/enocean/prj.conf index 91a02a14ea5e..4cde6e557342 100644 --- a/samples/bluetooth/enocean/prj.conf +++ b/samples/bluetooth/enocean/prj.conf @@ -8,8 +8,6 @@ CONFIG_NCS_SAMPLES_DEFAULTS=y # General configuration CONFIG_FLASH=y CONFIG_FLASH_MAP=y -CONFIG_SETTINGS=y -CONFIG_NVS=y CONFIG_DK_LIBRARY=y # Bluetooth configuration diff --git a/samples/bluetooth/fast_pair/input_device/Kconfig b/samples/bluetooth/fast_pair/input_device/Kconfig new file mode 100644 index 000000000000..587856d89b2b --- /dev/null +++ b/samples/bluetooth/fast_pair/input_device/Kconfig @@ -0,0 +1,16 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +source "Kconfig.zephyr" + +config SETTINGS + default y + +config ZMS + default y if SOC_FLASH_NRF_RRAM + +config NVS + default y if !SOC_FLASH_NRF_RRAM diff --git a/samples/bluetooth/fast_pair/input_device/prj.conf b/samples/bluetooth/fast_pair/input_device/prj.conf index 85828aaa57db..e31f9d9c0f9e 100644 --- a/samples/bluetooth/fast_pair/input_device/prj.conf +++ b/samples/bluetooth/fast_pair/input_device/prj.conf @@ -14,9 +14,6 @@ CONFIG_DK_LIBRARY=y # Enable settings to store data in non-volatile memory CONFIG_FLASH=y CONFIG_FLASH_MAP=y -CONFIG_NVS=y -CONFIG_SETTINGS_NVS=y -CONFIG_SETTINGS=y CONFIG_BT_SETTINGS=y CONFIG_BT=y diff --git a/samples/bluetooth/fast_pair/input_device/sysbuild/ipc_radio/prj.conf b/samples/bluetooth/fast_pair/input_device/sysbuild/ipc_radio/prj.conf index 6c8fb4b2fb81..e806ef2d7a01 100644 --- a/samples/bluetooth/fast_pair/input_device/sysbuild/ipc_radio/prj.conf +++ b/samples/bluetooth/fast_pair/input_device/sysbuild/ipc_radio/prj.conf @@ -21,8 +21,6 @@ CONFIG_BT_MAX_CONN=16 CONFIG_BT_CTLR_TX_PWR_DYNAMIC_CONTROL=y CONFIG_ASSERT=y -CONFIG_DEBUG_INFO=y -CONFIG_EXCEPTION_STACK_TRACE=y CONFIG_IPC_RADIO_BT=y CONFIG_IPC_RADIO_BT_HCI_IPC=y diff --git a/samples/bluetooth/fast_pair/locator_tag/Kconfig b/samples/bluetooth/fast_pair/locator_tag/Kconfig index beeb05dce424..ad61ef9e8494 100644 --- a/samples/bluetooth/fast_pair/locator_tag/Kconfig +++ b/samples/bluetooth/fast_pair/locator_tag/Kconfig @@ -23,6 +23,15 @@ rsource "src/Kconfig.dfu" rsource "src/ui/Kconfig.ui" rsource "src/battery/Kconfig.battery" +config SETTINGS + default y + +config ZMS + default y if SOC_FLASH_NRF_RRAM + +config NVS + default y if !SOC_FLASH_NRF_RRAM + endmenu source "Kconfig.zephyr" diff --git a/samples/bluetooth/fast_pair/locator_tag/configuration/prj.conf b/samples/bluetooth/fast_pair/locator_tag/configuration/prj.conf index 79ef6f8ffe0a..a193d020378e 100644 --- a/samples/bluetooth/fast_pair/locator_tag/configuration/prj.conf +++ b/samples/bluetooth/fast_pair/locator_tag/configuration/prj.conf @@ -20,9 +20,6 @@ CONFIG_RESET_ON_FATAL_ERROR=n # Enable settings to store data in non-volatile memory CONFIG_FLASH=y CONFIG_FLASH_MAP=y -CONFIG_NVS=y -CONFIG_SETTINGS_NVS=y -CONFIG_SETTINGS=y CONFIG_BT_SETTINGS=y CONFIG_BT=y diff --git a/samples/bluetooth/fast_pair/locator_tag/configuration/prj_release.conf b/samples/bluetooth/fast_pair/locator_tag/configuration/prj_release.conf index b0486af2d8fa..c83bc30dc524 100644 --- a/samples/bluetooth/fast_pair/locator_tag/configuration/prj_release.conf +++ b/samples/bluetooth/fast_pair/locator_tag/configuration/prj_release.conf @@ -32,9 +32,6 @@ CONFIG_SETTINGS_DYNAMIC_HANDLERS=n # Enable settings to store data in non-volatile memory CONFIG_FLASH=y CONFIG_FLASH_MAP=y -CONFIG_NVS=y -CONFIG_SETTINGS_NVS=y -CONFIG_SETTINGS=y CONFIG_BT_SETTINGS=y CONFIG_BT=y diff --git a/samples/bluetooth/fast_pair/locator_tag/src/dfu.c b/samples/bluetooth/fast_pair/locator_tag/src/dfu.c index 17e567ad6ea1..b2456eaa52e8 100644 --- a/samples/bluetooth/fast_pair/locator_tag/src/dfu.c +++ b/samples/bluetooth/fast_pair/locator_tag/src/dfu.c @@ -14,6 +14,8 @@ #include #include +#include + #include "app_dfu.h" #include "app_factory_reset.h" #include "app_fp_adv.h" @@ -25,17 +27,7 @@ LOG_MODULE_DECLARE(fp_fmdn, LOG_LEVEL_INF); /* DFU mode timeout in minutes. */ #define DFU_MODE_TIMEOUT_MIN (5) -/* UUID of the SMP service used for the DFU. */ -#define BT_UUID_SMP_SVC_VAL \ - BT_UUID_128_ENCODE(0x8d53dc1d, 0x1db7, 0x4cd3, 0x868b, 0x8a527460aa84) - -/* UUID of the SMP characteristic used for the DFU. */ -#define BT_UUID_SMP_CHAR_VAL \ - BT_UUID_128_ENCODE(0xda2e7828, 0xfbce, 0x4e01, 0xae9e, 0x261174997c48) - -#define BT_UUID_SMP_CHAR BT_UUID_DECLARE_128(BT_UUID_SMP_CHAR_VAL) - -static const struct bt_data data = BT_DATA_BYTES(BT_DATA_UUID128_ALL, BT_UUID_SMP_SVC_VAL); +static const struct bt_data data = BT_DATA_BYTES(BT_DATA_UUID128_ALL, SMP_BT_SVC_UUID_VAL); static bool dfu_mode; APP_FP_ADV_TRIGGER_REGISTER(fp_adv_trigger_dfu, "dfu"); @@ -83,7 +75,7 @@ APP_FACTORY_RESET_CALLBACKS_REGISTER(factory_reset_cbs, dfu_factory_reset_prepar bool app_dfu_bt_gatt_operation_allow(const struct bt_uuid *uuid) { - if (bt_uuid_cmp(uuid, BT_UUID_SMP_CHAR) != 0) { + if (bt_uuid_cmp(uuid, SMP_BT_CHR_UUID) != 0) { return true; } diff --git a/samples/bluetooth/fast_pair/locator_tag/sysbuild/ipc_radio/prj.conf b/samples/bluetooth/fast_pair/locator_tag/sysbuild/ipc_radio/prj.conf index 74712bef9cf7..b3aa9fac614f 100644 --- a/samples/bluetooth/fast_pair/locator_tag/sysbuild/ipc_radio/prj.conf +++ b/samples/bluetooth/fast_pair/locator_tag/sysbuild/ipc_radio/prj.conf @@ -14,8 +14,6 @@ CONFIG_LOG=y CONFIG_LOG_MODE_MINIMAL=y CONFIG_ASSERT=y -CONFIG_DEBUG_INFO=y -CONFIG_EXCEPTION_STACK_TRACE=y CONFIG_MBOX=y CONFIG_IPC_SERVICE=y diff --git a/samples/bluetooth/iso_time_sync/README.rst b/samples/bluetooth/iso_time_sync/README.rst index f4f35afb4d4d..658c9f9260bf 100644 --- a/samples/bluetooth/iso_time_sync/README.rst +++ b/samples/bluetooth/iso_time_sync/README.rst @@ -40,15 +40,15 @@ The sample demonstrates the following features: .. group-tab:: nRF52 and nRF53 DKs This sample configures a single device as a transmitter of its **Button 1** state. - The transmitting and receiving devices toggle **LED 1** synchronously with the accuracy of a few microseconds. - When the :ref:`CONFIG_LED_TOGGLE_IMMEDIATELY_ON_SEND_OR_RECEIVE ` Kconfig option is enabled, **LED 2** is toggled upon sending or receiving data. + The transmitting and receiving devices toggle **LED 2** synchronously with the accuracy of a few microseconds. + When the :ref:`CONFIG_LED_TOGGLE_IMMEDIATELY_ON_SEND_OR_RECEIVE ` Kconfig option is enabled, **LED 1** is toggled upon sending or receiving data. This allows you to measure the minimal end-to-end latency. .. group-tab:: nRF54 DKs This sample configures a single device as a transmitter of its **Button 0** state. - The transmitting and receiving devices toggle **LED 0** synchronously with the accuracy of a few microseconds. - When the :ref:`CONFIG_LED_TOGGLE_IMMEDIATELY_ON_SEND_OR_RECEIVE ` Kconfig option is enabled, **LED 1** is toggled upon sending or receiving data. + The transmitting and receiving devices toggle **LED 1** synchronously with the accuracy of a few microseconds. + When the :ref:`CONFIG_LED_TOGGLE_IMMEDIATELY_ON_SEND_OR_RECEIVE ` Kconfig option is enabled, **LED 0** is toggled upon sending or receiving data. This allows you to measure the minimal end-to-end latency. .. note:: @@ -69,7 +69,7 @@ Check and configure the following Kconfig options: .. _CONFIG_LED_TOGGLE_IMMEDIATELY_ON_SEND_OR_RECEIVE: CONFIG_LED_TOGGLE_IMMEDIATELY_ON_SEND_OR_RECEIVE - This configuration option enables immediate toggling of **LED 2** (nRF52 and nRF53 DKs) or **LED 1** (nRF54 DKs) when isochronous data is sent or received. + This configuration option enables immediate toggling of **LED 1** (nRF52 and nRF53 DKs) or **LED 0** (nRF54 DKs) when isochronous data is sent or received. It allows for measurement of the minimum end-to-end latency. .. _CONFIG_SDU_INTERVAL_US: @@ -180,9 +180,9 @@ The sample code is divided into multiple source files, which makes it easier to When a valid SDU is received, the following operations are performed: - * If the :ref:`CONFIG_LED_TOGGLE_IMMEDIATELY_ON_SEND_OR_RECEIVE ` Kconfig option is enabled, **LED 2** is toggled immediately. + * If the :ref:`CONFIG_LED_TOGGLE_IMMEDIATELY_ON_SEND_OR_RECEIVE ` Kconfig option is enabled, **LED 1** is toggled immediately. You can use this to observe that different receivers may receive the SDU at different points in time. - * A timer trigger is configured to toggle **LED 1** :ref:`CONFIG_TIMED_LED_PRESENTATION_DELAY_US ` after the received timestamp. + * A timer trigger is configured to toggle **LED 2** :ref:`CONFIG_TIMED_LED_PRESENTATION_DELAY_US ` after the received timestamp. This ensures that all receivers and the transmitter toggle it at the same time. ``iso_tx.c`` @@ -195,9 +195,9 @@ The sample code is divided into multiple source files, which makes it easier to * The SDU is transmitted on all the established isochronous channels with the same timestamp. This ensures that all the receivers can toggle their corresponding LEDs at the same time. The very first SDU is provided without a timestamp, because the timestamp is not known at this point in time. - * **LED 1** is configured to toggle synchronously with the **LED 1** on all the receivers. + * **LED 2** is configured to toggle synchronously with the **LED 2** on all the receivers. The toggle time is determined by the TX timestamp and defined relative to the synchronization reference on the receiver. - * If the :ref:`CONFIG_LED_TOGGLE_IMMEDIATELY_ON_SEND_OR_RECEIVE ` Kconfig option is enabled, **LED 2** is toggled right before sending the SDU. + * If the :ref:`CONFIG_LED_TOGGLE_IMMEDIATELY_ON_SEND_OR_RECEIVE ` Kconfig option is enabled, **LED 1** is toggled right before sending the SDU. You can use this to observe the end-to-end latency. ``timed_led_toggle.c`` @@ -257,9 +257,9 @@ The sample code is divided into multiple source files, which makes it easier to When a valid SDU is received, the following operations are performed: - * If the :ref:`CONFIG_LED_TOGGLE_IMMEDIATELY_ON_SEND_OR_RECEIVE ` Kconfig option is enabled, **LED 1** is toggled immediately. + * If the :ref:`CONFIG_LED_TOGGLE_IMMEDIATELY_ON_SEND_OR_RECEIVE ` Kconfig option is enabled, **LED 0** is toggled immediately. You can use this to observe that different receivers may receive the SDU at different points in time. - * A timer trigger is configured to toggle **LED 0** :ref:`CONFIG_TIMED_LED_PRESENTATION_DELAY_US ` after the received timestamp. + * A timer trigger is configured to toggle **LED 1** :ref:`CONFIG_TIMED_LED_PRESENTATION_DELAY_US ` after the received timestamp. This ensures that all receivers and the transmitter toggle it at the same time. ``iso_tx.c`` @@ -272,9 +272,9 @@ The sample code is divided into multiple source files, which makes it easier to * The SDU is transmitted on all the established isochronous channels with the same timestamp. This ensures that all the receivers can toggle their corresponding LEDs at the same time. The very first SDU is provided without a timestamp, because the timestamp is not known at this point in time. - * **LED 0** is configured to toggle synchronously with the **LED 0** on all the receivers. + * **LED 1** is configured to toggle synchronously with the **LED 1** on all the receivers. The toggle time is determined by the TX timestamp and defined relative to the synchronization reference on the receiver. - * If the :ref:`CONFIG_LED_TOGGLE_IMMEDIATELY_ON_SEND_OR_RECEIVE ` Kconfig option is enabled, **LED 1** is toggled right before sending the SDU. + * If the :ref:`CONFIG_LED_TOGGLE_IMMEDIATELY_ON_SEND_OR_RECEIVE ` Kconfig option is enabled, **LED 0** is toggled right before sending the SDU. You can use this to observe the end-to-end latency. ``timed_led_toggle.c`` @@ -318,7 +318,7 @@ After programming the sample to the development kits, perform the following step #. Select which BIS the receiver should synchronize to. #. Observe that the device(s) synchronize to the broadcaster and start receiving isochronous data. #. Press **Button 1** on the broadcaster. - #. Observe that **LED 1** toggles on both the broadcaster and the receivers. + #. Observe that **LED 2** toggles on both the broadcaster and the receivers. .. group-tab:: nRF54 DKs @@ -331,7 +331,7 @@ After programming the sample to the development kits, perform the following step #. Select which BIS the receiver should synchronize to. #. Observe that the device(s) synchronize to the broadcaster and start receiving isochronous data. #. Press **Button 0** on the broadcaster. - #. Observe that **LED 0** toggles on both the broadcaster and the receivers. + #. Observe that **LED 1** toggles on both the broadcaster and the receivers. Testing connected isochronous streams ===================================== @@ -353,7 +353,7 @@ After programming the sample to the development kits, perform the following step #. Select data direction. #. Observe that the peripheral(s) connect to the central and start receiving isochronous data. #. Press **Button 1** on the central device. - #. Observe that **LED 1** toggles on both the central and peripheral devices. + #. Observe that **LED 2** toggles on both the central and peripheral devices. .. group-tab:: nRF54 DKs @@ -368,7 +368,7 @@ After programming the sample to the development kits, perform the following step #. Select data direction. #. Observe that the peripheral(s) connect to the central and start receiving isochronous data. #. Press **Button 0** on the central device. - #. Observe that **LED 0** toggles on both the central and peripheral devices. + #. Observe that **LED 1** toggles on both the central and peripheral devices. Observe time-synchronized ISO data processing @@ -378,12 +378,12 @@ Observe time-synchronized ISO data processing .. group-tab:: nRF52 and nRF53 DKs - When you press **Button 1** on the transmitting device, you can observe that **LED 1** toggles simultaneously on all devices. + When you press **Button 1** on the transmitting device, you can observe that **LED 2** toggles simultaneously on all devices. To observe the accurate toggling, use a logic analyzer or an oscilloscope. .. group-tab:: nRF54 DKs - When you press **Button 0** on the transmitting device, you can observe that **LED 0** toggles simultaneously on all devices. + When you press **Button 0** on the transmitting device, you can observe that **LED 1** toggles simultaneously on all devices. To observe the accurate toggling, use a logic analyzer or an oscilloscope. Sample output diff --git a/samples/bluetooth/iso_time_sync/src/bis_receiver.c b/samples/bluetooth/iso_time_sync/src/bis_receiver.c index e79d0ee6bf81..ef9364a7548b 100644 --- a/samples/bluetooth/iso_time_sync/src/bis_receiver.c +++ b/samples/bluetooth/iso_time_sync/src/bis_receiver.c @@ -167,7 +167,7 @@ void bis_receiver_start(uint8_t bis_index_to_sync_to) memset(&big_sync_param, 0, sizeof(big_sync_param)); big_sync_param.bis_channels = iso_rx_channels_get(); big_sync_param.num_bis = 1; - big_sync_param.bis_bitfield = BIT(bis_index_to_sync_to); + big_sync_param.bis_bitfield = BIT(bis_index_to_sync_to - 1); big_sync_param.mse = BT_ISO_SYNC_MSE_ANY; big_sync_param.sync_timeout = 100; /* in 10 ms units */ diff --git a/samples/bluetooth/iso_time_sync/src/iso_rx.c b/samples/bluetooth/iso_time_sync/src/iso_rx.c index 0153bfa2472d..3cbd61ca9963 100644 --- a/samples/bluetooth/iso_time_sync/src/iso_rx.c +++ b/samples/bluetooth/iso_time_sync/src/iso_rx.c @@ -26,7 +26,7 @@ static void iso_disconnected(struct bt_iso_chan *chan, uint8_t reason); static void (*iso_chan_disconnected_cb)(void); -static struct gpio_dt_spec led_sdu_received = GPIO_DT_SPEC_GET_OR(DT_ALIAS(led1), gpios, {0}); +static struct gpio_dt_spec led_sdu_received = GPIO_DT_SPEC_GET_OR(DT_ALIAS(led0), gpios, {0}); static struct bt_iso_chan_ops iso_ops = { .recv = iso_recv, diff --git a/samples/bluetooth/iso_time_sync/src/iso_tx.c b/samples/bluetooth/iso_time_sync/src/iso_tx.c index c585babd69fb..0705024ff2ce 100644 --- a/samples/bluetooth/iso_time_sync/src/iso_tx.c +++ b/samples/bluetooth/iso_time_sync/src/iso_tx.c @@ -30,7 +30,7 @@ #include "iso_time_sync.h" static const struct gpio_dt_spec button = GPIO_DT_SPEC_GET_OR(DT_ALIAS(sw0), gpios, {0}); -static struct gpio_dt_spec led_on_sdu_send = GPIO_DT_SPEC_GET_OR(DT_ALIAS(led1), gpios, {0}); +static struct gpio_dt_spec led_on_sdu_send = GPIO_DT_SPEC_GET_OR(DT_ALIAS(led0), gpios, {0}); static void iso_sent(struct bt_iso_chan *chan); static void iso_connected(struct bt_iso_chan *chan); diff --git a/samples/bluetooth/iso_time_sync/src/timed_led_toggle.c b/samples/bluetooth/iso_time_sync/src/timed_led_toggle.c index 06f91d5b5a12..b5f7afcad89f 100644 --- a/samples/bluetooth/iso_time_sync/src/timed_led_toggle.c +++ b/samples/bluetooth/iso_time_sync/src/timed_led_toggle.c @@ -54,8 +54,8 @@ int timed_led_toggle_init(void) const nrfx_gpiote_task_config_t task_cfg_led_toggle = { .task_ch = gpiote_chan_led_toggle, .polarity = NRF_GPIOTE_POLARITY_TOGGLE, - .init_val = (led.dt_flags & GPIO_ACTIVE_HIGH) ? - NRF_GPIOTE_INITIAL_VALUE_LOW : NRF_GPIOTE_INITIAL_VALUE_HIGH, + .init_val = (led.dt_flags & GPIO_ACTIVE_LOW) ? + NRF_GPIOTE_INITIAL_VALUE_HIGH : NRF_GPIOTE_INITIAL_VALUE_LOW, }; if (nrfx_gpiote_output_configure(&gpiote, LED_PIN, &gpiote_output_cfg, diff --git a/samples/bluetooth/llpm/prj.conf b/samples/bluetooth/llpm/prj.conf index 032751f5e27a..351c196f55e4 100644 --- a/samples/bluetooth/llpm/prj.conf +++ b/samples/bluetooth/llpm/prj.conf @@ -30,6 +30,3 @@ CONFIG_BT_LATENCY_CLIENT=y CONFIG_BT_HCI_VS_EVT_USER=y CONFIG_HEAP_MEM_POOL_SIZE=2048 CONFIG_BT_GAP_PERIPHERAL_PREF_PARAMS=n - -CONFIG_LOG=y -CONFIG_BT_LOG_LEVEL_DBG=y diff --git a/samples/bluetooth/mesh/ble_peripheral_lbs_coex/src/lb_service_handler.c b/samples/bluetooth/mesh/ble_peripheral_lbs_coex/src/lb_service_handler.c index b61ff34e42ea..c4949115baaf 100644 --- a/samples/bluetooth/mesh/ble_peripheral_lbs_coex/src/lb_service_handler.c +++ b/samples/bluetooth/mesh/ble_peripheral_lbs_coex/src/lb_service_handler.c @@ -41,7 +41,7 @@ static const struct bt_data sd[] = { }; static struct bt_le_ext_adv *adv; -static struct bt_le_adv_param *adv_params = (struct bt_le_adv_param *)BT_LE_ADV_CONN; +static uint8_t lbs_conn_id; static bool ble_button_state; static void connected(struct bt_conn *conn, uint8_t err) @@ -55,7 +55,7 @@ static void connected(struct bt_conn *conn, uint8_t err) return; } - if (cinfo.id != adv_params->id) { + if (cinfo.id != lbs_conn_id) { return; } @@ -78,7 +78,7 @@ static void disconnected(struct bt_conn *conn, uint8_t reason) return; } - if (cinfo.id != adv_params->id) { + if (cinfo.id != lbs_conn_id) { return; } @@ -119,7 +119,7 @@ static void lbs_adv_start(void) { int err; size_t id_count = 0xFF; - + struct bt_le_adv_param adv_params = *BT_LE_ADV_CONN; /* Use different identity from Bluetooth Mesh to avoid conflicts with Mesh Provisioning * Service and Mesh Proxy Service advertisements. */ @@ -131,18 +131,20 @@ static void lbs_adv_start(void) if (id < 0) { printk("Unable to create a new identity for LBS (err %d)." " Using the default one.\n", id); - adv_params->id = BT_ID_DEFAULT; + lbs_conn_id = BT_ID_DEFAULT; } else { - adv_params->id = id; + lbs_conn_id = id; } - printk("Created a new identity for LBS: %d\n", adv_params->id); + printk("Created a new identity for LBS: %d\n", lbs_conn_id); } else { - adv_params->id = BT_ID_DEFAULT + 1; - printk("Recovered identity for LBS: %d\n", adv_params->id); + lbs_conn_id = BT_ID_DEFAULT + 1; + printk("Recovered identity for LBS: %d\n", lbs_conn_id); } - err = bt_le_ext_adv_create(adv_params, NULL, &adv); + adv_params.id = lbs_conn_id; + + err = bt_le_ext_adv_create(&adv_params, NULL, &adv); if (err) { printk("Creating LBS service adv instance failed (err %d)\n", err); return; diff --git a/samples/bluetooth/multiple_adv_sets/sample.yaml b/samples/bluetooth/multiple_adv_sets/sample.yaml index 414f21e6001f..c1d8b8a5ad14 100644 --- a/samples/bluetooth/multiple_adv_sets/sample.yaml +++ b/samples/bluetooth/multiple_adv_sets/sample.yaml @@ -10,7 +10,8 @@ tests: - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp - nrf5340dk/nrf5340/cpuapp/ns + - nrf54l15dk/nrf54l15/cpuapp - nrf54h20dk/nrf54h20/cpuapp platform_allow: nrf52dk/nrf52832 nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp - nrf5340dk/nrf5340/cpuapp/ns nrf54h20dk/nrf54h20/cpuapp + nrf5340dk/nrf5340/cpuapp/ns nrf54l15dk/nrf54l15/cpuapp nrf54h20dk/nrf54h20/cpuapp tags: bluetooth ci_build sysbuild diff --git a/samples/bluetooth/peripheral_ams_client/Kconfig b/samples/bluetooth/peripheral_ams_client/Kconfig new file mode 100644 index 000000000000..587856d89b2b --- /dev/null +++ b/samples/bluetooth/peripheral_ams_client/Kconfig @@ -0,0 +1,16 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +source "Kconfig.zephyr" + +config SETTINGS + default y + +config ZMS + default y if SOC_FLASH_NRF_RRAM + +config NVS + default y if !SOC_FLASH_NRF_RRAM diff --git a/samples/bluetooth/peripheral_ams_client/prj.conf b/samples/bluetooth/peripheral_ams_client/prj.conf index 7fb314f3256f..48a507c12d3f 100644 --- a/samples/bluetooth/peripheral_ams_client/prj.conf +++ b/samples/bluetooth/peripheral_ams_client/prj.conf @@ -22,8 +22,6 @@ CONFIG_BT_SETTINGS=y CONFIG_FLASH=y CONFIG_FLASH_PAGE_LAYOUT=y CONFIG_FLASH_MAP=y -CONFIG_NVS=y -CONFIG_SETTINGS=y # Enable DK LED and Buttons library CONFIG_DK_LIBRARY=y diff --git a/samples/bluetooth/peripheral_ancs_client/Kconfig b/samples/bluetooth/peripheral_ancs_client/Kconfig new file mode 100644 index 000000000000..587856d89b2b --- /dev/null +++ b/samples/bluetooth/peripheral_ancs_client/Kconfig @@ -0,0 +1,16 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +source "Kconfig.zephyr" + +config SETTINGS + default y + +config ZMS + default y if SOC_FLASH_NRF_RRAM + +config NVS + default y if !SOC_FLASH_NRF_RRAM diff --git a/samples/bluetooth/peripheral_ancs_client/prj.conf b/samples/bluetooth/peripheral_ancs_client/prj.conf index b0fb0f0daeab..8b4dafba9e5d 100644 --- a/samples/bluetooth/peripheral_ancs_client/prj.conf +++ b/samples/bluetooth/peripheral_ancs_client/prj.conf @@ -25,8 +25,6 @@ CONFIG_BT_SETTINGS=y CONFIG_FLASH=y CONFIG_FLASH_PAGE_LAYOUT=y CONFIG_FLASH_MAP=y -CONFIG_NVS=y -CONFIG_SETTINGS=y # Enable DK LED and Buttons library CONFIG_DK_LIBRARY=y diff --git a/samples/bluetooth/peripheral_bms/Kconfig b/samples/bluetooth/peripheral_bms/Kconfig new file mode 100644 index 000000000000..587856d89b2b --- /dev/null +++ b/samples/bluetooth/peripheral_bms/Kconfig @@ -0,0 +1,16 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +source "Kconfig.zephyr" + +config SETTINGS + default y + +config ZMS + default y if SOC_FLASH_NRF_RRAM + +config NVS + default y if !SOC_FLASH_NRF_RRAM diff --git a/samples/bluetooth/peripheral_bms/prj.conf b/samples/bluetooth/peripheral_bms/prj.conf index 411923400a0d..3be4aafc12b5 100644 --- a/samples/bluetooth/peripheral_bms/prj.conf +++ b/samples/bluetooth/peripheral_bms/prj.conf @@ -22,5 +22,3 @@ CONFIG_BT_SETTINGS=y CONFIG_FLASH=y CONFIG_FLASH_PAGE_LAYOUT=y CONFIG_FLASH_MAP=y -CONFIG_NVS=y -CONFIG_SETTINGS=y diff --git a/samples/bluetooth/peripheral_bms/sample.yaml b/samples/bluetooth/peripheral_bms/sample.yaml index 248531a8498f..dcc9e698ec3f 100644 --- a/samples/bluetooth/peripheral_bms/sample.yaml +++ b/samples/bluetooth/peripheral_bms/sample.yaml @@ -9,7 +9,8 @@ tests: - nrf52dk/nrf52832 - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp + - nrf54l15dk/nrf54l15/cpuapp - nrf54h20dk/nrf54h20/cpuapp platform_allow: nrf52dk/nrf52832 nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp - nrf54h20dk/nrf54h20/cpuapp + nrf54l15dk/nrf54l15/cpuapp nrf54h20dk/nrf54h20/cpuapp tags: bluetooth ci_build sysbuild diff --git a/samples/bluetooth/peripheral_cgms/Kconfig b/samples/bluetooth/peripheral_cgms/Kconfig new file mode 100644 index 000000000000..587856d89b2b --- /dev/null +++ b/samples/bluetooth/peripheral_cgms/Kconfig @@ -0,0 +1,16 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +source "Kconfig.zephyr" + +config SETTINGS + default y + +config ZMS + default y if SOC_FLASH_NRF_RRAM + +config NVS + default y if !SOC_FLASH_NRF_RRAM diff --git a/samples/bluetooth/peripheral_cgms/prj.conf b/samples/bluetooth/peripheral_cgms/prj.conf index 5157954b59f2..9502757520ff 100644 --- a/samples/bluetooth/peripheral_cgms/prj.conf +++ b/samples/bluetooth/peripheral_cgms/prj.conf @@ -14,8 +14,6 @@ CONFIG_BT_DEVICE_NAME="Nordic Glucose Sensor" CONFIG_FLASH=y CONFIG_FLASH_PAGE_LAYOUT=y CONFIG_FLASH_MAP=y -CONFIG_NVS=y -CONFIG_SETTINGS=y CONFIG_BT_SETTINGS=y # CGMS Specific options diff --git a/samples/bluetooth/peripheral_cgms/sample.yaml b/samples/bluetooth/peripheral_cgms/sample.yaml index 7cf5ec41a117..65fb9de6273a 100644 --- a/samples/bluetooth/peripheral_cgms/sample.yaml +++ b/samples/bluetooth/peripheral_cgms/sample.yaml @@ -11,7 +11,9 @@ tests: - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp - nrf5340dk/nrf5340/cpuapp/ns + - nrf54l15dk/nrf54l15/cpuapp - nrf54h20dk/nrf54h20/cpuapp platform_allow: nrf52dk/nrf52832 nrf52833dk/nrf52833 nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp nrf5340dk/nrf5340/cpuapp/ns nrf54h20dk/nrf54h20/cpuapp + nrf5340dk/nrf5340/cpuapp nrf5340dk/nrf5340/cpuapp/ns nrf54l15dk/nrf54l15/cpuapp + nrf54h20dk/nrf54h20/cpuapp tags: bluetooth ci_build sysbuild diff --git a/samples/bluetooth/peripheral_cts_client/Kconfig b/samples/bluetooth/peripheral_cts_client/Kconfig new file mode 100644 index 000000000000..587856d89b2b --- /dev/null +++ b/samples/bluetooth/peripheral_cts_client/Kconfig @@ -0,0 +1,16 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +source "Kconfig.zephyr" + +config SETTINGS + default y + +config ZMS + default y if SOC_FLASH_NRF_RRAM + +config NVS + default y if !SOC_FLASH_NRF_RRAM diff --git a/samples/bluetooth/peripheral_cts_client/prj.conf b/samples/bluetooth/peripheral_cts_client/prj.conf index 19bacac2fb53..afa4c300641d 100644 --- a/samples/bluetooth/peripheral_cts_client/prj.conf +++ b/samples/bluetooth/peripheral_cts_client/prj.conf @@ -22,8 +22,6 @@ CONFIG_BT_SETTINGS=y CONFIG_FLASH=y CONFIG_FLASH_PAGE_LAYOUT=y CONFIG_FLASH_MAP=y -CONFIG_NVS=y -CONFIG_SETTINGS=y # Enable DK LED and Buttons library CONFIG_DK_LIBRARY=y diff --git a/samples/bluetooth/peripheral_cts_client/sample.yaml b/samples/bluetooth/peripheral_cts_client/sample.yaml index 1dc40c99a8d3..fec26b6c0a88 100644 --- a/samples/bluetooth/peripheral_cts_client/sample.yaml +++ b/samples/bluetooth/peripheral_cts_client/sample.yaml @@ -10,7 +10,8 @@ tests: - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp - nrf5340dk/nrf5340/cpuapp/ns + - nrf54l15dk/nrf54l15/cpuapp - nrf54h20dk/nrf54h20/cpuapp platform_allow: nrf52dk/nrf52832 nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp - nrf5340dk/nrf5340/cpuapp/ns nrf54h20dk/nrf54h20/cpuapp + nrf5340dk/nrf5340/cpuapp/ns nrf54l15dk/nrf54l15/cpuapp nrf54h20dk/nrf54h20/cpuapp tags: bluetooth ci_build sysbuild diff --git a/samples/bluetooth/peripheral_gatt_dm/sample.yaml b/samples/bluetooth/peripheral_gatt_dm/sample.yaml index e8803ea55342..499d46c3b1b5 100644 --- a/samples/bluetooth/peripheral_gatt_dm/sample.yaml +++ b/samples/bluetooth/peripheral_gatt_dm/sample.yaml @@ -10,7 +10,8 @@ tests: - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp - nrf5340dk/nrf5340/cpuapp/ns + - nrf54l15dk/nrf54l15/cpuapp - nrf54h20dk/nrf54h20/cpuapp platform_allow: nrf52dk/nrf52832 nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp - nrf5340dk/nrf5340/cpuapp/ns nrf54h20dk/nrf54h20/cpuapp + nrf5340dk/nrf5340/cpuapp/ns nrf54l15dk/nrf54l15/cpuapp nrf54h20dk/nrf54h20/cpuapp tags: bluetooth ci_build sysbuild diff --git a/samples/bluetooth/peripheral_gatt_dm/src/main.c b/samples/bluetooth/peripheral_gatt_dm/src/main.c index 73e9196c9291..c3f4a62f1e2e 100644 --- a/samples/bluetooth/peripheral_gatt_dm/src/main.c +++ b/samples/bluetooth/peripheral_gatt_dm/src/main.c @@ -139,7 +139,12 @@ static void pairing_confirm(struct bt_conn *conn) pairing_confirmation_conn = bt_conn_ref(conn); printk("Pairing confirmation required for %s\n", addr); - printk("Press Button 1 to confirm, Button 2 to reject.\n"); + + if (IS_ENABLED(CONFIG_SOC_SERIES_NRF54HX) || IS_ENABLED(CONFIG_SOC_SERIES_NRF54LX)) { + printk("Press Button 0 to confirm, Button 1 to reject.\n"); + } else { + printk("Press Button 1 to confirm, Button 2 to reject.\n"); + } } static void pairing_complete(struct bt_conn *conn, bool bonded) diff --git a/samples/bluetooth/peripheral_hids_keyboard/Kconfig b/samples/bluetooth/peripheral_hids_keyboard/Kconfig index 9cd47775b48d..2d5d2f19b084 100644 --- a/samples/bluetooth/peripheral_hids_keyboard/Kconfig +++ b/samples/bluetooth/peripheral_hids_keyboard/Kconfig @@ -18,4 +18,13 @@ config NFC_OOB_PAIRING select NFC_NDEF_RECORD select NFC_NDEF_LE_OOB_REC +config SETTINGS + default y + +config ZMS + default y if SOC_FLASH_NRF_RRAM + +config NVS + default y if !SOC_FLASH_NRF_RRAM + endmenu diff --git a/samples/bluetooth/peripheral_hids_keyboard/prj.conf b/samples/bluetooth/peripheral_hids_keyboard/prj.conf index 793480463329..57b7f262e227 100644 --- a/samples/bluetooth/peripheral_hids_keyboard/prj.conf +++ b/samples/bluetooth/peripheral_hids_keyboard/prj.conf @@ -37,7 +37,5 @@ CONFIG_BT_SETTINGS=y CONFIG_FLASH=y CONFIG_FLASH_PAGE_LAYOUT=y CONFIG_FLASH_MAP=y -CONFIG_NVS=y -CONFIG_SETTINGS=y CONFIG_DK_LIBRARY=y diff --git a/samples/bluetooth/peripheral_hids_keyboard/src/main.c b/samples/bluetooth/peripheral_hids_keyboard/src/main.c index 85c8f83f940b..cdc19bb1b97f 100644 --- a/samples/bluetooth/peripheral_hids_keyboard/src/main.c +++ b/samples/bluetooth/peripheral_hids_keyboard/src/main.c @@ -236,7 +236,12 @@ static void pairing_process(struct k_work *work) addr, sizeof(addr)); printk("Passkey for %s: %06u\n", addr, pairing_data.passkey); - printk("Press Button 1 to confirm, Button 2 to reject.\n"); + + if (IS_ENABLED(CONFIG_SOC_SERIES_NRF54HX) || IS_ENABLED(CONFIG_SOC_SERIES_NRF54LX)) { + printk("Press Button 0 to confirm, Button 1 to reject.\n"); + } else { + printk("Press Button 1 to confirm, Button 2 to reject.\n"); + } } diff --git a/samples/bluetooth/peripheral_hids_mouse/Kconfig b/samples/bluetooth/peripheral_hids_mouse/Kconfig index 473690e516d9..f94d2470e5e3 100644 --- a/samples/bluetooth/peripheral_hids_mouse/Kconfig +++ b/samples/bluetooth/peripheral_hids_mouse/Kconfig @@ -16,7 +16,8 @@ config BT_HIDS_SECURITY_ENABLED select FLASH select FLASH_PAGE_LAYOUT select FLASH_MAP - select NVS + select ZMS if SOC_FLASH_NRF_RRAM + select NVS if !SOC_FLASH_NRF_RRAM select SETTINGS help "Enable BLE security for the HIDS service" diff --git a/samples/bluetooth/peripheral_hids_mouse/src/main.c b/samples/bluetooth/peripheral_hids_mouse/src/main.c index 2a5c4620d2b1..4300e9094af4 100644 --- a/samples/bluetooth/peripheral_hids_mouse/src/main.c +++ b/samples/bluetooth/peripheral_hids_mouse/src/main.c @@ -242,7 +242,12 @@ static void pairing_process(struct k_work *work) addr, sizeof(addr)); printk("Passkey for %s: %06u\n", addr, pairing_data.passkey); - printk("Press Button 1 to confirm, Button 2 to reject.\n"); + + if (IS_ENABLED(CONFIG_SOC_SERIES_NRF54HX) || IS_ENABLED(CONFIG_SOC_SERIES_NRF54LX)) { + printk("Press Button 0 to confirm, Button 1 to reject.\n"); + } else { + printk("Press Button 1 to confirm, Button 2 to reject.\n"); + } } diff --git a/samples/bluetooth/peripheral_hr_coded/sample.yaml b/samples/bluetooth/peripheral_hr_coded/sample.yaml index 46f1d5daf375..8ab357d9442e 100644 --- a/samples/bluetooth/peripheral_hr_coded/sample.yaml +++ b/samples/bluetooth/peripheral_hr_coded/sample.yaml @@ -9,6 +9,8 @@ tests: integration_platforms: - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp + - nrf54l15dk/nrf54l15/cpuapp - nrf54h20dk/nrf54h20/cpuapp - platform_allow: nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp nrf54h20dk/nrf54h20/cpuapp + platform_allow: nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp nrf54l15dk/nrf54l15/cpuapp + nrf54h20dk/nrf54h20/cpuapp tags: bluetooth ci_build sysbuild diff --git a/samples/bluetooth/peripheral_lbs/Kconfig b/samples/bluetooth/peripheral_lbs/Kconfig index 96645f78f7b5..8ba880adf79a 100644 --- a/samples/bluetooth/peripheral_lbs/Kconfig +++ b/samples/bluetooth/peripheral_lbs/Kconfig @@ -16,7 +16,8 @@ config BT_LBS_SECURITY_ENABLED select FLASH select FLASH_PAGE_LAYOUT select FLASH_MAP - select NVS + select ZMS if SOC_FLASH_NRF_RRAM + select NVS if !SOC_FLASH_NRF_RRAM select SETTINGS help "Enable BLE security for the LED-Button service" diff --git a/samples/bluetooth/peripheral_lbs/prj_minimal.conf b/samples/bluetooth/peripheral_lbs/prj_minimal.conf index 9f7ab77f7b5c..f511cc16af9a 100644 --- a/samples/bluetooth/peripheral_lbs/prj_minimal.conf +++ b/samples/bluetooth/peripheral_lbs/prj_minimal.conf @@ -30,6 +30,7 @@ CONFIG_THREAD_CUSTOM_DATA=n CONFIG_FPU=n # Boot +CONFIG_NCS_BOOT_BANNER=n CONFIG_BOOT_BANNER=n CONFIG_BOOT_DELAY=0 diff --git a/samples/bluetooth/peripheral_lbs/sample.yaml b/samples/bluetooth/peripheral_lbs/sample.yaml index ec5b52c26cc4..ed7624479dd6 100644 --- a/samples/bluetooth/peripheral_lbs/sample.yaml +++ b/samples/bluetooth/peripheral_lbs/sample.yaml @@ -23,12 +23,13 @@ tests: sample.bluetooth.peripheral_lbs_minimal: sysbuild: true build_only: true - extra_args: OVERLAY_CONFIG=prj_minimal.conf + extra_args: FILE_SUFFIX=minimal integration_platforms: + - nrf52dk/nrf52805 - nrf52dk/nrf52810 - nrf52840dk/nrf52811 - nrf52833dk/nrf52820 - platform_allow: nrf52dk/nrf52810 nrf52840dk/nrf52811 nrf52833dk/nrf52820 + platform_allow: nrf52dk/nrf52805 nrf52dk/nrf52810 nrf52840dk/nrf52811 nrf52833dk/nrf52820 tags: bluetooth ci_build sysbuild sample.bluetooth.peripheral_lbs_no_security: sysbuild: true diff --git a/samples/bluetooth/peripheral_mds/Kconfig b/samples/bluetooth/peripheral_mds/Kconfig new file mode 100644 index 000000000000..587856d89b2b --- /dev/null +++ b/samples/bluetooth/peripheral_mds/Kconfig @@ -0,0 +1,16 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +source "Kconfig.zephyr" + +config SETTINGS + default y + +config ZMS + default y if SOC_FLASH_NRF_RRAM + +config NVS + default y if !SOC_FLASH_NRF_RRAM diff --git a/samples/bluetooth/peripheral_mds/README.rst b/samples/bluetooth/peripheral_mds/README.rst index f0739d5c40c3..08f51e13d256 100644 --- a/samples/bluetooth/peripheral_mds/README.rst +++ b/samples/bluetooth/peripheral_mds/README.rst @@ -33,54 +33,114 @@ The sample also includes the BAS functionalities. Metrics ======= -The sample shows how to capture user-specific metrics. -It defines the following metrics: + The sample shows how to capture user-specific metrics. + It defines the following metrics: -* ``button_3_press_count`` - The number of **Button 3** presses. -* ``battery_soc_pct`` - The simulated battery level. -* ``button_1_elapsed_time_ms`` - The time measured between two **Button 1** presses. +.. tabs:: -These metrics are defined in the :file:`samples/bluetooth/peripheral_mds/memfault_config/memfault_metrics_heartbeat_config.def` file. -For more details about the metrics, see `Memfault: Collecting Device Metrics`_. + .. group-tab:: nRF52 and nRF53 DKs -There are also metrics that are specific to |NCS|. -:ref:`mod_memfault` adds these system proprietary metrics. -The following metrics are enabled by default in this sample: + * ``button_press_count`` - The number of **Button 3** presses. + * ``battery_soc_pct`` - The simulated battery level. + * ``button_elapsed_time_ms`` - The time measured between two **Button 1** presses. -* Bluetooth metrics, enabled and disabled using the :kconfig:option:`CONFIG_MEMFAULT_NCS_BT_METRICS` Kconfig option. + These metrics are defined in the :file:`samples/bluetooth/peripheral_mds/memfault_config/memfault_metrics_heartbeat_config.def` file. + For more details about the metrics, see `Memfault: Collecting Device Metrics`_. - * ``ncs_bt_connection_count`` - Number of Bluetooth connections. - * ``ncs_bt_connection_time_ms`` - Bluetooth connection time. + There are also metrics that are specific to |NCS|. + :ref:`mod_memfault` adds these system proprietary metrics. + The following metrics are enabled by default in this sample: - Time with at least one live Bluetooth connection. - * ``ncs_bt_bond_count`` - Number of Bluetooth bonds. + * Bluetooth metrics, enabled and disabled using the :kconfig:option:`CONFIG_MEMFAULT_NCS_BT_METRICS` Kconfig option. -* Stack usage metrics shows the free stack space in bytes. - Configurable by the :kconfig:option:`CONFIG_MEMFAULT_NCS_STACK_METRICS` Kconfig option. + * ``ncs_bt_connection_count`` - Number of Bluetooth connections. + * ``ncs_bt_connection_time_ms`` - Bluetooth connection time. - * ``ncs_bt_rx_unused_stack`` - HCI RX thread stack. - * ``ncs_bt_tx_unused_stack`` - HCI TX thread stack. + Time with at least one live Bluetooth connection. + * ``ncs_bt_bond_count`` - Number of Bluetooth bonds. + * Stack usage metrics shows the free stack space in bytes. + Configurable by the :kconfig:option:`CONFIG_MEMFAULT_NCS_STACK_METRICS` Kconfig option. + + * ``ncs_bt_rx_unused_stack`` - HCI RX thread stack. + * ``ncs_bt_tx_unused_stack`` - HCI TX thread stack. + + .. group-tab:: nRF54 DKs + + The sample shows how to capture user-specific metrics. + It defines the following metrics: + + * ``button_press_count`` - The number of **Button 2** presses. + * ``battery_soc_pct`` - The simulated battery level. + * ``button_elapsed_time_ms`` - The time measured between two **Button 0** presses. + + These metrics are defined in the :file:`samples/bluetooth/peripheral_mds/memfault_config/memfault_metrics_heartbeat_config.def` file. + For more details about the metrics, see `Memfault: Collecting Device Metrics`_. + + There are also metrics that are specific to |NCS|. + :ref:`mod_memfault` adds these system proprietary metrics. + The following metrics are enabled by default in this sample: + + * Bluetooth metrics, enabled and disabled using the :kconfig:option:`CONFIG_MEMFAULT_NCS_BT_METRICS` Kconfig option. + + * ``ncs_bt_connection_count`` - Number of Bluetooth connections. + * ``ncs_bt_connection_time_ms`` - Bluetooth connection time. + + Time with at least one live Bluetooth connection. + * ``ncs_bt_bond_count`` - Number of Bluetooth bonds. + + * Stack usage metrics shows the free stack space in bytes. + Configurable by the :kconfig:option:`CONFIG_MEMFAULT_NCS_STACK_METRICS` Kconfig option. + + * ``ncs_bt_rx_unused_stack`` - HCI RX thread stack. + * ``ncs_bt_tx_unused_stack`` - HCI TX thread stack. Error tracking with trace events ================================ -The sample implements the following user-defined trace reason for demonstration purposes: + The sample implements the following user-defined trace reason for demonstration purposes: + +.. tabs:: + + .. group-tab:: nRF52 and nRF53 DKs + + ``button_state_changed`` - Collected every time when **Button 2** changes its state. -``button_2_state_changed`` - Collected every time when **Button 2** changes its state. + The trace events are defined in the :file:`samples/bluetooth/peripheral_mds/memfault_config/memfault_trace_reason_user_config.def` file. + See `Memfault: Error Tracking with Trace Events`_ for more details about trace events. -The trace events are defined in the file :file:`samples/bluetooth/peripheral_mds/memfault_config/memfault_trace_reason_user_config.def` file. -See `Memfault: Error Tracking with Trace Events`_ for more details about trace events. + .. group-tab:: nRF54 DKs + + The sample implements the following user-defined trace reason for demonstration purposes: + + ``button_state_changed`` - Collected every time when **Button 1** changes its state. + + The trace events are defined in the :file:`samples/bluetooth/peripheral_mds/memfault_config/memfault_trace_reason_user_config.def` file. + See `Memfault: Error Tracking with Trace Events`_ for more details about trace events. Core dumps ========== -You can trigger core dumps in this sample using the following methods: + You can trigger core dumps in this sample using the following methods: + +.. tabs:: - * **Button 4** - Triggers a hardfault exception by division by zero. - * ``mfl crash`` shell command - Triggers an assertion fail. + .. group-tab:: nRF52 and nRF53 DKs -When a fault occurs, it results in crashes that are captured by Memfault. -After your development kit reboots and reconnects with the Bluetooth gateway, it sends core dump data to the Memfault cloud for further inspection and analysis. + * **Button 4** - Triggers a hardfault exception by division by zero. + * ``mfl crash`` shell command - Triggers an assertion fail. + + When a fault occurs, it results in crashes that are captured by Memfault. + After your development kit reboots and reconnects with the Bluetooth gateway, it sends core dump data to the Memfault cloud for further inspection and analysis. + + .. group-tab:: nRF54 DKs + + You can trigger core dumps in this sample using the following methods: + + * **Button 3** - Triggers a hardfault exception by division by zero. + * ``mfl crash`` shell command - Triggers an assertion fail. + + When a fault occurs, it results in crashes that are captured by Memfault. + After your development kit reboots and reconnects with the Bluetooth gateway, it sends core dump data to the Memfault cloud for further inspection and analysis. Memfault shell ============== @@ -98,29 +158,57 @@ User interface The sample supports a simple user interface. You can control the sample using predefined buttons, while LEDs are used to display information. -LED 1: - Blinks, toggling on/off every second, when the main loop is running and the device is advertising. +.. tabs:: + + .. group-tab:: nRF52 and nRF53 DKs + + LED 1: + Blinks, toggling on/off every second, when the main loop is running and the device is advertising. + + LED 2: + Lit when the development kit is connected. + + Button 1: + Press this button to start time measuring. + The second press stops time measuring. -LED 2: - Lit when the development kit is connected. + During the pairing procedure, press this button to accept pairing. -Button 1: - Press this button to start time measuring. - The second press stops time measuring. + Button 2: + Triggers the ``button_state_changed`` trace event. - During the pairing procedure, press this button to accept pairing. + During the pairing procedure, press this button to reject pairing. -Button 2: - Triggers the ``button_2_state_changed`` trace event. + Button 3: + Every press of this button is counted under the ``button_press_count`` metric. - During the pairing procedure, press this button to reject pairing. + Button 4: + Simulate a development kit crash by triggering a hardfault exception by division by zero. -Button 3: - Every press of this button is counted under the ``button_3_press_count`` metric. + .. group-tab:: nRF54 DKs -Button 4: - Simulate a development kit crash by triggering a hardfault exception by division by zero. + LED 0: + Blinks, toggling on/off every second, when the main loop is running and the device is advertising. + LED 1: + Lit when the development kit is connected. + + Button 0: + Press this button to start time measuring. + The second press stops time measuring. + + During the pairing procedure, press this button to accept pairing. + + Button 1: + Triggers the ``button_state_changed`` trace event. + + During the pairing procedure, press this button to reject pairing. + + Button 2: + Every press of this button is counted under the ``button_press_count`` metric. + + Button 3: + Simulate a development kit crash by triggering a hardfault exception by division by zero. Configuration ************* @@ -133,7 +221,8 @@ See `Memfault SDK`_ for more information. To send data to the Memfault cloud through a Bluetooth gateway, you must configure a project key using the :kconfig:option:`CONFIG_MEMFAULT_NCS_PROJECT_KEY` Kconfig option. You can find your project key in the project settings at `Memfault Dashboards`_. -You also need to set the :kconfig:option:`CONFIG_MEMFAULT_NCS_DEVICE_ID` static Kconfig option for this sample +Use the :kconfig:option:`CONFIG_MEMFAULT_NCS_DEVICE_ID` Kconfig option to set a static device ID. +For this sample, the device ID is ``ncs-ble-testdevice`` by default. Building and running ******************** @@ -181,97 +270,198 @@ You can also use them for your custom applications using the Memfault Diagnostic Testing with MDS BLE gateway script ----------------------------------- -1. |connect_terminal_ANSI| -#. Reset your development kit. -#. Observe that the sample starts. -#. Run the following command in the |NCS| root directory to install the MDS BLE gateway script dependencies: +.. tabs:: - .. code-block:: console + .. group-tab:: nRF52 and nRF53 DKs - pip install --user -r scripts/memfault/requirements.txt + 1. |connect_terminal_ANSI| + #. Reset your development kit. + #. Observe that the sample starts. + #. Run the following command in the |NCS| root directory to install the MDS BLE gateway script dependencies: -#. Connect the nRF52 development kit to your PC that uses the :ref:`mds_ble_gateway_script`. -#. Start the :file:`mds_ble_gateway.py` script with the correct parameters, for example: + .. code-block:: console - .. code-block:: console + pip install --user -r scripts/memfault/requirements.txt - python3 mds_ble_gateway.py --snr 682900407 --com COM0 + #. Connect the nRF52 development kit to your PC that uses the :ref:`mds_ble_gateway_script`. + #. Start the :file:`mds_ble_gateway.py` script with the correct parameters, for example: -#. Wait for the script to establish a connection with your development kit. -#. Use the buttons on the development kit to confirm or reject a pairing request. + .. code-block:: console - .. code-block:: console + python3 mds_ble_gateway.py --snr 682900407 --com COM0 - Pairing confirmation required for 6D:99:66:6E:19:72 (random) - Press Button 1 to confirm, Button 2 to reject. + #. Wait for the script to establish a connection with your development kit. + #. Use the buttons on the development kit to confirm or reject a pairing request. -#. Upon connection, data already collected by the `Memfault SDK`_ is forwarded to the cloud for further analysis. - When connected, the new data is periodically transferred to the cloud with the interval configured in the :kconfig:option:`CONFIG_BT_MDS_DATA_POLL_INTERVAL` Kconfig option. -#. On the terminal running the script, you can observe the Memfault chunk counter: + .. code-block:: console - .. code-block:: console + Pairing confirmation required for 6D:99:66:6E:19:72 (random) + Press Button 1 to confirm, Button 2 to reject. - Sending.. - Forwarded 2 Memfault Chunks + #. Upon connection, data already collected by the `Memfault SDK`_ is forwarded to the cloud for further analysis. + When connected, the new data is periodically transferred to the cloud with the interval configured in the :kconfig:option:`CONFIG_BT_MDS_DATA_POLL_INTERVAL` Kconfig option. + #. On the terminal running the script, you can observe the Memfault chunk counter: -#. Upload the symbol file generated from your build to your Memfault account so that the information from your application can be parsed. - The symbol file is located in the build folder: :file:`peripheral_memfault/build/zephyr/zephyr.elf`: + .. code-block:: console - a. Open `Memfault`_ in a web browser. - #. Log in to your account and select the project you created earlier. - #. Navigate to :guilabel:`Fleet` > :guilabel:`Devices` in the left side menu. - You can see your newly connected device and the software version in the list. - #. Select the software version number for your device and click :guilabel:`Upload` to upload the symbol file. + Sending.. + Forwarded 2 Memfault Chunks -#. Return to the terminal and press the Tab button on your keyboard to confirm that the Memfault shell is working. - The shell commands available are displayed. + #. Upload the symbol file generated from your build to your Memfault account so that the information from your application can be parsed. + The symbol file is located in the build folder: :file:`peripheral_memfault/build/zephyr/zephyr.elf`: - To learn about the Memfault shell commands, issue command ``mflt help`` -#. Use the buttons to trigger Memfault crashes, traces and metrics collection. + a. Open `Memfault`_ in a web browser. + #. Log in to your account and select the project you created earlier. + #. Navigate to :guilabel:`Fleet` > :guilabel:`Devices` in the left side menu. + You can see your newly connected device and the software version in the list. + #. Select the software version number for your device and click :guilabel:`Upload` to upload the symbol file. - See :ref:`peripheral_mds_user_interface` for details about button functions. -#. Explore the Memfault user interface to see the errors and metrics sent from your device. + #. Return to the terminal and press the Tab button on your keyboard to confirm that the Memfault shell is working. + The shell commands available are displayed. -Testing with Memfault WebBluetooth Client ------------------------------------------ + To learn about the Memfault shell commands, issue command ``mflt help`` + #. Use the buttons to trigger Memfault crashes, traces and metrics collection. -.. note:: - The Web Bluetooth API used by the `Memfault WebBluetooth Client`_ is an experimental feature. - The functionality depends on your browser and computer OS compatibility. + See :ref:`peripheral_mds_user_interface` for details about button functions. + #. Explore the Memfault user interface to see the errors and metrics sent from your device. -1. |connect_terminal_ANSI| -#. Reset your development kit. -#. Observe that the sample starts. -#. Open a recent version of the `Google Chrome browser`_. -#. Run the `Memfault WebBluetooth Client`_ script to forward Memfault diagnostic data to the cloud. - For more details, see the `Memfault WebBluetooth Client source code`_. -#. Make sure that your development kit is advertising. -#. In the browser, click the :guilabel:`Connect` button and select your device from the list. -#. Use the buttons on your development kit to confirm or reject a pairing request: - - .. code-block:: console - - Pairing confirmation required for 6D:99:66:6E:19:72 (random) - Press Button 1 to confirm, Button 2 to reject. - -#. Upon connection, data already collected by the `Memfault SDK`_ is forwarded to the cloud for further the analysis. - When connected, the new data is periodically flushed to the cloud with the interval configured by the Kconfig option :kconfig:option:`CONFIG_BT_MDS_DATA_POLL_INTERVAL`. -#. Upload the symbol file generated from your build to your Memfault account so that the information from your application can be parsed. - The :file:`zephyr.elf` symbol file is located in the build folder :file:`peripheral_memfault/build/zephyr`. - - a. In a web browser, navigate to `Memfault`_. - #. Log in to your account and select the project you created earlier. - #. Navigate to :guilabel:`Fleet` > :guilabel:`Devices` in the left side menu. - You can see your newly connected device and the software version in the list. - #. Select the software version number for your device and click :guilabel:`Upload` to upload the symbol file. - -#. Return to the terminal and press the Tab button on your keyboard to confirm that the Memfault shell is working. - The shell commands available are displayed. + .. group-tab:: nRF54 DKs - To learn about the Memfault shell commands, issue command ``mflt help``. -#. Use the buttons to trigger Memfault crashes, traces and metrics collection. - See :ref:`peripheral_mds_user_interface` for details about button functions. -#. Explore the Memfault user interface to see the errors and metrics sent from your device. + 1. |connect_terminal_ANSI| + #. Reset your development kit. + #. Observe that the sample starts. + #. Run the following command in the |NCS| root directory to install the MDS BLE gateway script dependencies: + + .. code-block:: console + + pip install --user -r scripts/memfault/requirements.txt + + #. Connect the nRF52 development kit to your PC that uses the :ref:`mds_ble_gateway_script`. + #. Start the :file:`mds_ble_gateway.py` script with the correct parameters, for example: + + .. code-block:: console + + python3 mds_ble_gateway.py --snr 682900407 --com COM0 + + #. Wait for the script to establish a connection with your development kit. + #. Use the buttons on the development kit to confirm or reject a pairing request. + + .. code-block:: console + + Pairing confirmation required for 6D:99:66:6E:19:72 (random) + Press Button 0 to confirm, Button 1 to reject. + + #. Upon connection, data already collected by the `Memfault SDK`_ is forwarded to the cloud for further analysis. + When connected, the new data is periodically transferred to the cloud with the interval configured in the :kconfig:option:`CONFIG_BT_MDS_DATA_POLL_INTERVAL` Kconfig option. + #. On the terminal running the script, you can observe the Memfault chunk counter: + + .. code-block:: console + + Sending.. + Forwarded 2 Memfault Chunks + + #. Upload the symbol file generated from your build to your Memfault account so that the information from your application can be parsed. + The symbol file is located in the build folder: :file:`peripheral_memfault/build/zephyr/zephyr.elf`: + + a. Open `Memfault`_ in a web browser. + #. Log in to your account and select the project you created earlier. + #. Navigate to :guilabel:`Fleet` > :guilabel:`Devices` in the left side menu. + You can see your newly connected device and the software version in the list. + #. Select the software version number for your device and click :guilabel:`Upload` to upload the symbol file. + + #. Return to the terminal and press the Tab button on your keyboard to confirm that the Memfault shell is working. + The shell commands available are displayed. + + To learn about the Memfault shell commands, issue command ``mflt help`` + #. Use the buttons to trigger Memfault crashes, traces and metrics collection. + + See :ref:`peripheral_mds_user_interface` for details about button functions. + #. Explore the Memfault user interface to see the errors and metrics sent from your device. + +Testing with Memfault WebBluetooth Client +----------------------------------------- + +.. tabs:: + + .. group-tab:: nRF52 and nRF53 DKs + + .. note:: + The Web Bluetooth API used by the `Memfault WebBluetooth Client`_ is an experimental feature. + The functionality depends on your browser and computer OS compatibility. + + 1. |connect_terminal_ANSI| + #. Reset your development kit. + #. Observe that the sample starts. + #. Open a recent version of the `Google Chrome browser`_. + #. Run the `Memfault WebBluetooth Client`_ script to forward Memfault diagnostic data to the cloud. + For more details, see the `Memfault WebBluetooth Client source code`_. + #. Make sure that your development kit is advertising. + #. In the browser, click the :guilabel:`Connect` button and select your device from the list. + #. Use the buttons on your development kit to confirm or reject a pairing request: + + .. code-block:: console + + Pairing confirmation required for 6D:99:66:6E:19:72 (random) + Press Button 1 to confirm, Button 2 to reject. + + #. Upon connection, data already collected by the `Memfault SDK`_ is forwarded to the cloud for further the analysis. + When connected, the new data is periodically flushed to the cloud with the interval configured by the Kconfig option :kconfig:option:`CONFIG_BT_MDS_DATA_POLL_INTERVAL`. + #. Upload the symbol file generated from your build to your Memfault account so that the information from your application can be parsed. + The :file:`zephyr.elf` symbol file is located in the build folder :file:`peripheral_memfault/build/zephyr`. + + a. In a web browser, navigate to `Memfault`_. + #. Log in to your account and select the project you created earlier. + #. Navigate to :guilabel:`Fleet` > :guilabel:`Devices` in the left side menu. + You can see your newly connected device and the software version in the list. + #. Select the software version number for your device and click :guilabel:`Upload` to upload the symbol file. + + #. Return to the terminal and press the Tab button on your keyboard to confirm that the Memfault shell is working. + The shell commands available are displayed. + + To learn about the Memfault shell commands, issue command ``mflt help``. + #. Use the buttons to trigger Memfault crashes, traces and metrics collection. + See :ref:`peripheral_mds_user_interface` for details about button functions. + #. Explore the Memfault user interface to see the errors and metrics sent from your device. + + .. group-tab:: nRF54 DKs + + .. note:: + The Web Bluetooth API used by the `Memfault WebBluetooth Client`_ is an experimental feature. + The functionality depends on your browser and computer OS compatibility. + + 1. |connect_terminal_ANSI| + #. Reset your development kit. + #. Observe that the sample starts. + #. Open a recent version of the `Google Chrome browser`_. + #. Run the `Memfault WebBluetooth Client`_ script to forward Memfault diagnostic data to the cloud. + For more details, see the `Memfault WebBluetooth Client source code`_. + #. Make sure that your development kit is advertising. + #. In the browser, click the :guilabel:`Connect` button and select your device from the list. + #. Use the buttons on your development kit to confirm or reject a pairing request: + + .. code-block:: console + + Pairing confirmation required for 6D:99:66:6E:19:72 (random) + Press Button 0 to confirm, Button 1 to reject. + + #. Upon connection, data already collected by the `Memfault SDK`_ is forwarded to the cloud for further the analysis. + When connected, the new data is periodically flushed to the cloud with the interval configured by the Kconfig option :kconfig:option:`CONFIG_BT_MDS_DATA_POLL_INTERVAL`. + #. Upload the symbol file generated from your build to your Memfault account so that the information from your application can be parsed. + The :file:`zephyr.elf` symbol file is located in the build folder :file:`peripheral_memfault/build/zephyr`. + + a. In a web browser, navigate to `Memfault`_. + #. Log in to your account and select the project you created earlier. + #. Navigate to :guilabel:`Fleet` > :guilabel:`Devices` in the left side menu. + You can see your newly connected device and the software version in the list. + #. Select the software version number for your device and click :guilabel:`Upload` to upload the symbol file. + + #. Return to the terminal and press the Tab button on your keyboard to confirm that the Memfault shell is working. + The shell commands available are displayed. + + To learn about the Memfault shell commands, issue command ``mflt help``. + #. Use the buttons to trigger Memfault crashes, traces and metrics collection. + See :ref:`peripheral_mds_user_interface` for details about button functions. + #. Explore the Memfault user interface to see the errors and metrics sent from your device. Dependencies ************ diff --git a/samples/bluetooth/peripheral_mds/memfault_config/memfault_metrics_heartbeat_config.def b/samples/bluetooth/peripheral_mds/memfault_config/memfault_metrics_heartbeat_config.def index 2c15e711e705..506774c10e9c 100644 --- a/samples/bluetooth/peripheral_mds/memfault_config/memfault_metrics_heartbeat_config.def +++ b/samples/bluetooth/peripheral_mds/memfault_config/memfault_metrics_heartbeat_config.def @@ -2,6 +2,6 @@ * Please refer to https://docs.memfault.com/docs/embedded/metrics-api for more details. */ -MEMFAULT_METRICS_KEY_DEFINE(button_3_press_count, kMemfaultMetricType_Unsigned) -MEMFAULT_METRICS_KEY_DEFINE(button_1_elapsed_time_ms, kMemfaultMetricType_Timer) +MEMFAULT_METRICS_KEY_DEFINE(button_press_count, kMemfaultMetricType_Unsigned) +MEMFAULT_METRICS_KEY_DEFINE(button_elapsed_time_ms, kMemfaultMetricType_Timer) MEMFAULT_METRICS_KEY_DEFINE(battery_soc_pct, kMemfaultMetricType_Unsigned) diff --git a/samples/bluetooth/peripheral_mds/memfault_config/memfault_trace_reason_user_config.def b/samples/bluetooth/peripheral_mds/memfault_config/memfault_trace_reason_user_config.def index 786d3b805bf8..5a80f3b03a01 100644 --- a/samples/bluetooth/peripheral_mds/memfault_config/memfault_trace_reason_user_config.def +++ b/samples/bluetooth/peripheral_mds/memfault_config/memfault_trace_reason_user_config.def @@ -2,4 +2,4 @@ * Please refer to https://docs.memfault.com/docs/embedded/trace-events for more details. */ -MEMFAULT_TRACE_REASON_DEFINE(button_2_state_changed) +MEMFAULT_TRACE_REASON_DEFINE(button_state_changed) diff --git a/samples/bluetooth/peripheral_mds/prj.conf b/samples/bluetooth/peripheral_mds/prj.conf index e4cbed98f614..3bcf11b0f44b 100644 --- a/samples/bluetooth/peripheral_mds/prj.conf +++ b/samples/bluetooth/peripheral_mds/prj.conf @@ -37,9 +37,11 @@ CONFIG_HEAP_MEM_POOL_SIZE=256 CONFIG_MEMFAULT=y CONFIG_MEMFAULT_SHELL=y +CONFIG_MEMFAULT_LOGGING_ENABLE=y +CONFIG_MEMFAULT_LOG_LEVEL_INF=y CONFIG_MEMFAULT_NCS_PROJECT_KEY="" -CONFIG_MEMFAULT_NCS_DEVICE_ID="" +CONFIG_MEMFAULT_NCS_DEVICE_ID="nrf-ble-testdevice" CONFIG_MEMFAULT_NCS_BT_METRICS=y @@ -48,8 +50,6 @@ CONFIG_BT_SETTINGS=y CONFIG_FLASH=y CONFIG_FLASH_PAGE_LAYOUT=y CONFIG_FLASH_MAP=y -CONFIG_NVS=y -CONFIG_SETTINGS=y # This example requires more stack CONFIG_MAIN_STACK_SIZE=1152 diff --git a/samples/bluetooth/peripheral_mds/sample.yaml b/samples/bluetooth/peripheral_mds/sample.yaml index ecadb41592be..e77d8584691e 100644 --- a/samples/bluetooth/peripheral_mds/sample.yaml +++ b/samples/bluetooth/peripheral_mds/sample.yaml @@ -14,6 +14,7 @@ tests: - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp - nrf5340dk/nrf5340/cpuapp/ns + - nrf54l15dk/nrf54l15/cpuapp platform_allow: nrf52dk/nrf52832 nrf52833dk/nrf52833 nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp nrf5340dk/nrf5340/cpuapp/ns + nrf5340dk/nrf5340/cpuapp nrf5340dk/nrf5340/cpuapp/ns nrf54l15dk/nrf54l15/cpuapp tags: bluetooth ci_build sysbuild diff --git a/samples/bluetooth/peripheral_mds/src/main.c b/samples/bluetooth/peripheral_mds/src/main.c index a486a71d2521..512700d39130 100644 --- a/samples/bluetooth/peripheral_mds/src/main.c +++ b/samples/bluetooth/peripheral_mds/src/main.c @@ -143,7 +143,12 @@ static void pairing_confirm(struct bt_conn *conn) pairing_confirmation_conn = conn; printk("Pairing confirmation required for %s\n", addr); - printk("Press Button 1 to confirm, Button 2 to reject.\n"); + + if (IS_ENABLED(CONFIG_SOC_SERIES_NRF54HX) || IS_ENABLED(CONFIG_SOC_SERIES_NRF54LX)) { + printk("Press Button 0 to confirm, Button 1 to reject.\n"); + } else { + printk("Press Button 1 to confirm, Button 2 to reject.\n"); + } } static struct bt_conn_auth_cb conn_auth_callbacks = { @@ -175,12 +180,12 @@ static void button_handler(uint32_t button_state, uint32_t has_changed) time_measure_start = !time_measure_start; if (time_measure_start) { - err = MEMFAULT_METRIC_TIMER_START(button_1_elapsed_time_ms); + err = MEMFAULT_METRIC_TIMER_START(button_elapsed_time_ms); if (err) { printk("Failed to start memfault metrics timer: %d\n", err); } } else { - err = MEMFAULT_METRIC_TIMER_STOP(button_1_elapsed_time_ms); + err = MEMFAULT_METRIC_TIMER_STOP(button_elapsed_time_ms); if (err) { printk("Failed to stop memfault metrics: %d\n", err); } @@ -206,10 +211,10 @@ static void button_handler(uint32_t button_state, uint32_t has_changed) if ((has_changed & DK_BTN2_MSK) && !pairing_confirmation_conn) { bool button_state = (buttons & DK_BTN2_MSK) ? 1 : 0; - MEMFAULT_TRACE_EVENT_WITH_LOG(button_2_state_changed, "Button state: %u", + MEMFAULT_TRACE_EVENT_WITH_LOG(button_state_changed, "Button state: %u", button_state); - printk("button_2_state_changed event has been tracked, button state: %u\n", + printk("button_state_changed event has been tracked, button state: %u\n", button_state); } @@ -227,11 +232,11 @@ static void button_handler(uint32_t button_state, uint32_t has_changed) } if (buttons & DK_BTN3_MSK) { - err = MEMFAULT_METRIC_ADD(button_3_press_count, 1); + err = MEMFAULT_METRIC_ADD(button_press_count, 1); if (err) { - printk("Failed to increase button_3_press_count metric: %d\n", err); + printk("Failed to increase button_press_count metric: %d\n", err); } else { - printk("button_3_press_count metric increased\n"); + printk("button_press_count metric increased\n"); } } diff --git a/samples/bluetooth/peripheral_nfc_pairing/Kconfig b/samples/bluetooth/peripheral_nfc_pairing/Kconfig index e209575fb41f..9f3667e7f713 100644 --- a/samples/bluetooth/peripheral_nfc_pairing/Kconfig +++ b/samples/bluetooth/peripheral_nfc_pairing/Kconfig @@ -30,6 +30,15 @@ config NFC_TAG_CH_REQUESTER endchoice +config SETTINGS + default y + +config ZMS + default y if SOC_FLASH_NRF_RRAM + +config NVS + default y if !SOC_FLASH_NRF_RRAM + endmenu menu "Zephyr Kernel" diff --git a/samples/bluetooth/peripheral_nfc_pairing/README.rst b/samples/bluetooth/peripheral_nfc_pairing/README.rst index 397602510b28..34e38681f9a2 100644 --- a/samples/bluetooth/peripheral_nfc_pairing/README.rst +++ b/samples/bluetooth/peripheral_nfc_pairing/README.rst @@ -136,23 +136,13 @@ Testing with NFC Poller Device Testing with NFC TNEP Poller Device ----------------------------------- -.. tabs:: - - .. group-tab:: nRF52 and nRF53 DKs - - 1. Touch the NFC antenna with the NFC Poller Device, for example :ref:`central_nfc_pairing` and observe that **LED 2** is lit. - #. Observe the output log. - The content of the exchanged NDEF messages is printed there. - #. Check the security level of the paring on the terminal. - #. Move the NFC antenna away from the NFC Poller Device. - - .. group-tab:: nRF54 DKs +For nRF52 and nRF53 DKs, perform the following steps: - 1. Touch the NFC antenna with the NFC Poller Device, for example :ref:`central_nfc_pairing` and observe that **LED 1** is lit. - #. Observe the output log. - The content of the exchanged NDEF messages is printed there. - #. Check the security level of the paring on the terminal. - #. Move the NFC antenna away from the NFC Poller Device. + 1. Touch the NFC antenna with the NFC Poller Device, for example :ref:`central_nfc_pairing` and observe that **LED 2** is lit. + #. Observe the output log. + The content of the exchanged NDEF messages is printed there. + #. Check the security level of the paring on the terminal. + #. Move the NFC antenna away from the NFC Poller Device. Dependencies ************ diff --git a/samples/bluetooth/peripheral_nfc_pairing/prj.conf b/samples/bluetooth/peripheral_nfc_pairing/prj.conf index dca07cc98114..3c8ddccfec47 100644 --- a/samples/bluetooth/peripheral_nfc_pairing/prj.conf +++ b/samples/bluetooth/peripheral_nfc_pairing/prj.conf @@ -43,8 +43,6 @@ CONFIG_BT_SETTINGS=y CONFIG_FLASH=y CONFIG_FLASH_PAGE_LAYOUT=y CONFIG_FLASH_MAP=y -CONFIG_NVS=y -CONFIG_SETTINGS=y CONFIG_DK_LIBRARY=y diff --git a/samples/bluetooth/peripheral_nfc_pairing/sample.yaml b/samples/bluetooth/peripheral_nfc_pairing/sample.yaml index fff4a5452809..b98975c7d933 100644 --- a/samples/bluetooth/peripheral_nfc_pairing/sample.yaml +++ b/samples/bluetooth/peripheral_nfc_pairing/sample.yaml @@ -10,7 +10,8 @@ tests: - nrf52dk/nrf52832 - nrf5340dk/nrf5340/cpuapp - nrf5340dk/nrf5340/cpuapp/ns + - nrf54l15dk/nrf54l15/cpuapp - nrf54h20dk/nrf54h20/cpuapp platform_allow: nrf52840dk/nrf52840 nrf52dk/nrf52832 nrf5340dk/nrf5340/cpuapp - nrf5340dk/nrf5340/cpuapp/ns nrf54h20dk/nrf54h20/cpuapp + nrf5340dk/nrf5340/cpuapp/ns nrf54l15dk/nrf54l15/cpuapp nrf54h20dk/nrf54h20/cpuapp tags: bluetooth ci_build sysbuild diff --git a/samples/bluetooth/peripheral_power_profiling/Kconfig b/samples/bluetooth/peripheral_power_profiling/Kconfig index f26dee120fed..7247914aae7e 100644 --- a/samples/bluetooth/peripheral_power_profiling/Kconfig +++ b/samples/bluetooth/peripheral_power_profiling/Kconfig @@ -71,4 +71,13 @@ config BT_POWER_PROFILING_NON_CONNECTABLE_ADV_INTERVAL_MAX help Non-connectable advertising maximum interval in 0.625 milliseconds unit. +config SETTINGS + default y + +config ZMS + default y if SOC_FLASH_NRF_RRAM + +config NVS + default y if !SOC_FLASH_NRF_RRAM + endmenu diff --git a/samples/bluetooth/peripheral_power_profiling/README.rst b/samples/bluetooth/peripheral_power_profiling/README.rst index 06b4ed3ecb96..d9d212d60ce5 100644 --- a/samples/bluetooth/peripheral_power_profiling/README.rst +++ b/samples/bluetooth/peripheral_power_profiling/README.rst @@ -41,10 +41,21 @@ The only mechanisms that are functional in this mode are reset and wake-up. To wake up your development kit from the system off state, you have the following options: -* Press the **RESET** button on your development kit. -* Press **Button 1** to start connectable advertising. -* Press **Button 2** to start non-connectable advertising. -* Approach the NFC field of the development kit antenna. +.. tabs:: + + .. group-tab:: nRF52 and nRF53 DKs + + * Press the **RESET** button on your development kit. + * Press **Button 1** to start connectable advertising. + * Press **Button 2** to start non-connectable advertising. + * Approach the NFC field of the development kit antenna. + + .. group-tab:: nRF54 DKs + + * Press the **RESET** button on your development kit. + * Press **Button 0** to start connectable advertising. + * Press **Button 1** to start non-connectable advertising. + * Approach the NFC field of the development kit antenna. The development kit starts advertising automatically. If you use a mobile phone, it connects and bonds with your device. @@ -106,18 +117,37 @@ User interface The sample uses buttons and LEDs to provide a simple user interface. -LED 1: - Blinks, toggling on/off every second, when the main loop is running and the device is advertising. - Off when the device is in system off state. +.. tabs:: + + .. group-tab:: nRF52 and nRF53 DKs + + LED 1: + Blinks, toggling on/off every second, when the main loop is running and the device is advertising. + Off when the device is in system off state. + + LED 2: + Lit when an NFC field is detected. + + Button 1: + Starts connectable advertising and wakes up the SoC from the system off state. + + Button 2: + Starts non-connectable advertising and wakes up the SoC from the system off state. + + .. group-tab:: nRF54 DKs + + LED 0: + Blinks, toggling on/off every second, when the main loop is running and the device is advertising. + Off when the device is in system off state. -LED 2: - Lit when an NFC field is detected. + LED 1: + Lit when an NFC field is detected. -Button 1: - Starts connectable advertising and wakes up the SoC from the system off state. + Button 0: + Starts connectable advertising and wakes up the SoC from the system off state. -Button 2: - Starts non-connectable advertising and wakes up the SoC from the system off state. + Button 1: + Starts non-connectable advertising and wakes up the SoC from the system off state. .. note:: When you use buttons to wake up the SoC from the system off state, the button state is read in the main thread after booting the Zephyr kernel. diff --git a/samples/bluetooth/peripheral_power_profiling/prj.conf b/samples/bluetooth/peripheral_power_profiling/prj.conf index 1a56a24ce496..bbca11cdb8e5 100644 --- a/samples/bluetooth/peripheral_power_profiling/prj.conf +++ b/samples/bluetooth/peripheral_power_profiling/prj.conf @@ -29,8 +29,6 @@ CONFIG_BT_SETTINGS=y CONFIG_FLASH=y CONFIG_FLASH_PAGE_LAYOUT=y CONFIG_FLASH_MAP=y -CONFIG_NVS=y -CONFIG_SETTINGS=y CONFIG_POWEROFF=y diff --git a/samples/bluetooth/peripheral_power_profiling/sample.yaml b/samples/bluetooth/peripheral_power_profiling/sample.yaml index 1ef0bc82e6f4..11a5695a9abd 100644 --- a/samples/bluetooth/peripheral_power_profiling/sample.yaml +++ b/samples/bluetooth/peripheral_power_profiling/sample.yaml @@ -11,6 +11,7 @@ tests: - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp - nrf5340dk/nrf5340/cpuapp/ns + - nrf54l15dk/nrf54l15/cpuapp platform_allow: nrf52dk/nrf52832 nrf52833dk/nrf52833 nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp nrf5340dk/nrf5340/cpuapp/ns + nrf5340dk/nrf5340/cpuapp nrf5340dk/nrf5340/cpuapp/ns nrf54l15dk/nrf54l15/cpuapp tags: bluetooth ci_build sysbuild diff --git a/samples/bluetooth/peripheral_rscs/Kconfig b/samples/bluetooth/peripheral_rscs/Kconfig index 76214afcc6fc..c6bb851c2fd8 100644 --- a/samples/bluetooth/peripheral_rscs/Kconfig +++ b/samples/bluetooth/peripheral_rscs/Kconfig @@ -16,7 +16,8 @@ config BT_RSCS_SECURITY_ENABLED select FLASH select FLASH_PAGE_LAYOUT select FLASH_MAP - select NVS + select ZMS if SOC_FLASH_NRF_RRAM + select NVS if !SOC_FLASH_NRF_RRAM select SETTINGS help "Enable Bluetooth LE security for the Running Speed and Cadence Service" diff --git a/samples/bluetooth/peripheral_rscs/sample.yaml b/samples/bluetooth/peripheral_rscs/sample.yaml index 9b9eede79c76..19e4e3eac2eb 100644 --- a/samples/bluetooth/peripheral_rscs/sample.yaml +++ b/samples/bluetooth/peripheral_rscs/sample.yaml @@ -11,8 +11,9 @@ tests: - nrf52833dk/nrf52833 - nrf5340dk/nrf5340/cpuapp - nrf5340dk/nrf5340/cpuapp/ns + - nrf54l15dk/nrf54l15/cpuapp - nrf54h20dk/nrf54h20/cpuapp platform_allow: > nrf52dk/nrf52832 nrf52840dk/nrf52840 nrf52833dk/nrf52833 nrf5340dk/nrf5340/cpuapp - nrf5340dk/nrf5340/cpuapp/ns nrf54h20dk/nrf54h20/cpuapp + nrf5340dk/nrf5340/cpuapp/ns nrf54l15dk/nrf54l15/cpuapp nrf54h20dk/nrf54h20/cpuapp tags: bluetooth ci_build sysbuild diff --git a/samples/bluetooth/peripheral_status/Kconfig b/samples/bluetooth/peripheral_status/Kconfig index c9090a30b9d4..06704d337094 100644 --- a/samples/bluetooth/peripheral_status/Kconfig +++ b/samples/bluetooth/peripheral_status/Kconfig @@ -16,7 +16,8 @@ config BT_STATUS_SECURITY_ENABLED select FLASH select FLASH_PAGE_LAYOUT select FLASH_MAP - select NVS + select ZMS if SOC_FLASH_NRF_RRAM + select NVS if !SOC_FLASH_NRF_RRAM select SETTINGS help Enable BLE security implementation for Nordic Status Message instances. diff --git a/samples/bluetooth/peripheral_uart/Kconfig b/samples/bluetooth/peripheral_uart/Kconfig index 4a87afb828b6..a6da8c39ce34 100644 --- a/samples/bluetooth/peripheral_uart/Kconfig +++ b/samples/bluetooth/peripheral_uart/Kconfig @@ -33,4 +33,13 @@ config BT_NUS_UART_RX_WAIT_TIME help Wait for RX complete event time in microseconds +config SETTINGS + default y + +config ZMS + default y if SOC_FLASH_NRF_RRAM + +config NVS + default y if !SOC_FLASH_NRF_RRAM + endmenu diff --git a/samples/bluetooth/peripheral_uart/prj.conf b/samples/bluetooth/peripheral_uart/prj.conf index 25deae6ec73a..29f93eb2546c 100644 --- a/samples/bluetooth/peripheral_uart/prj.conf +++ b/samples/bluetooth/peripheral_uart/prj.conf @@ -31,8 +31,6 @@ CONFIG_BT_SETTINGS=y CONFIG_FLASH=y CONFIG_FLASH_PAGE_LAYOUT=y CONFIG_FLASH_MAP=y -CONFIG_NVS=y -CONFIG_SETTINGS=y # Enable DK LED and Buttons library CONFIG_DK_LIBRARY=y diff --git a/samples/bluetooth/peripheral_uart/prj_minimal.conf b/samples/bluetooth/peripheral_uart/prj_minimal.conf index db12c8739f90..d31653ac666b 100644 --- a/samples/bluetooth/peripheral_uart/prj_minimal.conf +++ b/samples/bluetooth/peripheral_uart/prj_minimal.conf @@ -26,8 +26,6 @@ CONFIG_BT_SETTINGS=y CONFIG_FLASH=y CONFIG_FLASH_PAGE_LAYOUT=y CONFIG_FLASH_MAP=y -CONFIG_NVS=y -CONFIG_SETTINGS=y # Enable DK LED and Buttons library CONFIG_DK_LIBRARY=y @@ -50,6 +48,7 @@ CONFIG_THREAD_CUSTOM_DATA=n CONFIG_FPU=n # Boot +CONFIG_NCS_BOOT_BANNER=n CONFIG_BOOT_BANNER=n CONFIG_BOOT_DELAY=0 @@ -102,6 +101,7 @@ CONFIG_BT_NUS_THREAD_STACK_SIZE=512 CONFIG_TIMESLICING=n CONFIG_COMMON_LIBC_MALLOC=n CONFIG_LOG=n +CONFIG_LOG_BACKEND_RTT=n CONFIG_ASSERT=n # Disable Bluetooth features not needed diff --git a/samples/bluetooth/peripheral_uart/sample.yaml b/samples/bluetooth/peripheral_uart/sample.yaml index 965fe5eda196..947fa0143aa8 100644 --- a/samples/bluetooth/peripheral_uart/sample.yaml +++ b/samples/bluetooth/peripheral_uart/sample.yaml @@ -35,12 +35,13 @@ tests: sample.bluetooth.peripheral_uart_minimal: sysbuild: true build_only: true - extra_args: OVERLAY_CONFIG=prj_minimal.conf + extra_args: FILE_SUFFIX=minimal integration_platforms: + - nrf52dk/nrf52805 - nrf52dk/nrf52810 - nrf52840dk/nrf52811 - nrf52833dk/nrf52820 - platform_allow: nrf52dk/nrf52810 nrf52840dk/nrf52811 nrf52833dk/nrf52820 + platform_allow: nrf52dk/nrf52805 nrf52dk/nrf52810 nrf52840dk/nrf52811 nrf52833dk/nrf52820 tags: bluetooth ci_build sysbuild sample.bluetooth.peripheral_uart_ble_rpc: sysbuild: true diff --git a/samples/bluetooth/peripheral_uart/src/main.c b/samples/bluetooth/peripheral_uart/src/main.c index 7d47ceb96887..0e0e17bc4a7a 100644 --- a/samples/bluetooth/peripheral_uart/src/main.c +++ b/samples/bluetooth/peripheral_uart/src/main.c @@ -414,7 +414,12 @@ static void auth_passkey_confirm(struct bt_conn *conn, unsigned int passkey) bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr)); LOG_INF("Passkey for %s: %06u", addr, passkey); - LOG_INF("Press Button 1 to confirm, Button 2 to reject."); + + if (IS_ENABLED(CONFIG_SOC_SERIES_NRF54HX) || IS_ENABLED(CONFIG_SOC_SERIES_NRF54LX)) { + LOG_INF("Press Button 0 to confirm, Button 1 to reject."); + } else { + LOG_INF("Press Button 1 to confirm, Button 2 to reject."); + } } diff --git a/samples/bluetooth/rpc_host/Kconfig b/samples/bluetooth/rpc_host/Kconfig new file mode 100644 index 000000000000..587856d89b2b --- /dev/null +++ b/samples/bluetooth/rpc_host/Kconfig @@ -0,0 +1,16 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +source "Kconfig.zephyr" + +config SETTINGS + default y + +config ZMS + default y if SOC_FLASH_NRF_RRAM + +config NVS + default y if !SOC_FLASH_NRF_RRAM diff --git a/samples/bluetooth/rpc_host/prj.conf b/samples/bluetooth/rpc_host/prj.conf index 3025f10bf42f..52565aa48def 100644 --- a/samples/bluetooth/rpc_host/prj.conf +++ b/samples/bluetooth/rpc_host/prj.conf @@ -23,8 +23,6 @@ CONFIG_BT_SETTINGS=y CONFIG_FLASH=y CONFIG_FLASH_PAGE_LAYOUT=y CONFIG_FLASH_MAP=y -CONFIG_NVS=y -CONFIG_SETTINGS=y CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096 CONFIG_HEAP_MEM_POOL_SIZE=4096 diff --git a/samples/bluetooth/shell_bt_nus/sample.yaml b/samples/bluetooth/shell_bt_nus/sample.yaml index 4310dc14916e..dbb393dc5e08 100644 --- a/samples/bluetooth/shell_bt_nus/sample.yaml +++ b/samples/bluetooth/shell_bt_nus/sample.yaml @@ -10,7 +10,8 @@ tests: - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp - nrf5340dk/nrf5340/cpuapp/ns + - nrf54l15dk/nrf54l15/cpuapp - nrf54h20dk/nrf54h20/cpuapp platform_allow: nrf52dk/nrf52832 nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp - nrf5340dk/nrf5340/cpuapp/ns nrf54h20dk/nrf54h20/cpuapp + nrf5340dk/nrf5340/cpuapp/ns nrf54l15dk/nrf54l15/cpuapp nrf54h20dk/nrf54h20/cpuapp tags: bluetooth ci_build sysbuild diff --git a/samples/bluetooth/throughput/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/samples/bluetooth/throughput/boards/nrf54l15dk_nrf54l15_cpuapp.overlay new file mode 100644 index 000000000000..6fa3faa6eff4 --- /dev/null +++ b/samples/bluetooth/throughput/boards/nrf54l15dk_nrf54l15_cpuapp.overlay @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/ { + chosen { + zephyr,shell-uart = &uart20; + }; +}; + +&uart20 { + /delete-property/ hw-flow-control; +}; diff --git a/samples/bluetooth/throughput/sample.yaml b/samples/bluetooth/throughput/sample.yaml index 0492506aaca8..6f08232e4f0b 100644 --- a/samples/bluetooth/throughput/sample.yaml +++ b/samples/bluetooth/throughput/sample.yaml @@ -10,7 +10,8 @@ tests: - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp - nrf5340dk/nrf5340/cpuapp/ns + - nrf54l15dk/nrf54l15/cpuapp - nrf54h20dk/nrf54h20/cpuapp platform_allow: nrf52dk/nrf52832 nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp - nrf5340dk/nrf5340/cpuapp/ns nrf54h20dk/nrf54h20/cpuapp + nrf5340dk/nrf5340/cpuapp/ns nrf54l15dk/nrf54l15/cpuapp nrf54h20dk/nrf54h20/cpuapp tags: bluetooth ci_build sysbuild diff --git a/samples/bluetooth/throughput/src/main.c b/samples/bluetooth/throughput/src/main.c index 10c8eed06a01..bc4c598bedeb 100644 --- a/samples/bluetooth/throughput/src/main.c +++ b/samples/bluetooth/throughput/src/main.c @@ -650,8 +650,14 @@ int main(void) } printk("\n"); - printk("Press button 1 or type \"central\" on the central board.\n"); - printk("Press button 2 or type \"peripheral\" on the peripheral board.\n"); + + if (IS_ENABLED(CONFIG_SOC_SERIES_NRF54HX) || IS_ENABLED(CONFIG_SOC_SERIES_NRF54LX)) { + printk("Press button 0 or type \"central\" on the central board.\n"); + printk("Press button 1 or type \"peripheral\" on the peripheral board.\n"); + } else { + printk("Press button 1 or type \"central\" on the central board.\n"); + printk("Press button 2 or type \"peripheral\" on the peripheral board.\n"); + } buttons_init(); diff --git a/samples/cellular/gnss/src/factory_almanac_v2.h b/samples/cellular/gnss/src/factory_almanac_v2.h index 449d1f6166b8..01657e0fc73b 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 2024-09-06 19:47:23. +/* Factory almanac generated on 2024-10-09 10:44:04. * * Note, that the almanac gets more inaccurate with time and it should be updated periodically. */ #define FACTORY_ALMANAC_DATA_V2 \ - "f0ea0200311b0900000000000000000000000000000000000000000000000000" \ - "0000000000000000000031ee830f1b0931104ffd00270da100b06902002cbbd1" \ - "ffe911440084fe020031e02e0f1b092c1c6afd00f80ca1008eb53000132c2f00" \ - "d433b3ff2c020400319a180f1b091c0f4cfd00360da100d9a15c0024bb85ffbc" \ - "5d3000cd0102003149300f1b09a9135ffd00fb0ca100c08f2e00c2f835009f49" \ - "4a003dff000031a2180f1b09e71e64fd00340da1008a8206009c6fe1ff4649ef" \ - "ff2f00f9ff3166990f1b09670551fd00790ca100e8dc85ff885aaaff341ccaff" \ - "d6ff010031f14e0f1b09d20530fd00010da100d5bbd9ff71fb0e0024933d006a" \ - "0104003148190f1b09f60a45fd00550ca1008f2c5a0020ab5000e1bf51006d01" \ - "040031d84e0f1b09f11b67fd00230da100fb9a3000fa069fff25bb8dff83fffd" \ - "ff31a60d0f1b09a30f51fd00c60da10009c30700351f98ff21651d0000fdffff" \ - "3116470f1b09690c53fd00680ca1006753b3fff18c3b00ae88acffcdfdffff31" \ - "64460f1b09551353fd001e0da10098ff6000cc05270084f93000c402010031c2" \ - "270f1b09900145fd002b0da1007c72b1ff5bb08bffbfe9a7ff0302020031e483" \ - "0f1b09f0fb32fd00170da1006cda540028163700e1ff1400d40001003106720f" \ - "1b09080c50fd008e0ca1008b0cb4ff535522006d7e64003dff030031ca6e0f1b" \ - "0926103efd00ef0da100fea8ddffd3c9caffdbf939009702fdff31cd250f1b09" \ - "071557fd00730ca1008c9d06006a7e85ff7b72edff54fdffff31bf510f1b09a6" \ - "0f3ffd00760da1009d76dfff35aa6b00eb2d89ff3102010031d01e0f1b093608" \ - "4efd005d0ca100f23c290044f097ffd003feff85010000319dcf0f1b09710c4b" \ - "fd00de0ca1004718020075beeaffa59335006b00000031ce730f1b09990b51fd" \ - "00260da100ea2eb4ffd379d2ffee4e5100c1ffffff3117260f1b09c71864fd00" \ - "810ca10051672f00af9587ffcb16bdff4b01020031f7810f1b09ccfa42fd0023" \ - "0da10047d681ff3ef32800f8c4f0ff02fe00003119600f1b09a2044bfd00820d" \ - "a100d0bfafff5c7a2c00eca3a7ff0c020000310e4b0f1b0920f83bfd001f0da1" \ - "006e1fadff696c1600fc5789ff5700feff3134670f1b09b80b37fd000a0da100" \ - "53d9daff487e200081923f00ddff00003116030f1b09a10c5cfd004d0da10079" \ - "9084ff121b39008e269cff59fefcff31ec170f1b09c31140fd00c90da1002b48" \ - "deff96996c00aeb13a00a1fd010031bf3a0f1b09b9fb44fd003b0ca100f9d285" \ - "ff594b9cffcb66c4ffabfe02003119570f1b09fa0759fd00d40da100cdc186ff" \ - "29761d007405a1ff14ff00003144400f1b09290d49fd00510da10055c95a005e" \ - "01a9ffd1195a008cfd0100000000000000000000000000000000000000000000" \ + "f0ea0200311f0900000000000000000000000000000000000000000000000000" \ + "0000000000000000000031e184631f0906104dfd00220da100c1e2edffeb57d2" \ + "ff48ce68009bfe020031ab2e631f09a81c57fd00d40ca10064321c00dc792f00" \ + "6490d8ff52020300313d19631f090f0f5cfd00370da1001d1948008f7b85ff42" \ + "e55500e201020031962f631f0923144afd001a0da1007e081a0045733600b64d" \ + "6f0039ff0000318219631f09cf1e5bfd005a0da1005a03f2ff14c7e0ff461f15" \ + "00e2fff8ff31c899631f09520550fd005d0ca10003567100ec7daaff5728f0ff" \ + "e2ff010031f44f631f096e0547fd00250da100412bc5fff0120f00b5f262008f" \ + "01030031f219631f09f40a55fd00440ca10019a14500315c5100616f77009c01" \ + "0500311f50631f096c1c58fd00230da100e4171c007a369fff70ecb2ff5ffffc" \ + "ff31d10d631f09920f47fd00180ca1007c3cf3ff6e1e9bff705d3f00f5fcffff" \ + "31a447631f09870c53fd003a0ca10048ca9eff46a23b0095ced2ffc5fdffff31" \ + "3347631f093a1362fd002a0da100a2794c00e37b270074df5500ca0200003152" \ + "28631f09ae0145fd00190da10058e49cff9fa78bff4d54cdff1c020200315e84" \ + "631f0902fc40fd00420da100244640002ca73700b6c63900e1000100310e7363" \ + "1f09220c56fd009f0ca100eb829ffff6802200d95c8aff5aff030031e46e631f" \ + "09ba0f57fd00120ca100051ec9ff7f7ccbff22435f007502fdff31fb26631f09" \ + "f1144efd00820da100a319f2ff399286ffb06d11004ffd000031ad51631f0937" \ + "0f57fd00920da100b1ebcaff0a816c000246adff4002010031451f631f09ac08" \ + "3afd00820ca1008ab01400d56299ffe6c72200840100003149d0631f09450c4b" \ + "fd00cd0ca100528fedff594cebff1bbe5a006900000031b072631f09b50b56fd" \ + "00100da10047a59fffdffcd2ff94377600b7ffffff314027631f09411953fd00" \ + "8f0ca100c0e21a007a5088ff2676e2ff6301020031c783631f09affa43fd0016" \ + "0da10065496d00a57329001aa2150003fe0000314361631f09c40449fd00530d" \ + "a1005c339bff10922c001997ccff0c020000318e4c631f0941f83afd002e0da1" \ + "00158d98ffdde71600cd38aeff3e00fdff31dc67631f09530b4efd00140da100" \ + "c34bc6ff0a8020002d0b6500dcff0000318c03631f09870c5bfd006f0da10051" \ + "0d70009c473900e208c1ff31fefcff31ac17631f09581159fd00b90da10037be" \ + "c9ff6b516d00e79e5e00a8fd010031c53a631f09a5fb43fd00140ca100294771" \ + "00252a9cff7309ebffc0fe0200314257631f09e60756fd00310ca1005a3c7200" \ + "1b841e00c349c5ff16ff000031da40631f09210d57fd00800da1003e3f46006f" \ + "f7a8ff72307f0097fd0100000000000000000000000000000000000000000000" \ "0000000000" #define FACTORY_ALMANAC_CHECKSUM_V2 \ - "c2d2a28f851381e5ca6c784a70ba7a59af96f64e0b4063e9b9fb1c72c5a82262" + "96bfaef8508ea4c578141b18265bf7b549ce3b9d2f4488709f9a8a8010f552bd" #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 36c559cc468f..474923039500 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 2024-09-07 19:16:52. +/* Factory almanac generated on 2024-10-09 11:45:55. * * Note, that the almanac gets more inaccurate with time and it should be updated periodically. */ #define FACTORY_ALMANAC_DATA_V3 \ - "f0ea0300311b0900000000000000000000000000000000000000000000000000" \ - "0000000000000000000031f683241b0930104afd00250da1007562020093bfd1" \ - "ff1e39430085fe020031e12e241b09301c6afd00f90ca1009dae3000d1312f00" \ - "6f5bb2ff2e02040031a318241b091d0f53fd00390da100a09a5c00f0bc85ffe3" \ - "862f00ce010200314730241b09ad135efd00fe0ca100ad882e0075ff35001f70" \ - "49003dff000031a718241b09e51e5efd00330da1008f7b0600aa68e1ff4b7bee" \ - "ff2c00f9ff316599241b09640550fd00720ca100b4d585ffe75aaafff44dc9ff" \ - "d6ff010031f74e241b09d10537fd00060da10050b4d9ff76fa0e0019c13c006c" \ - "010400314b19241b09f80a4cfd00580ca10042255a0010b7500048e750006e01" \ - "040031e34e241b09f51b67fd00260da1000994300078069fff58e78cff82fffd" \ - "ff31ad0d241b09a20f4bfd00c50da100d6bb07005a2a98ffa97f1c0000fdffff" \ - "311747241b096a0c57fd00660ca100394cb3ff958d3b00ccbaabffcdfdffff31" \ - "6646241b09561359fd00210da10071f860009b0927008a213000c402010031c8" \ - "27241b0990014afd002a0da100276bb1fff3b28bffb012a7ff0402020031e383" \ - "241b09f2fb39fd001d0da100ddd25400c71a370063271400d4000100310b7224" \ - "1b09080c55fd008e0ca1005805b4fffc5522001faf63003dff030031d06e241b" \ - "09251044fd00f50da100a3a1ddffa3cdcaff1d1a39009602fdff31d425241b09" \ - "061551fd00710ca1006d960600e68585ff459decff54fdffff31bf51241b09a5" \ - "0f45fd007b0da1003f6fdfff01b26b00bc4e88ff3202010031d41e241b093a08" \ - "4cfd00600ca100b33529007af597ffb131fdff8501000031a1cf241b09700c47" \ - "fd00dc0ca100fc10020006c2eaff6dbe34006b00000031c773241b099a0b56fd" \ - "00250da100b727b4ff427dd2ff36775000c1ffffff312226241b09ca1864fd00" \ - "830ca10054602f00379887ff0146bcff4c010200310682241b09cafa41fd001d" \ - "0da100e0ce81ff59f82800adebefff02fe0000312060241b09a2044ffd007f0d" \ - "a10088b8afff817a2c0019cca6ff0c02000031194b241b091ff83efd001e0da1" \ - "00f717adff226f1600438188ff5700feff313667241b09b70b3efd000f0da100" \ - "e4d1daff787d2000ebbf3e00ddff0000311d03241b099e0c5bfd00480da10061" \ - "8984ff8136390055359bff57fefcff31e917241b09c21146fd00cd0da100d740" \ - "deffffa26c00c6cd3900a1fd010031bc3a241b09b6fb42fd00340ca1009dcb85" \ - "ff88479cff0b9fc3ffacfe0200311f57241b09f70758fd00ce0da100a4ba86ff" \ - "ae7e1d003322a0ff14ff0000314c40241b092a0d51fd00570da10012c25a00e5" \ - "ffa8ff374559008cfd0100000000000000000000000000000000000000000000" \ - "0000000000000000000000000000316e7c1a1b09cbcb22ff0192ecca00007ebc" \ - "ff202ec0ffd4052400ffff0000319a761a1b09b5cc31ff01f2e9ca004c060300" \ - "efa3bfff6758ddfffdff0000317f761a1b09ac9af2fe01d2e6ca00da65480087" \ - "b3bfff5a7e93ff17000000000000000000000000000000000000000000000000" \ + "f0ea0300311f0900000000000000000000000000000000000000000000000000" \ + "0000000000000000000031e184631f0906104dfd00220da100c1e2edffeb57d2" \ + "ff48ce68009bfe020031ab2e631f09a81c57fd00d40ca10064321c00dc792f00" \ + "6490d8ff52020300313d19631f090f0f5cfd00370da1001d1948008f7b85ff42" \ + "e55500e201020031962f631f0923144afd001a0da1007e081a0045733600b64d" \ + "6f0039ff0000318219631f09cf1e5bfd005a0da1005a03f2ff14c7e0ff461f15" \ + "00e2fff8ff31c899631f09520550fd005d0ca10003567100ec7daaff5728f0ff" \ + "e2ff010031f44f631f096e0547fd00250da100412bc5fff0120f00b5f262008f" \ + "01030031f219631f09f40a55fd00440ca10019a14500315c5100616f77009c01" \ + "0500311f50631f096c1c58fd00230da100e4171c007a369fff70ecb2ff5ffffc" \ + "ff31d10d631f09920f47fd00180ca1007c3cf3ff6e1e9bff705d3f00f5fcffff" \ + "31a447631f09870c53fd003a0ca10048ca9eff46a23b0095ced2ffc5fdffff31" \ + "3347631f093a1362fd002a0da100a2794c00e37b270074df5500ca0200003152" \ + "28631f09ae0145fd00190da10058e49cff9fa78bff4d54cdff1c020200315e84" \ + "631f0902fc40fd00420da100244640002ca73700b6c63900e1000100310e7363" \ + "1f09220c56fd009f0ca100eb829ffff6802200d95c8aff5aff030031e46e631f" \ + "09ba0f57fd00120ca100051ec9ff7f7ccbff22435f007502fdff31fb26631f09" \ + "f1144efd00820da100a319f2ff399286ffb06d11004ffd000031ad51631f0937" \ + "0f57fd00920da100b1ebcaff0a816c000246adff4002010031451f631f09ac08" \ + "3afd00820ca1008ab01400d56299ffe6c72200840100003149d0631f09450c4b" \ + "fd00cd0ca100528fedff594cebff1bbe5a006900000031b072631f09b50b56fd" \ + "00100da10047a59fffdffcd2ff94377600b7ffffff314027631f09411953fd00" \ + "8f0ca100c0e21a007a5088ff2676e2ff6301020031c783631f09affa43fd0016" \ + "0da10065496d00a57329001aa2150003fe0000314361631f09c40449fd00530d" \ + "a1005c339bff10922c001997ccff0c020000318e4c631f0941f83afd002e0da1" \ + "00158d98ffdde71600cd38aeff3e00fdff31dc67631f09530b4efd00140da100" \ + "c34bc6ff0a8020002d0b6500dcff0000318c03631f09870c5bfd006f0da10051" \ + "0d70009c473900e208c1ff31fefcff31ac17631f09581159fd00b90da10037be" \ + "c9ff6b516d00e79e5e00a8fd010031c53a631f09a5fb43fd00140ca100294771" \ + "00252a9cff7309ebffc0fe0200314257631f09e60756fd00310ca1005a3c7200" \ + "1b841e00c349c5ff16ff000031da40631f09210d57fd00800da1003e3f46006f" \ + "f7a8ff72307f0097fd0100000000000000000000000000000000000000000000" \ + "000000000000000000000000000031db776a1f0995cb0eff01ccedca00dd84a8" \ + "ff9a99c0ff1ae50300ffff000031bc786a1f0970cc33ff017bebca008120efff" \ + "e4ebbfff3476befffbff00003119786a1f09529b22ff0109e9ca00b4653400f2" \ + "34c0ffe7bf750017000000000000000000000000000000000000000000000000" \ "0000000000000000000000000000000000000000000000000000000000000000" \ - "0000000000000000003111021a1b09d5005a0001a7eaca00bda881ff520bf6ff" \ - "72021f0000000000000000000000000000000000000000000000000000000000" \ + "0000000000000000003169016a1f09cf005f000197ebca00e82480ff0e53f4ff" \ + "8ddbefff00000000000000000000000000000000000000000000000000000000" \ "0000000000000000000000000000000000000000000000000000000000000000" \ "0000000000000000000000000000000000000000000000000000000000000000" \ "00000000000000000000000000000000000000000000000000000000000000" #define FACTORY_ALMANAC_CHECKSUM_V3 \ - "e6ae70cd4d2b881ff8eb80a171c00e971520c0c1a362552fdae199bcd0fd5d30" + "b1ac5c4f14a8e341de0a19323f570d083a67c24b0c090bfd7b3475518e7d2824" #endif /* FACTORY_ALMANAC_V3_H_ */ diff --git a/samples/cellular/location/README.rst b/samples/cellular/location/README.rst index 56bed6360d33..c8f702f9165e 100644 --- a/samples/cellular/location/README.rst +++ b/samples/cellular/location/README.rst @@ -71,13 +71,13 @@ Building and running nRF91 Series DK with nRF7002 EK Wi-Fi support ============================================= -To build the sample with nRF91 Series DK and nRF7002 EK Wi-Fi support, use the ``-DSHIELD=nrf7002ek`` and ``-DEXTRA_CONF_FILE=overlay-nrf700x-wifi-scan-only.conf`` options. +To build the sample with nRF91 Series DK and nRF7002 EK Wi-Fi support, use the ``-DSHIELD=nrf7002ek``, ``-DEXTRA_CONF_FILE=overlay-nrf700x-wifi-scan-only.conf``, ``-DSB_CONFIG_WIFI_NRF70=y``, and ``-DSB_CONFIG_WIFI_NRF70_SCAN_ONLY=y`` options. For example: .. parsed-literal:: :class: highlight - west build -p -b *board_target* -- -DSHIELD=nrf7002ek -DEXTRA_CONF_FILE=overlay-nrf700x-wifi-scan-only.conf + west build -p -b *board_target* -- -DSHIELD=nrf7002ek -DEXTRA_CONF_FILE=overlay-nrf700x-wifi-scan-only.conf -DSB_CONFIG_WIFI_NRF70=y -DSB_CONFIG_WIFI_NRF70_SCAN_ONLY=y |board_target| @@ -86,12 +86,12 @@ See :ref:`cmake_options` for more instructions on how to add these options. Thingy:91 X Wi-Fi support ========================= -To build the Location sample with Thingy:91 X Wi-Fi support, use the ``-DDTC_OVERLAY_FILE=thingy91x_wifi.overlay`` and ``-DEXTRA_CONF_FILE=overlay-nrf700x-wifi-scan-only.conf`` options. +To build the Location sample with Thingy:91 X Wi-Fi support, use the ``-DDTC_OVERLAY_FILE=thingy91x_wifi.overlay``, ``-DEXTRA_CONF_FILE=overlay-nrf700x-wifi-scan-only.conf``, ``-DSB_CONFIG_WIFI_NRF70=y``, and ``-DSB_CONFIG_WIFI_NRF70_SCAN_ONLY=y`` options. For example: .. code-block:: console - west build -p -b thingy91x_nrf9151_ns -- -DDTC_OVERLAY_FILE=thingy91x_wifi.overlay -DEXTRA_CONF_FILE=overlay-nrf700x-wifi-scan-only.conf + west build -p -b thingy91x/nrf9151/ns -- -DDTC_OVERLAY_FILE=thingy91x_wifi.overlay -DEXTRA_CONF_FILE=overlay-nrf700x-wifi-scan-only.conf -DSB_CONFIG_WIFI_NRF70=y -DSB_CONFIG_WIFI_NRF70_SCAN_ONLY=y See :ref:`cmake_options` for more instructions on how to add these options. diff --git a/samples/cellular/modem_callbacks/README.rst b/samples/cellular/modem_callbacks/README.rst index bd10503e87fe..cb4b72b107fe 100644 --- a/samples/cellular/modem_callbacks/README.rst +++ b/samples/cellular/modem_callbacks/README.rst @@ -23,7 +23,7 @@ Overview The sample performs the following operations: -1. Registers callbacks during compile time for modem initialization, functional mode changes, and shutdown using the :c:macro:`NRF_MODEM_LIB_ON_INIT`, :c:macro:`LTE_LC_ON_CFUN` and :c:macro:`NRF_MODEM_LIB_ON_SHUTDOWN` macros respectively. +1. Registers callbacks during compile time for modem initialization, functional mode changes, and shutdown using the :c:macro:`NRF_MODEM_LIB_ON_INIT`, :c:macro:`NRF_MODEM_LIB_ON_CFUN` and :c:macro:`NRF_MODEM_LIB_ON_SHUTDOWN` macros respectively. #. Initializes the :ref:`nrfxlib:nrf_modem`. #. Changes functional mode using the :c:func:`lte_lc_func_mode_set` function in the :ref:`lte_lc_readme` library #. Shuts down the :ref:`nrfxlib:nrf_modem`. diff --git a/samples/cellular/modem_shell/overlay-cloud_coap.conf b/samples/cellular/modem_shell/overlay-cloud_coap.conf index 1a357f604935..799fcc39cb54 100644 --- a/samples/cellular/modem_shell/overlay-cloud_coap.conf +++ b/samples/cellular/modem_shell/overlay-cloud_coap.conf @@ -14,7 +14,7 @@ CONFIG_COAP_CLIENT_BLOCK_SIZE=1024 CONFIG_COAP_CLIENT_STACK_SIZE=6144 CONFIG_COAP_CLIENT_THREAD_PRIORITY=0 CONFIG_COAP_EXTENDED_OPTIONS_LEN=y -CONFIG_COAP_EXTENDED_OPTIONS_LEN_VALUE=40 +CONFIG_COAP_EXTENDED_OPTIONS_LEN_VALUE=80 # Report standard information to shadow CONFIG_NRF_CLOUD_SEND_DEVICE_STATUS=y diff --git a/samples/cellular/modem_shell/sample.yaml b/samples/cellular/modem_shell/sample.yaml index a8e912d5e5f1..bebdd0862488 100644 --- a/samples/cellular/modem_shell/sample.yaml +++ b/samples/cellular/modem_shell/sample.yaml @@ -234,6 +234,19 @@ tests: - nrf9160dk/nrf9160/ns - nrf9161dk/nrf9161/ns tags: ci_build sysbuild ci_samples_cellular + sample.cellular.modem_shell.pgps_coap: + sysbuild: true + build_only: true + extra_args: EXTRA_CONF_FILE="overlay-pgps.conf;overlay-cloud_coap.conf" + integration_platforms: + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + platform_allow: + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + tags: ci_build sysbuild ci_samples_cellular sample.cellular.modem_shell.location_service_ext: sysbuild: true build_only: true diff --git a/samples/cellular/modem_shell/src/cloud/cloud_lwm2m.c b/samples/cellular/modem_shell/src/cloud/cloud_lwm2m.c index 83c036e65e76..2a0b6cc82232 100644 --- a/samples/cellular/modem_shell/src/cloud/cloud_lwm2m.c +++ b/samples/cellular/modem_shell/src/cloud/cloud_lwm2m.c @@ -49,7 +49,7 @@ static char utc_offset[UTC_OFFSET_STR_LEN] = ""; static char timezone[TIMEZONE_STR_LEN] = ""; #define APP_DEVICE_TYPE "OMA-LWM2M Client" #if defined(APP_VERSION) -#define CLIENT_SW_VER STRINGIFY(APP_VERSION) +#define CLIENT_SW_VER ("v" NCS_VERSION_STRING "-" NCS_COMMIT_STRING) #else #define CLIENT_SW_VER "unknown" #endif diff --git a/samples/cellular/modem_shell/src/drivers/nrf91_non_offloaded_dev.c b/samples/cellular/modem_shell/src/drivers/nrf91_non_offloaded_dev.c index 7a78c89fbea7..25a88cdc144a 100644 --- a/samples/cellular/modem_shell/src/drivers/nrf91_non_offloaded_dev.c +++ b/samples/cellular/modem_shell/src/drivers/nrf91_non_offloaded_dev.c @@ -108,10 +108,8 @@ static int util_get_pdn_conn_dyn_params(int cid, struct pdn_conn_dyn_params *ret { struct at_parser parser; size_t param_str_len; - char at_cmd_str[16]; char at_cmd_response_str[512]; char dns_addr_str[128]; - char *at_ptr = at_cmd_response_str; int ret, family, iterator; struct in_addr *addr; struct in6_addr *addr6; @@ -119,16 +117,15 @@ static int util_get_pdn_conn_dyn_params(int cid, struct pdn_conn_dyn_params *ret uint32_t mtu; int family_for_mtu; - sprintf(at_cmd_str, AT_CMD_PDP_CONTEXT_READ_DYN_INFO, cid); - - ret = nrf_modem_at_cmd(at_cmd_response_str, sizeof(at_cmd_response_str), at_cmd_str); + ret = nrf_modem_at_cmd(at_cmd_response_str, sizeof(at_cmd_response_str), + AT_CMD_PDP_CONTEXT_READ_DYN_INFO, cid); if (ret) { mosh_error("Cannot get PDP conn dyn params, ret: %d", ret); return false; } /* Parse the response */ - ret = at_parser_init(&parser, at_ptr); + ret = at_parser_init(&parser, at_cmd_response_str); if (ret) { mosh_error("Could not init AT parser, error: %d\n", ret); return ret; diff --git a/samples/cellular/modem_shell/src/link/link.h b/samples/cellular/modem_shell/src/link/link.h index 03974d5bb0b9..e1303f5eb890 100644 --- a/samples/cellular/modem_shell/src/link/link.h +++ b/samples/cellular/modem_shell/src/link/link.h @@ -18,8 +18,37 @@ enum link_ncellmeas_modes { #define LINK_FUNMODE_NONE 99 #define LINK_SYSMODE_NONE 99 -#define LINK_REDMOB_NONE 99 -#define LTE_LC_FACTORY_RESET_INVALID 99 + +/** Type of factory reset to perform. */ +enum link_factory_reset_type { + /** Reset all modem data to factory settings. */ + LINK_FACTORY_RESET_ALL = 0, + + /** Reset user-configurable data to factory settings. */ + LINK_FACTORY_RESET_USER = 1, + + /** Invalid type. */ + LINK_FACTORY_RESET_INVALID = 99 +}; + +/** Reduced mobility mode. */ +enum link_reduced_mobility_mode { + /** Functionality according to the 3GPP relaxed monitoring feature. */ + LINK_REDUCED_MOBILITY_DEFAULT = 0, + + /** Enable Nordic-proprietary reduced mobility feature. */ + LINK_REDUCED_MOBILITY_NORDIC = 1, + + /** + * Full measurements for best possible mobility. + * + * Disable the 3GPP relaxed monitoring and Nordic-proprietary reduced mobility features. + */ + LINK_REDUCED_MOBILITY_DISABLED = 2, + + /** Invalid type. */ + LINK_REDUCED_MOBILITY_NONE = 99 +}; void link_init(void); void link_ind_handler(const struct lte_lc_evt *const evt); diff --git a/samples/cellular/modem_shell/src/link/link_settings.c b/samples/cellular/modem_shell/src/link/link_settings.c index 7e05d7dd21bf..faddf1b13426 100644 --- a/samples/cellular/modem_shell/src/link/link_settings.c +++ b/samples/cellular/modem_shell/src/link/link_settings.c @@ -801,12 +801,12 @@ void link_sett_defaults_set(void) mosh_print("link settings reseted"); } -void link_sett_modem_factory_reset(enum lte_lc_factory_reset_type type) +void link_sett_modem_factory_reset(enum link_factory_reset_type type) { int err; /* Reset modem factory settings by type */ - err = lte_lc_factory_reset(type); + err = nrf_modem_at_printf("AT%%XFACTORYRESET=%d", type); if (err) { mosh_error("Resetting modem factory settings failed, err %d", err); } else { diff --git a/samples/cellular/modem_shell/src/link/link_settings.h b/samples/cellular/modem_shell/src/link/link_settings.h index a7579c0bb8e9..d327b7d6b980 100644 --- a/samples/cellular/modem_shell/src/link/link_settings.h +++ b/samples/cellular/modem_shell/src/link/link_settings.h @@ -7,6 +7,8 @@ #ifndef MOSH_LINK_SETTINGS_H #define MOSH_LINK_SETTINGS_H +#include "link.h" + int link_sett_init(void); void link_sett_defaults_set(void); @@ -56,6 +58,6 @@ bool link_sett_is_normal_mode_autoconn_enabled(void); bool link_sett_is_normal_mode_autoconn_rel14_used(void); void link_sett_normal_mode_autoconn_shell_print(void); -void link_sett_modem_factory_reset(enum lte_lc_factory_reset_type type); +void link_sett_modem_factory_reset(enum link_factory_reset_type type); #endif /* MOSH_LINK_SETTINGS_H */ diff --git a/samples/cellular/modem_shell/src/link/link_shell.c b/samples/cellular/modem_shell/src/link/link_shell.c index bd9542fce5d0..85fa8522a06f 100644 --- a/samples/cellular/modem_shell/src/link/link_shell.c +++ b/samples/cellular/modem_shell/src/link/link_shell.c @@ -1998,7 +1998,7 @@ static int link_shell_redmob(const struct shell *shell, size_t argc, char **argv { int ret; enum link_shell_operation operation = LINK_OPERATION_NONE; - enum lte_lc_reduced_mobility_mode redmob_mode = LINK_REDMOB_NONE; + enum link_reduced_mobility_mode redmob_mode = LINK_REDUCED_MOBILITY_NONE; char snum[10]; optreset = 1; @@ -2017,10 +2017,10 @@ static int link_shell_redmob(const struct shell *shell, size_t argc, char **argv break; case LINK_SHELL_OPT_REDMOB_DEFAULT: - redmob_mode = LTE_LC_REDUCED_MOBILITY_DEFAULT; + redmob_mode = LINK_REDUCED_MOBILITY_DEFAULT; break; case LINK_SHELL_OPT_REDMOB_NORDIC: - redmob_mode = LTE_LC_REDUCED_MOBILITY_NORDIC; + redmob_mode = LINK_REDUCED_MOBILITY_NORDIC; break; case 'h': @@ -2038,21 +2038,23 @@ static int link_shell_redmob(const struct shell *shell, size_t argc, char **argv } if (operation == LINK_OPERATION_DISABLE) { - redmob_mode = LTE_LC_REDUCED_MOBILITY_DISABLED; + redmob_mode = LINK_REDUCED_MOBILITY_DISABLED; } if (operation == LINK_OPERATION_READ) { - enum lte_lc_reduced_mobility_mode mode; + enum link_reduced_mobility_mode mode; + uint16_t mode_tmp; - ret = lte_lc_reduced_mobility_get(&mode); - if (ret) { + ret = nrf_modem_at_scanf("AT%REDMOB?", "%%REDMOB: %hu", &mode_tmp); + if (ret != 1) { mosh_error("Cannot get reduced mobility mode: %d", ret); } else { + mode = mode_tmp; mosh_print( "Reduced mobility mode read successfully: %s", link_shell_redmob_mode_to_string(mode, snum)); } - } else if (redmob_mode != LINK_REDMOB_NONE) { - ret = lte_lc_reduced_mobility_set(redmob_mode); + } else if (redmob_mode != LINK_REDUCED_MOBILITY_NONE) { + ret = nrf_modem_at_printf("AT%%REDMOB=%d", redmob_mode); if (ret) { mosh_error("Cannot set reduced mobility mode: %d", ret); } else { @@ -2354,7 +2356,7 @@ static int link_shell_search(const struct shell *shell, size_t argc, char **argv static int link_shell_settings(const struct shell *shell, size_t argc, char **argv) { enum link_shell_operation operation = LINK_OPERATION_NONE; - enum lte_lc_factory_reset_type mreset_type = LTE_LC_FACTORY_RESET_INVALID; + enum link_factory_reset_type mreset_type = LINK_FACTORY_RESET_INVALID; optreset = 1; optind = 1; @@ -2372,10 +2374,10 @@ static int link_shell_settings(const struct shell *shell, size_t argc, char **ar break; case LINK_SHELL_OPT_MRESET_ALL: - mreset_type = LTE_LC_FACTORY_RESET_ALL; + mreset_type = LINK_FACTORY_RESET_ALL; break; case LINK_SHELL_OPT_MRESET_USER: - mreset_type = LTE_LC_FACTORY_RESET_USER; + mreset_type = LINK_FACTORY_RESET_USER; break; case 'h': @@ -2395,7 +2397,7 @@ static int link_shell_settings(const struct shell *shell, size_t argc, char **ar if (operation == LINK_OPERATION_READ) { link_sett_all_print(); } else if (operation == LINK_OPERATION_RESET || - mreset_type != LTE_LC_FACTORY_RESET_INVALID) { + mreset_type != LINK_FACTORY_RESET_INVALID) { if (operation == LINK_OPERATION_RESET) { link_sett_defaults_set(); if (SYS_MODE_PREFERRED != LINK_SYSMODE_NONE) { @@ -2403,10 +2405,10 @@ static int link_shell_settings(const struct shell *shell, size_t argc, char **ar CONFIG_LTE_MODE_PREFERENCE_VALUE); } } - if (mreset_type == LTE_LC_FACTORY_RESET_ALL) { - link_sett_modem_factory_reset(LTE_LC_FACTORY_RESET_ALL); - } else if (mreset_type == LTE_LC_FACTORY_RESET_USER) { - link_sett_modem_factory_reset(LTE_LC_FACTORY_RESET_USER); + if (mreset_type == LINK_FACTORY_RESET_ALL) { + link_sett_modem_factory_reset(mreset_type); + } else if (mreset_type == LINK_FACTORY_RESET_USER) { + link_sett_modem_factory_reset(mreset_type); } } else { goto show_usage; diff --git a/samples/cellular/modem_shell/src/utils/mosh_print.c b/samples/cellular/modem_shell/src/utils/mosh_print.c index df03b0bf8d54..3940fad3a1f4 100644 --- a/samples/cellular/modem_shell/src/utils/mosh_print.c +++ b/samples/cellular/modem_shell/src/utils/mosh_print.c @@ -15,6 +15,8 @@ #include #include #include +#include +#include #include "mosh_print.h" @@ -180,11 +182,7 @@ void mosh_print_version_info(void) /* shell_print() is not used here, because this function is called early during * application startup and the shell might not be ready yet. */ -#if defined(APP_VERSION) - printk("\nMOSH version: %s\n", STRINGIFY(APP_VERSION)); -#else - printk("\nMOSH version: unknown\n"); -#endif + printk("\nMOSH version: v%s-%s\n", NCS_VERSION_STRING, NCS_COMMIT_STRING); #if defined(BUILD_ID) printk("MOSH build id: v%s\n", STRINGIFY(BUILD_ID)); diff --git a/samples/cellular/modem_trace_backend/src/main.c b/samples/cellular/modem_trace_backend/src/main.c index 7fde3abe6714..d0bf5bc7004b 100644 --- a/samples/cellular/modem_trace_backend/src/main.c +++ b/samples/cellular/modem_trace_backend/src/main.c @@ -10,10 +10,10 @@ #include /* define callback */ -LTE_LC_ON_CFUN(cfun_hook, on_cfun, NULL); +NRF_MODEM_LIB_ON_CFUN(cfun_hook, on_cfun, NULL); /* callback implementation */ -static void on_cfun(enum lte_lc_func_mode mode, void *context) +static void on_cfun(int mode, void *context) { printk("LTE mode changed to %d\n", mode); } diff --git a/samples/cellular/modem_trace_flash/src/main.c b/samples/cellular/modem_trace_flash/src/main.c index a17e58915d9a..6e8dfe6869d0 100644 --- a/samples/cellular/modem_trace_flash/src/main.c +++ b/samples/cellular/modem_trace_flash/src/main.c @@ -25,10 +25,10 @@ LOG_MODULE_REGISTER(modem_trace_flash_sample, CONFIG_MODEM_TRACE_FLASH_SAMPLE_LO static const struct device *const uart_dev = DEVICE_DT_GET(UART1_DT_NODE); -LTE_LC_ON_CFUN(cfun_hook, on_cfun, NULL); +NRF_MODEM_LIB_ON_CFUN(cfun_hook, on_cfun, NULL); /* Callback for when modem functional mode is changed */ -static void on_cfun(enum lte_lc_func_mode mode, void *context) +static void on_cfun(int mode, void *context) { LOG_INF("LTE mode changed to %d\n", mode); } diff --git a/samples/cellular/nrf_cloud_multi_service/Kconfig b/samples/cellular/nrf_cloud_multi_service/Kconfig index 5baee24dba93..e22f5e414eb4 100644 --- a/samples/cellular/nrf_cloud_multi_service/Kconfig +++ b/samples/cellular/nrf_cloud_multi_service/Kconfig @@ -245,6 +245,13 @@ config SEND_ONLINE_ALERT Enable this to demonstrate the alert feature of nRF Cloud. Reception of this alert indicates the device has rebooted. +config POST_PROVISIONING_INTERVAL_M + int "Delay in minutes between provisioning checks once connected" + default 30 + help + Use a slower rate to check for provisioning after we have successfully connected. + Until then use CONFIG_NRF_PROVISIONING_INTERVAL_S. + if NRF_CLOUD_COAP menuconfig COAP_FOTA diff --git a/samples/cellular/nrf_cloud_multi_service/Kconfig.sysbuild b/samples/cellular/nrf_cloud_multi_service/Kconfig.sysbuild index d907c91b3dd1..106113037c37 100644 --- a/samples/cellular/nrf_cloud_multi_service/Kconfig.sysbuild +++ b/samples/cellular/nrf_cloud_multi_service/Kconfig.sysbuild @@ -7,4 +7,8 @@ config WIFI_NRF70 default y if BOARD_THINGY91X_NRF9151_NS +choice WIFI_NRF70_OPER_MODES + default WIFI_NRF70_SCAN_ONLY if BOARD_THINGY91X_NRF9151_NS +endchoice + source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/cellular/nrf_cloud_multi_service/README.rst b/samples/cellular/nrf_cloud_multi_service/README.rst index e66f5924fa08..01d47a1dda77 100644 --- a/samples/cellular/nrf_cloud_multi_service/README.rst +++ b/samples/cellular/nrf_cloud_multi_service/README.rst @@ -797,14 +797,21 @@ The device is identified using its UUID rather than its IMEI, since both overlay Building with nRF7002 Wi-Fi scanning support ============================================ -To build the sample with Wi-Fi scanning support for the nRF7002 EK shield attached to an nRF91xx DK, use the ``-DSHIELD=nrf7002ek``, ``-DSB_CONF_FILE=sysbuild_nrf700x-wifi-scan.conf``, and ``-DEXTRA_CONF_FILE=overlay-nrf7002ek-wifi-scan-only`` options. +To build the sample with Wi-Fi scanning support for the nRF7002 EK shield attached to an nRF91xx DK, use the ``-DSHIELD=nrf7002ek_nrf7000``, ``-DSB_CONF_FILE=sysbuild_nrf700x-wifi-scan.conf``, and ``-DEXTRA_CONF_FILE=overlay-nrf7002ek-wifi-scan-only`` options. This enables the Wi-Fi location tracking method automatically. .. parsed-literal:: :class: highlight - west build -p -b *board_target* -- -DSHIELD=nrf7002ek -DSB_CONF_FILE="sysbuild_nrf700x-wifi-scan.conf" -DEXTRA_CONF_FILE="overlay-nrf7002ek-wifi-scan-only.conf" + west build -p -b *board_target* -- -DSHIELD=nrf7002ek_nrf7000 -DSB_CONF_FILE="sysbuild_nrf700x-wifi-scan.conf" -DEXTRA_CONF_FILE="overlay-nrf7002ek-wifi-scan-only.conf" + +.. note:: + + The ``nrf7002ek_nrf7000`` shield is used here, rather than the ``nrf7002ek`` shield, to put the nRF7002 EK into nRF7000 emulation mode. + This is required in order to use scan-only mode. + + To build the sample with Wi-Fi connectivity instead, see :ref:`nrf_cloud_multi_service_building_lte`. |board_target| diff --git a/samples/cellular/nrf_cloud_multi_service/boards/thingy91x_nrf9151_ns.overlay b/samples/cellular/nrf_cloud_multi_service/boards/thingy91x_nrf9151_ns.overlay index 4e6d3fd9f267..359ed5ae667a 100644 --- a/samples/cellular/nrf_cloud_multi_service/boards/thingy91x_nrf9151_ns.overlay +++ b/samples/cellular/nrf_cloud_multi_service/boards/thingy91x_nrf9151_ns.overlay @@ -20,3 +20,8 @@ &bme680 { status = "okay"; }; + +/* Switch to nrf7000 emulation so that scan-only mode is used. */ +&nrf70 { + compatible = "nordic,nrf7000-spi"; +}; diff --git a/samples/cellular/nrf_cloud_multi_service/overlay_coap.conf b/samples/cellular/nrf_cloud_multi_service/overlay_coap.conf index 25b10ca1fa2e..cda456fa5991 100644 --- a/samples/cellular/nrf_cloud_multi_service/overlay_coap.conf +++ b/samples/cellular/nrf_cloud_multi_service/overlay_coap.conf @@ -13,7 +13,8 @@ CONFIG_NEWLIB_LIBC_NANO=n # This is strictly for demo purposes. CONFIG_SENSOR_SAMPLE_INTERVAL_SECONDS=120 CONFIG_LOCATION_TRACKING_SAMPLE_INTERVAL_SECONDS=360 -CONFIG_COAP_FOTA_JOB_CHECK_RATE_MINUTES=5 +CONFIG_COAP_FOTA_JOB_CHECK_RATE_MINUTES=2 +CONFIG_COAP_SHADOW_CHECK_RATE_SECONDS=120 # Logs CONFIG_LOG=y @@ -45,7 +46,8 @@ CONFIG_NET_SOCKETS_OFFLOAD_PRIORITY=40 CONFIG_COAP_CLIENT_BLOCK_SIZE=1024 CONFIG_COAP_CLIENT_STACK_SIZE=2048 CONFIG_COAP_CLIENT_THREAD_PRIORITY=0 -CONFIG_COAP_EXTENDED_OPTIONS_LEN_VALUE=64 +# The extended options length must be increased to perform FOTA and P-GPS downloads over CoAP. +CONFIG_COAP_EXTENDED_OPTIONS_LEN_VALUE=192 # Not compatible with ground-fix CONFIG_ZCBOR_CANONICAL=n diff --git a/samples/cellular/nrf_cloud_multi_service/overlay_nrf700x_wifi_coap_no_lte.conf b/samples/cellular/nrf_cloud_multi_service/overlay_nrf700x_wifi_coap_no_lte.conf index aebbff0a463b..de7af63c66f7 100644 --- a/samples/cellular/nrf_cloud_multi_service/overlay_nrf700x_wifi_coap_no_lte.conf +++ b/samples/cellular/nrf_cloud_multi_service/overlay_nrf700x_wifi_coap_no_lte.conf @@ -118,7 +118,7 @@ CONFIG_FLASH_PAGE_LAYOUT=y CONFIG_FLASH_MAP=y ## Enable Wi-Fi networking and native networking stack -# Note: WPA_SUPP requires 24kB of unused RAM in the final build. +# Note: WIFI_NM_WPA_SUPPLICANT requires 24kB of unused RAM in the final build. # Memory allocations in this overlay are fine-tuned with that fact in mind. CONFIG_WIFI_NM_WPA_SUPPLICANT=y CONFIG_NET_L2_ETHERNET=y diff --git a/samples/cellular/nrf_cloud_multi_service/overlay_nrf700x_wifi_mqtt_no_lte.conf b/samples/cellular/nrf_cloud_multi_service/overlay_nrf700x_wifi_mqtt_no_lte.conf index cbbf45937c88..5336af8c40ae 100644 --- a/samples/cellular/nrf_cloud_multi_service/overlay_nrf700x_wifi_mqtt_no_lte.conf +++ b/samples/cellular/nrf_cloud_multi_service/overlay_nrf700x_wifi_mqtt_no_lte.conf @@ -120,7 +120,7 @@ CONFIG_FLASH_PAGE_LAYOUT=y CONFIG_FLASH_MAP=y ## Enable Wi-Fi networking and native networking stack -# Note: WPA_SUPP requires 24kB of unused RAM in the final build. +# Note: WIFI_NM_WPA_SUPPLICANT requires 24kB of unused RAM in the final build. # Memory allocations in this overlay are fine-tuned with that fact in mind. CONFIG_WIFI_NM_WPA_SUPPLICANT=y CONFIG_NET_L2_ETHERNET=y diff --git a/samples/cellular/nrf_cloud_multi_service/sample.yaml b/samples/cellular/nrf_cloud_multi_service/sample.yaml index d2cd8f8143f0..1564e95c3f17 100644 --- a/samples/cellular/nrf_cloud_multi_service/sample.yaml +++ b/samples/cellular/nrf_cloud_multi_service/sample.yaml @@ -70,7 +70,7 @@ tests: - nrf9151dk/nrf9151/ns - nrf9160dk/nrf9160/ns - nrf9161dk/nrf9161/ns - extra_args: EXTRA_CONF_FILE="overlay_coap.conf;overlay-coap_nrf_provisioning.conf" + extra_args: EXTRA_CONF_FILE="overlay-coap_nrf_provisioning.conf;overlay_coap.conf" nrf_cloud_multi_service_SNIPPET=nrf91-modem-trace-uart tags: ci_build sysbuild ci_samples_cellular sample.cellular.nrf7002ek_wifi.scan: @@ -94,7 +94,7 @@ tests: integration_platforms: - nrf5340dk/nrf5340/cpuapp/ns platform_allow: nrf5340dk/nrf5340/cpuapp/ns - extra_args: nrf_cloud_multi_service_SHIELD=nrf7002ek_nrf7000 + extra_args: nrf_cloud_multi_service_SHIELD=nrf7002ek EXTRA_CONF_FILE="overlay_nrf700x_wifi_mqtt_no_lte.conf" SB_CONF_FILE="sysbuild_nrf700x-wifi-conn.conf" tags: ci_build sysbuild ci_samples_cellular diff --git a/samples/cellular/nrf_cloud_multi_service/src/cloud_connection.c b/samples/cellular/nrf_cloud_multi_service/src/cloud_connection.c index 8a024a9894b9..885662550942 100644 --- a/samples/cellular/nrf_cloud_multi_service/src/cloud_connection.c +++ b/samples/cellular/nrf_cloud_multi_service/src/cloud_connection.c @@ -16,6 +16,7 @@ #include #include "fota_support_coap.h" #endif +#include #include "cloud_connection.h" #include "provisioning_support.h" @@ -143,6 +144,12 @@ static void cloud_ready(void) /* Notify that the nRF Cloud connection is ready for use. */ k_event_post(&cloud_events, CLOUD_READY); LOG_DBG("Setting CLOUD_READY"); + + if (IS_ENABLED(CONFIG_NRF_PROVISIONING)) { + LOG_INF("Reducing provisioning check interval to %d minutes", + CONFIG_POST_PROVISIONING_INTERVAL_M); + nrf_provisioning_set_interval(CONFIG_POST_PROVISIONING_INTERVAL_M * SEC_PER_MIN); + } } /* A callback that the application may register in order to handle custom device messages. @@ -614,10 +621,22 @@ static void check_credentials(void) LOG_WRN("nRF Cloud credentials are not installed. " "Please install and reboot."); } - k_sleep(K_FOREVER); - } else if (status) { - LOG_ERR("Error while checking for credentials: %d. Proceeding anyway.", status); + } else if (status == -ENOPROTOOPT) { + LOG_WRN("Required root CA certificate is missing."); + } else { + if (status) { + LOG_ERR("Error while checking for credentials: %d. Proceeding anyway.", + status); + } + return; + } + if (!IS_ENABLED(CONFIG_NRF_PROVISIONING)) { + /* Save power since credentials will not work, and we are not using the + * cloud-based nrf_provisioning service. + */ + conn_mgr_all_if_down(true); } + k_sleep(K_FOREVER); } void cloud_connection_thread_fn(void) diff --git a/samples/cellular/nrf_cloud_multi_service/src/fota_support_coap.c b/samples/cellular/nrf_cloud_multi_service/src/fota_support_coap.c index 0dd7b686a7bc..b05ada0c7693 100644 --- a/samples/cellular/nrf_cloud_multi_service/src/fota_support_coap.c +++ b/samples/cellular/nrf_cloud_multi_service/src/fota_support_coap.c @@ -81,8 +81,8 @@ int coap_fota_thread_fn(void) */ err = nrf_cloud_fota_poll_process(&ctx); if (err == -EAGAIN) { - LOG_DBG("Retrying in %d minute(s)", - CONFIG_COAP_FOTA_JOB_CHECK_RATE_MINUTES); + LOG_INF("Checking for FOTA job in %d seconds", + CONFIG_COAP_FOTA_JOB_CHECK_RATE_MINUTES * SEC_PER_MIN); k_sleep(K_MINUTES(CONFIG_COAP_FOTA_JOB_CHECK_RATE_MINUTES)); continue; } diff --git a/samples/cellular/nrf_cloud_rest_cell_location/src/main.c b/samples/cellular/nrf_cloud_rest_cell_location/src/main.c index 2f50af7904a2..21b6e76ef368 100644 --- a/samples/cellular/nrf_cloud_rest_cell_location/src/main.c +++ b/samples/cellular/nrf_cloud_rest_cell_location/src/main.c @@ -581,7 +581,7 @@ static void check_credentials(void) { int err = nrf_cloud_credentials_configured_check(); - if (err == -ENOTSUP) { + if ((err == -ENOTSUP) || (err == -ENOPROTOOPT)) { LOG_ERR("Required nRF Cloud credentials were not found"); LOG_INF("Install credentials and then reboot the device"); k_sleep(K_FOREVER); diff --git a/samples/cellular/nrf_cloud_rest_device_message/src/main.c b/samples/cellular/nrf_cloud_rest_device_message/src/main.c index bd1d276090f6..0216dab87b75 100644 --- a/samples/cellular/nrf_cloud_rest_device_message/src/main.c +++ b/samples/cellular/nrf_cloud_rest_device_message/src/main.c @@ -248,7 +248,7 @@ static bool cred_check(struct nrf_cloud_credentials_status *const cs) * - a CA for the TLS connections * - a private key to sign the JWT */ - return (cs->ca && cs->prv_key); + return (cs->ca && cs->ca_aws && cs->prv_key); } static void await_credentials(void) diff --git a/samples/cellular/nrf_cloud_rest_fota/src/main.c b/samples/cellular/nrf_cloud_rest_fota/src/main.c index 85ff9b845080..8645cfd349e2 100644 --- a/samples/cellular/nrf_cloud_rest_fota/src/main.c +++ b/samples/cellular/nrf_cloud_rest_fota/src/main.c @@ -473,6 +473,9 @@ static void check_credentials(void) LOG_ERR("Required nRF Cloud credentials were not found"); LOG_INF("Install credentials and then reboot the device"); k_sleep(K_FOREVER); + } else if (err == -ENOPROTOOPT) { + LOG_ERR("Required root CA certificate is missing."); + k_sleep(K_FOREVER); } else if (err) { LOG_ERR("nrf_cloud_credentials_configured_check() failed, error: %d", err); LOG_WRN("Continuing without verifying that credentials are installed"); @@ -552,7 +555,7 @@ int main(void) /* Wait for the configured duration or a button press */ (void)nrf_cloud_rest_disconnect(&rest_ctx); - LOG_INF("Retrying in %d minute(s) or when button %d is pressed", + LOG_INF("Checking for FOTA job in %d minute(s) or when button %d is pressed", fota_check_rate, CONFIG_REST_FOTA_BUTTON_EVT_NUM); (void)k_sem_take(&button_press_sem, K_MINUTES(fota_check_rate)); diff --git a/samples/cellular/smp_svr/sysbuild.conf b/samples/cellular/smp_svr/sysbuild.conf new file mode 100644 index 000000000000..9ef3c5f38dd7 --- /dev/null +++ b/samples/cellular/smp_svr/sysbuild.conf @@ -0,0 +1,8 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +SB_CONFIG_BOOTLOADER_MCUBOOT=y +SB_CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY=n diff --git a/samples/cellular/smp_svr/sysbuild/mcuboot/prj.conf b/samples/cellular/smp_svr/sysbuild/mcuboot/prj.conf new file mode 100644 index 000000000000..309eb53b45bc --- /dev/null +++ b/samples/cellular/smp_svr/sysbuild/mcuboot/prj.conf @@ -0,0 +1,37 @@ +CONFIG_MAIN_STACK_SIZE=10240 +CONFIG_MBEDTLS_CFG_FILE="mcuboot-mbedtls-cfg.h" + +CONFIG_BOOT_SWAP_SAVE_ENCTLV=n +CONFIG_BOOT_ENCRYPT_IMAGE=n + +CONFIG_BOOT_UPGRADE_ONLY=n +CONFIG_BOOT_BOOTSTRAP=n + +### mbedTLS has its own heap +# CONFIG_HEAP_MEM_POOL_SIZE is not set + +### We never want Zephyr's copy of tinycrypt. If tinycrypt is needed, +### MCUboot has its own copy in tree. +# CONFIG_TINYCRYPT is not set +# CONFIG_TINYCRYPT_ECC_DSA is not set +# CONFIG_TINYCRYPT_SHA256 is not set + +CONFIG_FLASH=y +CONFIG_FPROTECT=y + +### Various Zephyr boards enable features that we don't want. +# CONFIG_BT is not set +# CONFIG_BT_CTLR is not set +# CONFIG_I2C is not set + +CONFIG_LOG=y +CONFIG_LOG_MODE_MINIMAL=y # former CONFIG_MODE_MINIMAL +### Ensure Zephyr logging changes don't use more resources +CONFIG_LOG_DEFAULT_LEVEL=0 +### Use info log level by default +CONFIG_MCUBOOT_LOG_LEVEL_INF=y +### Decrease footprint by ~4 KB in comparison to CBPRINTF_COMPLETE=y +CONFIG_CBPRINTF_NANO=y +CONFIG_NRF_RTC_TIMER_USER_CHAN_COUNT=0 +### Use the minimal C library to reduce flash usage +CONFIG_MINIMAL_LIBC=y diff --git a/samples/cellular/udp/sample.yaml b/samples/cellular/udp/sample.yaml index 384456d45cce..b5fa93c42f49 100644 --- a/samples/cellular/udp/sample.yaml +++ b/samples/cellular/udp/sample.yaml @@ -9,6 +9,7 @@ tests: - nrf9160dk/nrf9160/ns - nrf9161dk/nrf9161/ns - thingy91/nrf9160/ns + - thingy91x/nrf9151/ns platform_allow: - nrf9151dk/nrf9151/ns - nrf9160dk/nrf9160/ns diff --git a/samples/cellular/uicc_lwm2m/CMakeLists.txt b/samples/cellular/uicc_lwm2m/CMakeLists.txt new file mode 100644 index 000000000000..576ad099b9be --- /dev/null +++ b/samples/cellular/uicc_lwm2m/CMakeLists.txt @@ -0,0 +1,16 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +cmake_minimum_required(VERSION 3.20.0) + +find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) +project(uicc_lwm2m) + +# NORDIC SDK APP START +target_sources(app PRIVATE src/main.c) +# NORDIC SDK APP END + +zephyr_include_directories(src) diff --git a/samples/cellular/uicc_lwm2m/README.rst b/samples/cellular/uicc_lwm2m/README.rst new file mode 100644 index 000000000000..a521dd045e47 --- /dev/null +++ b/samples/cellular/uicc_lwm2m/README.rst @@ -0,0 +1,87 @@ +.. _uicc_lwm2m_sample: + +Cellular: UICC LwM2M +#################### + +.. contents:: + :local: + :depth: 2 + +The UICC LwM2M sample demonstrates how to use the :ref:`lib_uicc_lwm2m` library on an nRF91 Series device. + +Requirements +************ + +The sample supports the following development kits: + +.. table-from-sample-yaml:: + +.. include:: /includes/tfm.txt + +Overview +******** + +The UICC LwM2M sample turns on UICC and tries to read the LwM2M bootstrap data record from SIM. + +.. note:: + + This sample requires a SIM with LwM2M bootstrap data. + +Configuration +************* + +|config| + +.. include:: /libraries/modem/nrf_modem_lib/nrf_modem_lib_trace.rst + :start-after: modem_lib_sending_traces_UART_start + :end-before: modem_lib_sending_traces_UART_end + +Building and running +******************** + +.. |sample path| replace:: :file:`samples/cellular/uicc_lwm2m` + +.. include:: /includes/build_and_run_ns.txt + +Testing +======= + +|test_sample| + +1. |connect_kit| +#. |connect_terminal| +#. Observe that the sample starts and shows the following output from the device. + This is an example, and the output need not be identical to your observed output. + + .. code-block:: console + + UICC LwM2M sample started + LwM2M bootstrap data found, length: 256 + + 0000 00 01 00 36 00 00 00 00 31 08 00 2e c8 00 25 63 ...6.... 1.....%c + 0010 6f 61 70 3a 2f 2f 6c 65 73 68 61 6e 2e 65 63 6c oap://le shan.ecl + 0020 69 70 73 65 70 72 6f 6a 65 63 74 73 2e 69 6f 3a ipseproj ects.io: + 0030 35 37 38 33 c1 01 01 c1 02 03 ff ff ff ff ff ff 5783.... ........ + 0040 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ........ ........ + 0050 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ........ ........ + 0060 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ........ ........ + 0070 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ........ ........ + 0080 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ........ ........ + 0090 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ........ ........ + 00a0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ........ ........ + 00b0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ........ ........ + 00c0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ........ ........ + 00d0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ........ ........ + 00e0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ........ ........ + 00f0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ........ ........ + +Dependencies +************ + +This sample uses the following `sdk-nrfxlib`_ library: + +* :ref:`nrfxlib:nrf_modem` + +The sample also uses the following secure firmware component: + +* :ref:`Trusted Firmware-M ` diff --git a/samples/cellular/uicc_lwm2m/prj.conf b/samples/cellular/uicc_lwm2m/prj.conf new file mode 100644 index 000000000000..fe2418ba2ba5 --- /dev/null +++ b/samples/cellular/uicc_lwm2m/prj.conf @@ -0,0 +1,18 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# General config +CONFIG_SERIAL=y + +# Modem library +CONFIG_NRF_MODEM_LIB=y + +# UICC LwM2M library +CONFIG_UICC_LWM2M=y + +# Heap and stacks +CONFIG_HEAP_MEM_POOL_SIZE=1024 +CONFIG_MAIN_STACK_SIZE=1536 diff --git a/samples/cellular/uicc_lwm2m/sample.yaml b/samples/cellular/uicc_lwm2m/sample.yaml new file mode 100644 index 000000000000..3f5cc6059882 --- /dev/null +++ b/samples/cellular/uicc_lwm2m/sample.yaml @@ -0,0 +1,18 @@ +sample: + name: UICC LwM2M sample +tests: + sample.cellular.uicc_lwm2m: + sysbuild: true + build_only: true + platform_allow: + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + - thingy91/nrf9160/ns + - thingy91x/nrf9151/ns + integration_platforms: + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + - thingy91/nrf9160/ns + tags: ci_build sysbuild ci_samples_cellular diff --git a/samples/cellular/uicc_lwm2m/src/main.c b/samples/cellular/uicc_lwm2m/src/main.c new file mode 100644 index 000000000000..47dd620b1f94 --- /dev/null +++ b/samples/cellular/uicc_lwm2m/src/main.c @@ -0,0 +1,98 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include + +#include +#include +#include +#include + +uint8_t buffer[UICC_RECORD_BUFFER_MAX]; + +static void printk_hexdump(char *data, int len) +{ + static const char hexchars[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', + 'a', 'b', 'c', 'd', 'e', 'f' }; + int pos = 0; + + while (pos < len) { + char hexbuf[256]; + char *cur = hexbuf; + int i; + + /* Dump offset */ + cur += snprintf(cur, 20, "%04x ", pos); + + /* Dump bytes as hex */ + for (i = 0; i < 16 && pos + i < len; i++) { + *cur++ = hexchars[(data[pos + i] & 0xf0) >> 4]; + *cur++ = hexchars[data[pos + i] & 0x0f]; + *cur++ = ' '; + if (i == 7) { + *cur++ = ' '; + } + } + + while (cur < hexbuf + 58) { + /* Fill it up with space to ascii column */ + *cur++ = ' '; + } + + /* Dump bytes as text */ + for (i = 0; i < 16 && pos + i < len; i++) { + if (isprint((int)data[pos + i])) { + *cur++ = data[pos + i]; + } else { + *cur++ = '.'; + } + if (i == 7) { + *cur++ = ' '; + } + } + + pos += i; + *cur = 0; + + printk("%s\n", hexbuf); + } +} + +int main(void) +{ + int ret; + + printk("UICC LwM2M sample started\n"); + + ret = nrf_modem_lib_init(); + if (ret) { + printk("Modem library initialization failed, error: %d\n", ret); + return -1; + } + + ret = nrf_modem_at_printf("AT+CFUN=41"); + if (ret) { + printk("Activate UICC failed, error: %d\n", ret); + return -1; + } + + ret = uicc_lwm2m_bootstrap_read(buffer, sizeof(buffer)); + if (ret > 0) { + printk("LwM2M bootstrap data found, length: %d\n\n", ret); + printk_hexdump(buffer, ret); + } else { + printk("Failed to read data, error: %d\n", -ret); + } + + ret = nrf_modem_lib_shutdown(); + if (ret) { + printk("Modem library shutdown failed, error: %d\n", ret); + return -1; + } + + return 0; +} diff --git a/samples/crypto/aes_cbc/sample.yaml b/samples/crypto/aes_cbc/sample.yaml index 16017a11f6dc..02a5a7f371e1 100644 --- a/samples/crypto/aes_cbc/sample.yaml +++ b/samples/crypto/aes_cbc/sample.yaml @@ -31,7 +31,7 @@ tests: tags: introduction psa cracen sysbuild ci_samples_crypto platform_allow: > nrf54l15dk/nrf54l15/cpuapp nrf54l15pdk/nrf54l15/cpuapp - nrf54l15pdk/nrf54l15/cpuapp/ns + nrf54l15dk/nrf54l15/cpuapp/ns harness: console harness_config: type: multi_line @@ -40,7 +40,7 @@ tests: integration_platforms: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15pdk/nrf54l15/cpuapp - - nrf54l15pdk/nrf54l15/cpuapp/ns + - nrf54l15dk/nrf54l15/cpuapp/ns sample.aes_cbc.cracen.crypto_service: sysbuild: true tags: introduction psa cracen sysbuild crypto ci_samples_crypto diff --git a/samples/crypto/aes_ccm/sample.yaml b/samples/crypto/aes_ccm/sample.yaml index 715409021365..17347dff765d 100644 --- a/samples/crypto/aes_ccm/sample.yaml +++ b/samples/crypto/aes_ccm/sample.yaml @@ -31,7 +31,7 @@ tests: tags: introduction psa cracen sysbuild ci_samples_crypto platform_allow: > nrf54l15dk/nrf54l15/cpuapp nrf54l15pdk/nrf54l15/cpuapp - nrf54l15pdk/nrf54l15/cpuapp/ns + nrf54l15dk/nrf54l15/cpuapp/ns harness: console harness_config: type: multi_line @@ -40,7 +40,7 @@ tests: integration_platforms: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15pdk/nrf54l15/cpuapp - - nrf54l15pdk/nrf54l15/cpuapp/ns + - nrf54l15dk/nrf54l15/cpuapp/ns sample.aes_ccm.cracen.crypto_service: sysbuild: true tags: introduction psa cracen sysbuild crypto ci_samples_crypto diff --git a/samples/crypto/aes_ctr/sample.yaml b/samples/crypto/aes_ctr/sample.yaml index d9996b433f33..4a451f94b0e2 100644 --- a/samples/crypto/aes_ctr/sample.yaml +++ b/samples/crypto/aes_ctr/sample.yaml @@ -31,7 +31,7 @@ tests: tags: introduction psa cracen sysbuild ci_samples_crypto platform_allow: > nrf54l15dk/nrf54l15/cpuapp nrf54l15pdk/nrf54l15/cpuapp - nrf54l15pdk/nrf54l15/cpuapp/ns + nrf54l15dk/nrf54l15/cpuapp/ns harness: console harness_config: type: multi_line @@ -40,7 +40,7 @@ tests: integration_platforms: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15pdk/nrf54l15/cpuapp - - nrf54l15pdk/nrf54l15/cpuapp/ns + - nrf54l15dk/nrf54l15/cpuapp/ns sample.aes_ctr.cracen.crypto_service: sysbuild: true tags: introduction psa cracen sysbuild crypto ci_samples_crypto diff --git a/samples/crypto/aes_gcm/sample.yaml b/samples/crypto/aes_gcm/sample.yaml index c31f600eb813..634f1bd47039 100644 --- a/samples/crypto/aes_gcm/sample.yaml +++ b/samples/crypto/aes_gcm/sample.yaml @@ -42,7 +42,7 @@ tests: platform_allow: > nrf54l15dk/nrf54l15/cpuapp nrf54l15pdk/nrf54l15/cpuapp - nrf54l15pdk/nrf54l15/cpuapp/ns + nrf54l15dk/nrf54l15/cpuapp/ns harness: console harness_config: type: multi_line @@ -51,7 +51,7 @@ tests: integration_platforms: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15pdk/nrf54l15/cpuapp - - nrf54l15pdk/nrf54l15/cpuapp/ns + - nrf54l15dk/nrf54l15/cpuapp/ns sample.aes_gcm.cracen.crypto_service: sysbuild: true tags: introduction psa cracen sysbuild crypto ci_samples_crypto diff --git a/samples/crypto/chachapoly/sample.yaml b/samples/crypto/chachapoly/sample.yaml index f9bc32e91e6e..4aec45d8fe60 100644 --- a/samples/crypto/chachapoly/sample.yaml +++ b/samples/crypto/chachapoly/sample.yaml @@ -32,7 +32,7 @@ tests: platform_allow: > nrf54l15dk/nrf54l15/cpuapp nrf54l15pdk/nrf54l15/cpuapp - nrf54l15pdk/nrf54l15/cpuapp/ns + nrf54l15dk/nrf54l15/cpuapp/ns harness: console harness_config: type: multi_line @@ -41,7 +41,7 @@ tests: integration_platforms: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15pdk/nrf54l15/cpuapp - - nrf54l15pdk/nrf54l15/cpuapp/ns + - nrf54l15dk/nrf54l15/cpuapp/ns sample.chachapoly.cracen.crypto_service: sysbuild: true tags: introduction psa cracen sysbuild crypto ci_samples_crypto diff --git a/samples/crypto/ecdh/sample.yaml b/samples/crypto/ecdh/sample.yaml index 433df1a42088..44058365a1ec 100644 --- a/samples/crypto/ecdh/sample.yaml +++ b/samples/crypto/ecdh/sample.yaml @@ -31,7 +31,7 @@ tests: tags: introduction psa cracen sysbuild ci_samples_crypto platform_allow: > nrf54l15dk/nrf54l15/cpuapp nrf54l15pdk/nrf54l15/cpuapp - nrf54l15pdk/nrf54l15/cpuapp/ns + nrf54l15dk/nrf54l15/cpuapp/ns harness: console harness_config: type: multi_line @@ -40,7 +40,7 @@ tests: integration_platforms: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15pdk/nrf54l15/cpuapp - - nrf54l15pdk/nrf54l15/cpuapp/ns + - nrf54l15dk/nrf54l15/cpuapp/ns sample.ecdh.cracen.crypto_service: sysbuild: true tags: introduction psa cracen sysbuild crypto ci_samples_crypto diff --git a/samples/crypto/ecdsa/sample.yaml b/samples/crypto/ecdsa/sample.yaml index 229c82b70369..9a31e9a0f506 100644 --- a/samples/crypto/ecdsa/sample.yaml +++ b/samples/crypto/ecdsa/sample.yaml @@ -31,7 +31,7 @@ tests: platform_allow: > nrf54l15dk/nrf54l15/cpuapp nrf54l15pdk/nrf54l15/cpuapp - nrf54l15pdk/nrf54l15/cpuapp/ns + nrf54l15dk/nrf54l15/cpuapp/ns harness: console harness_config: type: multi_line @@ -40,7 +40,7 @@ tests: integration_platforms: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15pdk/nrf54l15/cpuapp - - nrf54l15pdk/nrf54l15/cpuapp/ns + - nrf54l15dk/nrf54l15/cpuapp/ns sample.ecdsa.cracen.crypto_service: sysbuild: true tags: introduction psa cracen sysbuild crypto ci_samples_crypto diff --git a/samples/crypto/ecjpake/sample.yaml b/samples/crypto/ecjpake/sample.yaml index dadf1cd9f838..22505ffcec41 100644 --- a/samples/crypto/ecjpake/sample.yaml +++ b/samples/crypto/ecjpake/sample.yaml @@ -37,7 +37,7 @@ tests: platform_allow: > nrf54l15dk/nrf54l15/cpuapp nrf54l15pdk/nrf54l15/cpuapp - nrf54l15pdk/nrf54l15/cpuapp/ns + nrf54l15dk/nrf54l15/cpuapp/ns harness: console harness_config: type: multi_line @@ -46,7 +46,7 @@ tests: integration_platforms: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15pdk/nrf54l15/cpuapp - - nrf54l15pdk/nrf54l15/cpuapp/ns + - nrf54l15dk/nrf54l15/cpuapp/ns sample.ecjpake.cracen.crypto_service: sysbuild: true tags: introduction psa cracen sysbuild crypto ci_samples_crypto diff --git a/samples/crypto/eddsa/sample.yaml b/samples/crypto/eddsa/sample.yaml index 9da513f14c02..646d7f338632 100644 --- a/samples/crypto/eddsa/sample.yaml +++ b/samples/crypto/eddsa/sample.yaml @@ -30,7 +30,7 @@ tests: tags: introduction psa cracen sysbuild ci_samples_crypto platform_allow: > nrf54l15dk/nrf54l15/cpuapp nrf54l15pdk/nrf54l15/cpuapp - nrf54l15pdk/nrf54l15/cpuapp/ns + nrf54l15dk/nrf54l15/cpuapp/ns harness: console harness_config: type: multi_line @@ -39,7 +39,7 @@ tests: integration_platforms: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15pdk/nrf54l15/cpuapp - - nrf54l15pdk/nrf54l15/cpuapp/ns + - nrf54l15dk/nrf54l15/cpuapp/ns sample.eddsa.cracen.crypto_service: sysbuild: true tags: introduction psa cracen sysbuild crypto ci_samples_crypto diff --git a/samples/crypto/hkdf/sample.yaml b/samples/crypto/hkdf/sample.yaml index bb7e8f559b90..a5fda315d05e 100644 --- a/samples/crypto/hkdf/sample.yaml +++ b/samples/crypto/hkdf/sample.yaml @@ -29,7 +29,7 @@ tests: tags: introduction psa cracen sysbuild ci_samples_crypto platform_allow: > nrf54l15dk/nrf54l15/cpuapp nrf54l15pdk/nrf54l15/cpuapp - nrf54l15pdk/nrf54l15/cpuapp/ns + nrf54l15dk/nrf54l15/cpuapp/ns harness: console harness_config: type: multi_line @@ -38,7 +38,7 @@ tests: integration_platforms: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15pdk/nrf54l15/cpuapp - - nrf54l15pdk/nrf54l15/cpuapp/ns + - nrf54l15dk/nrf54l15/cpuapp/ns sample.hkdf.cracen.crypto_service: sysbuild: true tags: introduction psa cracen sysbuild crypto ci_samples_crypto diff --git a/samples/crypto/hmac/sample.yaml b/samples/crypto/hmac/sample.yaml index d75a2e911e43..fc00837658fa 100644 --- a/samples/crypto/hmac/sample.yaml +++ b/samples/crypto/hmac/sample.yaml @@ -31,7 +31,7 @@ tests: tags: introduction psa cracen sysbuild ci_samples_crypto platform_allow: > nrf54l15dk/nrf54l15/cpuapp nrf54l15pdk/nrf54l15/cpuapp - nrf54l15pdk/nrf54l15/cpuapp/ns + nrf54l15dk/nrf54l15/cpuapp/ns harness: console harness_config: type: multi_line @@ -40,7 +40,7 @@ tests: integration_platforms: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15pdk/nrf54l15/cpuapp - - nrf54l15pdk/nrf54l15/cpuapp/ns + - nrf54l15dk/nrf54l15/cpuapp/ns sample.hmac.cracen.crypto_service: sysbuild: true tags: introduction psa cracen sysbuild crypto ci_samples_crypto diff --git a/samples/crypto/pbkdf2/sample.yaml b/samples/crypto/pbkdf2/sample.yaml index 90680ba950ad..6be20e16a86a 100644 --- a/samples/crypto/pbkdf2/sample.yaml +++ b/samples/crypto/pbkdf2/sample.yaml @@ -29,7 +29,7 @@ tests: tags: introduction psa cracen sysbuild ci_samples_crypto platform_allow: > nrf54l15dk/nrf54l15/cpuapp nrf54l15pdk/nrf54l15/cpuapp - nrf54l15pdk/nrf54l15/cpuapp/ns + nrf54l15dk/nrf54l15/cpuapp/ns harness: console harness_config: type: multi_line @@ -38,7 +38,7 @@ tests: integration_platforms: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15pdk/nrf54l15/cpuapp - - nrf54l15pdk/nrf54l15/cpuapp/ns + - nrf54l15dk/nrf54l15/cpuapp/ns sample.pbkdf2.cracen.crypto_service: sysbuild: true tags: introduction psa cracen sysbuild crypto ci_samples_crypto diff --git a/samples/crypto/persistent_key_usage/sample.yaml b/samples/crypto/persistent_key_usage/sample.yaml index 95c4edb61d11..4f437b91360a 100644 --- a/samples/crypto/persistent_key_usage/sample.yaml +++ b/samples/crypto/persistent_key_usage/sample.yaml @@ -33,7 +33,7 @@ tests: platform_allow: > nrf54l15dk/nrf54l15/cpuapp nrf54l15pdk/nrf54l15/cpuapp - nrf54l15pdk/nrf54l15/cpuapp/ns + nrf54l15dk/nrf54l15/cpuapp/ns harness: console harness_config: type: multi_line @@ -42,4 +42,4 @@ tests: integration_platforms: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15pdk/nrf54l15/cpuapp - - nrf54l15pdk/nrf54l15/cpuapp/ns + - nrf54l15dk/nrf54l15/cpuapp/ns diff --git a/samples/crypto/psa_tls/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.conf b/samples/crypto/psa_tls/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf similarity index 100% rename from samples/crypto/psa_tls/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.conf rename to samples/crypto/psa_tls/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf diff --git a/samples/crypto/psa_tls/sample.yaml b/samples/crypto/psa_tls/sample.yaml index 8af1d130ffce..75104b36a508 100644 --- a/samples/crypto/psa_tls/sample.yaml +++ b/samples/crypto/psa_tls/sample.yaml @@ -118,11 +118,11 @@ tests: OVERLAY_CONFIG="overlays/server.conf;overlays/ecdsa.conf;overlays/cracen-psa.conf" platform_allow: > nrf54l15dk/nrf54l15/cpuapp nrf54l15pdk/nrf54l15/cpuapp - nrf54l15pdk/nrf54l15/cpuapp/ns + nrf54l15dk/nrf54l15/cpuapp/ns integration_platforms: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15pdk/nrf54l15/cpuapp - - nrf54l15pdk/nrf54l15/cpuapp/ns + - nrf54l15dk/nrf54l15/cpuapp/ns tags: ci_build cracen sysbuild ci_samples_crypto sample.psa_tls.client.ecdsa.cracen: sysbuild: true @@ -131,11 +131,11 @@ tests: OVERLAY_CONFIG="overlays/client.conf;overlays/ecdsa.conf;overlays/cracen-psa.conf" platform_allow: > nrf54l15dk/nrf54l15/cpuapp nrf54l15pdk/nrf54l15/cpuapp - nrf54l15pdk/nrf54l15/cpuapp/ns + nrf54l15dk/nrf54l15/cpuapp/ns integration_platforms: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15pdk/nrf54l15/cpuapp - - nrf54l15pdk/nrf54l15/cpuapp/ns + - nrf54l15dk/nrf54l15/cpuapp/ns tags: ci_build cracen sysbuild ci_samples_crypto ################################################################################ ## Legacy APIs with Cryptocell (secure-only) diff --git a/samples/crypto/rng/sample.yaml b/samples/crypto/rng/sample.yaml index e8be5dfcc92b..0a0c28ef1a23 100644 --- a/samples/crypto/rng/sample.yaml +++ b/samples/crypto/rng/sample.yaml @@ -29,7 +29,7 @@ tests: tags: introduction psa cracen sysbuild ci_samples_crypto platform_allow: > nrf54l15dk/nrf54l15/cpuapp nrf54l15pdk/nrf54l15/cpuapp - nrf54l15pdk/nrf54l15/cpuapp/ns + nrf54l15dk/nrf54l15/cpuapp/ns harness: console harness_config: type: multi_line @@ -38,7 +38,7 @@ tests: integration_platforms: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15pdk/nrf54l15/cpuapp - - nrf54l15pdk/nrf54l15/cpuapp/ns + - nrf54l15dk/nrf54l15/cpuapp/ns sample.rng.cracen.crypto_service: sysbuild: true tags: introduction psa cracen sysbuild crypto ci_samples_crypto diff --git a/samples/crypto/rsa/sample.yaml b/samples/crypto/rsa/sample.yaml index 8a5f280b8a67..d350f5bd2bf5 100644 --- a/samples/crypto/rsa/sample.yaml +++ b/samples/crypto/rsa/sample.yaml @@ -30,7 +30,7 @@ tests: tags: introduction psa cracen sysbuild ci_samples_crypto platform_allow: > nrf54l15dk/nrf54l15/cpuapp nrf54l15pdk/nrf54l15/cpuapp - nrf54l15pdk/nrf54l15/cpuapp/ns + nrf54l15dk/nrf54l15/cpuapp/ns harness: console harness_config: type: multi_line @@ -39,4 +39,4 @@ tests: integration_platforms: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15pdk/nrf54l15/cpuapp - - nrf54l15pdk/nrf54l15/cpuapp/ns + - nrf54l15dk/nrf54l15/cpuapp/ns diff --git a/samples/crypto/sha256/sample.yaml b/samples/crypto/sha256/sample.yaml index f26f91fcc80d..425307e9ba04 100644 --- a/samples/crypto/sha256/sample.yaml +++ b/samples/crypto/sha256/sample.yaml @@ -29,7 +29,7 @@ tests: tags: introduction psa cracen sysbuild ci_samples_crypto platform_allow: > nrf54l15dk/nrf54l15/cpuapp nrf54l15pdk/nrf54l15/cpuapp - nrf54l15pdk/nrf54l15/cpuapp/ns + nrf54l15dk/nrf54l15/cpuapp/ns harness: console harness_config: type: multi_line @@ -38,7 +38,7 @@ tests: integration_platforms: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15pdk/nrf54l15/cpuapp - - nrf54l15pdk/nrf54l15/cpuapp/ns + - nrf54l15dk/nrf54l15/cpuapp/ns # Build integration regression protection. sample.nrf_security.sha256.integration: sysbuild: true diff --git a/samples/crypto/spake2p/sample.yaml b/samples/crypto/spake2p/sample.yaml index 1c721110c1ea..9c45018173d9 100644 --- a/samples/crypto/spake2p/sample.yaml +++ b/samples/crypto/spake2p/sample.yaml @@ -31,7 +31,7 @@ tests: platform_allow: > nrf54l15dk/nrf54l15/cpuapp nrf54l15pdk/nrf54l15/cpuapp - nrf54l15pdk/nrf54l15/cpuapp/ns + nrf54l15dk/nrf54l15/cpuapp/ns harness: console harness_config: type: multi_line @@ -40,7 +40,7 @@ tests: integration_platforms: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15pdk/nrf54l15/cpuapp - - nrf54l15pdk/nrf54l15/cpuapp/ns + - nrf54l15dk/nrf54l15/cpuapp/ns sample.spake2p.cracen.crypto_service: sysbuild: true tags: introduction psa cracen sysbuild crypto ci_samples_crypto diff --git a/samples/dect/dect_phy/dect_shell/src/dect/dect_phy_ctrl.c b/samples/dect/dect_phy/dect_shell/src/dect/dect_phy_ctrl.c index bdfaa3f1dbae..7fea0d583fa2 100644 --- a/samples/dect/dect_phy/dect_shell/src/dect/dect_phy_ctrl.c +++ b/samples/dect/dect_phy/dect_shell/src/dect/dect_phy_ctrl.c @@ -674,6 +674,12 @@ static void dect_phy_ctrl_mdm_on_capability_get_cb( } } +static void dect_phy_ctrl_mdm_on_stf_cover_seq_control_cb( + const uint64_t *time, enum nrf_modem_dect_phy_err err) +{ + printk("WARN: Unexpectedly in %s\n", (__func__)); +} + static void dect_phy_ctrl_mdm_on_deinit_cb(const uint64_t *time, enum nrf_modem_dect_phy_err err) { ctrl_data.phy_api_initialized = false; @@ -693,6 +699,7 @@ static const struct nrf_modem_dect_phy_callbacks dect_phy_api_config = { .link_config = dect_phy_ctrl_mdm_on_link_configuration_cb, .time_get = dect_phy_ctrl_mdm_time_query_cb, .capability_get = dect_phy_ctrl_mdm_on_capability_get_cb, + .stf_cover_seq_control = dect_phy_ctrl_mdm_on_stf_cover_seq_control_cb, .deinit = dect_phy_ctrl_mdm_on_deinit_cb, }; diff --git a/samples/dect/dect_phy/dect_shell/src/dect/dect_phy_shell.c b/samples/dect/dect_phy/dect_shell/src/dect/dect_phy_shell.c index 0ef964d744d1..9e907ff8aec4 100644 --- a/samples/dect/dect_phy/dect_shell/src/dect/dect_phy_shell.c +++ b/samples/dect/dect_phy/dect_shell/src/dect/dect_phy_shell.c @@ -1139,8 +1139,8 @@ static const char dect_rx_usage_str[] = " [-e ]\n" " [-i ] [--busy_th ]\n" "Subcommands:\n" - " start, Start RX.\n" - " stop, Stop RX.\n" + " start, Start RX.\n" + " stop, Stop RX.\n" "Starting options:\n" " -c , --c_ch, Channel number. Default: 1665\n" " -t, --c_scan_time , Scanning duration in seconds\n" @@ -1201,7 +1201,7 @@ static int dect_phy_rx_cmd(const struct shell *shell, size_t argc, char **argv) } optreset = 1; - optind = 1; + optind = 2; if (argv[1] != NULL && !strcmp(argv[1], "stop")) { dect_phy_ctrl_rx_stop(); } else if (argv[1] != NULL && !strcmp(argv[1], "start")) { diff --git a/samples/dect/dect_phy/dect_shell/src/dect/perf/dect_phy_perf.c b/samples/dect/dect_phy/dect_shell/src/dect/perf/dect_phy_perf.c index 57043dbc3434..14fd918bb700 100644 --- a/samples/dect/dect_phy/dect_shell/src/dect/perf/dect_phy_perf.c +++ b/samples/dect/dect_phy/dect_shell/src/dect/perf/dect_phy_perf.c @@ -655,6 +655,12 @@ static void dect_phy_perf_capability_get_cb(const uint64_t *time, enum nrf_modem } } +static void dect_phy_perf_stf_cover_seq_control_cb( + const uint64_t *time, enum nrf_modem_dect_phy_err err) +{ + printk("WARN: Unexpectedly in %s\n", (__func__)); +} + static void dect_phy_perf_deinit_cb(const uint64_t *time, enum nrf_modem_dect_phy_err err) { dect_phy_ctrl_msgq_non_data_op_add(DECT_PHY_CTRL_OP_PERF_CMD_DONE); @@ -672,6 +678,7 @@ static const struct nrf_modem_dect_phy_callbacks perf_phy_api_config = { .link_config = dect_phy_perf_link_configuration_cb, .time_get = dect_phy_perf_time_query_cb, .capability_get = dect_phy_perf_capability_get_cb, + .stf_cover_seq_control = dect_phy_perf_stf_cover_seq_control_cb, .deinit = dect_phy_perf_deinit_cb, }; diff --git a/samples/dect/dect_phy/dect_shell/src/dect/ping/dect_phy_ping.c b/samples/dect/dect_phy/dect_shell/src/dect/ping/dect_phy_ping.c index a0b2b0d6bbc7..ce88d09ae155 100644 --- a/samples/dect/dect_phy/dect_shell/src/dect/ping/dect_phy_ping.c +++ b/samples/dect/dect_phy/dect_shell/src/dect/ping/dect_phy_ping.c @@ -785,6 +785,12 @@ static void dect_phy_ping_capability_get_cb(const uint64_t *time, enum nrf_modem dect_app_modem_time_save(time); } +static void dect_phy_ping_stf_cover_seq_control_cb( + const uint64_t *time, enum nrf_modem_dect_phy_err err) +{ + printk("WARN: Unexpectedly in %s\n", (__func__)); +} + static void dect_phy_ping_deinit_cb(const uint64_t *time, enum nrf_modem_dect_phy_err err) { dect_phy_ctrl_msgq_non_data_op_add(DECT_PHY_CTRL_OP_PING_CMD_DONE); @@ -802,6 +808,7 @@ static const struct nrf_modem_dect_phy_callbacks ping_phy_api_config = { .link_config = dect_phy_ping_link_configuration_cb, .time_get = dect_phy_ping_time_query_cb, .capability_get = dect_phy_ping_capability_get_cb, + .stf_cover_seq_control = dect_phy_ping_stf_cover_seq_control_cb, .deinit = dect_phy_ping_deinit_cb, }; diff --git a/samples/dect/dect_phy/dect_shell/src/dect/rf_tool/dect_phy_rf_tool.c b/samples/dect/dect_phy/dect_shell/src/dect/rf_tool/dect_phy_rf_tool.c index e38d9bf6168f..820f369bbb51 100644 --- a/samples/dect/dect_phy/dect_shell/src/dect/rf_tool/dect_phy_rf_tool.c +++ b/samples/dect/dect_phy/dect_shell/src/dect/rf_tool/dect_phy_rf_tool.c @@ -132,7 +132,7 @@ static bool dect_phy_rf_tool_rx_mode(enum dect_phy_rf_tool_mode mode); /**************************************************************************************************/ -void dect_phy_rf_tool_initialize_cb(const uint64_t *time, int16_t temperature, +static void dect_phy_rf_tool_initialize_cb(const uint64_t *time, int16_t temperature, enum nrf_modem_dect_phy_err status, const struct nrf_modem_dect_phy_modem_cfg *modem_configuration) { @@ -149,13 +149,13 @@ void dect_phy_rf_tool_initialize_cb(const uint64_t *time, int16_t temperature, sizeof(struct dect_phy_common_op_initialized_params)); } -void dect_phy_rf_tool_rx_op_stop_cb(uint64_t const *time, enum nrf_modem_dect_phy_err status, +static void dect_phy_rf_tool_rx_op_stop_cb(uint64_t const *time, enum nrf_modem_dect_phy_err status, uint32_t handle) { dect_app_modem_time_save(time); } -void dect_phy_rf_tool_op_complete_cb(uint64_t const *time, int16_t temperature, +static void dect_phy_rf_tool_op_complete_cb(uint64_t const *time, int16_t temperature, enum nrf_modem_dect_phy_err status, uint32_t handle) { struct dect_phy_common_op_completed_params rf_tool_op_completed_params = { @@ -196,7 +196,7 @@ static void dect_phy_rf_tool_rx_pcc_cb(uint64_t const *time, sizeof(struct dect_phy_common_op_pcc_rcv_params)); } -void dect_phy_rf_tool_pcc_crc_failure_cb( +static void dect_phy_rf_tool_pcc_crc_failure_cb( uint64_t const *time, struct nrf_modem_dect_phy_rx_pcc_crc_failure const *crc_failure) { struct dect_phy_common_op_pcc_crc_fail_params pdc_crc_fail_params = { @@ -210,7 +210,7 @@ void dect_phy_rf_tool_pcc_crc_failure_cb( sizeof(struct dect_phy_common_op_pcc_crc_fail_params)); } -void dect_phy_rf_tool_rx_pdc_cb(uint64_t const *time, +static void dect_phy_rf_tool_rx_pdc_cb(uint64_t const *time, struct nrf_modem_dect_phy_rx_pdc_status const *p_rx_status, void const *p_data, uint32_t length) { @@ -240,7 +240,7 @@ void dect_phy_rf_tool_rx_pdc_cb(uint64_t const *time, } } -void dect_phy_rf_tool_on_pdc_crc_failure_cb( +static void dect_phy_rf_tool_on_pdc_crc_failure_cb( uint64_t const *time, struct nrf_modem_dect_phy_rx_pdc_crc_failure const *crc_failure) { struct dect_phy_common_op_pdc_crc_fail_params pdc_crc_fail_params = { @@ -254,29 +254,37 @@ void dect_phy_rf_tool_on_pdc_crc_failure_cb( sizeof(struct dect_phy_common_op_pdc_crc_fail_params)); } -void dect_phy_rf_tool_on_rssi_cb(const uint64_t *time, +static void dect_phy_rf_tool_on_rssi_cb(const uint64_t *time, const struct nrf_modem_dect_phy_rssi_meas *p_result) { printk("WARN: Unexpectedly in %s\n", (__func__)); } -void dect_phy_rf_tool_link_configuration_cb(uint64_t const *time, +static void dect_phy_rf_tool_link_configuration_cb(uint64_t const *time, enum nrf_modem_dect_phy_err status) { printk("WARN: Unexpectedly in %s\n", (__func__)); } -void dect_phy_rf_tool_time_query_cb(uint64_t const *time, enum nrf_modem_dect_phy_err status) +static void dect_phy_rf_tool_time_query_cb( + uint64_t const *time, enum nrf_modem_dect_phy_err status) { } -void dect_phy_rf_tool_capability_get_cb(const uint64_t *time, enum nrf_modem_dect_phy_err err, - const struct nrf_modem_dect_phy_capability *capabilities) +static void dect_phy_rf_tool_capability_get_cb( + const uint64_t *time, enum nrf_modem_dect_phy_err err, + const struct nrf_modem_dect_phy_capability *capabilities) { dect_app_modem_time_save(time); } -void dect_phy_rf_tool_deinit_cb(const uint64_t *time, enum nrf_modem_dect_phy_err err) +static void dect_phy_rf_tool_stf_cover_seq_control_cb( + const uint64_t *time, enum nrf_modem_dect_phy_err err) +{ + printk("WARN: Unexpectedly in %s\n", (__func__)); +} + +static void dect_phy_rf_tool_deinit_cb(const uint64_t *time, enum nrf_modem_dect_phy_err err) { dect_phy_rf_tool_msgq_non_data_op_add(DECT_PHY_RF_TOOL_EVT_MDM_DEINITIALIZED); } @@ -293,6 +301,7 @@ static const struct nrf_modem_dect_phy_callbacks rf_tool_phy_api_config = { .link_config = dect_phy_rf_tool_link_configuration_cb, .time_get = dect_phy_rf_tool_time_query_cb, .capability_get = dect_phy_rf_tool_capability_get_cb, + .stf_cover_seq_control = dect_phy_rf_tool_stf_cover_seq_control_cb, .deinit = dect_phy_rf_tool_deinit_cb, }; diff --git a/samples/dect/dect_phy/dect_shell/src/utils/desh_print.c b/samples/dect/dect_phy/dect_shell/src/utils/desh_print.c index e3cca3b04840..81e72495b04f 100644 --- a/samples/dect/dect_phy/dect_shell/src/utils/desh_print.c +++ b/samples/dect/dect_phy/dect_shell/src/utils/desh_print.c @@ -19,8 +19,6 @@ #include #include -#define SDK_VERSION NCS_VERSION_STRING "-" NCS_COMMIT_STRING - #include "desh_print.h" extern const struct shell *desh_shell; @@ -154,7 +152,7 @@ void desh_print_version_info(void) /* shell_print() is not used here, because this function is called early during * application startup and the shell might not be ready yet. */ - printk("\nDESH version: %s\n", SDK_VERSION); + printk("\nDESH version: v%s-%s\n", NCS_VERSION_STRING, NCS_COMMIT_STRING); #if defined(BUILD_ID) printk("DESH build id: v%s\n", STRINGIFY(BUILD_ID)); diff --git a/samples/dect/dect_phy/hello_dect/src/main.c b/samples/dect/dect_phy/hello_dect/src/main.c index b31d1449f9ca..1b1801a6ce86 100644 --- a/samples/dect/dect_phy/hello_dect/src/main.c +++ b/samples/dect/dect_phy/hello_dect/src/main.c @@ -136,6 +136,11 @@ static void capability_get(const uint64_t *time, enum nrf_modem_dect_phy_err err LOG_DBG("capability_get cb time %"PRIu64" status %d", *time, err); } +static void stf_cover_seq_control(const uint64_t *time, enum nrf_modem_dect_phy_err err) +{ + LOG_WRN("Unexpectedly in %s\n", (__func__)); +} + /* Dect PHY callbacks. */ static struct nrf_modem_dect_phy_callbacks dect_phy_callbacks = { .init = init, @@ -150,6 +155,7 @@ static struct nrf_modem_dect_phy_callbacks dect_phy_callbacks = { .link_config = link_config, .time_get = time_get, .capability_get = capability_get, + .stf_cover_seq_control = stf_cover_seq_control, }; /* Dect PHY init parameters. */ diff --git a/samples/matter/common/src/Kconfig b/samples/matter/common/src/Kconfig index 04cc2f1e7d55..e711b57594a7 100644 --- a/samples/matter/common/src/Kconfig +++ b/samples/matter/common/src/Kconfig @@ -44,7 +44,7 @@ config NCS_SAMPLE_MATTER_SETTINGS_SHELL bool "Settings shell for Matter purposes" default y if CHIP_MEMORY_PROFILING depends on SHELL - depends on NVS + depends on NVS || ZMS help Allows using matter_settings shell commands. You can use the following commands: diff --git a/samples/matter/common/src/persistent_storage/persistent_storage_shell.cpp b/samples/matter/common/src/persistent_storage/persistent_storage_shell.cpp index f5d819ab8b9e..66a192d15dd1 100644 --- a/samples/matter/common/src/persistent_storage/persistent_storage_shell.cpp +++ b/samples/matter/common/src/persistent_storage/persistent_storage_shell.cpp @@ -6,7 +6,11 @@ #include "persistent_storage_shell.h" +#ifdef CONFIG_NVS #include +#elif CONFIG_ZMS +#include +#endif #include #include @@ -14,13 +18,27 @@ using namespace Nrf; namespace { -nvs_fs *sNvsStorage = nullptr; +#ifdef CONFIG_NVS +nvs_fs *sStorage = nullptr; +#elif CONFIG_ZMS +zms_fs *sStorage = nullptr; +#endif + size_t sPeakSize = 0; struct SettingsParams { const struct shell *shell; }; +int CalculateFreeSpace() +{ +#ifdef CONFIG_NVS + return nvs_calc_free_space(sStorage); +#elif CONFIG_ZMS + return zms_calc_free_space(sStorage); +#endif +} + int SettingsReadClb(const char *key, size_t len, settings_read_cb read_cb, void *cb_arg, void *param) { uint8_t buffer[SETTINGS_MAX_VAL_LEN]; @@ -41,13 +59,12 @@ int SettingsReadClb(const char *key, size_t len, settings_read_cb read_cb, void int PeakHandler(const struct shell *shell, size_t argc, char **argv) { - if (!sNvsStorage) { + if (!sStorage) { return -ENODEV; } - size_t maxSize = sNvsStorage->sector_size * sNvsStorage->sector_count; - size_t freeSpace = nvs_calc_free_space(sNvsStorage); - + size_t maxSize = sStorage->sector_size * sStorage->sector_count; + size_t freeSpace = CalculateFreeSpace(); size_t currentPeak = maxSize - freeSpace; if (currentPeak > sPeakSize) { @@ -68,7 +85,7 @@ int ResetHandler(const struct shell *shell, size_t argc, char **argv) int GetSizeHandler(const struct shell *shell, size_t argc, char **argv) { - if (!sNvsStorage) { + if (!sStorage) { return -ENODEV; } @@ -81,12 +98,12 @@ int GetSizeHandler(const struct shell *shell, size_t argc, char **argv) int CurrentHandler(const struct shell *shell, size_t argc, char **argv) { - if (!sNvsStorage) { + if (!sStorage) { return -ENODEV; } - size_t maxSize = sNvsStorage->sector_size * sNvsStorage->sector_count; - size_t freeSpace = nvs_calc_free_space(sNvsStorage); + size_t maxSize = sStorage->sector_size * sStorage->sector_count; + size_t freeSpace = CalculateFreeSpace(); shell_fprintf(shell, SHELL_NORMAL, "%zu\n", maxSize - freeSpace); @@ -95,11 +112,11 @@ int CurrentHandler(const struct shell *shell, size_t argc, char **argv) int FreeHandler(const struct shell *shell, size_t argc, char **argv) { - if (!sNvsStorage) { + if (!sStorage) { return -ENODEV; } - size_t freeSpace = nvs_calc_free_space(sNvsStorage); + size_t freeSpace = CalculateFreeSpace(); shell_fprintf(shell, SHELL_NORMAL, "%zu\n", freeSpace); @@ -116,7 +133,11 @@ bool PersistentStorageShell::Init() return false; } - sNvsStorage = reinterpret_cast(storage); +#ifdef CONFIG_NVS + sStorage = reinterpret_cast(storage); +#elif CONFIG_ZMS + sStorage = reinterpret_cast(storage); +#endif return true; } diff --git a/samples/matter/light_bulb/Kconfig.sysbuild b/samples/matter/light_bulb/Kconfig.sysbuild index 651b54d02742..2e8a87008877 100644 --- a/samples/matter/light_bulb/Kconfig.sysbuild +++ b/samples/matter/light_bulb/Kconfig.sysbuild @@ -63,7 +63,7 @@ config DFU_MULTI_IMAGE_PACKAGE_NET endif # SOC_SERIES_NRF53X -if BOARD_NRF54L15PDK_NRF54L15_CPUAPP_NS +if BOARD_NRF54L15DK_NRF54L15_CPUAPP_NS # Disable checking the external drivers for NS build. config PM_OVERRIDE_EXTERNAL_DRIVER_CHECK @@ -73,7 +73,7 @@ config PM_OVERRIDE_EXTERNAL_DRIVER_CHECK config PM_MCUBOOT_PAD default 0x800 -endif # BOARD_NRF54L15PDK_NRF54L15_CPUAPP_NS +endif # BOARD_NRF54L15DK_NRF54L15_CPUAPP_NS endif # BOOTLOADER_MCUBOOT diff --git a/samples/matter/light_bulb/boards/nrf54l15dk_nrf54l15_cpuapp.conf b/samples/matter/light_bulb/boards/nrf54l15dk_nrf54l15_cpuapp.conf index 792f30a21fbd..cccb8cde877b 100644 --- a/samples/matter/light_bulb/boards/nrf54l15dk_nrf54l15_cpuapp.conf +++ b/samples/matter/light_bulb/boards/nrf54l15dk_nrf54l15_cpuapp.conf @@ -12,5 +12,5 @@ CONFIG_CHIP_MALLOC_SYS_HEAP_SIZE=10240 CONFIG_MPSL_WORK_STACK_SIZE=2048 CONFIG_CHIP_TASK_STACK_SIZE=7168 -# Set the NVS sector count to match the settings partition size that is 40 kB for this application. -CONFIG_SETTINGS_NVS_SECTOR_COUNT=10 +# Set the ZMS sector count to match the settings partition size that is 40 kB for this application. +CONFIG_SETTINGS_ZMS_SECTOR_COUNT=10 diff --git a/samples/matter/light_bulb/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.conf b/samples/matter/light_bulb/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf similarity index 88% rename from samples/matter/light_bulb/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.conf rename to samples/matter/light_bulb/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf index be1a6a76be76..facc5415b309 100644 --- a/samples/matter/light_bulb/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.conf +++ b/samples/matter/light_bulb/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf @@ -20,5 +20,5 @@ CONFIG_MPSL_WORK_STACK_SIZE=2048 # Enable DAC key migration by default for ns build CONFIG_CHIP_CRYPTO_PSA_MIGRATE_DAC_PRIV_KEY=y -# Set the NVS sector count to match the settings partition size that is 40 kB for this application. -CONFIG_SETTINGS_NVS_SECTOR_COUNT=10 +# Set the ZMS sector count to match the settings partition size that is 40 kB for this application. +CONFIG_SETTINGS_ZMS_SECTOR_COUNT=10 diff --git a/samples/matter/light_bulb/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.overlay b/samples/matter/light_bulb/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay similarity index 100% rename from samples/matter/light_bulb/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.overlay rename to samples/matter/light_bulb/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay diff --git a/samples/matter/light_bulb/pm_static_nrf54l15pdk_nrf54l15_cpuapp_ns.yml b/samples/matter/light_bulb/pm_static_nrf54l15dk_nrf54l15_cpuapp_ns.yml similarity index 100% rename from samples/matter/light_bulb/pm_static_nrf54l15pdk_nrf54l15_cpuapp_ns.yml rename to samples/matter/light_bulb/pm_static_nrf54l15dk_nrf54l15_cpuapp_ns.yml diff --git a/samples/matter/light_bulb/sample.yaml b/samples/matter/light_bulb/sample.yaml index 9df633fc1614..9ebf53475ad2 100644 --- a/samples/matter/light_bulb/sample.yaml +++ b/samples/matter/light_bulb/sample.yaml @@ -10,9 +10,9 @@ tests: - nrf5340dk/nrf5340/cpuapp - nrf7002dk/nrf5340/cpuapp - nrf54l15dk/nrf54l15/cpuapp - - nrf54l15pdk/nrf54l15/cpuapp/ns + - nrf54l15dk/nrf54l15/cpuapp/ns platform_allow: nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp nrf7002dk/nrf5340/cpuapp - nrf54l15dk/nrf54l15/cpuapp nrf54l15pdk/nrf54l15/cpuapp/ns + nrf54l15dk/nrf54l15/cpuapp nrf54l15dk/nrf54l15/cpuapp/ns tags: sysbuild ci_samples_matter sample.matter.light_bulb.release: sysbuild: true diff --git a/samples/matter/light_switch/Kconfig.sysbuild b/samples/matter/light_switch/Kconfig.sysbuild index 651b54d02742..2e8a87008877 100644 --- a/samples/matter/light_switch/Kconfig.sysbuild +++ b/samples/matter/light_switch/Kconfig.sysbuild @@ -63,7 +63,7 @@ config DFU_MULTI_IMAGE_PACKAGE_NET endif # SOC_SERIES_NRF53X -if BOARD_NRF54L15PDK_NRF54L15_CPUAPP_NS +if BOARD_NRF54L15DK_NRF54L15_CPUAPP_NS # Disable checking the external drivers for NS build. config PM_OVERRIDE_EXTERNAL_DRIVER_CHECK @@ -73,7 +73,7 @@ config PM_OVERRIDE_EXTERNAL_DRIVER_CHECK config PM_MCUBOOT_PAD default 0x800 -endif # BOARD_NRF54L15PDK_NRF54L15_CPUAPP_NS +endif # BOARD_NRF54L15DK_NRF54L15_CPUAPP_NS endif # BOOTLOADER_MCUBOOT diff --git a/samples/matter/light_switch/boards/nrf54l15dk_nrf54l15_cpuapp.conf b/samples/matter/light_switch/boards/nrf54l15dk_nrf54l15_cpuapp.conf index a891a583a1d7..5f3388a91552 100644 --- a/samples/matter/light_switch/boards/nrf54l15dk_nrf54l15_cpuapp.conf +++ b/samples/matter/light_switch/boards/nrf54l15dk_nrf54l15_cpuapp.conf @@ -12,8 +12,8 @@ CONFIG_CHIP_MALLOC_SYS_HEAP_SIZE=10240 CONFIG_MPSL_WORK_STACK_SIZE=2048 CONFIG_CHIP_TASK_STACK_SIZE=7168 -# Set the NVS sector count to match the settings partition size that is 40 kB for this application. -CONFIG_SETTINGS_NVS_SECTOR_COUNT=10 +# Set the ZMS sector count to match the settings partition size that is 40 kB for this application. +CONFIG_SETTINGS_ZMS_SECTOR_COUNT=10 # Low Power mode CONFIG_POWEROFF=y diff --git a/samples/matter/light_switch/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.conf b/samples/matter/light_switch/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf similarity index 88% rename from samples/matter/light_switch/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.conf rename to samples/matter/light_switch/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf index be1a6a76be76..facc5415b309 100644 --- a/samples/matter/light_switch/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.conf +++ b/samples/matter/light_switch/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf @@ -20,5 +20,5 @@ CONFIG_MPSL_WORK_STACK_SIZE=2048 # Enable DAC key migration by default for ns build CONFIG_CHIP_CRYPTO_PSA_MIGRATE_DAC_PRIV_KEY=y -# Set the NVS sector count to match the settings partition size that is 40 kB for this application. -CONFIG_SETTINGS_NVS_SECTOR_COUNT=10 +# Set the ZMS sector count to match the settings partition size that is 40 kB for this application. +CONFIG_SETTINGS_ZMS_SECTOR_COUNT=10 diff --git a/samples/matter/light_switch/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.overlay b/samples/matter/light_switch/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay similarity index 100% rename from samples/matter/light_switch/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.overlay rename to samples/matter/light_switch/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay diff --git a/samples/matter/light_switch/pm_static_nrf54l15pdk_nrf54l15_cpuapp_ns.yml b/samples/matter/light_switch/pm_static_nrf54l15dk_nrf54l15_cpuapp_ns.yml similarity index 100% rename from samples/matter/light_switch/pm_static_nrf54l15pdk_nrf54l15_cpuapp_ns.yml rename to samples/matter/light_switch/pm_static_nrf54l15dk_nrf54l15_cpuapp_ns.yml diff --git a/samples/matter/light_switch/sample.yaml b/samples/matter/light_switch/sample.yaml index 6d80f126c543..6a55dec80fa0 100644 --- a/samples/matter/light_switch/sample.yaml +++ b/samples/matter/light_switch/sample.yaml @@ -10,9 +10,9 @@ tests: - nrf5340dk/nrf5340/cpuapp - nrf7002dk/nrf5340/cpuapp - nrf54l15dk/nrf54l15/cpuapp - - nrf54l15pdk/nrf54l15/cpuapp/ns + - nrf54l15dk/nrf54l15/cpuapp/ns platform_allow: nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp nrf7002dk/nrf5340/cpuapp - nrf54l15dk/nrf54l15/cpuapp nrf54l15pdk/nrf54l15/cpuapp/ns + nrf54l15dk/nrf54l15/cpuapp nrf54l15dk/nrf54l15/cpuapp/ns tags: sysbuild ci_samples_matter sample.matter.light_switch.release: sysbuild: true diff --git a/samples/matter/lock/Kconfig b/samples/matter/lock/Kconfig index c4779310e9ab..404e519792b6 100644 --- a/samples/matter/lock/Kconfig +++ b/samples/matter/lock/Kconfig @@ -91,7 +91,7 @@ config THREAD_WIFI_SWITCHING depends on SOC_SERIES_NRF53X depends on NET_L2_OPENTHREAD depends on CHIP_WIFI - depends on !CHIP_FACTORY_RESET_ERASE_NVS + depends on !CHIP_FACTORY_RESET_ERASE_SETTINGS select EXPERIMENTAL help Build the application with both Thread and Wi-Fi support and initialize diff --git a/samples/matter/lock/Kconfig.sysbuild b/samples/matter/lock/Kconfig.sysbuild index 2f02640b157c..15e5c38f0b95 100644 --- a/samples/matter/lock/Kconfig.sysbuild +++ b/samples/matter/lock/Kconfig.sysbuild @@ -63,7 +63,7 @@ config DFU_MULTI_IMAGE_PACKAGE_NET endif # SOC_SERIES_NRF53X -if BOARD_NRF54L15PDK_NRF54L15_CPUAPP_NS +if BOARD_NRF54L15DK_NRF54L15_CPUAPP_NS # Disable checking the external drivers for NS build. config PM_OVERRIDE_EXTERNAL_DRIVER_CHECK @@ -73,7 +73,7 @@ config PM_OVERRIDE_EXTERNAL_DRIVER_CHECK config PM_MCUBOOT_PAD default 0x800 -endif # BOARD_NRF54L15PDK_NRF54L15_CPUAPP_NS +endif # BOARD_NRF54L15DK_NRF54L15_CPUAPP_NS endif # BOOTLOADER_MCUBOOT diff --git a/samples/matter/lock/boards/nrf54l15dk_nrf54l15_cpuapp.conf b/samples/matter/lock/boards/nrf54l15dk_nrf54l15_cpuapp.conf index a891a583a1d7..5f3388a91552 100644 --- a/samples/matter/lock/boards/nrf54l15dk_nrf54l15_cpuapp.conf +++ b/samples/matter/lock/boards/nrf54l15dk_nrf54l15_cpuapp.conf @@ -12,8 +12,8 @@ CONFIG_CHIP_MALLOC_SYS_HEAP_SIZE=10240 CONFIG_MPSL_WORK_STACK_SIZE=2048 CONFIG_CHIP_TASK_STACK_SIZE=7168 -# Set the NVS sector count to match the settings partition size that is 40 kB for this application. -CONFIG_SETTINGS_NVS_SECTOR_COUNT=10 +# Set the ZMS sector count to match the settings partition size that is 40 kB for this application. +CONFIG_SETTINGS_ZMS_SECTOR_COUNT=10 # Low Power mode CONFIG_POWEROFF=y diff --git a/samples/matter/lock/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.conf b/samples/matter/lock/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf similarity index 88% rename from samples/matter/lock/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.conf rename to samples/matter/lock/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf index be1a6a76be76..facc5415b309 100644 --- a/samples/matter/lock/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.conf +++ b/samples/matter/lock/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf @@ -20,5 +20,5 @@ CONFIG_MPSL_WORK_STACK_SIZE=2048 # Enable DAC key migration by default for ns build CONFIG_CHIP_CRYPTO_PSA_MIGRATE_DAC_PRIV_KEY=y -# Set the NVS sector count to match the settings partition size that is 40 kB for this application. -CONFIG_SETTINGS_NVS_SECTOR_COUNT=10 +# Set the ZMS sector count to match the settings partition size that is 40 kB for this application. +CONFIG_SETTINGS_ZMS_SECTOR_COUNT=10 diff --git a/samples/matter/lock/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.overlay b/samples/matter/lock/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay similarity index 100% rename from samples/matter/lock/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.overlay rename to samples/matter/lock/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay diff --git a/samples/matter/lock/pm_static_nrf54l15pdk_nrf54l15_cpuapp_ns.yml b/samples/matter/lock/pm_static_nrf54l15dk_nrf54l15_cpuapp_ns.yml similarity index 100% rename from samples/matter/lock/pm_static_nrf54l15pdk_nrf54l15_cpuapp_ns.yml rename to samples/matter/lock/pm_static_nrf54l15dk_nrf54l15_cpuapp_ns.yml diff --git a/samples/matter/lock/prj_thread_wifi_switched.conf b/samples/matter/lock/prj_thread_wifi_switched.conf index 5b4d8c6ec7fd..54c1daead59b 100644 --- a/samples/matter/lock/prj_thread_wifi_switched.conf +++ b/samples/matter/lock/prj_thread_wifi_switched.conf @@ -34,7 +34,7 @@ CONFIG_THREAD_WIFI_SWITCHING=y CONFIG_THREAD_WIFI_SWITCHING_SHELL=y CONFIG_CHIP_WIFI=y CONFIG_NET_L2_OPENTHREAD=y -CONFIG_CHIP_FACTORY_RESET_ERASE_NVS=n # Do not restore initial transport on factory reset +CONFIG_CHIP_FACTORY_RESET_ERASE_SETTINGS=n # Do not restore initial transport on factory reset # Reduce application size CONFIG_USE_SEGGER_RTT=n diff --git a/samples/matter/lock/sample.yaml b/samples/matter/lock/sample.yaml index 79448fd0c8e2..9e182ded5734 100644 --- a/samples/matter/lock/sample.yaml +++ b/samples/matter/lock/sample.yaml @@ -11,11 +11,11 @@ tests: - nrf7002dk/nrf5340/cpuapp - nrf7002dk/nrf5340/cpuapp/nrf7001 - nrf54l15dk/nrf54l15/cpuapp - - nrf54l15pdk/nrf54l15/cpuapp/ns + - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54h20dk/nrf54h20/cpuapp platform_allow: nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp nrf7002dk/nrf5340/cpuapp nrf7002dk/nrf5340/cpuapp/nrf7001 nrf54l15dk/nrf54l15/cpuapp - nrf54h20dk/nrf54h20/cpuapp nrf54l15pdk/nrf54l15/cpuapp/ns + nrf54h20dk/nrf54h20/cpuapp nrf54l15dk/nrf54l15/cpuapp/ns tags: sysbuild ci_samples_matter sample.matter.lock.release: sysbuild: true diff --git a/samples/matter/lock/src/access/access_storage.cpp b/samples/matter/lock/src/access/access_storage.cpp index 61ad72d64405..2bb2fdc3305e 100644 --- a/samples/matter/lock/src/access/access_storage.cpp +++ b/samples/matter/lock/src/access/access_storage.cpp @@ -11,7 +11,11 @@ #include #ifdef CONFIG_LOCK_PRINT_STORAGE_STATUS +#ifdef CONFIG_NVS #include +#elif CONFIG_ZMS +#include +#endif /* CONFIG_NVS */ #include #include @@ -27,11 +31,15 @@ bool GetStorageFreeSpace(size_t &freeBytes) LOG_ERR("AccessStorage: Cannot read NVS free space [error: %d]", status); return false; } +#ifdef CONFIG_NVS freeBytes = nvs_calc_free_space(static_cast(storage)); +#elif CONFIG_ZMS + freeBytes = zms_calc_free_space(static_cast(storage)); +#endif /* NVS */ return true; } } /* namespace */ -#endif +#endif /* CONFIG_LOCK_PRINT_STORAGE_STATUS */ /* Currently the secure storage is available only for non-Wi-Fi builds, because NCS Wi-Fi implementation does not support PSA API yet. */ diff --git a/samples/matter/smoke_co_alarm/boards/nrf54l15dk_nrf54l15_cpuapp.conf b/samples/matter/smoke_co_alarm/boards/nrf54l15dk_nrf54l15_cpuapp.conf index a891a583a1d7..5f3388a91552 100644 --- a/samples/matter/smoke_co_alarm/boards/nrf54l15dk_nrf54l15_cpuapp.conf +++ b/samples/matter/smoke_co_alarm/boards/nrf54l15dk_nrf54l15_cpuapp.conf @@ -12,8 +12,8 @@ CONFIG_CHIP_MALLOC_SYS_HEAP_SIZE=10240 CONFIG_MPSL_WORK_STACK_SIZE=2048 CONFIG_CHIP_TASK_STACK_SIZE=7168 -# Set the NVS sector count to match the settings partition size that is 40 kB for this application. -CONFIG_SETTINGS_NVS_SECTOR_COUNT=10 +# Set the ZMS sector count to match the settings partition size that is 40 kB for this application. +CONFIG_SETTINGS_ZMS_SECTOR_COUNT=10 # Low Power mode CONFIG_POWEROFF=y diff --git a/samples/matter/template/Kconfig.sysbuild b/samples/matter/template/Kconfig.sysbuild index 17cffb1d57f4..d43d12747f98 100644 --- a/samples/matter/template/Kconfig.sysbuild +++ b/samples/matter/template/Kconfig.sysbuild @@ -63,7 +63,7 @@ config DFU_MULTI_IMAGE_PACKAGE_NET endif # SOC_SERIES_NRF53X -if BOARD_NRF54L15PDK_NRF54L15_CPUAPP_NS +if BOARD_NRF54L15DK_NRF54L15_CPUAPP_NS # Disable checking the external drivers for NS build. config PM_OVERRIDE_EXTERNAL_DRIVER_CHECK @@ -73,7 +73,7 @@ config PM_OVERRIDE_EXTERNAL_DRIVER_CHECK config PM_MCUBOOT_PAD default 0x800 -endif # BOARD_NRF54L15PDK_NRF54L15_CPUAPP_NS +endif # BOARD_NRF54L15DK_NRF54L15_CPUAPP_NS endif # BOOTLOADER_MCUBOOT diff --git a/samples/matter/template/README.rst b/samples/matter/template/README.rst index 425a611005c6..a6e1cadd1798 100644 --- a/samples/matter/template/README.rst +++ b/samples/matter/template/README.rst @@ -116,17 +116,17 @@ Matter template with Trusted Firmware-M The sample supports using :ref:`Trusted Firmware-M ` on the nRF54L15 DK. The memory map of the sample has been aligned to meet the :ref:`ug_tfm_partition_alignment_requirements`. -You can build the sample with Trusted Firmware-M support by adding the ``ns`` suffix to the ``nrf54l15pdk/nrf54l15/cpuapp`` build target. +You can build the sample with Trusted Firmware-M support by adding the ``ns`` suffix to the ``nrf54l15dk/nrf54l15/cpuapp`` board target. For example: .. code-block:: console - west build -p -b nrf54l15pdk/nrf54l15/cpuapp/ns + west build -p -b nrf54l15dk/nrf54l15/cpuapp/ns .. note:: - The firmware built for ``nrf54l15pdk/nrf54l15/cpuapp/ns`` will not work on the nRF54L15 DK. + The firmware built for ``nrf54l15dk/nrf54l15/cpuapp/ns`` will not work on the nRF54L15 PDK. .. matter_template_build_with_tfm_end diff --git a/samples/matter/template/boards/nrf54l15dk_nrf54l15_cpuapp.conf b/samples/matter/template/boards/nrf54l15dk_nrf54l15_cpuapp.conf index 792f30a21fbd..cccb8cde877b 100644 --- a/samples/matter/template/boards/nrf54l15dk_nrf54l15_cpuapp.conf +++ b/samples/matter/template/boards/nrf54l15dk_nrf54l15_cpuapp.conf @@ -12,5 +12,5 @@ CONFIG_CHIP_MALLOC_SYS_HEAP_SIZE=10240 CONFIG_MPSL_WORK_STACK_SIZE=2048 CONFIG_CHIP_TASK_STACK_SIZE=7168 -# Set the NVS sector count to match the settings partition size that is 40 kB for this application. -CONFIG_SETTINGS_NVS_SECTOR_COUNT=10 +# Set the ZMS sector count to match the settings partition size that is 40 kB for this application. +CONFIG_SETTINGS_ZMS_SECTOR_COUNT=10 diff --git a/samples/matter/template/boards/nrf54l15dk_nrf54l15_cpuapp_internal.conf b/samples/matter/template/boards/nrf54l15dk_nrf54l15_cpuapp_internal.conf index 70931958b619..e2d1a570134f 100644 --- a/samples/matter/template/boards/nrf54l15dk_nrf54l15_cpuapp_internal.conf +++ b/samples/matter/template/boards/nrf54l15dk_nrf54l15_cpuapp_internal.conf @@ -12,8 +12,8 @@ CONFIG_CHIP_MALLOC_SYS_HEAP_SIZE=10240 CONFIG_MPSL_WORK_STACK_SIZE=2048 CONFIG_CHIP_TASK_STACK_SIZE=7168 -# Set the NVS sector count to match the settings partition size that is 44 kB for this application. -CONFIG_SETTINGS_NVS_SECTOR_COUNT=11 +# Set the ZMS sector count to match the settings partition size that is 44 kB for this application. +CONFIG_SETTINGS_ZMS_SECTOR_COUNT=11 # Disable SPI CONFIG_CHIP_SPI_NOR=n diff --git a/samples/matter/template/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.conf b/samples/matter/template/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf similarity index 85% rename from samples/matter/template/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.conf rename to samples/matter/template/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf index 86b46bc3af4e..d9673cc89769 100644 --- a/samples/matter/template/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.conf +++ b/samples/matter/template/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf @@ -17,5 +17,5 @@ CONFIG_MPSL_WORK_STACK_SIZE=2048 # Enable DAC key migration by default for ns build CONFIG_CHIP_CRYPTO_PSA_MIGRATE_DAC_PRIV_KEY=y -# Set the NVS sector count to match the settings partition size that is 40 kB for this application. -CONFIG_SETTINGS_NVS_SECTOR_COUNT=10 +# Set the ZMS sector count to match the settings partition size that is 40 kB for this application. +CONFIG_SETTINGS_ZMS_SECTOR_COUNT=10 diff --git a/samples/matter/template/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.overlay b/samples/matter/template/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay similarity index 100% rename from samples/matter/template/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.overlay rename to samples/matter/template/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay diff --git a/samples/matter/template/pm_static_nrf54l15pdk_nrf54l15_cpuapp_ns.yml b/samples/matter/template/pm_static_nrf54l15dk_nrf54l15_cpuapp_ns.yml similarity index 100% rename from samples/matter/template/pm_static_nrf54l15pdk_nrf54l15_cpuapp_ns.yml rename to samples/matter/template/pm_static_nrf54l15dk_nrf54l15_cpuapp_ns.yml diff --git a/samples/matter/template/sample.yaml b/samples/matter/template/sample.yaml index 42e45d2dc927..a231a0d0e94f 100644 --- a/samples/matter/template/sample.yaml +++ b/samples/matter/template/sample.yaml @@ -12,9 +12,9 @@ tests: - nrf7002dk/nrf5340/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54h20dk/nrf54h20/cpuapp - - nrf54l15pdk/nrf54l15/cpuapp/ns + - nrf54l15dk/nrf54l15/cpuapp/ns platform_allow: nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp nrf7002dk/nrf5340/cpuapp - nrf54l15dk/nrf54l15/cpuapp nrf54h20dk/nrf54h20/cpuapp nrf54l15pdk/nrf54l15/cpuapp/ns + nrf54l15dk/nrf54l15/cpuapp nrf54h20dk/nrf54h20/cpuapp nrf54l15dk/nrf54l15/cpuapp/ns tags: sysbuild ci_samples_matter sample.matter.template.release: sysbuild: true @@ -27,9 +27,9 @@ tests: - nrf7002dk/nrf5340/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54h20dk/nrf54h20/cpuapp - - nrf54l15pdk/nrf54l15/cpuapp/ns + - nrf54l15dk/nrf54l15/cpuapp/ns platform_allow: nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp nrf7002dk/nrf5340/cpuapp - nrf54l15dk/nrf54l15/cpuapp nrf54h20dk/nrf54h20/cpuapp nrf54l15pdk/nrf54l15/cpuapp/ns + nrf54l15dk/nrf54l15/cpuapp nrf54h20dk/nrf54h20/cpuapp nrf54l15dk/nrf54l15/cpuapp/ns tags: sysbuild ci_samples_matter sample.matter.template.lto: sysbuild: true @@ -55,9 +55,9 @@ tests: - nrf7002dk/nrf5340/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54h20dk/nrf54h20/cpuapp - - nrf54l15pdk/nrf54l15/cpuapp/ns + - nrf54l15dk/nrf54l15/cpuapp/ns platform_allow: nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp nrf7002dk/nrf5340/cpuapp - nrf54l15dk/nrf54l15/cpuapp nrf54h20dk/nrf54h20/cpuapp nrf54l15pdk/nrf54l15/cpuapp/ns + nrf54l15dk/nrf54l15/cpuapp nrf54h20dk/nrf54h20/cpuapp nrf54l15dk/nrf54l15/cpuapp/ns tags: sysbuild ci_samples_matter sample.matter.template.nrf54h20.nrf7002eb: sysbuild: true @@ -84,3 +84,12 @@ tests: - nrf54l15dk/nrf54l15/cpuapp platform_allow: nrf54l15dk/nrf54l15/cpuapp tags: sysbuild ci_samples_matter + sample.matter.template.cc3xx_backend: + sysbuild: true + build_only: true + extra_args: CONFIG_PSA_CRYPTO_DRIVER_CC3XX=y + integration_platforms: + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + platform_allow: nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp + tags: sysbuild ci_samples_matter diff --git a/samples/matter/thermostat/Kconfig.sysbuild b/samples/matter/thermostat/Kconfig.sysbuild index a9f26c598458..4e4438afe3d6 100644 --- a/samples/matter/thermostat/Kconfig.sysbuild +++ b/samples/matter/thermostat/Kconfig.sysbuild @@ -63,7 +63,7 @@ config DFU_MULTI_IMAGE_PACKAGE_NET endif # SOC_SERIES_NRF53X -if BOARD_NRF54L15PDK_NRF54L15_CPUAPP_NS +if BOARD_NRF54L15DK_NRF54L15_CPUAPP_NS # Disable checking the external drivers for NS build. config PM_OVERRIDE_EXTERNAL_DRIVER_CHECK @@ -73,7 +73,7 @@ config PM_OVERRIDE_EXTERNAL_DRIVER_CHECK config PM_MCUBOOT_PAD default 0x800 -endif # BOARD_NRF54L15PDK_NRF54L15_CPUAPP_NS +endif # BOARD_NRF54L15DK_NRF54L15_CPUAPP_NS endif # BOOTLOADER_MCUBOOT diff --git a/samples/matter/thermostat/boards/nrf54l15dk_nrf54l15_cpuapp.conf b/samples/matter/thermostat/boards/nrf54l15dk_nrf54l15_cpuapp.conf index 792f30a21fbd..cccb8cde877b 100644 --- a/samples/matter/thermostat/boards/nrf54l15dk_nrf54l15_cpuapp.conf +++ b/samples/matter/thermostat/boards/nrf54l15dk_nrf54l15_cpuapp.conf @@ -12,5 +12,5 @@ CONFIG_CHIP_MALLOC_SYS_HEAP_SIZE=10240 CONFIG_MPSL_WORK_STACK_SIZE=2048 CONFIG_CHIP_TASK_STACK_SIZE=7168 -# Set the NVS sector count to match the settings partition size that is 40 kB for this application. -CONFIG_SETTINGS_NVS_SECTOR_COUNT=10 +# Set the ZMS sector count to match the settings partition size that is 40 kB for this application. +CONFIG_SETTINGS_ZMS_SECTOR_COUNT=10 diff --git a/samples/matter/thermostat/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.conf b/samples/matter/thermostat/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf similarity index 88% rename from samples/matter/thermostat/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.conf rename to samples/matter/thermostat/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf index be1a6a76be76..facc5415b309 100644 --- a/samples/matter/thermostat/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.conf +++ b/samples/matter/thermostat/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf @@ -20,5 +20,5 @@ CONFIG_MPSL_WORK_STACK_SIZE=2048 # Enable DAC key migration by default for ns build CONFIG_CHIP_CRYPTO_PSA_MIGRATE_DAC_PRIV_KEY=y -# Set the NVS sector count to match the settings partition size that is 40 kB for this application. -CONFIG_SETTINGS_NVS_SECTOR_COUNT=10 +# Set the ZMS sector count to match the settings partition size that is 40 kB for this application. +CONFIG_SETTINGS_ZMS_SECTOR_COUNT=10 diff --git a/samples/matter/thermostat/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.overlay b/samples/matter/thermostat/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay similarity index 100% rename from samples/matter/thermostat/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.overlay rename to samples/matter/thermostat/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay diff --git a/samples/matter/thermostat/pm_static_nrf54l15pdk_nrf54l15_cpuapp_ns.yml b/samples/matter/thermostat/pm_static_nrf54l15dk_nrf54l15_cpuapp_ns.yml similarity index 100% rename from samples/matter/thermostat/pm_static_nrf54l15pdk_nrf54l15_cpuapp_ns.yml rename to samples/matter/thermostat/pm_static_nrf54l15dk_nrf54l15_cpuapp_ns.yml diff --git a/samples/matter/thermostat/sample.yaml b/samples/matter/thermostat/sample.yaml index 9aff15248ea3..9bc529fb542a 100644 --- a/samples/matter/thermostat/sample.yaml +++ b/samples/matter/thermostat/sample.yaml @@ -10,9 +10,9 @@ tests: - nrf5340dk/nrf5340/cpuapp - nrf7002dk/nrf5340/cpuapp - nrf54l15dk/nrf54l15/cpuapp - - nrf54l15pdk/nrf54l15/cpuapp/ns + - nrf54l15dk/nrf54l15/cpuapp/ns platform_allow: nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp nrf7002dk/nrf5340/cpuapp - nrf54l15dk/nrf54l15/cpuapp nrf54l15pdk/nrf54l15/cpuapp/ns + nrf54l15dk/nrf54l15/cpuapp nrf54l15dk/nrf54l15/cpuapp/ns tags: sysbuild ci_samples_matter sample.matter.thermostat.release: sysbuild: true diff --git a/samples/matter/window_covering/Kconfig.sysbuild b/samples/matter/window_covering/Kconfig.sysbuild index 651b54d02742..2e8a87008877 100644 --- a/samples/matter/window_covering/Kconfig.sysbuild +++ b/samples/matter/window_covering/Kconfig.sysbuild @@ -63,7 +63,7 @@ config DFU_MULTI_IMAGE_PACKAGE_NET endif # SOC_SERIES_NRF53X -if BOARD_NRF54L15PDK_NRF54L15_CPUAPP_NS +if BOARD_NRF54L15DK_NRF54L15_CPUAPP_NS # Disable checking the external drivers for NS build. config PM_OVERRIDE_EXTERNAL_DRIVER_CHECK @@ -73,7 +73,7 @@ config PM_OVERRIDE_EXTERNAL_DRIVER_CHECK config PM_MCUBOOT_PAD default 0x800 -endif # BOARD_NRF54L15PDK_NRF54L15_CPUAPP_NS +endif # BOARD_NRF54L15DK_NRF54L15_CPUAPP_NS endif # BOOTLOADER_MCUBOOT diff --git a/samples/matter/window_covering/boards/nrf54l15dk_nrf54l15_cpuapp.conf b/samples/matter/window_covering/boards/nrf54l15dk_nrf54l15_cpuapp.conf index a891a583a1d7..5f3388a91552 100644 --- a/samples/matter/window_covering/boards/nrf54l15dk_nrf54l15_cpuapp.conf +++ b/samples/matter/window_covering/boards/nrf54l15dk_nrf54l15_cpuapp.conf @@ -12,8 +12,8 @@ CONFIG_CHIP_MALLOC_SYS_HEAP_SIZE=10240 CONFIG_MPSL_WORK_STACK_SIZE=2048 CONFIG_CHIP_TASK_STACK_SIZE=7168 -# Set the NVS sector count to match the settings partition size that is 40 kB for this application. -CONFIG_SETTINGS_NVS_SECTOR_COUNT=10 +# Set the ZMS sector count to match the settings partition size that is 40 kB for this application. +CONFIG_SETTINGS_ZMS_SECTOR_COUNT=10 # Low Power mode CONFIG_POWEROFF=y diff --git a/samples/matter/window_covering/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf b/samples/matter/window_covering/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf new file mode 100644 index 000000000000..facc5415b309 --- /dev/null +++ b/samples/matter/window_covering/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf @@ -0,0 +1,24 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# Multirole is the only currently supported role by SoftDevice. +CONFIG_BT_LL_SOFTDEVICE_MULTIROLE=y + +# TODO: Workaround to be removed once Zephyr's CONFIG_FPROTECT is supported on nRF54L_ns +CONFIG_CHIP_FACTORY_DATA_WRITE_PROTECT=n + +# TODO: KRKNWK-19382: Disable NFC commissioning due to an issue with definitions for ns build. +CONFIG_CHIP_NFC_COMMISSIONING=n + +# nRF54L15 requires bigger stack sizes than nRF52/nRF53 families +CONFIG_CHIP_MALLOC_SYS_HEAP_SIZE=10240 +CONFIG_MPSL_WORK_STACK_SIZE=2048 + +# Enable DAC key migration by default for ns build +CONFIG_CHIP_CRYPTO_PSA_MIGRATE_DAC_PRIV_KEY=y + +# Set the ZMS sector count to match the settings partition size that is 40 kB for this application. +CONFIG_SETTINGS_ZMS_SECTOR_COUNT=10 diff --git a/samples/matter/window_covering/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.overlay b/samples/matter/window_covering/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay similarity index 100% rename from samples/matter/window_covering/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.overlay rename to samples/matter/window_covering/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay diff --git a/samples/matter/window_covering/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.conf b/samples/matter/window_covering/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.conf deleted file mode 100644 index be1a6a76be76..000000000000 --- a/samples/matter/window_covering/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.conf +++ /dev/null @@ -1,24 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# Multirole is the only currently supported role by SoftDevice. -CONFIG_BT_LL_SOFTDEVICE_MULTIROLE=y - -# TODO: Workaround to be removed once Zephyr's CONFIG_FPROTECT is supported on nRF54L_ns -CONFIG_CHIP_FACTORY_DATA_WRITE_PROTECT=n - -# TODO: KRKNWK-19382: Disable NFC commissioning due to an issue with definitions for ns build. -CONFIG_CHIP_NFC_COMMISSIONING=n - -# nRF54L15 requires bigger stack sizes than nRF52/nRF53 families -CONFIG_CHIP_MALLOC_SYS_HEAP_SIZE=10240 -CONFIG_MPSL_WORK_STACK_SIZE=2048 - -# Enable DAC key migration by default for ns build -CONFIG_CHIP_CRYPTO_PSA_MIGRATE_DAC_PRIV_KEY=y - -# Set the NVS sector count to match the settings partition size that is 40 kB for this application. -CONFIG_SETTINGS_NVS_SECTOR_COUNT=10 diff --git a/samples/matter/window_covering/pm_static_nrf54l15pdk_nrf54l15_cpuapp_ns.yml b/samples/matter/window_covering/pm_static_nrf54l15dk_nrf54l15_cpuapp_ns.yml similarity index 100% rename from samples/matter/window_covering/pm_static_nrf54l15pdk_nrf54l15_cpuapp_ns.yml rename to samples/matter/window_covering/pm_static_nrf54l15dk_nrf54l15_cpuapp_ns.yml diff --git a/samples/matter/window_covering/sample.yaml b/samples/matter/window_covering/sample.yaml index 0e4a27659d61..5c014208f855 100644 --- a/samples/matter/window_covering/sample.yaml +++ b/samples/matter/window_covering/sample.yaml @@ -9,9 +9,9 @@ tests: - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp - nrf54l15dk/nrf54l15/cpuapp - - nrf54l15pdk/nrf54l15/cpuapp/ns + - nrf54l15dk/nrf54l15/cpuapp/ns platform_allow: nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp - nrf54l15dk/nrf54l15/cpuapp nrf54l15pdk/nrf54l15/cpuapp/ns + nrf54l15dk/nrf54l15/cpuapp nrf54l15dk/nrf54l15/cpuapp/ns tags: sysbuild ci_samples_matter sample.matter.window_cover.release: sysbuild: true diff --git a/samples/nrf_compress/mcuboot_update/CMakeLists.txt b/samples/nrf_compress/mcuboot_update/CMakeLists.txt new file mode 100644 index 000000000000..6925d49bbe87 --- /dev/null +++ b/samples/nrf_compress/mcuboot_update/CMakeLists.txt @@ -0,0 +1,15 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +cmake_minimum_required(VERSION 3.20.0) + +find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) +project(mcuboot_update) + +# This project uses orginal sdk-zephyr C source code +target_sources(app PRIVATE src/hook.c ${ZEPHYR_BASE}/samples/subsys/mgmt/mcumgr/smp_svr/src/main.c) +target_sources_ifdef(CONFIG_MCUMGR_TRANSPORT_BT app PRIVATE ${ZEPHYR_BASE}/samples/subsys/mgmt/mcumgr/smp_svr/src/bluetooth.c) +zephyr_link_libraries(MCUBOOT_BOOTUTIL) diff --git a/samples/nrf_compress/mcuboot_update/Kconfig b/samples/nrf_compress/mcuboot_update/Kconfig new file mode 100644 index 000000000000..51cf6b096f3d --- /dev/null +++ b/samples/nrf_compress/mcuboot_update/Kconfig @@ -0,0 +1,13 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +config OUTPUT_BOOT_MESSAGE + bool "Output message on boot" + help + Will output a dummy message on boot, this is to allow for generating a different image + that can be used to test the compressed firmware update. + +source "Kconfig.zephyr" diff --git a/samples/nrf_compress/mcuboot_update/README.rst b/samples/nrf_compress/mcuboot_update/README.rst new file mode 100644 index 000000000000..c72bac51762c --- /dev/null +++ b/samples/nrf_compress/mcuboot_update/README.rst @@ -0,0 +1,137 @@ +.. _nrf_compression_mcuboot_compressed_update: + +nRF Compression: MCUboot compressed update +########################################## + +.. contents:: + :local: + :depth: 2 + +This sample demonstrates how to enable and use :ref:`image compression within MCUboot `, which allows for smaller application updates to be loaded to a device. + +Requirements +************ + +The sample supports the following development kits: + +.. table-from-sample-yaml:: + +Overview +******** + +This sample is using the :ref:`nrf_compression` library. + +The sample's default configuration has the following features enabled: + +* MCUboot in the upgrade-only mode with the Kconfig option :kconfig:option:`CONFIG_BOOT_UPGRADE_ONLY` set to ``y``. +* Single-update image with the Kconfig option :kconfig:option:`CONFIG_UPDATEABLE_IMAGE_NUMBER` set to ``1``. + +When the sample is built, the build system automatically generates the update binary files with compressed image data and flags set. +These files match the :ref:`requirements for MCUboot image compression `. + +Configuration +************* + +|config| + +See :ref:`configuring_kconfig` for information about the different ways you can set Kconfig options in the |NCS|. + +Configuration options +===================== + +.. _CONFIG_OUTPUT_BOOT_MESSAGE: + +CONFIG_OUTPUT_BOOT_MESSAGE + When enabled, this optional configuration option outputs a message at run-time that allows for checking if the image has been updated successfully. + +Building and running +******************** + +.. |sample path| replace:: :file:`samples/nrf_compress/mcuboot_update` + +.. include:: /includes/build_and_run.txt + +To upload MCUboot and the bundle of images to the device, program the sample by using the :ref:`flash command without erase `. + +Testing over Bluetooth LE +========================= + +The testing scenario uses the FOTA over Bluetooth LE method to load the firmware update to the device. +For the testing scenario to work, make sure you meet the following requirements: + +* Your update image differs from the base image so that the update can be applied. +* You changed the firmware version by setting :kconfig:option:`CONFIG_MCUBOOT_IMGTOOL_SIGN_VERSION` to ``"2.0.0"``. +* You set the :kconfig:option:`CONFIG_OUTPUT_BOOT_MESSAGE` Kconfig option to ``y``. +* You are familiar with the FOTA over Bluetooth LE method (see :ref:`the guide for the nRF52840 DK ` and :ref:`the guide for the nRF5340 DK `). +* You have the `nRF Connect Device Manager`_ mobile app installed on your smartphone to update your device with the new firmware over Bluetooth LE. + +Meeting these requirements requires rebuilding the sample. + +|test_sample| + +#. |connect_kit| +#. |connect_terminal| +#. Start the `nRF Connect Device Manager`_ mobile app. +#. Follow the testing steps for the FOTA over Bluetooth LE. + See the following sections of the documentation: + + * :ref:`Testing steps for FOTA over Bluetooth LE with nRF52840 ` + * :ref:`Testing steps for FOTA over Bluetooth LE with nRF5340 ` + * *Not yet available*: Testing steps for FOTA over Bluetooth LE with nRF54L15 + +#. Once the firmware update has been loaded, check the UART output. + See the following `Sample output`_ section. +#. Reboot the device. + The compressed firmware update will be applied to the device and it will boot into it. + + .. note:: + At this point, the compressed flags will not be present in the running application image, as the firmware update has been decompressed whilst copying to the primary slot. + +Sample output +============= + +After a firmware update has been loaded, the UART will output the information on the image which will be one of the following: + +LZMA2 with ARM + The following output is logged: + + .. code-block:: console + + Secondary slot image is LZMA2 compressed with ARM thumb filter applied + + This indicates that the loaded firmware update has been compressed using LZMA2 and had the ARM thumb filter applied. + This offers the best compression ratio and is recommended for general usage. + +LZMA2 only + The following output is logged: + + .. code-block:: console + + Secondary slot image is LZMA2 compressed + + This indicates that the loaded firmware update has been compressed using LZMZ2. + This offers a good compression ratio but is not optimal. + +No LZMA2 + The following output is logged: + + .. code-block:: console + + Secondary slot image is uncompressed + + This indicates that the loaded firmware update has not been compressed at all. + This is a suboptimal and incorrect update. + +For information about how these compression types are configured in the :ref:`nrf_compression` library, see :ref:`nrf_compression_config_compression_types` in its documentation. + +Dependencies +************ + +The sample uses the following Zephyr library: + +* :ref:`zephyr:mcu_mgr` + +It also uses the following |NCS| library: + +* :ref:`partition_manager` +* :ref:`nrf_compression` diff --git a/samples/nrf_compress/mcuboot_update/pm_static_nrf52840dk_nrf52840.yml b/samples/nrf_compress/mcuboot_update/pm_static_nrf52840dk_nrf52840.yml new file mode 100644 index 000000000000..4ed838ca157c --- /dev/null +++ b/samples/nrf_compress/mcuboot_update/pm_static_nrf52840dk_nrf52840.yml @@ -0,0 +1,60 @@ +app: + address: 0x10200 + end_address: 0xa2000 + region: flash_primary + size: 0x91e00 +EMPTY_1: + address: 0x0 + end_address: 0x10200 + device: MX25R64 + region: external_flash + size: 0x10200 +compressed_app: + address: 0x10200 + end_address: 0xa2000 + device: MX25R64 + region: external_flash + size: 0x91e00 +EMPTY_2: + address: 0xa2000 + end_address: 0x800000 + device: MX25R64 + region: external_flash + size: 0x75e000 +mcuboot: + address: 0x0 + end_address: 0x10000 + region: flash_primary + size: 0x10000 +mcuboot_pad: + address: 0x10000 + end_address: 0x10200 + region: flash_primary + size: 0x200 +mcuboot_primary: + address: 0x10000 + end_address: 0xa2000 + orig_span: &id001 + - mcuboot_pad + - app + region: flash_primary + size: 0x92000 + span: *id001 +mcuboot_primary_app: + address: 0x10200 + end_address: 0xa2000 + orig_span: &id002 + - app + region: flash_primary + size: 0x91e00 + span: *id002 +mcuboot_secondary: + address: 0xa2000 + end_address: 0xf0000 + region: flash_primary + size: 0x4e000 +settings_storage: + address: 0xf0000 + end_address: 0x100000 + region: flash_primary + size: 0x10000 diff --git a/samples/nrf_compress/mcuboot_update/pm_static_nrf5340dk_nrf5340_cpuapp.yml b/samples/nrf_compress/mcuboot_update/pm_static_nrf5340dk_nrf5340_cpuapp.yml new file mode 100644 index 000000000000..6e8197cc8abd --- /dev/null +++ b/samples/nrf_compress/mcuboot_update/pm_static_nrf5340dk_nrf5340_cpuapp.yml @@ -0,0 +1,78 @@ +app: + address: 0x10200 + end_address: 0xa2000 + region: flash_primary + size: 0x91e00 +EMPTY_1: + address: 0x0 + end_address: 0x10200 + device: MX25R64 + region: external_flash + size: 0x10200 +compressed_app: + address: 0x10200 + end_address: 0xa2000 + device: MX25R64 + region: external_flash + size: 0x91e00 +EMPTY_2: + address: 0xa2000 + end_address: 0x800000 + device: MX25R64 + region: external_flash + size: 0x75e000 +mcuboot: + address: 0x0 + end_address: 0x10000 + region: flash_primary + size: 0x10000 +mcuboot_pad: + address: 0x10000 + end_address: 0x10200 + region: flash_primary + size: 0x200 +mcuboot_primary: + address: 0x10000 + end_address: 0xa2000 + orig_span: &id001 + - mcuboot_pad + - app + region: flash_primary + size: 0x92000 + span: *id001 +mcuboot_primary_app: + address: 0x10200 + end_address: 0xa2000 + orig_span: &id002 + - app + region: flash_primary + size: 0x91e00 + span: *id002 +mcuboot_secondary: + address: 0xa2000 + end_address: 0xf0000 + region: flash_primary + size: 0x4e000 +otp: + address: 0xff8100 + end_address: 0xff83fc + region: otp + size: 0x2fc +rpmsg_nrf53_sram: + address: 0x20070000 + end_address: 0x20080000 + placement: + before: + - end + region: sram_primary + size: 0x10000 +settings_storage: + address: 0xf0000 + end_address: 0x100000 + region: flash_primary + size: 0x10000 +sram_primary: + address: 0x20000000 + end_address: 0x20070000 + region: sram_primary + size: 0x70000 diff --git a/samples/nrf_compress/mcuboot_update/pm_static_nrf54l15dk_nrf54l15_cpuapp.yml b/samples/nrf_compress/mcuboot_update/pm_static_nrf54l15dk_nrf54l15_cpuapp.yml new file mode 100644 index 000000000000..29091d59e17f --- /dev/null +++ b/samples/nrf_compress/mcuboot_update/pm_static_nrf54l15dk_nrf54l15_cpuapp.yml @@ -0,0 +1,65 @@ +app: + address: 0x10800 + end_address: 0xa2000 + region: flash_primary + size: 0x91800 +EMPTY_1: + address: 0x0 + end_address: 0x10800 + device: MX25R64 + region: external_flash + size: 0x10800 +compressed_app: + address: 0x10800 + end_address: 0xa2000 + device: MX25R64 + region: external_flash + size: 0x91800 +EMPTY_2: + address: 0xa2000 + end_address: 0x800000 + device: MX25R64 + region: external_flash + size: 0x75e000 +EMPTY_3: + address: 0x100000 + end_address: 0x165000 + region: flash_primary + size: 0x65000 +mcuboot: + address: 0x0 + end_address: 0x10000 + region: flash_primary + size: 0x10000 +mcuboot_pad: + address: 0x10000 + end_address: 0x10800 + region: flash_primary + size: 0x800 +mcuboot_primary: + address: 0x10000 + end_address: 0xa2000 + orig_span: &id001 + - mcuboot_pad + - app + region: flash_primary + size: 0x92000 + span: *id001 +mcuboot_primary_app: + address: 0x10800 + end_address: 0xa2000 + orig_span: &id002 + - app + region: flash_primary + size: 0x91800 + span: *id002 +mcuboot_secondary: + address: 0xa2000 + end_address: 0xf0000 + region: flash_primary + size: 0x4e000 +settings_storage: + address: 0xf0000 + end_address: 0x100000 + region: flash_primary + size: 0x10000 diff --git a/samples/nrf_compress/mcuboot_update/prj.conf b/samples/nrf_compress/mcuboot_update/prj.conf new file mode 100644 index 000000000000..989e3870108d --- /dev/null +++ b/samples/nrf_compress/mcuboot_update/prj.conf @@ -0,0 +1,84 @@ +# Enable MCUmgr and dependencies. +CONFIG_NET_BUF=y +CONFIG_ZCBOR=y +CONFIG_CRC=y +CONFIG_MCUMGR=y +CONFIG_STREAM_FLASH=y +CONFIG_FLASH_MAP=y + +# Some command handlers require a large stack. +CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2304 +CONFIG_MAIN_STACK_SIZE=2048 + +# Ensure an MCUboot-compatible binary is generated. +CONFIG_BOOTLOADER_MCUBOOT=y + +# Enable flash operations. +CONFIG_FLASH=y + +# Required by the `taskstat` command. +CONFIG_THREAD_MONITOR=y + +# Support for taskstat command +CONFIG_MCUMGR_GRP_OS_TASKSTAT=y + +# Enable statistics and statistic names. +CONFIG_STATS=y +CONFIG_STATS_NAMES=y + +# Enable most core commands. +CONFIG_FLASH=y +CONFIG_IMG_MANAGER=y +CONFIG_MCUMGR_GRP_IMG=y +CONFIG_MCUMGR_GRP_OS=y +CONFIG_MCUMGR_GRP_STAT=y + +# Enable logging +CONFIG_LOG=y +CONFIG_MCUBOOT_UTIL_LOG_LEVEL_WRN=y + +# Disable debug logging +CONFIG_LOG_MAX_LEVEL=3 + +CONFIG_BT=y +CONFIG_BT_PERIPHERAL=y + +# Allow for large Bluetooth data packets. +CONFIG_BT_L2CAP_TX_MTU=498 +CONFIG_BT_BUF_ACL_RX_SIZE=502 +CONFIG_BT_BUF_ACL_TX_SIZE=502 +CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 + +# Enable the Bluetooth mcumgr transport (unauthenticated). +CONFIG_MCUMGR_TRANSPORT_BT=y +CONFIG_MCUMGR_TRANSPORT_BT_PERM_RW=y +CONFIG_MCUMGR_TRANSPORT_BT_CONN_PARAM_CONTROL=y + +# Enable the Shell mcumgr transport. +CONFIG_BASE64=y +CONFIG_SHELL=y +CONFIG_SHELL_BACKEND_SERIAL=y +CONFIG_MCUMGR_TRANSPORT_SHELL=y +CONFIG_MCUMGR_TRANSPORT_SHELL_RX_BUF_COUNT=8 + +# Enable the mcumgr Packet Reassembly feature over Bluetooth and its configuration dependencies. +# MCUmgr buffer size is optimized to fit one SMP packet divided into five Bluetooth Write Commands, +# transmitted with the maximum possible MTU value: 498 bytes. +CONFIG_MCUMGR_TRANSPORT_BT_REASSEMBLY=y +CONFIG_MCUMGR_TRANSPORT_NETBUF_SIZE=2475 +CONFIG_MCUMGR_GRP_OS_MCUMGR_PARAMS=y +CONFIG_MCUMGR_TRANSPORT_WORKQUEUE_STACK_SIZE=4608 + +# Disable Bluetooth ping support +CONFIG_BT_CTLR_LE_PING=n + +# Disable shell commands that are not needed +CONFIG_CLOCK_CONTROL_NRF_SHELL=n +CONFIG_DEVICE_SHELL=n +CONFIG_DEVMEM_SHELL=n +CONFIG_FLASH_SHELL=n + +CONFIG_MCUMGR_MGMT_NOTIFICATION_HOOKS=y +CONFIG_MCUMGR_GRP_IMG_STATUS_HOOKS=y +CONFIG_MCUMGR_GRP_IMG_IMAGE_SLOT_STATE_HOOK=y +CONFIG_MCUMGR_GRP_IMG_IMAGE_SLOT_STATE_STATES=20 diff --git a/samples/nrf_compress/mcuboot_update/sample.yaml b/samples/nrf_compress/mcuboot_update/sample.yaml new file mode 100644 index 000000000000..b378e776b852 --- /dev/null +++ b/samples/nrf_compress/mcuboot_update/sample.yaml @@ -0,0 +1,14 @@ +common: + sysbuild: true + tags: sysbuild + build_only: true +tests: + nrf_compress.mcuboot_update: + platform_allow: + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf54l15dk/nrf54l15/cpuapp + integration_platforms: + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf54l15dk/nrf54l15/cpuapp diff --git a/samples/nrf_compress/mcuboot_update/src/hook.c b/samples/nrf_compress/mcuboot_update/src/hook.c new file mode 100644 index 000000000000..084bb79fb3b3 --- /dev/null +++ b/samples/nrf_compress/mcuboot_update/src/hook.c @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +LOG_MODULE_REGISTER(mcuboot_update_sample, LOG_LEVEL_DBG); + +#define SECONDARY_SLOT 1 + +#ifndef CONFIG_MCUMGR_GRP_IMG_FRUGAL_LIST +#define ZCBOR_ENCODE_FLAG(zse, label, value) \ + (zcbor_tstr_put_lit(zse, label) && zcbor_bool_put(zse, value)) +#else +/* In "frugal" lists flags are added to response only when they evaluate to true */ +/* Note that value is evaluated twice! */ +#define ZCBOR_ENCODE_FLAG(zse, label, value) (!(value) || \ + (zcbor_tstr_put_lit(zse, label) && zcbor_bool_put(zse, (value)))) +#endif + +static struct mgmt_callback image_slot_callback; +static struct k_work slot_output_work; + +static void slot_output_handler(struct k_work *work) +{ + uint32_t slot_flags; + int rc; + + rc = img_mgmt_read_info(SECONDARY_SLOT, NULL, NULL, &slot_flags); + + if (!rc) { + slot_flags &= IMAGE_F_COMPRESSED_LZMA2 && IMAGE_F_COMPRESSED_ARM_THUMB_FLT; + + if (slot_flags == (IMAGE_F_COMPRESSED_LZMA2 && IMAGE_F_COMPRESSED_ARM_THUMB_FLT)) { + LOG_INF( + "Secondary slot image is LZMA2 compressed with ARM thumb filter applied"); + } else if (slot_flags & IMAGE_F_COMPRESSED_LZMA2) { + LOG_INF("Secondary slot image is LZMA2 compressed"); + } else { + LOG_INF("Secondary slot image is uncompressed"); + } + } else { + LOG_ERR("Failed to read slot info: %d", rc); + } +} + +static enum mgmt_cb_return image_slot_state_cb(uint32_t event, enum mgmt_cb_return prev_status, + int32_t *rc, uint16_t *group, bool *abort_more, + void *data, size_t data_size) +{ + if (event == MGMT_EVT_OP_IMG_MGMT_IMAGE_SLOT_STATE) { + /* Append a field indicating if the image in the slot is compressed */ + struct img_mgmt_state_slot_encode *slot_data = + (struct img_mgmt_state_slot_encode *)data; + + *slot_data->ok = ZCBOR_ENCODE_FLAG(slot_data->zse, "compressed", + (slot_data->flags & IMAGE_F_COMPRESSED_LZMA2)); + } else if (event == MGMT_EVT_OP_IMG_MGMT_DFU_PENDING) { + (void)k_work_submit(&slot_output_work); + } + + return MGMT_CB_OK; +} + +static int setup_slot_hook(void) +{ + /* Setup hook for when img mgmt image slot state is used and DFU pending callback */ + image_slot_callback.callback = image_slot_state_cb; + image_slot_callback.event_id = MGMT_EVT_OP_IMG_MGMT_IMAGE_SLOT_STATE | + MGMT_EVT_OP_IMG_MGMT_DFU_PENDING; + mgmt_callback_register(&image_slot_callback); + k_work_init(&slot_output_work, slot_output_handler); + +#if defined(CONFIG_OUTPUT_BOOT_MESSAGE) + LOG_INF("Dummy message indicating new firmware is running..."); +#endif + + return 0; +} + +SYS_INIT(setup_slot_hook, APPLICATION, 0); diff --git a/samples/nrf_compress/mcuboot_update/sysbuild.conf b/samples/nrf_compress/mcuboot_update/sysbuild.conf new file mode 100644 index 000000000000..43de0cb90004 --- /dev/null +++ b/samples/nrf_compress/mcuboot_update/sysbuild.conf @@ -0,0 +1,12 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +SB_CONFIG_BOOTLOADER_MCUBOOT=y +SB_CONFIG_BOOT_SIGNATURE_TYPE_ECDSA_P256=y +SB_CONFIG_MCUBOOT_MODE_OVERWRITE_ONLY=y +SB_CONFIG_MCUBOOT_UPDATEABLE_IMAGES=1 +SB_CONFIG_MCUBOOT_COMPRESSED_IMAGE_SUPPORT=y +SB_CONFIG_NETCORE_HCI_IPC=y diff --git a/samples/nrf_compress/mcuboot_update/sysbuild/mcuboot.conf b/samples/nrf_compress/mcuboot_update/sysbuild/mcuboot.conf new file mode 100644 index 000000000000..965c33a0e3ee --- /dev/null +++ b/samples/nrf_compress/mcuboot_update/sysbuild/mcuboot.conf @@ -0,0 +1 @@ +CONFIG_BOOT_MAX_IMG_SECTORS=512 diff --git a/samples/nrf_rpc/protocols_serialization/client/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/samples/nrf_rpc/protocols_serialization/client/boards/nrf54l15dk_nrf54l15_cpuapp.overlay index f4453ec45ada..b8455f2eef60 100644 --- a/samples/nrf_rpc/protocols_serialization/client/boards/nrf54l15dk_nrf54l15_cpuapp.overlay +++ b/samples/nrf_rpc/protocols_serialization/client/boards/nrf54l15dk_nrf54l15_cpuapp.overlay @@ -13,12 +13,9 @@ uart21_default: uart21_default { group1 { psels = , - ; - }; - group2 { - psels = , + , + , ; - bias-pull-up; }; }; @@ -40,4 +37,20 @@ pinctrl-0 = <&uart21_default>; pinctrl-1 = <&uart21_sleep>; pinctrl-names = "default", "sleep"; + hw-flow-control; +}; + +/* restore full RRAM and SRAM space - by default some parts are dedicated to FLRP */ +&cpuapp_rram { + reg = <0x0 DT_SIZE_K(1524)>; +}; + +&cpuapp_sram { + reg = <0x20000000 DT_SIZE_K(256)>; + ranges = <0x0 0x20000000 0x40000>; +}; + +&rram_controller { + /delete-node/ cpuflpr_sram; + /delete-node/ cpuflpr_rram; }; diff --git a/samples/nrf_rpc/protocols_serialization/client/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay b/samples/nrf_rpc/protocols_serialization/client/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay index f4453ec45ada..ed4ee0aa2487 100644 --- a/samples/nrf_rpc/protocols_serialization/client/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay +++ b/samples/nrf_rpc/protocols_serialization/client/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay @@ -41,3 +41,18 @@ pinctrl-1 = <&uart21_sleep>; pinctrl-names = "default", "sleep"; }; + +/* restore full RRAM and SRAM space - by default some parts are dedicated to FLRP */ +&cpuapp_rram { + reg = <0x0 DT_SIZE_K(1524)>; +}; + +&cpuapp_sram { + reg = <0x20000000 DT_SIZE_K(256)>; + ranges = <0x0 0x20000000 0x40000>; +}; + +&rram_controller { + /delete-node/ cpuflpr_sram; + /delete-node/ cpuflpr_rram; +}; diff --git a/samples/nrf_rpc/protocols_serialization/client/prj.conf b/samples/nrf_rpc/protocols_serialization/client/prj.conf index a733c7089c6b..c11a86b36456 100644 --- a/samples/nrf_rpc/protocols_serialization/client/prj.conf +++ b/samples/nrf_rpc/protocols_serialization/client/prj.conf @@ -11,6 +11,7 @@ CONFIG_NRF_RPC_ZCBOR_BACKUPS=1 CONFIG_NRF_RPC_THREAD_STACK_SIZE=4096 CONFIG_NRF_RPC_GROUP_INIT_WAIT_TIME=-1 CONFIG_NRF_RPC_UART_TRANSPORT=y +CONFIG_NRF_RPC_UART_RELIABLE=y CONFIG_UART_LINE_CTRL=y CONFIG_UART_INTERRUPT_DRIVEN=y diff --git a/samples/nrf_rpc/protocols_serialization/client/src/ot_shell.c b/samples/nrf_rpc/protocols_serialization/client/src/ot_shell.c index 45fc6ed24f38..c2dc3d24b46e 100644 --- a/samples/nrf_rpc/protocols_serialization/client/src/ot_shell.c +++ b/samples/nrf_rpc/protocols_serialization/client/src/ot_shell.c @@ -175,47 +175,11 @@ static otError ot_cli_command_discover(const struct shell *sh, size_t argc, char discover_cb, (void *)sh); } -static otError ot_cli_command_active_tlvs(const struct shell *sh, size_t argc, char *argv[]) -{ - otOperationalDatasetTlvs dataset; - otError error; - - if (argc <= 1) { - error = otDatasetGetActiveTlvs(NULL, &dataset); - - if (error == OT_ERROR_NONE) { - shell_print(sh, "%s", "Operational Dataset TLVs: "); - shell_hexdump(sh, dataset.mTlvs, dataset.mLength); - } else { - shell_warn(sh, "Operational Dataset TLVs not found err:%i", error); - } - - return error; - } - - if (argc != 2) { - return OT_ERROR_INVALID_COMMAND; - } - - dataset.mLength = hex2bin(argv[1], strlen(argv[1]), dataset.mTlvs, sizeof(dataset.mTlvs)); - error = otDatasetSetActiveTlvs(NULL, &dataset); - - if (error != OT_ERROR_NONE) { - shell_warn(sh, "Unable to set Operational Dataset TLVs err:%i", error); - } - - return error; -} - static int cmd_discover(const struct shell *sh, size_t argc, char *argv[]) { return ot_cli_command_invoke(ot_cli_command_discover, sh, argc, argv); } -static int cmd_active_tlvs(const struct shell *sh, size_t argc, char *argv[]) -{ - return ot_cli_command_invoke(ot_cli_command_active_tlvs, sh, argc, argv); -} static otError ot_cli_command_ifconfig(const struct shell *sh, size_t argc, char *argv[]) { if (argc <= 1) { @@ -782,7 +746,6 @@ SHELL_STATIC_SUBCMD_SET_CREATE( SHELL_CMD_ARG(state, NULL, "Current role", cmd_state, 1, 1), SHELL_CMD_ARG(thread, NULL, "Role management", cmd_thread, 2, 0), SHELL_CMD_ARG(discover, NULL, "Thread discovery scan", cmd_discover, 1, 4), - SHELL_CMD_ARG(active_tlvs, NULL, "Set active dataset", cmd_active_tlvs, 1, 1), SHELL_CMD_ARG(test_message, NULL, "Test message API", cmd_test_message, 1, 0), SHELL_CMD_ARG(test_udp_init, NULL, "Test udp init API", cmd_test_udp_init, 1, 0), SHELL_CMD_ARG(test_udp_send, NULL, "Test udp send API", cmd_test_udp_send, 1, 0), diff --git a/samples/nrf_rpc/protocols_serialization/server/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/samples/nrf_rpc/protocols_serialization/server/boards/nrf54l15dk_nrf54l15_cpuapp.overlay index f4453ec45ada..b8455f2eef60 100644 --- a/samples/nrf_rpc/protocols_serialization/server/boards/nrf54l15dk_nrf54l15_cpuapp.overlay +++ b/samples/nrf_rpc/protocols_serialization/server/boards/nrf54l15dk_nrf54l15_cpuapp.overlay @@ -13,12 +13,9 @@ uart21_default: uart21_default { group1 { psels = , - ; - }; - group2 { - psels = , + , + , ; - bias-pull-up; }; }; @@ -40,4 +37,20 @@ pinctrl-0 = <&uart21_default>; pinctrl-1 = <&uart21_sleep>; pinctrl-names = "default", "sleep"; + hw-flow-control; +}; + +/* restore full RRAM and SRAM space - by default some parts are dedicated to FLRP */ +&cpuapp_rram { + reg = <0x0 DT_SIZE_K(1524)>; +}; + +&cpuapp_sram { + reg = <0x20000000 DT_SIZE_K(256)>; + ranges = <0x0 0x20000000 0x40000>; +}; + +&rram_controller { + /delete-node/ cpuflpr_sram; + /delete-node/ cpuflpr_rram; }; diff --git a/samples/nrf_rpc/protocols_serialization/server/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay b/samples/nrf_rpc/protocols_serialization/server/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay index f4453ec45ada..ed4ee0aa2487 100644 --- a/samples/nrf_rpc/protocols_serialization/server/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay +++ b/samples/nrf_rpc/protocols_serialization/server/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay @@ -41,3 +41,18 @@ pinctrl-1 = <&uart21_sleep>; pinctrl-names = "default", "sleep"; }; + +/* restore full RRAM and SRAM space - by default some parts are dedicated to FLRP */ +&cpuapp_rram { + reg = <0x0 DT_SIZE_K(1524)>; +}; + +&cpuapp_sram { + reg = <0x20000000 DT_SIZE_K(256)>; + ranges = <0x0 0x20000000 0x40000>; +}; + +&rram_controller { + /delete-node/ cpuflpr_sram; + /delete-node/ cpuflpr_rram; +}; diff --git a/samples/nrf_rpc/protocols_serialization/server/prj.conf b/samples/nrf_rpc/protocols_serialization/server/prj.conf index 47bf1d9badb9..3c531875cbc8 100644 --- a/samples/nrf_rpc/protocols_serialization/server/prj.conf +++ b/samples/nrf_rpc/protocols_serialization/server/prj.conf @@ -11,6 +11,7 @@ CONFIG_NRF_RPC_ZCBOR_BACKUPS=1 CONFIG_NRF_RPC_THREAD_STACK_SIZE=4096 CONFIG_NRF_RPC_GROUP_INIT_WAIT_TIME=-1 CONFIG_NRF_RPC_UART_TRANSPORT=y +CONFIG_NRF_RPC_UART_RELIABLE=y CONFIG_UART_LINE_CTRL=y CONFIG_UART_INTERRUPT_DRIVEN=y diff --git a/samples/nrf_rpc/protocols_serialization/server/snippets/log_rpc/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/samples/nrf_rpc/protocols_serialization/server/snippets/log_rpc/boards/nrf54l15dk_nrf54l15_cpuapp.overlay index f8ec97b63260..cbd033c05f04 100644 --- a/samples/nrf_rpc/protocols_serialization/server/snippets/log_rpc/boards/nrf54l15dk_nrf54l15_cpuapp.overlay +++ b/samples/nrf_rpc/protocols_serialization/server/snippets/log_rpc/boards/nrf54l15dk_nrf54l15_cpuapp.overlay @@ -6,7 +6,7 @@ / { sram@2003FC00 { compatible = "zephyr,memory-region", "mmio-sram"; - reg = <0x2002EC00 DT_SIZE_K(1)>; + reg = <0x2003FC00 DT_SIZE_K(1)>; zephyr,memory-region = "RetainedMem"; status = "okay"; @@ -31,5 +31,5 @@ /* Reduce SRAM_CPUAPP usage by 1KB to account for non-init area */ &cpuapp_sram { - reg = <0x20000000 DT_SIZE_K(187)>; + reg = <0x20000000 DT_SIZE_K(255)>; }; diff --git a/samples/nrf_rpc/protocols_serialization/server/snippets/log_rpc/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay b/samples/nrf_rpc/protocols_serialization/server/snippets/log_rpc/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay index f8ec97b63260..cbd033c05f04 100644 --- a/samples/nrf_rpc/protocols_serialization/server/snippets/log_rpc/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay +++ b/samples/nrf_rpc/protocols_serialization/server/snippets/log_rpc/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay @@ -6,7 +6,7 @@ / { sram@2003FC00 { compatible = "zephyr,memory-region", "mmio-sram"; - reg = <0x2002EC00 DT_SIZE_K(1)>; + reg = <0x2003FC00 DT_SIZE_K(1)>; zephyr,memory-region = "RetainedMem"; status = "okay"; @@ -31,5 +31,5 @@ /* Reduce SRAM_CPUAPP usage by 1KB to account for non-init area */ &cpuapp_sram { - reg = <0x20000000 DT_SIZE_K(187)>; + reg = <0x20000000 DT_SIZE_K(255)>; }; diff --git a/samples/nrf_rpc/protocols_serialization/server/snippets/openthread/openthread.conf b/samples/nrf_rpc/protocols_serialization/server/snippets/openthread/openthread.conf index c50c6550c506..5d2889c90397 100644 --- a/samples/nrf_rpc/protocols_serialization/server/snippets/openthread/openthread.conf +++ b/samples/nrf_rpc/protocols_serialization/server/snippets/openthread/openthread.conf @@ -14,7 +14,6 @@ CONFIG_NET_SOCKETS=y CONFIG_NET_SOCKETS_PACKET=y CONFIG_OPENTHREAD_RPC=y CONFIG_OPENTHREAD_RPC_SERVER=y -CONFIG_IEEE802154_NET_IF_NO_AUTO_START=y # Let RPC client start the interface on demand CONFIG_OPENTHREAD_MANUAL_START=y CONFIG_NET_BUF_RX_COUNT=80 CONFIG_NET_BUF_TX_COUNT=80 diff --git a/samples/openthread/cli/boards/nrf54l15dk_nrf54l15_cpuapp.conf b/samples/openthread/cli/boards/nrf54l15dk_nrf54l15_cpuapp.conf index b64e3785e2d9..f6cb57237eea 100644 --- a/samples/openthread/cli/boards/nrf54l15dk_nrf54l15_cpuapp.conf +++ b/samples/openthread/cli/boards/nrf54l15dk_nrf54l15_cpuapp.conf @@ -11,3 +11,9 @@ CONFIG_NRFX_UARTE0=n # while using CRACEN CONFIG_MAIN_STACK_SIZE=6144 CONFIG_SHELL_STACK_SIZE=5120 + +# Workaround required as Zephyr L2 implies usage of NVS backend for settings. +# It should be removed once the proper fix will be applied in Zephyr. +CONFIG_NVS=n +CONFIG_ZMS=y +CONFIG_SETTINGS_ZMS=y diff --git a/samples/openthread/cli/snippets/tcp/tcp.conf b/samples/openthread/cli/snippets/tcp/tcp.conf index 28c2c23f5c0c..9b312786d7d2 100644 --- a/samples/openthread/cli/snippets/tcp/tcp.conf +++ b/samples/openthread/cli/snippets/tcp/tcp.conf @@ -4,6 +4,9 @@ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # +# Enforce building from sources when changing OpenThread configuration +CONFIG_OPENTHREAD_SOURCES=y + # TCP configuration CONFIG_OPENTHREAD_TCP_ENABLE=y CONFIG_OPENTHREAD_CLI_TCP_ENABLE=y diff --git a/samples/openthread/coprocessor/boards/nrf54l15dk_nrf54l15_cpuapp.conf b/samples/openthread/coprocessor/boards/nrf54l15dk_nrf54l15_cpuapp.conf index 051efff8b4db..f4a72c04dba7 100644 --- a/samples/openthread/coprocessor/boards/nrf54l15dk_nrf54l15_cpuapp.conf +++ b/samples/openthread/coprocessor/boards/nrf54l15dk_nrf54l15_cpuapp.conf @@ -6,3 +6,9 @@ CONFIG_FPU=n CONFIG_SPI_NOR=n + +# Workaround required as Zephyr L2 implies usage of NVS backend for settings. +# It should be removed once the proper fix will be applied in Zephyr. +CONFIG_NVS=n +CONFIG_ZMS=y +CONFIG_SETTINGS_ZMS=y diff --git a/samples/peripheral/radio_test/src/main.c b/samples/peripheral/radio_test/src/main.c index 7f44191535bd..1d7ff55c9b26 100644 --- a/samples/peripheral/radio_test/src/main.c +++ b/samples/peripheral/radio_test/src/main.c @@ -60,5 +60,11 @@ int main(void) clock_init(); #endif /* defined(CONFIG_CLOCK_CONTROL_NRF) */ +#if defined(CONFIG_SOC_SERIES_NRF54HX) + /* Apply HMPAN-102 workaround for nRF54H series */ + *(volatile uint32_t *)0x5302C7E4 = + (((*((volatile uint32_t *)0x5302C7E4)) & 0xFF000FFF) | 0x0012C000); +#endif + return 0; } diff --git a/samples/peripheral/radio_test/src/radio_cmd.c b/samples/peripheral/radio_test/src/radio_cmd.c index 35c5649806ba..cd2659a4a23a 100644 --- a/samples/peripheral/radio_test/src/radio_cmd.c +++ b/samples/peripheral/radio_test/src/radio_cmd.c @@ -476,6 +476,22 @@ static int cmd_print(const struct shell *shell, size_t argc, char **argv) break; #endif /* defined(RADIO_MODE_MODE_Nrf_4Mbit0_25) */ +#if defined(RADIO_MODE_MODE_Nrf_4Mbit_0BT6) + case NRF_RADIO_MODE_NRF_4MBIT_BT_0_6: + shell_print(shell, + "Data rate: %s", + STRINGIFY(NRF_RADIO_MODE_NRF_4MBIT_BT_0_6)); + break; +#endif /* defined(RADIO_MODE_MODE_Nrf_4Mbit_0BT6) */ + +#if defined(RADIO_MODE_MODE_Nrf_4Mbit_0BT4) + case NRF_RADIO_MODE_NRF_4MBIT_BT_0_4: + shell_print(shell, + "Data rate: %s", + STRINGIFY(NRF_RADIO_MODE_NRF_4MBIT_BT_0_4)); + break; +#endif /* defined(RADIO_MODE_MODE_Nrf_4Mbit_0BT4) */ + case NRF_RADIO_MODE_NRF_1MBIT: shell_print(shell, "Data rate: %s", @@ -837,19 +853,35 @@ static void cmd_neg16dbm(const struct shell *shell, size_t argc, char **argv) shell_print(shell, "TX power : %d dBm", config.txpower); } +#if defined(RADIO_TXPOWER_TXPOWER_Neg18dBm) +static void cmd_neg18dbm(const struct shell *shell, size_t argc, char **argv) +{ + config.txpower = -18; + shell_print(shell, "TX power : %d dBm", config.txpower); +} +#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg18dBm) */ + static void cmd_neg20dbm(const struct shell *shell, size_t argc, char **argv) { config.txpower = -20; shell_print(shell, "TX power : %d dBm", config.txpower); } -#if defined(RADIO_TXPOWER_TXPOWER_Neg26dBm) -static void cmd_neg26dbm(const struct shell *shell, size_t argc, char **argv) +#if defined(RADIO_TXPOWER_TXPOWER_Neg22dBm) +static void cmd_neg22dbm(const struct shell *shell, size_t argc, char **argv) { - config.txpower = -26; + config.txpower = -22; shell_print(shell, "TX power : %d dBm", config.txpower); } -#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg26dBm) */ +#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg22dBm) */ + +#if defined(RADIO_TXPOWER_TXPOWER_Neg28dBm) +static void cmd_neg28dbm(const struct shell *shell, size_t argc, char **argv) +{ + config.txpower = -28; + shell_print(shell, "TX power : %d dBm", config.txpower); +} +#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg28dBm) */ #if defined(RADIO_TXPOWER_TXPOWER_Neg30dBm) static void cmd_neg30dbm(const struct shell *shell, size_t argc, char **argv) @@ -881,6 +913,14 @@ static void cmd_neg70dbm(const struct shell *shell, size_t argc, char **argv) } #endif /* defined(RADIO_TXPOWER_TXPOWER_Neg70dBm) */ +#if defined(RADIO_TXPOWER_TXPOWER_Neg100dBm) +static void cmd_neg100dbm(const struct shell *shell, size_t argc, char **argv) +{ + config.txpower = -100; + shell_print(shell, "TX power : %d dBm", config.txpower); +} +#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg100dBm) */ + static int cmd_nrf_1mbit(const struct shell *shell, size_t argc, char **argv) { config.mode = NRF_RADIO_MODE_NRF_1MBIT; @@ -935,6 +975,30 @@ static int cmd_nrf_4mbit_h_0_25(const struct shell *shell, size_t argc, } #endif /* defined(RADIO_MODE_MODE_Nrf_4Mbit0_25) */ +#if defined(RADIO_MODE_MODE_Nrf_4Mbit_0BT6) +static int cmd_nrf_4mbit_bt_0_6(const struct shell *shell, size_t argc, + char **argv) +{ + config.mode = NRF_RADIO_MODE_NRF_4MBIT_BT_0_6; + shell_print(shell, "Data rate: %s", + STRINGIFY(NRF_RADIO_MODE_NRF_4MBIT_BT_0_6)); + + return 0; +} +#endif /* defined(RADIO_MODE_MODE_Nrf_4Mbit_0BT6) */ + +#if defined(RADIO_MODE_MODE_Nrf_4Mbit_0BT4) +static int cmd_nrf_4mbit_bt_0_4(const struct shell *shell, size_t argc, + char **argv) +{ + config.mode = NRF_RADIO_MODE_NRF_4MBIT_BT_0_4; + shell_print(shell, "Data rate: %s", + STRINGIFY(NRF_RADIO_MODE_NRF_4MBIT_BT_0_4)); + + return 0; +} +#endif /* defined(RADIO_MODE_MODE_Nrf_4Mbit_0BT4) */ + static int cmd_ble_1mbit(const struct shell *shell, size_t argc, char **argv) { config.mode = NRF_RADIO_MODE_BLE_1MBIT; @@ -1043,6 +1107,18 @@ SHELL_STATIC_SUBCMD_SET_CREATE(sub_data_rate, cmd_nrf_4mbit_h_0_25), #endif /* defined(RADIO_MODE_MODE_Nrf_4Mbit0_25) */ +#if defined(RADIO_MODE_MODE_Nrf_4Mbit_0BT6) + SHELL_CMD(nrf_4Mbit_BT06, NULL, + "4 Mbps Nordic proprietary radio mode (BT=0.6/h=0.5)", + cmd_nrf_4mbit_bt_0_6), +#endif /* defined(RADIO_MODE_MODE_Nrf_4Mbit_0BT6) */ + +#if defined(RADIO_MODE_MODE_Nrf_4Mbit_0BT4) + SHELL_CMD(nrf_4Mbit_BT04, NULL, + "4 Mbps Nordic proprietary radio mode (BT=0.4/h=0.5)", + cmd_nrf_4mbit_bt_0_4), +#endif /* defined(RADIO_MODE_MODE_Nrf_4Mbit_0BT4) */ + SHELL_CMD(ble_1Mbit, NULL, "1 Mbit/s Bluetooth Low Energy", cmd_ble_1mbit), SHELL_CMD(ble_2Mbit, NULL, "2 Mbit/s Bluetooth Low Energy", @@ -1254,10 +1330,16 @@ SHELL_STATIC_SUBCMD_SET_CREATE(sub_output_power, SHELL_CMD(neg14dBm, NULL, "TX power: -14 dBm", cmd_neg14dbm), #endif /* defined(RADIO_TXPOWER_TXPOWER_Neg14dBm) */ SHELL_CMD(neg16dBm, NULL, "TX power: -16 dBm", cmd_neg16dbm), +#if defined(RADIO_TXPOWER_TXPOWER_Neg18dBm) + SHELL_CMD(neg18dBm, NULL, "TX power: -18 dBm", cmd_neg18dbm), +#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg18dBm) */ SHELL_CMD(neg20dBm, NULL, "TX power: -20 dBm", cmd_neg20dbm), -#if defined(RADIO_TXPOWER_TXPOWER_Neg26dBm) - SHELL_CMD(neg26dBm, NULL, "TX power: -26 dBm", cmd_neg26dbm), -#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg26dBm) */ +#if defined(RADIO_TXPOWER_TXPOWER_Neg22dBm) + SHELL_CMD(neg22dBm, NULL, "TX power: -22 dBm", cmd_neg22dbm), +#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg22dBm) */ +#if defined(RADIO_TXPOWER_TXPOWER_Neg28dBm) + SHELL_CMD(neg28dBm, NULL, "TX power: -28 dBm", cmd_neg28dbm), +#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg28dBm) */ #if defined(RADIO_TXPOWER_TXPOWER_Neg30dBm) SHELL_CMD(neg30dBm, NULL, "TX power: -30 dBm", cmd_neg30dbm), #endif /* defined(RADIO_TXPOWER_TXPOWER_Neg30dBm) */ @@ -1268,6 +1350,9 @@ SHELL_STATIC_SUBCMD_SET_CREATE(sub_output_power, #if defined(RADIO_TXPOWER_TXPOWER_Neg70dBm) SHELL_CMD(neg70dBm, NULL, "TX power: -70 dBm", cmd_neg70dbm), #endif /* defined(RADIO_TXPOWER_TXPOWER_Neg70dBm) */ +#if defined(RADIO_TXPOWER_TXPOWER_Neg100dBm) + SHELL_CMD(neg100dBm, NULL, "TX power: -100 dBm", cmd_neg100dbm), +#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg100dBm) */ SHELL_SUBCMD_SET_END ); diff --git a/samples/peripheral/radio_test/src/radio_test.c b/samples/peripheral/radio_test/src/radio_test.c index f4b868dc4147..14e1b91f74b8 100644 --- a/samples/peripheral/radio_test/src/radio_test.c +++ b/samples/peripheral/radio_test/src/radio_test.c @@ -138,6 +138,11 @@ static uint16_t channel_to_frequency(nrf_radio_mode_t mode, uint8_t channel) static nrf_radio_txpower_t dbm_to_nrf_radio_txpower(int8_t tx_power) { switch (tx_power) { +#if defined(RADIO_TXPOWER_TXPOWER_Neg100dBm) + case -100: + return RADIO_TXPOWER_TXPOWER_Neg100dBm; +#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg100dBm) */ + #if defined(RADIO_TXPOWER_TXPOWER_Neg70dBm) case -70: return RADIO_TXPOWER_TXPOWER_Neg70dBm; @@ -156,14 +161,24 @@ static nrf_radio_txpower_t dbm_to_nrf_radio_txpower(int8_t tx_power) return RADIO_TXPOWER_TXPOWER_Neg30dBm; #endif /* defined(RADIO_TXPOWER_TXPOWER_Neg30dBm) */ -#if defined(RADIO_TXPOWER_TXPOWER_Neg26dBm) - case -26: - return RADIO_TXPOWER_TXPOWER_Neg26dBm; -#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg26dBm) */ +#if defined(RADIO_TXPOWER_TXPOWER_Neg28dBm) + case -28: + return RADIO_TXPOWER_TXPOWER_Neg28dBm; +#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg28dBm) */ + +#if defined(RADIO_TXPOWER_TXPOWER_Neg22dBm) + case -22: + return RADIO_TXPOWER_TXPOWER_Neg22dBm; +#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg22dBm) */ case -20: return RADIO_TXPOWER_TXPOWER_Neg20dBm; +#if defined(RADIO_TXPOWER_TXPOWER_Neg18dBm) + case -18: + return RADIO_TXPOWER_TXPOWER_Neg18dBm; +#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg18dBm) */ + case -16: return RADIO_TXPOWER_TXPOWER_Neg16dBm; @@ -563,6 +578,61 @@ static void radio_config(nrf_radio_mode_t mode, enum transmit_pattern pattern) /* preamble, address (BALEN + PREFIX), lflen and payload */ total_payload_size = 2 + (packet_conf.balen + 1) + 1 + packet_conf.maxlen; break; +#if defined(RADIO_MODE_MODE_Nrf_4Mbit0_5) + case NRF_RADIO_MODE_NRF_4MBIT_H_0_5: + /* Packet configuration: + * S1 size = 0 bits, + * S0 size = 0 bytes, + * 16-bit preamble. + */ + packet_conf.plen = NRF_RADIO_PREAMBLE_LENGTH_16BIT; + + /* preamble, address (BALEN + PREFIX), lflen and payload */ + total_payload_size = 2 + (packet_conf.balen + 1) + 1 + packet_conf.maxlen; + break; +#endif /* defined(RADIO_MODE_MODE_Nrf_4Mbit0_5) */ + +#if defined(RADIO_MODE_MODE_Nrf_4Mbit0_25) + case NRF_RADIO_MODE_NRF_4MBIT_H_0_25: + /* Packet configuration: + * S1 size = 0 bits, + * S0 size = 0 bytes, + * 16-bit preamble. + */ + packet_conf.plen = NRF_RADIO_PREAMBLE_LENGTH_16BIT; + + /* preamble, address (BALEN + PREFIX), lflen and payload */ + total_payload_size = 2 + (packet_conf.balen + 1) + 1 + packet_conf.maxlen; + break; +#endif /* defined(RADIO_MODE_MODE_Nrf_4Mbit0_25) */ + +#if defined(RADIO_MODE_MODE_Nrf_4Mbit_0BT6) + case NRF_RADIO_MODE_NRF_4MBIT_BT_0_6: + /* Packet configuration: + * S1 size = 0 bits, + * S0 size = 0 bytes, + * 16-bit preamble. + */ + packet_conf.plen = NRF_RADIO_PREAMBLE_LENGTH_16BIT; + + /* preamble, address (BALEN + PREFIX), lflen and payload */ + total_payload_size = 2 + (packet_conf.balen + 1) + 1 + packet_conf.maxlen; + break; +#endif /* defined(RADIO_MODE_MODE_Nrf_4Mbit_0BT6) */ + +#if defined(RADIO_MODE_MODE_Nrf_4Mbit_0BT4) + case NRF_RADIO_MODE_NRF_4MBIT_BT_0_4: + /* Packet configuration: + * S1 size = 0 bits, + * S0 size = 0 bytes, + * 16-bit preamble. + */ + packet_conf.plen = NRF_RADIO_PREAMBLE_LENGTH_16BIT; + + /* preamble, address (BALEN + PREFIX), lflen and payload */ + total_payload_size = 2 + (packet_conf.balen + 1) + 1 + packet_conf.maxlen; + break; +#endif /* defined(RADIO_MODE_MODE_Nrf_4Mbit_0BT4) */ default: /* Packet configuration: @@ -637,6 +707,17 @@ static void radio_disable(void) #endif /* CONFIG_FEM */ } +static void mltpan_6(nrf_radio_mode_t mode) +{ +#if defined(NRF54L_SERIES) + if (mode == NRF_RADIO_MODE_IEEE802154_250KBIT) { + *((volatile uint32_t *)0x5008A810) = 2; + } +#else + ARG_UNUSED(mode); +#endif /* defined(NRF54L_SERIES) */ +} + #if NRF53_ERRATA_117_PRESENT static void errata_117(nrf_radio_mode_t mode) { @@ -663,6 +744,7 @@ static void radio_mode_set(NRF_RADIO_Type *reg, nrf_radio_mode_t mode) { errata_117(mode); nrf_radio_mode_set(reg, mode); + mltpan_6(mode); } static void radio_unmodulated_tx_carrier(uint8_t mode, int8_t txpower, uint8_t channel) @@ -718,6 +800,12 @@ static void radio_modulated_tx_carrier(uint8_t mode, int8_t txpower, uint8_t cha #if defined(RADIO_MODE_MODE_Nrf_4Mbit0_25) case NRF_RADIO_MODE_NRF_4MBIT_H_0_25: #endif /* defined(RADIO_MODE_MODE_Nrf_4Mbit0_25) */ +#if defined(RADIO_MODE_MODE_Nrf_4Mbit_0BT6) + case NRF_RADIO_MODE_NRF_4MBIT_BT_0_6: +#endif /* defined(RADIO_MODE_MODE_Nrf_4Mbit_0BT6) */ +#if defined(RADIO_MODE_MODE_Nrf_4Mbit_0BT4) + case NRF_RADIO_MODE_NRF_4MBIT_BT_0_4: +#endif /* defined(RADIO_MODE_MODE_Nrf_4Mbit_0BT4) */ nrf_radio_shorts_enable(NRF_RADIO, NRF_RADIO_SHORT_READY_START_MASK | RADIO_TEST_SHORT_END_START_MASK); diff --git a/samples/pmic/native/npm1300_fuel_gauge/README.rst b/samples/pmic/native/npm1300_fuel_gauge/README.rst index b85bf0bb85fd..d5a4eef6d029 100644 --- a/samples/pmic/native/npm1300_fuel_gauge/README.rst +++ b/samples/pmic/native/npm1300_fuel_gauge/README.rst @@ -43,30 +43,35 @@ To connect your DK to the nPM1300 EK, complete the following steps: - nRF52840 DK pins - nRF5340 DK pins - nRF54L15 DK pins + - nRF54H20 DK pins - nRF9160 DK pins * - SDA - P0.26 - P0.26 - P1.02 - P1.11 + - P0.04 - P0.30 * - SCL - P0.27 - P0.27 - P1.03 - P1.12 + - P0.00 - P0.31 * - GPIO3 - P0.22 - P1.12 - P1.12 - P1.10 + - P0.05 - P0.10 * - VDDIO - VDD - VDD - VDD - VDDIO + - VDD_P0 - VDD * - GND - GND @@ -74,6 +79,7 @@ To connect your DK to the nPM1300 EK, complete the following steps: - GND - GND - GND + - GND #. Make the following connections on the nPM1300 EK: @@ -85,6 +91,10 @@ To connect your DK to the nPM1300 EK, complete the following steps: * On the **P13** pin header, connect **RSET1** and **VSET1** pins with a jumper. * On the **P14** pin header, connect **RSET2** and **VSET2** pins with a jumper. +.. note:: + + When using the :ref:`zephyr:nrf54l15dk_nrf54l15`, the nPM1300 **GPIO3** interrupt pin assignment uses the DK's **LED 1** pin. + Building and running ******************** diff --git a/samples/pmic/native/npm1300_fuel_gauge/boards/extensions/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.overlay b/samples/pmic/native/npm1300_fuel_gauge/boards/extensions/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.overlay new file mode 100644 index 000000000000..68b6b80af762 --- /dev/null +++ b/samples/pmic/native/npm1300_fuel_gauge/boards/extensions/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +&pinctrl { + i2c130_default: i2c130_default { + group1 { + psels = , + ; + }; + }; + + i2c130_sleep: i2c130_sleep { + group1 { + psels = , + ; + low-power-enable; + }; + }; +}; + +/* Define arduino_i2c here so it is available for the shield overlay */ +arduino_i2c: &i2c130 { + compatible = "nordic,nrf-twim"; + pinctrl-0 = <&i2c130_default>; + pinctrl-1 = <&i2c130_sleep>; + pinctrl-names = "default", "sleep"; + clock-frequency = ; + zephyr,concat-buf-size = <255>; + memory-regions = <&cpuapp_dma_region>; +}; diff --git a/samples/pmic/native/npm1300_fuel_gauge/nrf54h20dk_nrf54h20_cpuapp.overlay b/samples/pmic/native/npm1300_fuel_gauge/nrf54h20dk_nrf54h20_cpuapp.overlay new file mode 100644 index 000000000000..361db7046d6f --- /dev/null +++ b/samples/pmic/native/npm1300_fuel_gauge/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + + #include + +&i2c130_default { + group1 { + bias-pull-up; + }; +}; + +&i2c130 { + status = "okay"; +}; + +&gpio0 { + status = "okay"; +}; + +&npm1300_ek_pmic { + host-int-gpios = <&gpio0 5 0>; + pmic-int-pin = <3>; +}; diff --git a/samples/pmic/native/npm1300_fuel_gauge/sample.yaml b/samples/pmic/native/npm1300_fuel_gauge/sample.yaml index af5a3307fcc8..2afd68073da7 100644 --- a/samples/pmic/native/npm1300_fuel_gauge/sample.yaml +++ b/samples/pmic/native/npm1300_fuel_gauge/sample.yaml @@ -9,12 +9,14 @@ common: - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp - nrf54l15dk/nrf54l15/cpuapp + - nrf54h20dk/nrf54h20/cpuapp - nrf9160dk/nrf9160 platform_allow: - nrf52dk/nrf52832 - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp - nrf54l15dk/nrf54l15/cpuapp + - nrf54h20dk/nrf54h20/cpuapp - nrf9160dk/nrf9160 tags: pmic ci_samples_pmic @@ -34,7 +36,7 @@ tests: - "SoC: [0-9.]+, TTE: ([0-9.]+|nan), TTF: ([0-9.]+|nan)" samples.compile: sysbuild: true - platform_allow: nrf9160dk/nrf9160 nrf54l15dk/nrf54l15/cpuapp + platform_allow: nrf9160dk/nrf9160 nrf54l15dk/nrf54l15/cpuapp nrf54h20dk/nrf54h20/cpuapp harness: shield tags: shield sysbuild ci_samples_pmic extra_args: SHIELD=npm1300_ek diff --git a/samples/pmic/native/npm1300_one_button/README.rst b/samples/pmic/native/npm1300_one_button/README.rst index 399e77605bf7..441ff1cc8340 100644 --- a/samples/pmic/native/npm1300_one_button/README.rst +++ b/samples/pmic/native/npm1300_one_button/README.rst @@ -54,30 +54,35 @@ To connect your DK to the nPM1300 EK, complete the following steps: - nRF52840 DK pins - nRF5340 DK pins - nRF54L15 DK pins + - nRF54H20 DK pins - nRF9160 DK pins * - SDA - P0.26 - P0.26 - P1.02 - P1.11 + - P0.04 - P0.30 * - SCL - P0.27 - P0.27 - P1.03 - P1.12 + - P0.00 - P0.31 * - GPIO3 - P0.22 - P1.12 - P1.12 - P1.10 + - P0.05 - P0.10 * - VDDIO - VDD - VDD - VDD - VDDIO + - VDD_P0 - VDD * - GND - GND @@ -85,6 +90,11 @@ To connect your DK to the nPM1300 EK, complete the following steps: - GND - GND - GND + - GND + +.. note:: + + When using the :ref:`zephyr:nrf54l15dk_nrf54l15`, the nPM1300 **GPIO3** interrupt pin assignment uses the DK's **LED 1** pin. Building and running ******************** diff --git a/samples/pmic/native/npm1300_one_button/boards/extensions/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.overlay b/samples/pmic/native/npm1300_one_button/boards/extensions/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.overlay new file mode 100644 index 000000000000..68b6b80af762 --- /dev/null +++ b/samples/pmic/native/npm1300_one_button/boards/extensions/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +&pinctrl { + i2c130_default: i2c130_default { + group1 { + psels = , + ; + }; + }; + + i2c130_sleep: i2c130_sleep { + group1 { + psels = , + ; + low-power-enable; + }; + }; +}; + +/* Define arduino_i2c here so it is available for the shield overlay */ +arduino_i2c: &i2c130 { + compatible = "nordic,nrf-twim"; + pinctrl-0 = <&i2c130_default>; + pinctrl-1 = <&i2c130_sleep>; + pinctrl-names = "default", "sleep"; + clock-frequency = ; + zephyr,concat-buf-size = <255>; + memory-regions = <&cpuapp_dma_region>; +}; diff --git a/samples/pmic/native/npm1300_one_button/nrf54h20dk_nrf54h20_cpuapp.overlay b/samples/pmic/native/npm1300_one_button/nrf54h20dk_nrf54h20_cpuapp.overlay new file mode 100644 index 000000000000..d2cf7d77ae59 --- /dev/null +++ b/samples/pmic/native/npm1300_one_button/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + + #include + +&i2c130_default { + group1 { + bias-pull-up; + }; +}; + +&i2c130 { + status = "okay"; +}; + +&gpio0 { + status = "okay"; +}; + +&npm1300_ek_ldo1 { + regulator-initial-mode = ; +}; + +&npm1300_ek_pmic { + host-int-gpios = <&gpio0 5 0>; + pmic-int-pin = <3>; +}; diff --git a/samples/pmic/native/npm1300_one_button/sample.yaml b/samples/pmic/native/npm1300_one_button/sample.yaml index 4ad6a678098e..6d5eaa6730b8 100644 --- a/samples/pmic/native/npm1300_one_button/sample.yaml +++ b/samples/pmic/native/npm1300_one_button/sample.yaml @@ -9,12 +9,14 @@ common: - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp - nrf54l15dk/nrf54l15/cpuapp + - nrf54h20dk/nrf54h20/cpuapp - nrf9160dk/nrf9160 platform_allow: - nrf52dk/nrf52832 - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp - nrf54l15dk/nrf54l15/cpuapp + - nrf54h20dk/nrf54h20/cpuapp - nrf9160dk/nrf9160 tags: pmic ci_samples_pmic @@ -32,7 +34,7 @@ tests: tags: sysbuild ci_samples_pmic samples.npm1300_one_button_compile: sysbuild: true - platform_allow: nrf9160dk/nrf9160 nrf54l15dk/nrf54l15/cpuapp + platform_allow: nrf9160dk/nrf9160 nrf54l15dk/nrf54l15/cpuapp nrf54h20dk/nrf54h20/cpuapp harness: shield tags: shield sysbuild ci_samples_pmic extra_args: SHIELD=npm1300_ek diff --git a/samples/suit/recovery/README.rst b/samples/suit/recovery/README.rst index 00d866652185..f36581b2a24e 100644 --- a/samples/suit/recovery/README.rst +++ b/samples/suit/recovery/README.rst @@ -10,6 +10,12 @@ SUIT: Recovery application The SUIT recovery application is a minimal application that allows recovering the device firmware if the original firmware is damaged. It is to be used as a companion firmware to the main application that is using :ref:`Software Update for Internet of Things (SUIT) ` procedure, rather than a stand-alone application. +The following limitations apply to this application: + +* The recovery firmware is only able to recover from a situation where the application or radio core are damaged. + It does not recover from Nordic Semiconductor-controlled firmware failures. +* The recovery firmware is not compatible with a main application that uses a external flash for update. + .. _suit_recovery_reqs: Requirements @@ -94,6 +100,7 @@ Testing Device firmware update for recovery firmware ============================================ -To update the recovery firmware, perform a SUIT firmware update using the SUIT envelope found in :file:`/recovery/src/recovery-build/DFU/application.suit`. +To update the recovery firmware, perform a SUIT firmware update using the SUIT envelope found in :file:`/DFU/app_recovery.suit`. +For updating using the Device Manager application, you can also use the zip file found in :file:`/zephyr/dfu_suit_recovery.zip`. -See the ``smp_transfer`` sample documentation to see how to perform the update using the Device Manager application. +See :ref:`nrf54h_suit_sample` to see how to perform the update using the Device Manager application. diff --git a/samples/suit/smp_transfer/README.rst b/samples/suit/smp_transfer/README.rst index 3bfc92252498..d9dd3df4b903 100644 --- a/samples/suit/smp_transfer/README.rst +++ b/samples/suit/smp_transfer/README.rst @@ -107,22 +107,30 @@ See :ref:`app_build_output_files_suit_dfu` for a full table of SUIT-generated ou If you want to make modifications to how the DFU is executed in this sample, you can do so by editing the manifest templates, or generating your own custom manifests. See the :ref:`ug_nrf54h20_suit_customize_dfu` user guide for instructions and examples. +.. _nrf54h_suit_sample_extflash: + External flash support ====================== -You can enable the external flash support by setting the following ``FILE_SUFFIX=extflash`` parameter: +You can build the application with external flash support by running the following command from the sample directory: .. code-block:: console - west build -p -b nrf54h20dk/nrf54h20/cpuapp -- -DFILE_SUFFIX="extflash" + west build ./ -b nrf54h20dk/nrf54h20/cpuapp -T sample.suit.smp_transfer.cache_push.extflash With this configuration, the sample is configured to use UART as the transport and the external flash is enabled. +To see which Kconfig options are needed to achieve that, see the ``sample.suit.smp_transfer.cache_push.extflash`` configuration in the :file:`samples/suit/sample.yaml` file. To enable both the external flash and the BLE transport, use the following command: .. code-block:: console - west build -p -b nrf54h20dk/nrf54h20/cpuapp -- -DFILE_SUFFIX="extflash" -DOVERLAY_CONFIG="sysbuild/smp_transfer_bt.conf" -DSB_OVERLAY_CONFIG="sysbuild_bt.conf" + west build ./ -b nrf54h20dk/nrf54h20/cpuapp -T sample.suit.smp_transfer.cache_push.extflash.bt + +.. note:: + This way of building the application will enable the push scenario for updating from external flash. + It will also extract the image to a DFU cache partition file. + For more information, see :ref:`How to push SUIT payloads to multiple partitions `. Building and running ******************** @@ -313,6 +321,20 @@ After programming the sample to your development kit and updating the sequence n 197.40 KiB / 244.57 KiB [==============================================================================================================================>------------------------------] 80.71% 20.51 KiB/s 00m02s 241.16 KiB / 244.57 KiB [=================================================================================================================================================================>--] 98.60% 20.74 KiB/s Done + #. If you have built the application with :ref:`external flash support `, upload the cache partition to the external flash using the following command: + + .. code-block:: console + + mcumgr --conntype serial --connstring "dev=/dev/ttyACM0,baud=115200" image upload -n 2 build/DFU/dfu_cache_partition_1.bin + + .. note:: + the ``-n 2`` parameter uploads to DFU cache partition 1 (where image 0 is the envelope and image 1 is the cache partition 0). + + #. Start the installation of the new firmware as follows: + + .. code-block:: console + + mcumgr --conntype serial --connstring "dev=/dev/ttyACM0,baud=115200" image confirm #. Read the version and digest of the uploaded root manifest with MCUmgr: diff --git a/samples/suit/smp_transfer/prj.conf b/samples/suit/smp_transfer/prj.conf index 2fcd9483b962..72e9f510f42f 100644 --- a/samples/suit/smp_transfer/prj.conf +++ b/samples/suit/smp_transfer/prj.conf @@ -23,5 +23,11 @@ CONFIG_FLASH=y # Extended SUIT commands over USER group CONFIG_MGMT_SUITFU_GRP_SUIT=y +# Enable bootloader identification within OS Management group +CONFIG_MCUMGR_GRP_OS=y +CONFIG_MCUMGR_GRP_OS_BOOTLOADER_INFO=y +CONFIG_MCUMGR_MGMT_NOTIFICATION_HOOKS=y +CONFIG_MCUMGR_GRP_OS_BOOTLOADER_INFO_HOOK=y + # For UART transport settings see: sysbuild/smp_transfer.conf # For BLE transport settings see: sysbuild/smp_transfer_bt.conf diff --git a/samples/suit/smp_transfer/sample.yaml b/samples/suit/smp_transfer/sample.yaml index befb62418cb0..d03fa13c045a 100644 --- a/samples/suit/smp_transfer/sample.yaml +++ b/samples/suit/smp_transfer/sample.yaml @@ -49,8 +49,6 @@ tests: extra_args: - FILE_SUFFIX=bt - SB_CONFIG_SUIT_BUILD_RECOVERY=y - extra_configs: - - CONFIG_SUIT_DFU_CANDIDATE_PROCESSING_FULL=y tags: suit bluetooth ci_samples_suit sample.suit.smp_transfer.full_processing.extflash.bt: diff --git a/samples/suit/smp_transfer/suit/nrf54h20/app_envelope_extflash.yaml.jinja2 b/samples/suit/smp_transfer/suit/nrf54h20/app_envelope_extflash.yaml.jinja2 index c699ebe37a79..4aa5c7a67769 100644 --- a/samples/suit/smp_transfer/suit/nrf54h20/app_envelope_extflash.yaml.jinja2 +++ b/samples/suit/smp_transfer/suit/nrf54h20/app_envelope_extflash.yaml.jinja2 @@ -94,7 +94,13 @@ SUIT_Envelope_Tagged: - suit-directive-fetch: - suit-send-record-failure {%- endif %} + +{%- if application['dt'].label2node['suit_storage_partition'].regs[0].size == 24576 %} + # Application DTS contains larger SUIT storage - use legacy encoding + suit-install-legacy: +{%- else %} suit-install: +{%- endif %} {%- if flash_companion is defined %} - suit-directive-set-component-index: 1 - suit-directive-override-parameters: diff --git a/samples/suit/smp_transfer/suit/nrf54h20/rad_envelope_extflash.yaml.jinja2 b/samples/suit/smp_transfer/suit/nrf54h20/rad_envelope_extflash.yaml.jinja2 index e8c9374b9766..b711ebc76f38 100644 --- a/samples/suit/smp_transfer/suit/nrf54h20/rad_envelope_extflash.yaml.jinja2 +++ b/samples/suit/smp_transfer/suit/nrf54h20/rad_envelope_extflash.yaml.jinja2 @@ -85,7 +85,13 @@ SUIT_Envelope_Tagged: - suit-directive-fetch: - suit-send-record-failure {%- endif %} + +{%- if radio['dt'].label2node['suit_storage_partition'].regs[0].size == 24576 %} + # Radio DTS contains larger SUIT storage - use legacy encoding + suit-install-legacy: +{%- else %} suit-install: +{%- endif %} - suit-directive-set-component-index: 1 - suit-directive-override-parameters: {%- if 'CONFIG_SUIT_DFU_CACHE_EXTRACT_IMAGE_URI' in radio['config'] and radio['config']['CONFIG_SUIT_DFU_CACHE_EXTRACT_IMAGE_URI'] != '' %} diff --git a/samples/suit/smp_transfer/suit/nrf54h20/root_with_binary_nordic_top_extflash.yaml.jinja2 b/samples/suit/smp_transfer/suit/nrf54h20/root_with_binary_nordic_top_extflash.yaml.jinja2 index acd9bdd49bb0..bbf3263af792 100644 --- a/samples/suit/smp_transfer/suit/nrf54h20/root_with_binary_nordic_top_extflash.yaml.jinja2 +++ b/samples/suit/smp_transfer/suit/nrf54h20/root_with_binary_nordic_top_extflash.yaml.jinja2 @@ -156,7 +156,12 @@ SUIT_Envelope_Tagged: - suit-send-sysinfo-failure {%- endif %} +{%- if application['dt'].label2node['suit_storage_partition'].regs[0].size == 24576 %} + # Application DTS contains larger SUIT storage - use legacy encoding + suit-install-legacy: +{%- else %} suit-install: +{%- endif %} - suit-directive-set-component-index: 0 {%- if application is defined %} - suit-directive-override-parameters: diff --git a/samples/tfm/provisioning_image/README.rst b/samples/tfm/provisioning_image/README.rst index 9394dd89b4d3..19ae3fd6340c 100644 --- a/samples/tfm/provisioning_image/README.rst +++ b/samples/tfm/provisioning_image/README.rst @@ -11,7 +11,7 @@ Running the provisioning image sample will initialize the provisioning process o This sample does not include a TF-M image, it is a Zephyr image intended to be flashed, run, and erased before the TF-M image is flashed. After completion, the device is in the Platform Root-of-Trust (PRoT) security lifecycle state called **PRoT Provisioning**. -For more information about the PRoT security lifecycle, see Arm's Platform Security Model 1.1 defined in the Platform Security Architecture (PSA). +For more information about the PRoT security lifecycle, see `ARM Platform Security Model 1.1`_. When built for the nrf5340dk/nrf5340/cpuapp target, this image by default also includes the :ref:`provisioning_image_net_core` sample as a child image for the network core (``nrf5340dk/nrf5340/cpunet`` target). The child image demonstrates how to disable the debugging access on the network core by writing to the UICR.APPROTECT register. @@ -34,7 +34,7 @@ The sample also requires the following libraries to generate and store the maste Overview ******** -The PSA security model defines the PRoT security lifecycle states. +The Platform Security Architecture (PSA) security model defines the PRoT security lifecycle states. This sample performs the transition from the PRoT security lifecycle state **Device Assembly and Test** to the **PRoT Provisioning** state. PRoT Provisioning is a state where the device platform security parameters are generated. diff --git a/samples/tfm/tfm_hello_world/sample.yaml b/samples/tfm/tfm_hello_world/sample.yaml index e58d4d3f1fd1..78a9aff10951 100644 --- a/samples/tfm/tfm_hello_world/sample.yaml +++ b/samples/tfm/tfm_hello_world/sample.yaml @@ -6,7 +6,6 @@ common: tags: tfm ci_samples_tfm platform_allow: - nrf5340dk/nrf5340/cpuapp/ns - - nrf54l15pdk/nrf54l15/cpuapp/ns - nrf9151dk/nrf9151/ns - nrf9160dk/nrf9160/ns - nrf9161dk/nrf9161/ns @@ -24,24 +23,24 @@ tests: sample.tfm.helloworld: sysbuild: true tags: ci_build sysbuild ci_samples_tfm + platform_allow: + - nrf54l15dk/nrf54l15/cpuapp/ns + integration_platforms: + - nrf54l15dk/nrf54l15/cpuapp/ns sample.tfm.hello_world.bootloaders: sysbuild: true tags: ci_build sysbuild ci_samples_tfm extra_args: FILE_SUFFIX=bootloaders - platform_exclude: nrf54l15pdk/nrf54l15/cpuapp/ns sample.tfm.hello_world.bootloaders_debug: sysbuild: true build_only: true tags: ci_build sysbuild ci_samples_tfm extra_args: FILE_SUFFIX=bootloaders CONFIG_DEBUG_OPTIMIZATIONS=y - platform_exclude: nrf54l15pdk/nrf54l15/cpuapp/ns sample.tfm.hello_world.full: sysbuild: true tags: ci_build sysbuild ci_samples_tfm extra_args: CONFIG_TFM_PROFILE_TYPE_NOT_SET=y CONFIG_NRF_SECURITY=y - platform_exclude: nrf54l15pdk/nrf54l15/cpuapp/ns sample.tfm.hello_world.lvl2: sysbuild: true tags: ci_build sysbuild ci_samples_tfm extra_args: CONFIG_TFM_IPC=y CONFIG_TFM_ISOLATION_LEVEL=2 CONFIG_TFM_PROFILE_TYPE_NOT_SET=y - platform_exclude: nrf54l15pdk/nrf54l15/cpuapp/ns diff --git a/samples/tfm/tfm_psa_template/prj.conf b/samples/tfm/tfm_psa_template/prj.conf index 947ace15cf01..010bfc3f8632 100644 --- a/samples/tfm/tfm_psa_template/prj.conf +++ b/samples/tfm/tfm_psa_template/prj.conf @@ -66,3 +66,6 @@ CONFIG_LOG_MODE_IMMEDIATE=y # Enable TFM isolation level 2 CONFIG_TFM_ISOLATION_LEVEL=2 + +# Initial Attestation requires RNG +CONFIG_PSA_WANT_GENERATE_RANDOM=y diff --git a/samples/wifi/monitor/prj.conf b/samples/wifi/monitor/prj.conf index 1bff86b8e8e2..519ec2fc3dd0 100644 --- a/samples/wifi/monitor/prj.conf +++ b/samples/wifi/monitor/prj.conf @@ -37,7 +37,7 @@ CONFIG_NET_L2_ETHERNET=y CONFIG_NET_SOCKETS_POLL_MAX=10 # Memories -CONFIG_MAIN_STACK_SIZE=4096 +CONFIG_MAIN_STACK_SIZE=5200 CONFIG_NET_TX_STACK_SIZE=4096 CONFIG_NET_RX_STACK_SIZE=4096 diff --git a/samples/wifi/promiscuous/prj.conf b/samples/wifi/promiscuous/prj.conf index 54767ae464fb..7b28b7410ee9 100644 --- a/samples/wifi/promiscuous/prj.conf +++ b/samples/wifi/promiscuous/prj.conf @@ -55,7 +55,7 @@ CONFIG_NET_L2_ETHERNET=y CONFIG_NET_SOCKETS_POLL_MAX=10 # Memories -CONFIG_MAIN_STACK_SIZE=4300 +CONFIG_MAIN_STACK_SIZE=5200 CONFIG_NET_TX_STACK_SIZE=4096 CONFIG_NET_RX_STACK_SIZE=4096 diff --git a/samples/wifi/radio_test/sample.yaml b/samples/wifi/radio_test/sample.yaml index 98d582af81d2..564be56c1d66 100644 --- a/samples/wifi/radio_test/sample.yaml +++ b/samples/wifi/radio_test/sample.yaml @@ -73,3 +73,13 @@ tests: build_only: true platform_allow: thingy91x/nrf9151/ns tags: ci_build sysbuild ci_samples_wifi + sample.nrf54_nrf7002eb.radio_test: + sysbuild: true + build_only: true + extra_args: + - radio_test_SHIELD=nrf7002eb_interposer_p1 + - radio_test_SHIELD=nrf7002eb + platform_allow: + - nrf54h20dk/nrf54h20/cpuapp + - nrf54l15dk/nrf54l15/cpuapp + tags: ci_build sysbuild ci_samples_wifi diff --git a/samples/wifi/raw_tx_packet/prj.conf b/samples/wifi/raw_tx_packet/prj.conf index e3399c6e181d..f8774ab1e92c 100644 --- a/samples/wifi/raw_tx_packet/prj.conf +++ b/samples/wifi/raw_tx_packet/prj.conf @@ -51,7 +51,7 @@ CONFIG_NET_CONFIG_INIT_TIMEOUT=0 CONFIG_NET_SOCKETS_POLL_MAX=10 # Memories -CONFIG_MAIN_STACK_SIZE=4300 +CONFIG_MAIN_STACK_SIZE=5200 CONFIG_NET_TX_STACK_SIZE=4096 CONFIG_NET_RX_STACK_SIZE=4096 diff --git a/samples/wifi/scan/prj.conf b/samples/wifi/scan/prj.conf index 27c1710484d8..0bcd078acbd5 100644 --- a/samples/wifi/scan/prj.conf +++ b/samples/wifi/scan/prj.conf @@ -23,7 +23,7 @@ CONFIG_NET_OFFLOAD=y CONFIG_INIT_STACKS=y # Memories -CONFIG_MAIN_STACK_SIZE=4096 +CONFIG_MAIN_STACK_SIZE=5200 # Debugging CONFIG_STACK_SENTINEL=y diff --git a/samples/wifi/scan/sample.yaml b/samples/wifi/scan/sample.yaml index 269d677d80bb..a1c78c66cae2 100644 --- a/samples/wifi/scan/sample.yaml +++ b/samples/wifi/scan/sample.yaml @@ -52,6 +52,5 @@ tests: - scan_SNIPPET=nrf70-wifi platform_allow: - nrf54h20dk/nrf54h20/cpuapp - - nrf54l15pdk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp tags: ci_build sysbuild ci_samples_wifi diff --git a/samples/wifi/shell/prj.conf b/samples/wifi/shell/prj.conf index cb520cd1c3f4..d9966b8aa1b1 100644 --- a/samples/wifi/shell/prj.conf +++ b/samples/wifi/shell/prj.conf @@ -51,8 +51,8 @@ CONFIG_NET_L2_ETHERNET=y CONFIG_NET_SHELL=y # Memories -CONFIG_MAIN_STACK_SIZE=4200 -CONFIG_SHELL_STACK_SIZE=4700 +CONFIG_MAIN_STACK_SIZE=5200 +CONFIG_SHELL_STACK_SIZE=5200 CONFIG_NET_TX_STACK_SIZE=4096 CONFIG_NET_RX_STACK_SIZE=4096 diff --git a/samples/wifi/shell/sample.yaml b/samples/wifi/shell/sample.yaml index 24486e33b19d..2b16ca4c5a79 100644 --- a/samples/wifi/shell/sample.yaml +++ b/samples/wifi/shell/sample.yaml @@ -211,7 +211,6 @@ tests: - shell_SNIPPET=nrf70-wifi platform_allow: - nrf54h20dk/nrf54h20/cpuapp - - nrf54l15pdk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp tags: ci_build sysbuild ci_samples_wifi # Used by QA and also acts as a memory stress test diff --git a/samples/wifi/softap/prj.conf b/samples/wifi/softap/prj.conf index cb6652cf9fe1..32a3c08e17c6 100644 --- a/samples/wifi/softap/prj.conf +++ b/samples/wifi/softap/prj.conf @@ -49,7 +49,7 @@ CONFIG_NET_CONFIG_INIT_TIMEOUT=0 CONFIG_NET_SOCKETS_POLL_MAX=10 # Memories -CONFIG_MAIN_STACK_SIZE=4096 +CONFIG_MAIN_STACK_SIZE=5200 CONFIG_NET_TX_STACK_SIZE=4096 CONFIG_NET_RX_STACK_SIZE=4096 CONFIG_SOFTAP_SAMPLE_START_WIFI_THREAD_STACK_SIZE=4300 diff --git a/samples/wifi/sta/prj.conf b/samples/wifi/sta/prj.conf index b3f031357fce..a7a837960005 100644 --- a/samples/wifi/sta/prj.conf +++ b/samples/wifi/sta/prj.conf @@ -53,10 +53,10 @@ CONFIG_NET_CONFIG_INIT_TIMEOUT=0 CONFIG_NET_SOCKETS_POLL_MAX=10 # Memories -CONFIG_MAIN_STACK_SIZE=4096 +CONFIG_MAIN_STACK_SIZE=5200 CONFIG_NET_TX_STACK_SIZE=4096 CONFIG_NET_RX_STACK_SIZE=4096 -CONFIG_STA_SAMPLE_START_WIFI_THREAD_STACK_SIZE=4300 +CONFIG_STA_SAMPLE_START_WIFI_THREAD_STACK_SIZE=5200 # Debugging CONFIG_STACK_SENTINEL=y diff --git a/samples/wifi/sta/sample.yaml b/samples/wifi/sta/sample.yaml index 494de460dfd3..667a0d28e92f 100644 --- a/samples/wifi/sta/sample.yaml +++ b/samples/wifi/sta/sample.yaml @@ -66,6 +66,5 @@ tests: - sta_SNIPPET=nrf70-wifi platform_allow: - nrf54h20dk/nrf54h20/cpuapp - - nrf54l15pdk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp tags: ci_build sysbuild ci_samples_wifi diff --git a/samples/wifi/throughput/overlay-high-performance.conf b/samples/wifi/throughput/overlay-high-performance.conf index 9072588b0398..d56b014b9230 100644 --- a/samples/wifi/throughput/overlay-high-performance.conf +++ b/samples/wifi/throughput/overlay-high-performance.conf @@ -14,6 +14,6 @@ CONFIG_NRF70_MAX_TX_TOKENS=12 CONFIG_ZVFS_OPEN_MAX=20 CONFIG_NET_SOCKETS_POLL_MAX=20 # Sockets: select + poll take up more stack -CONFIG_MAIN_STACK_SIZE=4600 -CONFIG_SHELL_STACK_SIZE=4600 +CONFIG_MAIN_STACK_SIZE=4200 +CONFIG_SHELL_STACK_SIZE=4700 CONFIG_NET_MGMT_EVENT_STACK_SIZE=4600 diff --git a/samples/wifi/throughput/overlay-iot-devices.conf b/samples/wifi/throughput/overlay-iot-devices.conf index 715c7db962d1..9f2df60a3655 100644 --- a/samples/wifi/throughput/overlay-iot-devices.conf +++ b/samples/wifi/throughput/overlay-iot-devices.conf @@ -15,6 +15,6 @@ CONFIG_NRF70_MAX_TX_TOKENS=5 CONFIG_ZVFS_OPEN_MAX=20 CONFIG_NET_SOCKETS_POLL_MAX=20 # Sockets: select + poll take up more stack -CONFIG_MAIN_STACK_SIZE=4600 -CONFIG_SHELL_STACK_SIZE=4600 +CONFIG_MAIN_STACK_SIZE=5200 +CONFIG_SHELL_STACK_SIZE=5200 CONFIG_NET_MGMT_EVENT_STACK_SIZE=4600 diff --git a/samples/wifi/throughput/overlay-memory-optimized.conf b/samples/wifi/throughput/overlay-memory-optimized.conf index 0bdb00f6dc48..74027fa62180 100644 --- a/samples/wifi/throughput/overlay-memory-optimized.conf +++ b/samples/wifi/throughput/overlay-memory-optimized.conf @@ -15,6 +15,6 @@ CONFIG_NRF70_MAX_TX_TOKENS=5 CONFIG_ZVFS_OPEN_MAX=20 CONFIG_NET_SOCKETS_POLL_MAX=20 # Sockets: select + poll take up more stack -CONFIG_MAIN_STACK_SIZE=4600 -CONFIG_SHELL_STACK_SIZE=4600 +CONFIG_MAIN_STACK_SIZE=5200 +CONFIG_SHELL_STACK_SIZE=5200 CONFIG_NET_MGMT_EVENT_STACK_SIZE=4600 diff --git a/samples/wifi/throughput/overlay-rx-prio.conf b/samples/wifi/throughput/overlay-rx-prio.conf index c613b0105a8f..cdaff4125553 100644 --- a/samples/wifi/throughput/overlay-rx-prio.conf +++ b/samples/wifi/throughput/overlay-rx-prio.conf @@ -15,6 +15,6 @@ CONFIG_NRF70_MAX_TX_TOKENS=5 CONFIG_ZVFS_OPEN_MAX=20 CONFIG_NET_SOCKETS_POLL_MAX=20 # Sockets: select + poll take up more stack -CONFIG_MAIN_STACK_SIZE=4600 -CONFIG_SHELL_STACK_SIZE=4600 +CONFIG_MAIN_STACK_SIZE=5200 +CONFIG_SHELL_STACK_SIZE=5200 CONFIG_NET_MGMT_EVENT_STACK_SIZE=4600 diff --git a/samples/wifi/throughput/overlay-tx-prio.conf b/samples/wifi/throughput/overlay-tx-prio.conf index 75493026b6a2..6afd165a5fb9 100644 --- a/samples/wifi/throughput/overlay-tx-prio.conf +++ b/samples/wifi/throughput/overlay-tx-prio.conf @@ -15,6 +15,6 @@ CONFIG_NRF70_MAX_TX_TOKENS=12 CONFIG_ZVFS_OPEN_MAX=20 CONFIG_NET_SOCKETS_POLL_MAX=20 # Sockets: select + poll take up more stack -CONFIG_MAIN_STACK_SIZE=4600 -CONFIG_SHELL_STACK_SIZE=4600 +CONFIG_MAIN_STACK_SIZE=5200 +CONFIG_SHELL_STACK_SIZE=5200 CONFIG_NET_MGMT_EVENT_STACK_SIZE=4600 diff --git a/samples/wifi/twt/prj.conf b/samples/wifi/twt/prj.conf index 650c9ff5adc8..2506b0d7d75a 100644 --- a/samples/wifi/twt/prj.conf +++ b/samples/wifi/twt/prj.conf @@ -57,7 +57,7 @@ CONFIG_NET_CONFIG_INIT_TIMEOUT=0 CONFIG_NET_SOCKETS_POLL_MAX=10 # Memories -CONFIG_MAIN_STACK_SIZE=4300 +CONFIG_MAIN_STACK_SIZE=5200 CONFIG_NET_TX_STACK_SIZE=4096 CONFIG_NET_RX_STACK_SIZE=4096 diff --git a/samples/zigbee/light_switch/Kconfig.sysbuild b/samples/zigbee/light_switch/Kconfig.sysbuild index 17c81e65255f..9c588f970a93 100644 --- a/samples/zigbee/light_switch/Kconfig.sysbuild +++ b/samples/zigbee/light_switch/Kconfig.sysbuild @@ -4,7 +4,43 @@ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # -source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" - +#### Radio core selection config NRF_DEFAULT_IPC_RADIO default y + +if BOOTLOADER_MCUBOOT + +#### DFU multi-image support +config DFU_MULTI_IMAGE_PACKAGE_BUILD + default y + +config DFU_MULTI_IMAGE_PACKAGE_APP + default y + +#### DFU dual core configuration +if SOC_SERIES_NRF53X + +config PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY + default y + +config MCUBOOT_UPDATEABLE_IMAGES + default 2 + +choice MCUBOOT_MODE + default MCUBOOT_MODE_OVERWRITE_ONLY +endchoice + +config SECURE_BOOT_NETCORE + default y + +config NETCORE_APP_UPDATE + default y + +config DFU_MULTI_IMAGE_PACKAGE_NET + default y + +endif # SOC_SERIES_NRF53X + +endif # BOOTLOADER_MCUBOOT + +source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/zigbee/light_switch/sysbuild_fota.conf b/samples/zigbee/light_switch/sysbuild_fota.conf index ed1b947df9eb..f9fccb6ee297 100644 --- a/samples/zigbee/light_switch/sysbuild_fota.conf +++ b/samples/zigbee/light_switch/sysbuild_fota.conf @@ -4,6 +4,4 @@ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # -SB_CONFIG_DFU_MULTI_IMAGE_PACKAGE_BUILD=y SB_CONFIG_BOOTLOADER_MCUBOOT=y -SB_CONFIG_DFU_MULTI_IMAGE_PACKAGE_APP=y diff --git a/scripts/ci/codeowners.py b/scripts/ci/codeowners.py index a8729d4fd206..c2feef539801 100755 --- a/scripts/ci/codeowners.py +++ b/scripts/ci/codeowners.py @@ -110,6 +110,10 @@ def ls_owned_files(codeowners): continue git_patrn = match.group(1) + if git_patrn == '*': + logger.info('Skipping default \'*\' entry') + continue + glob = git_pattern_to_glob(git_patrn) files = [] for abs_path in top_path.glob(glob): diff --git a/scripts/ci/tags.yaml b/scripts/ci/tags.yaml index 445d29b32c7a..83c8a9bdd2d3 100644 --- a/scripts/ci/tags.yaml +++ b/scripts/ci/tags.yaml @@ -375,6 +375,7 @@ Sidewalk: - nrf/subsys/nrf_security/ - nrf/subsys/partition_manager/ - nrf/subsys/pcd/ + - nrf/subsys/trusted_storage/ - nrfxlib/crypto/ - sidewalk/ - zephyr/include/dfu/ @@ -1150,6 +1151,11 @@ ci_tests_lib_sample_rate_converter: - nrf/lib/sample_rate_converter/ - nrf/tests/lib/sample_rate_converter/ +ci_tests_lib_uicc_lwm2m: + files: + - nrf/lib/uicc_lwm2m/ + - nrf/tests/lib/uicc_lwm2m/ + ci_tests_drivers_lpuart: files: - modules/hal/nordic/nrfx/ @@ -1256,6 +1262,15 @@ ci_tests_benchmarks_current_consumption: - zephyr/drivers/counter/ - zephyr/soc/nordic/ +ci_tests_drivers_egpio: + files: + - nrf/applications/sdp/gpio/ + - nrf/drivers/gpio/ + - nrf/snippets/emulated-gpio/ + - nrf/tests/drivers/gpio/egpio_basic_api/ + - zephyr/drivers/mbox/ + - zephyr/subsys/ipc/ipc_service/ + ci_tests_drivers_fprotect: files: - nrf/lib/fprotect/ diff --git a/scripts/docker/Dockerfile b/scripts/docker/Dockerfile index 51f27caa8e29..2f26be410457 100644 --- a/scripts/docker/Dockerfile +++ b/scripts/docker/Dockerfile @@ -2,12 +2,12 @@ FROM ubuntu:22.04 ARG VERSION ENV HOME=/opt -RUN apt-get update && apt-get install -y wget ca-certificates qemu-system-arm libffi7 git \ +RUN apt-get update && apt-get install -y wget ca-certificates qemu-system-arm git \ libxcb-render-util0 libxcb-shape0 libxcb-icccm4 libxcb-keysyms1 libxcb-image0 libxkbcommon-x11-0 libsm6 libice6 udev \ && rm -rf /var/lib/apt/lists/* RUN wget https://developer.nordicsemi.com/.pc-tools/nrfutil/x64-linux/nrfutil -q -O /usr/local/bin/nrfutil \ && chmod +x /usr/local/bin/nrfutil \ - && nrfutil install device=2.5.4 \ + && nrfutil install device=2.6.4 \ && nrfutil install toolchain-manager=0.15.0 RUN nrfutil toolchain-manager install --toolchain-bundle-id $VERSION \ && nrfutil toolchain-manager env --as-script > /opt/toolchain-env.sh \ diff --git a/scripts/hid_configurator/NrfHidManager.py b/scripts/hid_configurator/NrfHidManager.py index 5fe550f449a0..b968c0436b56 100644 --- a/scripts/hid_configurator/NrfHidManager.py +++ b/scripts/hid_configurator/NrfHidManager.py @@ -9,7 +9,7 @@ class NrfHidManager(): TYPE2BOARDLIST = { - 'gaming_mouse' : ['nrf52840gmouse', 'nrf52840dk', 'nrf54l15dk', 'nrf54l15pdk', 'nrf54h20dk'], + 'gaming_mouse' : ['nrf52840gmouse', 'nrf52840dk', 'nrf54l15dk', 'nrf54h20dk'], 'dongle' : ['nrf52840dongle', 'nrf52833dongle', 'nrf52820dongle', 'nrf5340dk'], 'keyboard' : ['nrf52kbd'], 'desktop_mouse' : ['nrf52dmouse', 'nrf52810dmouse'], diff --git a/scripts/quarantine_integration.yaml b/scripts/quarantine_integration.yaml index 927545bc2b3b..9bab59dfce79 100644 --- a/scripts/quarantine_integration.yaml +++ b/scripts/quarantine_integration.yaml @@ -113,7 +113,7 @@ - sample.matter.thermostat.debug - sample.matter.window_cover.debug platforms: - - nrf54l15pdk/nrf54l15/cpuapp/ns + - nrf54l15dk/nrf54l15/cpuapp/ns comment: "Configurations excluded to limit resources usage in integration Matter ns builds" - scenarios: diff --git a/scripts/tools-versions-darwin.yml b/scripts/tools-versions-darwin.yml index d10df8778df5..89f70def461b 100644 --- a/scripts/tools-versions-darwin.yml +++ b/scripts/tools-versions-darwin.yml @@ -18,8 +18,6 @@ nanopb: zephyr-sdk: version: 0.16.8 architectures: # https://github.com/zephyrproject-rtos/sdk-ng/releases/tag/v0.16.8 - - aarch64-zephyr-elf - - x86_64-zephyr-elf - arm-zephyr-eabi - riscv64-zephyr-elf doxygen: diff --git a/scripts/tools-versions-linux.yml b/scripts/tools-versions-linux.yml index 1d4c7f58b2cb..d0f60b38e20b 100644 --- a/scripts/tools-versions-linux.yml +++ b/scripts/tools-versions-linux.yml @@ -19,8 +19,6 @@ nanopb: zephyr-sdk: version: 0.16.8 architectures: # https://github.com/zephyrproject-rtos/sdk-ng/releases/tag/v0.16.8 - - aarch64-zephyr-elf - - x86_64-zephyr-elf - arm-zephyr-eabi - riscv64-zephyr-elf ccache: diff --git a/scripts/tools-versions-win10.yml b/scripts/tools-versions-win10.yml index eb0752ae74b3..d685a3781209 100644 --- a/scripts/tools-versions-win10.yml +++ b/scripts/tools-versions-win10.yml @@ -17,8 +17,6 @@ nanopb: zephyr-sdk: version: 0.16.8 architectures: # https://github.com/zephyrproject-rtos/sdk-ng/releases/tag/v0.16.8 - - aarch64-zephyr-elf - - x86_64-zephyr-elf - arm-zephyr-eabi - riscv64-zephyr-elf doxygen: diff --git a/scripts/west-commands.yml b/scripts/west-commands.yml index 5dacd8292870..e10ed15ba597 100644 --- a/scripts/west-commands.yml +++ b/scripts/west-commands.yml @@ -29,3 +29,8 @@ west-commands: - name: suit-manifest class: SuitManifest help: SUIT manifest utility + - file: scripts/west_commands/genboard/ncs_genboard.py + commands: + - name: ncs-genboard + class: NcsGenboard + help: generate board skeleton files for any Nordic SoC diff --git a/scripts/west_commands/genboard/config.yml b/scripts/west_commands/genboard/config.yml new file mode 100644 index 000000000000..03a80b5e8f17 --- /dev/null +++ b/scripts/west_commands/genboard/config.yml @@ -0,0 +1,105 @@ +products: + - series: nrf52 + socs: + - name: nrf52805 + variants: + - name: caaa + ram: 24 + flash: 192 + - name: nrf52810 + variants: + - name: qfaa + ram: 24 + flash: 192 + - name: nrf52811 + variants: + - name: qfaa + ram: 24 + flash: 192 + - name: nrf52820 + variants: + - name: qdaa + ram: 32 + flash: 256 + - name: nrf52832 + variants: + - name: ciaa + ram: 64 + flash: 512 + - name: qfaa + ram: 64 + flash: 512 + - name: qfab + ram: 64 + flash: 512 + - name: nrf52833 + variants: + - name: qdaa + ram: 128 + flash: 512 + since: 2.5.0 + - name: qiaa + ram: 128 + flash: 512 + - name: nrf52840 + variants: + - name: qfaa + ram: 256 + flash: 1024 + since: 2.5.0 + - name: qiaa + ram: 256 + flash: 1024 + - series: nrf53 + socs: + - name: nrf5340 + variants: + - name: qkaa + cores: + - name: cpuapp + ns: true + ram: 512 + flash: 1024 + - name: cpunet + ram: 64 + flash: 246 + - series: nrf54l + socs: + - name: nrf54l15 + variants: + - name: qfaa + since: 2.7.0 + cores: + - name: cpuapp + arch: arm + ram: 188 + flash: 324 + - series: nrf91 + socs: + - name: nrf9131 + variants: + - name: laca + ram: 256 + flash: 1024 + ns: true + since: 2.5.0 + - name: nrf9151 + variants: + - name: laca + ram: 256 + flash: 1024 + ns: true + since: 2.6.0 + - name: nrf9160 + variants: + - name: sica + ram: 256 + flash: 1024 + ns: true + - name: nrf9161 + variants: + - name: laca + since: 2.5.0 + ram: 256 + flash: 1024 + ns: true diff --git a/scripts/west_commands/genboard/ncs_genboard.py b/scripts/west_commands/genboard/ncs_genboard.py new file mode 100644 index 000000000000..747c56ae7bd3 --- /dev/null +++ b/scripts/west_commands/genboard/ncs_genboard.py @@ -0,0 +1,247 @@ +# Copyright (c) 2024 Nordic Semiconductor ASA +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + +from pathlib import Path +import re +import shutil + +from jinja2 import Environment, FileSystemLoader +from west.commands import WestCommand +from west import log +from yaml import load + +try: + from yaml import CLoader as Loader +except ImportError: + from yaml import Loader + + +SCRIPT_DIR = Path(__file__).absolute().parent +TEMPLATE_DIR = SCRIPT_DIR / "templates" +CONFIG = SCRIPT_DIR / "config.yml" + +NCS_VERSION_MIN = (2, 0, 0) +HWMV2_SINCE = (2, 7, 0) +TFM_SINCE = (2, 6, 0) + +NCS_VERSION_RE = re.compile(r"^(\d+)\.(\d+)\.(\d+)$") +VENDOR_RE = re.compile(r"^[a-zA-Z0-9_-]+$") +BOARD_RE = re.compile(r"^[a-zA-Z0-9_-]+$") + + +class NcsGenboard(WestCommand): + + def __init__(self): + super().__init__( + "ncs-genboard", "Generate board skeleton files for any Nordic SoC", "" + ) + + def do_add_parser(self, parser_adder): + parser = parser_adder.add_parser( + self.name, help=self.help, description=self.description + ) + + parser.add_argument( + "-o", "--output", required=True, type=Path, help="Output directory" + ) + parser.add_argument("-e", "--vendor", required=True, help="Vendor name") + parser.add_argument("-b", "--board", required=True, help="Board name") + parser.add_argument( + "-d", "--board-desc", required=True, help="Board description" + ) + parser.add_argument("-s", "--soc", required=True, help="SoC") + parser.add_argument("-v", "--variant", required=True, help="Variant") + parser.add_argument( + "-n", "--ncs-version", required=True, help="NCS target version" + ) + + return parser + + def do_run(self, args, unknown_args): + with open(CONFIG, "r") as f: + config = load(f, Loader=Loader) + + # validate input + m = NCS_VERSION_RE.match(args.ncs_version) + if not m: + log.err(f"Invalid NCS version: {args.ncs_version}") + return + + ncs_version = tuple(int(n) for n in m.groups()) + + if ncs_version < NCS_VERSION_MIN: + log.err(f"Unsupported NCS version: {args.ncs_version}") + return + + if not VENDOR_RE.match(args.vendor): + log.err(f"Invalid vendor name: {args.vendor}") + return + + if not BOARD_RE.match(args.board): + log.err(f"Invalid board name: {args.board}") + return + + series = None + soc = None + for product in config["products"]: + if series: + break + + for soc_ in product["socs"]: + if args.soc == soc_["name"]: + series = product["series"] + soc = soc_ + break + + if not series: + log.err(f"Invalid/unsupported SoC: {args.soc}") + return + + targets = [] + for variant in soc["variants"]: + if args.variant == variant["name"]: + since = variant.get("since", ".".join(str(i) for i in NCS_VERSION_MIN)) + m = NCS_VERSION_RE.match(since) + if not m: + log.err(f"Malformed NCS version: {since}") + return + + since_version = tuple(int(n) for n in m.groups()) + if ncs_version < since_version: + log.err( + f"SoC {args.soc}-{args.variant} not supported in NCS version {args.ncs_version}" + ) + return + + if "cores" in variant: + for core in variant["cores"]: + target = { + "core": core["name"], + "ram": core["ram"], + "flash": core["flash"], + "ns": core.get("ns", False) if ncs_version >= TFM_SINCE else False, + "xip": core.get("xip", False), + "arch": core.get("arch", "arm"), + } + + targets.append(target) + if target["ns"]: + target_ns = target.copy() + target_ns["ns"] = False + targets.append(target_ns) + elif target["xip"]: + target_xip = target.copy() + target_xip["xip"] = False + targets.append(target_xip) + else: + target = { + "ram": variant["ram"], + "flash": variant["flash"], + "ns": variant.get("ns", False) if ncs_version >= TFM_SINCE else False, + "xip": variant.get("xip", False), + "arch": variant.get("arch", "arm"), + } + + targets.append(target) + if target["ns"]: + target_ns = target.copy() + target_ns["ns"] = False + targets.append(target_ns) + + break + + if not targets: + log.err(f"Invalid/unsupported variant: {args.variant}") + return + + # prepare Jinja environment + env = Environment( + trim_blocks=True, + lstrip_blocks=True, + loader=FileSystemLoader(TEMPLATE_DIR / series), + ) + + env.globals["ncs_version"] = ncs_version + env.globals["hwmv2_since"] = HWMV2_SINCE + env.globals["vendor"] = args.vendor + env.globals["board"] = args.board + env.globals["board_desc"] = args.board_desc + env.globals["series"] = series + env.globals["soc"] = args.soc + env.globals["variant"] = args.variant + env.globals["targets"] = targets + + # render templates/copy files + if ncs_version < HWMV2_SINCE: + out_dir = args.output / "arm" / args.board + else: + out_dir = args.output / args.vendor / args.board + + if not out_dir.exists(): + out_dir.mkdir(parents=True) + + # board-level files + tmpl = TEMPLATE_DIR / series / "pre_dt_board.cmake" + shutil.copy(tmpl, out_dir) + + tmpl = TEMPLATE_DIR / series / "board-pinctrl.dtsi" + shutil.copy(tmpl, out_dir / f"{ args.board }-pinctrl.dtsi") + + tmpl = env.get_template("board.cmake.jinja2") + with open(out_dir / "board.cmake", "w") as f: + f.write(tmpl.render()) + + tmpl = env.get_template("Kconfig.board.jinja2") + fname = ( + "Kconfig.board" if ncs_version < HWMV2_SINCE else f"Kconfig.{args.board}" + ) + with open(out_dir / fname, "w") as f: + f.write(tmpl.render()) + + if ncs_version >= HWMV2_SINCE: + tmpl = env.get_template("board.yml.jinja2") + with open(out_dir / f"board.yml", "w") as f: + f.write(tmpl.render()) + + tmpl = env.get_template("Kconfig.defconfig.jinja2") + with open(out_dir / f"Kconfig.defconfig", "w") as f: + f.write(tmpl.render(config)) + + # nrf53 specific files + if series == "nrf53": + tmpl = env.get_template("board-cpuapp_partitioning.dtsi.jinja2") + with open(out_dir / f"{ args.board }-cpuapp_partitioning.dtsi", "w") as f: + f.write(tmpl.render(config)) + + tmpl = TEMPLATE_DIR / series / "board-shared_sram.dtsi" + shutil.copy(tmpl, out_dir / f"{ args.board }-shared_sram.dtsi") + + # nrf91 specific files + if series == "nrf91": + tmpl = env.get_template("board-partitioning.dtsi.jinja2") + with open(out_dir / f"{ args.board }-partitioning.dtsi", "w") as f: + f.write(tmpl.render(config)) + + # per-target files + for target in targets: + name = args.board + if target.get("core"): + if ncs_version >= HWMV2_SINCE: + name += f"_{args.soc}" + name += f"_{target['core']}" + if target["ns"]: + name += "_ns" + elif target["xip"]: + name += "_xip" + + tmpl = env.get_template("board_defconfig.jinja2") + with open(out_dir / f"{ name }_defconfig", "w") as f: + f.write(tmpl.render(target=target)) + + tmpl = env.get_template("board.dts.jinja2") + with open(out_dir / f"{name}.dts", "w") as f: + f.write(tmpl.render(target=target)) + + tmpl = env.get_template("board_twister.yml.jinja2") + with open(out_dir / f"{name}.yml", "w") as f: + f.write(tmpl.render(target=target)) diff --git a/scripts/west_commands/genboard/templates/nrf52/Kconfig.board.jinja2 b/scripts/west_commands/genboard/templates/nrf52/Kconfig.board.jinja2 new file mode 100644 index 000000000000..041c6af87e17 --- /dev/null +++ b/scripts/west_commands/genboard/templates/nrf52/Kconfig.board.jinja2 @@ -0,0 +1,7 @@ +config BOARD_{{ board | upper }} +{% if ncs_version < hwmv2_since %} + bool "{{ board_desc }}" + depends on SOC_{{ soc | upper }}_{{ variant | upper}} +{% else %} + select SOC_{{ soc | upper }}_{{ variant | upper}} +{% endif %} diff --git a/scripts/west_commands/genboard/templates/nrf52/Kconfig.defconfig.jinja2 b/scripts/west_commands/genboard/templates/nrf52/Kconfig.defconfig.jinja2 new file mode 100644 index 000000000000..789b19cecf03 --- /dev/null +++ b/scripts/west_commands/genboard/templates/nrf52/Kconfig.defconfig.jinja2 @@ -0,0 +1,11 @@ +if BOARD_{{ board | upper }} + +{% if ncs_version < hwmv2_since %} +config BOARD + default "{{ board }}" + +{% endif %} +config BT_CTLR + default BT + +endif # BOARD_{{ board | upper }} diff --git a/scripts/west_commands/genboard/templates/nrf52/board-pinctrl.dtsi b/scripts/west_commands/genboard/templates/nrf52/board-pinctrl.dtsi new file mode 100644 index 000000000000..eb124f540995 --- /dev/null +++ b/scripts/west_commands/genboard/templates/nrf52/board-pinctrl.dtsi @@ -0,0 +1,2 @@ +&pinctrl { +}; diff --git a/scripts/west_commands/genboard/templates/nrf52/board.cmake.jinja2 b/scripts/west_commands/genboard/templates/nrf52/board.cmake.jinja2 new file mode 100644 index 000000000000..7688edbbcf38 --- /dev/null +++ b/scripts/west_commands/genboard/templates/nrf52/board.cmake.jinja2 @@ -0,0 +1,10 @@ +board_runner_args(jlink "--device={{ soc | replace("nrf", "nRF") }}_xx{{ variant[2:] | upper }}" "--speed=4000") +board_runner_args(pyocd "--target={{ soc }}" "--frequency=4000000") + +include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) +{% if ncs_version >= (2, 4, 0) %} +include(${ZEPHYR_BASE}/boards/common/nrfutil.board.cmake) +{% endif %} +include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) +include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake) +include(${ZEPHYR_BASE}/boards/common/openocd-nrf5.board.cmake) diff --git a/scripts/west_commands/genboard/templates/nrf52/board.dts.jinja2 b/scripts/west_commands/genboard/templates/nrf52/board.dts.jinja2 new file mode 100644 index 000000000000..68c2ad334187 --- /dev/null +++ b/scripts/west_commands/genboard/templates/nrf52/board.dts.jinja2 @@ -0,0 +1,156 @@ +/dts-v1/; +#include +#include "{{ board }}-pinctrl.dtsi" + +/ { + model = "{{ board_desc }}"; + compatible = "{{ vendor }},{{ board | replace("_", "-") }}"; + + chosen { + zephyr,sram = &sram0; + zephyr,flash = &flash0; + zephyr,code-partition = &slot0_partition; + }; +}; + +&flash0 { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + boot_partition: partition@0 { + label = "mcuboot"; + reg = <0x00000000 DT_SIZE_K(48)>; + }; + +{% if soc == "nrf52840" %} +{% if ncs_version <= (2, 4, 0) %} + slot0_partition: partition@c000 { + label = "image-0"; + reg = <0x0000c000 DT_SIZE_K(412)>; + }; + + slot1_partition: partition@73000 { + label = "image-1"; + reg = <0x00073000 DT_SIZE_K(412)>; + }; + + scratch_partition: partition@da000 { + label = "image-scratch"; + reg = <0xda000 DT_SIZE_K(120)>; + }; + + storage_partition: partition@f8000 { + label = "storage"; + reg = <0x000f8000 DT_SIZE_K(32)>; + }; +{% else %} + slot0_partition: partition@c000 { + label = "image-0"; + reg = <0x0000c000 DT_SIZE_K(472)>; + }; + + slot1_partition: partition@82000 { + label = "image-1"; + reg = <0x00082000 DT_SIZE_K(472)>; + }; + + storage_partition: partition@f8000 { + label = "storage"; + reg = <0x000f8000 DT_SIZE_K(32)>; + }; +{% endif %} +{% elif soc == "nrf52833" or soc == "nrf52832" %} +{% if ncs_version <= (2, 4, 0) %} + slot0_partition: partition@c000 { + label = "image-0"; + reg = <0x0000c000 DT_SIZE_K(200)>; + }; + + slot1_partition: partition@3e000 { + label = "image-1"; + reg = <0x0003e000 DT_SIZE_K(200)>; + }; + + scratch_partition: partition@70000 { + label = "image-scratch"; + reg = <0x70000 DT_SIZE_K(40)>; + }; + + storage_partition: partition@7a000 { + label = "storage"; + reg = <0x0007a000 DT_SIZE_K(24)>; + }; +{% else %} + slot0_partition: partition@c000 { + label = "image-0"; + reg = <0x0000c000 DT_SIZE_K(220)>; + }; + + slot1_partition: partition@43000 { + label = "image-1"; + reg = <0x00043000 DT_SIZE_K(220)>; + }; + + storage_partition: partition@7a000 { + label = "storage"; + reg = <0x0007a000 DT_SIZE_K(24)>; + }; +{% endif %} +{% elif soc == "nrf52820" %} + slot0_partition: partition@c000 { + label = "image-0"; + reg = <0x0000c000 DT_SIZE_K(92)>; + }; + + slot1_partition: partition@23000 { + label = "image-1"; + reg = <0x00023000 DT_SIZE_K(92)>; + }; + + storage_partition: partition@3a000 { + label = "storage"; + reg = <0x0003a000 DT_SIZE_K(24)>; + }; +{% elif soc == "nrf52811" or soc == "nrf52810" or soc == "nrf52805" %} +{% if ncs_version <= (2, 4, 0) %} + slot0_partition: partition@c000 { + label = "image-0"; + reg = <0x0000c000 DT_SIZE_K(52)>; + }; + + slot1_partition: partition@19000 { + label = "image-1"; + reg = <0x0001a000 DT_SIZE_K(52)>; + }; + + scratch_partition: partition@26000 { + label = "image-scratch"; + reg = <0x26000 DT_SIZE_K(12)>; + }; + + storage_partition: partition@29000 { + label = "storage"; + reg = <0x00029000 DT_SIZE_K(28)>; + }; +{% else %} + slot0_partition: partition@c000 { + label = "image-0"; + reg = <0x0000c000 DT_SIZE_K(56)>; + }; + + slot1_partition: partition@1a000 { + label = "image-1"; + reg = <0x0001a000 DT_SIZE_K(56)>; + }; + + storage_partition: partition@28000 { + label = "storage"; + reg = <0x00028000 DT_SIZE_K(32)>; + }; +{% endif %} + +{% endif %} + }; +}; diff --git a/scripts/west_commands/genboard/templates/nrf52/board.yml.jinja2 b/scripts/west_commands/genboard/templates/nrf52/board.yml.jinja2 new file mode 100644 index 000000000000..e21aa7843883 --- /dev/null +++ b/scripts/west_commands/genboard/templates/nrf52/board.yml.jinja2 @@ -0,0 +1,5 @@ +board: + name: {{ board }} + vendor: {{ vendor }} + socs: + - name: {{ soc }} diff --git a/scripts/west_commands/genboard/templates/nrf52/board_defconfig.jinja2 b/scripts/west_commands/genboard/templates/nrf52/board_defconfig.jinja2 new file mode 100644 index 000000000000..fc4877c5d89d --- /dev/null +++ b/scripts/west_commands/genboard/templates/nrf52/board_defconfig.jinja2 @@ -0,0 +1,12 @@ +{% if ncs_version < hwmv2_since %} +CONFIG_SOC_SERIES_{{ series | upper }}X=y +CONFIG_SOC_{{ soc | upper }}_{{ variant | upper }}=y +CONFIG_BOARD_{{ board | upper }}=y + +{% endif %} +CONFIG_ARM_MPU=y +CONFIG_HW_STACK_PROTECTION=y + +{% if ncs_version <= (2, 6, 0) %} +CONFIG_PINCTRL=y +{% endif %} diff --git a/scripts/west_commands/genboard/templates/nrf52/board_twister.yml.jinja2 b/scripts/west_commands/genboard/templates/nrf52/board_twister.yml.jinja2 new file mode 100644 index 000000000000..0d42966da788 --- /dev/null +++ b/scripts/west_commands/genboard/templates/nrf52/board_twister.yml.jinja2 @@ -0,0 +1,15 @@ +{% if ncs_version < hwmv2_since %} +identifier: {{ board }} +{% else %} +identifier: {{ board }}/{{ soc }} +{% endif %} +name: {{ board_desc }} +vendor: {{ vendor }} +type: mcu +arch: arm +ram: {{ target["ram"] }} +flash: {{ target["flash"] }} +toolchain: + - zephyr +supported: + - gpio diff --git a/scripts/west_commands/genboard/templates/nrf52/pre_dt_board.cmake b/scripts/west_commands/genboard/templates/nrf52/pre_dt_board.cmake new file mode 100644 index 000000000000..519d7844635e --- /dev/null +++ b/scripts/west_commands/genboard/templates/nrf52/pre_dt_board.cmake @@ -0,0 +1,2 @@ +# Suppress "unique_unit_address_if_enabled" to handle some overlaps +list(APPEND EXTRA_DTC_FLAGS "-Wno-unique_unit_address_if_enabled") diff --git a/scripts/west_commands/genboard/templates/nrf53/Kconfig.board.jinja2 b/scripts/west_commands/genboard/templates/nrf53/Kconfig.board.jinja2 new file mode 100644 index 000000000000..4ab1ca1327ad --- /dev/null +++ b/scripts/west_commands/genboard/templates/nrf53/Kconfig.board.jinja2 @@ -0,0 +1,20 @@ +{% if ncs_version < hwmv2_since %} +if SOC_NRF5340_CPUAPP_QKAA + +config BOARD_{{ board | upper }}_CPUAPP + bool "{{ board_desc }} (CPUAPP)" + +config BOARD_{{ board | upper }}_CPUAPP_NS + bool "{{ board_desc }} (CPUAPP Non-Secure)" + +endif # SOC_NRF5340_CPUAPP_QKAA + +config BOARD_{{ board | upper }}_CPUNET + bool "{{ board_desc }} (CPUNET)" + depends on SOC_NRF5340_CPUNET_QKAA +{% else %} +config BOARD_{{ board | upper }} + select SOC_NRF5340_CPUAPP_QKAA if BOARD_{{ board | upper }}_NRF5340_CPUAPP + select SOC_NRF5340_CPUAPP_QKAA if BOARD_{{ board | upper }}_NRF5340_CPUAPP_NS + select SOC_NRF5340_CPUNET_QKAA if BOARD_{{ board | upper }}_NRF5340_CPUNET +{% endif %} diff --git a/scripts/west_commands/genboard/templates/nrf53/Kconfig.defconfig.jinja2 b/scripts/west_commands/genboard/templates/nrf53/Kconfig.defconfig.jinja2 new file mode 100644 index 000000000000..7a86e7e3db44 --- /dev/null +++ b/scripts/west_commands/genboard/templates/nrf53/Kconfig.defconfig.jinja2 @@ -0,0 +1,129 @@ +{% if ncs_version < hwmv2_since %} +if BOARD_{{ board | upper }}_CPUAPP || BOARD_{{ board | upper }}_CPUAPP_NS +{% else %} +if BOARD_{{ board | upper }}_NRF5340_CPUAPP || BOARD_{{ board | upper }}_NRF5340_CPUAPP_NS +{% endif %} + +{% if ncs_version < hwmv2_since %} +config BOARD + default "{{ board }}_cpuapp" + +{% endif %} +# Code Partition: +# +# For the secure version of the board the firmware is linked at the beginning +# of the flash, or into the code-partition defined in DT if it is intended to +# be loaded by MCUboot. If the secure firmware is to be combined with a non- +# secure image (TRUSTED_EXECUTION_SECURE=y), the secure FW image shall always +# be restricted to the size of its code partition. +# +# For the non-secure version of the board, the firmware +# must be linked into the code-partition (non-secure) defined in DT, regardless. +# Apply this configuration below by setting the Kconfig symbols used by +# the linker according to the information extracted from DT partitions. + +# SRAM Partition: +# +# If the secure firmware is to be combined with a non-secure image +# (TRUSTED_EXECUTION_SECURE=y), the secure FW image SRAM shall always +# be restricted to the secure image SRAM partition (sram-secure-partition). +# Otherwise (if TRUSTED_EXECUTION_SECURE is not set) the whole zephyr,sram +# may be used by the image. +# +# For the non-secure version of the board, the firmware image SRAM is +# always restricted to the allocated non-secure SRAM partition. +DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition +DT_CHOSEN_Z_SRAM_PARTITION := zephyr,sram-secure-partition + +{% if ncs_version < hwmv2_since %} +if BOARD_{{ board | upper }}_CPUAPP && TRUSTED_EXECUTION_SECURE +{% else %} +if BOARD_{{ board | upper }}_NRF5340_CPUAPP && TRUSTED_EXECUTION_SECURE +{% endif %} + +config FLASH_LOAD_SIZE + default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) + +config SRAM_SIZE + default $(dt_chosen_reg_size_int,$(DT_CHOSEN_Z_SRAM_PARTITION),0,K) + +{% if ncs_version < hwmv2_since %} +endif # BOARD_{{ board | upper }}_CPUAPP && TRUSTED_EXECUTION_SECURE +{% else %} +endif # BOARD_{{ board | upper }}_NRF5340_CPUAPP && TRUSTED_EXECUTION_SECURE +{% endif %} + +{% if ncs_version < hwmv2_since %} +if BOARD_{{ board | upper }}_CPUAPP_NS +{% else %} +if BOARD_{{ board | upper }}_NRF5340_CPUAPP_NS +{% endif %} + +config FLASH_LOAD_OFFSET + default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) + +config FLASH_LOAD_SIZE + default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) + +{% if ncs_version < hwmv2_since %} +endif # BOARD_{{ board | upper }}_CPUAPP_NS +{% else %} +endif # BOARD_{{ board | upper }}_NRF5340_CPUAPP_NS +{% endif %} + +{% if ncs_version >= (2, 7, 99) %} +config BT_HCI_IPC + default y if BT + +config HEAP_MEM_POOL_ADD_SIZE_BOARD + int + default 4096 if BT_HCI_IPC +{% elif ncs_version >= (2, 7, 0) %} +choice BT_HCI_BUS_TYPE + default BT_HCI_IPC if BT +endchoice + +config HEAP_MEM_POOL_ADD_SIZE_BOARD + int + default 4096 if BT_HCI_IPC +{% elif ncs_version >= (2, 6, 0) %} +choice BT_HCI_BUS_TYPE + default BT_HCI_IPC if BT +endchoice + +config HEAP_MEM_POOL_SIZE + default 4096 if BT_HCI_IPC +{% else %} +choice BT_HCI_BUS_TYPE + default BT_RPMSG if BT +endchoice + +config HEAP_MEM_POOL_SIZE + default 4096 if BT_RPMSG +{% endif %} + +{% if ncs_version < hwmv2_since %} +endif # BOARD_{{ board | upper }}_CPUAPP || BOARD_{{ board | upper }}_CPUAPP_NS +{% else %} +endif # BOARD_{{ board | upper }}_NRF5340_CPUAPP || BOARD_{{ board | upper }}_NRF5340_CPUAPP_NS +{% endif %} + +{% if ncs_version < hwmv2_since %} +if BOARD_{{ board | upper }}_CPUNET +{% else %} +if BOARD_{{ board | upper }}_NRF5340_CPUNET +{% endif %} + +{% if ncs_version < hwmv2_since %} +config BOARD + default "{{ board }}_cpunet" + +{% endif %} +config BT_CTLR + default y if BT + +{% if ncs_version < hwmv2_since %} +endif # BOARD_{{ board | upper }}_CPUNET +{% else %} +endif # BOARD_{{ board | upper }}_NRF5340_CPUNET +{% endif %} diff --git a/scripts/west_commands/genboard/templates/nrf53/board-cpuapp_partitioning.dtsi.jinja2 b/scripts/west_commands/genboard/templates/nrf53/board-cpuapp_partitioning.dtsi.jinja2 new file mode 100644 index 000000000000..1cbf167195a6 --- /dev/null +++ b/scripts/west_commands/genboard/templates/nrf53/board-cpuapp_partitioning.dtsi.jinja2 @@ -0,0 +1,94 @@ +/* + * Default Flash planning for Application MCU. + * + * Zephyr build for nRF5340 with ARM TrustZone-M support, implies building + * Secure and Non-Secure Zephyr images. + * + * Secure image will be placed, by default, in flash0 (or in slot0, if MCUboot + * is present). Secure image will use sram0 for system memory. + * + * Non-Secure image will be placed in slot0_ns, and use sram0_ns for system + * memory. + * + * Note that the Secure image only requires knowledge of the beginning of the + * Non-Secure image (not its size). + */ +&flash0 { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + boot_partition: partition@0 { + label = "mcuboot"; + reg = <0x00000000 DT_SIZE_K(64)>; + }; + + slot0_partition: partition@10000 { + label = "image-0"; + reg = <0x00010000 DT_SIZE_K(256)>; + }; + + slot0_ns_partition: partition@50000 { + label = "image-0-nonsecure"; + reg = <0x00050000 DT_SIZE_K(192)>; + }; + + slot1_partition: partition@80000 { + label = "image-1"; + reg = <0x00080000 DT_SIZE_K(256)>; + }; + + slot1_ns_partition: partition@c0000 { + label = "image-1-nonsecure"; + reg = <0x000c0000 DT_SIZE_K(192)>; + }; + +{% if ncs_version <= (2, 4, 0) %} + scratch_partition: partition@f0000 { + label = "image-scratch"; + reg = <0x000f0000 DT_SIZE_K(40)>; + }; + + storage_partition: partition@f8000 { + label = "storage"; + reg = <0x000f8000 DT_SIZE_K(24)>; + }; +{% else %} + /* 0xf0000 to 0xf7fff reserved for TF-M partitions */ + storage_partition: partition@f8000 { + label = "storage"; + reg = <0x000f8000 DT_SIZE_K(32)>; + }; +{% endif %} + }; +}; + +/* Default SRAM planning when building for nRF5340 with ARM TrustZone-M support + * - Lowest 256 kB SRAM allocated to Secure image (sram0_s) + * - Middle 192 kB allocated to Non-Secure image (sram0_ns) + * - Upper 64 kB SRAM allocated as Shared memory (sram0_shared) + * (see {board}_shared_sram.dtsi) + */ +/ { + reserved-memory { + #address-cells = <1>; + #size-cells = <1>; + ranges; + + /* Zephyr image(s) memory */ + sram0_image: image@20000000 { + reg = <0x20000000 DT_SIZE_K(448)>; + }; + + /* Secure image memory */ + sram0_s: image_s@20000000 { + reg = <0x20000000 DT_SIZE_K(256)>; + }; + + /* Non-Secure image memory */ + sram0_ns: image_ns@20040000 { + reg = <0x20040000 DT_SIZE_K(192)>; + }; + }; +}; diff --git a/scripts/west_commands/genboard/templates/nrf53/board-pinctrl.dtsi b/scripts/west_commands/genboard/templates/nrf53/board-pinctrl.dtsi new file mode 100644 index 000000000000..eb124f540995 --- /dev/null +++ b/scripts/west_commands/genboard/templates/nrf53/board-pinctrl.dtsi @@ -0,0 +1,2 @@ +&pinctrl { +}; diff --git a/scripts/west_commands/genboard/templates/nrf53/board-shared_sram.dtsi b/scripts/west_commands/genboard/templates/nrf53/board-shared_sram.dtsi new file mode 100644 index 000000000000..87e024420c3e --- /dev/null +++ b/scripts/west_commands/genboard/templates/nrf53/board-shared_sram.dtsi @@ -0,0 +1,24 @@ +/* Default shared SRAM planning when building for nRF5340. + * This file is included by both nRF5340 CPUAPP (Application MCU) + * and nRF5340 CPUNET (Network MCU). + * - 64 kB SRAM allocated as Shared memory (sram0_shared) + * - Region defined after the image SRAM of Application MCU + */ + +/ { + chosen { + /* shared memory reserved for the inter-processor communication */ + zephyr,ipc_shm = &sram0_shared; + }; + + reserved-memory { + #address-cells = <1>; + #size-cells = <1>; + ranges; + + sram0_shared: memory@20070000 { + /* SRAM allocated to shared memory */ + reg = <0x20070000 0x10000>; + }; + }; +}; diff --git a/scripts/west_commands/genboard/templates/nrf53/board.cmake.jinja2 b/scripts/west_commands/genboard/templates/nrf53/board.cmake.jinja2 new file mode 100644 index 000000000000..756c1457cbbe --- /dev/null +++ b/scripts/west_commands/genboard/templates/nrf53/board.cmake.jinja2 @@ -0,0 +1,33 @@ +{% if ncs_version < hwmv2_since %} +if(CONFIG_BOARD_{{ board | upper }}_CPUAPP_NS) +{% else %} +if(CONFIG_BOARD_{{ board | upper }}_NRF5340_CPUAPP_NS) +{% endif %} + set(TFM_PUBLIC_KEY_FORMAT "full") +endif() + +if(CONFIG_TFM_FLASH_MERGED_BINARY) + set_property(TARGET runners_yaml_props_target PROPERTY hex_file "${CMAKE_BINARY_DIR}/tfm_merged.hex") +endif() + +{% if ncs_version < hwmv2_since %} +if(CONFIG_BOARD_{{ board | upper }}_CPUAPP OR CONFIG_BOARD_{{ board | upper }}_CPUAPP_NS) +{% else %} +if(CONFIG_BOARD_{{ board | upper }}_NRF5340_CPUAPP OR CONFIG_BOARD_{{ board | upper }}_NRF5340_CPUAPP_NS) +{% endif %} + board_runner_args(jlink "--device=nrf5340_xxaa_app" "--speed=4000") +endif() + +{% if ncs_version < hwmv2_since %} +if(CONFIG_BOARD_{{ board | upper }}_CPUNET) +{% else %} +if(CONFIG_BOARD_{{ board | upper }}_NRF5340_CPUNET) +{% endif %} + board_runner_args(jlink "--device=nrf5340_xxaa_net" "--speed=4000") +endif() + +include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) +{% if ncs_version >= (2, 4, 0) %} +include(${ZEPHYR_BASE}/boards/common/nrfutil.board.cmake) +{% endif %} +include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) diff --git a/scripts/west_commands/genboard/templates/nrf53/board.dts.jinja2 b/scripts/west_commands/genboard/templates/nrf53/board.dts.jinja2 new file mode 100644 index 000000000000..c17e40b30789 --- /dev/null +++ b/scripts/west_commands/genboard/templates/nrf53/board.dts.jinja2 @@ -0,0 +1,83 @@ +{% if target['core'] == "cpuapp" %} +{% if target['ns'] %} +/dts-v1/; +#include +#include "{{ board }}-pinctrl.dtsi" + +/ { + model = "{{ board_desc }} (CPUAPP Non-Secure)"; + compatible = "{{ vendor }},{{ board | replace("_", "-") }}-cpuapp-ns"; + + chosen { + zephyr,sram = &sram0_ns; + zephyr,flash = &flash0; + zephyr,code-partition = &slot0_ns_partition; + }; +}; +{% else %} +/dts-v1/; +#include +#include "{{ board }}-pinctrl.dtsi" + +/ { + model = "{{ board_desc }} (CPUAPP)"; + compatible = "{{ vendor }},{{ board | replace("_", "-") }}-cpuapp"; + + chosen { + zephyr,sram = &sram0_image; + zephyr,flash = &flash0; + zephyr,code-partition = &slot0_partition; + zephyr,sram-secure-partition = &sram0_s; + zephyr,sram-non-secure-partition = &sram0_ns; + }; +}; +{% endif %} + +#include "{{ board }}-cpuapp_partitioning.dtsi" +#include "{{ board }}-shared_sram.dtsi" +{% else %} +/dts-v1/; +#include +#include "{{ board }}-pinctrl.dtsi" + +/ { + model = "{{ board_desc }}"; + compatible = "{{ vendor }},{{ board | replace("_", "-") }}-cpunet"; + + chosen { + zephyr,sram = &sram1; + zephyr,flash = &flash1; + zephyr,code-partition = &slot0_partition; + }; +}; + +&flash1 { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + boot_partition: partition@0 { + label = "mcuboot"; + reg = <0x00000000 DT_SIZE_K(48)>; + }; + + slot0_partition: partition@c000 { + label = "image-0"; + reg = <0x0000c000 DT_SIZE_K(92)>; + }; + + slot1_partition: partition@23000 { + label = "image-1"; + reg = <0x00023000 DT_SIZE_K(92)>; + }; + + storage_partition: partition@3a000 { + label = "storage"; + reg = <0x0003a000 DT_SIZE_K(24)>; + }; + }; +}; + +#include "{{ board }}-shared_sram.dtsi" +{% endif %} diff --git a/scripts/west_commands/genboard/templates/nrf53/board.yml.jinja2 b/scripts/west_commands/genboard/templates/nrf53/board.yml.jinja2 new file mode 100644 index 000000000000..346ad528963f --- /dev/null +++ b/scripts/west_commands/genboard/templates/nrf53/board.yml.jinja2 @@ -0,0 +1,8 @@ +board: + name: {{ board }} + vendor: {{ vendor }} + socs: + - name: nrf5340 + variants: + - name: ns + cpucluster: cpuapp diff --git a/scripts/west_commands/genboard/templates/nrf53/board_defconfig.jinja2 b/scripts/west_commands/genboard/templates/nrf53/board_defconfig.jinja2 new file mode 100644 index 000000000000..8fd5e9632534 --- /dev/null +++ b/scripts/west_commands/genboard/templates/nrf53/board_defconfig.jinja2 @@ -0,0 +1,19 @@ +{% if ncs_version < hwmv2_since %} +CONFIG_SOC_SERIES_NRF53X=y +CONFIG_SOC_NRF5340_{{ target['core'] | upper }}_{{ variant | upper }}=y +CONFIG_BOARD_{{ board | upper }}_{{ target['core'] | upper }}=y + +{% endif %} +CONFIG_ARM_MPU=y +CONFIG_HW_STACK_PROTECTION=y + +{% if target['core'] == 'cpuapp' %} +CONFIG_ARM_TRUSTZONE_M=y +{% if target.get('ns') %} +CONFIG_TRUSTED_EXECUTION_NONSECURE=y +{% endif %} + +{% endif %} +{% if ncs_version <= (2, 6, 0) %} +CONFIG_PINCTRL=y +{% endif %} diff --git a/scripts/west_commands/genboard/templates/nrf53/board_twister.yml.jinja2 b/scripts/west_commands/genboard/templates/nrf53/board_twister.yml.jinja2 new file mode 100644 index 000000000000..947381969684 --- /dev/null +++ b/scripts/west_commands/genboard/templates/nrf53/board_twister.yml.jinja2 @@ -0,0 +1,25 @@ +{% if ncs_version < hwmv2_since %} +identifier: {{ board }}_{{ target['core'] }} +{% else %} +identifier: {{ board }}/nrf5340/{{ target['core'] }}{{ '/ns' if target['ns'] else '' }} +{% endif %} +name: {{ board_desc }} +vendor: {{ vendor }} +type: mcu +arch: arm +{% if target['core'] == 'cpunet' %} +ram: 64 +flash: 256 +{% else %} +{% if target['ns'] %} +ram: 192 +flash: 192 +{% else %} +ram: 448 +flash: 1024 +{% endif %} +{% endif %} +toolchain: + - zephyr +supported: + - gpio diff --git a/scripts/west_commands/genboard/templates/nrf53/pre_dt_board.cmake b/scripts/west_commands/genboard/templates/nrf53/pre_dt_board.cmake new file mode 100644 index 000000000000..519d7844635e --- /dev/null +++ b/scripts/west_commands/genboard/templates/nrf53/pre_dt_board.cmake @@ -0,0 +1,2 @@ +# Suppress "unique_unit_address_if_enabled" to handle some overlaps +list(APPEND EXTRA_DTC_FLAGS "-Wno-unique_unit_address_if_enabled") diff --git a/scripts/west_commands/genboard/templates/nrf54l/Kconfig.board.jinja2 b/scripts/west_commands/genboard/templates/nrf54l/Kconfig.board.jinja2 new file mode 100644 index 000000000000..1160e378e7f5 --- /dev/null +++ b/scripts/west_commands/genboard/templates/nrf54l/Kconfig.board.jinja2 @@ -0,0 +1,5 @@ +config BOARD_{{ board | upper }} + select SOC_{{ soc | upper }}_ENGA_CPUAPP if BOARD_{{ board | upper }}_{{ soc | upper }}_CPUAPP + select SOC_{{ soc | upper }}_ENGA_CPUFLPR if \ + BOARD_{{ board | upper }}_{{ soc | upper }}_CPUFLPR || \ + BOARD_{{ board | upper }}_{{ soc | upper }}_CPUFLPR_XIP diff --git a/scripts/west_commands/genboard/templates/nrf54l/Kconfig.defconfig.jinja2 b/scripts/west_commands/genboard/templates/nrf54l/Kconfig.defconfig.jinja2 new file mode 100644 index 000000000000..bdb12bdfd778 --- /dev/null +++ b/scripts/west_commands/genboard/templates/nrf54l/Kconfig.defconfig.jinja2 @@ -0,0 +1,9 @@ +if BOARD_{{ board | upper }}_CPUAPP + +config BT_CTLR + default BT + +config ROM_START_OFFSET + default 0x800 if BOOTLOADER_MCUBOOT + +endif # BOARD_{{ board | upper }}_CPUAPP diff --git a/scripts/west_commands/genboard/templates/nrf54l/board-pinctrl.dtsi b/scripts/west_commands/genboard/templates/nrf54l/board-pinctrl.dtsi new file mode 100644 index 000000000000..eb124f540995 --- /dev/null +++ b/scripts/west_commands/genboard/templates/nrf54l/board-pinctrl.dtsi @@ -0,0 +1,2 @@ +&pinctrl { +}; diff --git a/scripts/west_commands/genboard/templates/nrf54l/board.cmake.jinja2 b/scripts/west_commands/genboard/templates/nrf54l/board.cmake.jinja2 new file mode 100644 index 000000000000..467fefa96d99 --- /dev/null +++ b/scripts/west_commands/genboard/templates/nrf54l/board.cmake.jinja2 @@ -0,0 +1,9 @@ +if (CONFIG_SOC_{{ soc | upper }}_CPUAPP) + board_runner_args(jlink "--device=cortex-m33" "--speed=4000") +elseif (CONFIG_SOC_{{ soc | upper }}_CPUFLPR) + board_runner_args(jlink "--speed=4000") +endif() + +include(${ZEPHYR_BASE}/boards/common/nrfutil.board.cmake) +include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) +include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) diff --git a/scripts/west_commands/genboard/templates/nrf54l/board.dts.jinja2 b/scripts/west_commands/genboard/templates/nrf54l/board.dts.jinja2 new file mode 100644 index 000000000000..85b83afd8a60 --- /dev/null +++ b/scripts/west_commands/genboard/templates/nrf54l/board.dts.jinja2 @@ -0,0 +1,112 @@ +{% if target['core'] == 'cpuapp' %} +/dts-v1/; +#include +#include "{{ board }}-pinctrl.dtsi" + +/ { + model = "{{ board_desc }}"; + compatible = "{{ vendor }},{{ board | replace("_", "-") }}-cpuapp"; + + chosen { + zephyr,code-partition = &slot0_partition; + zephyr,sram = &cpuapp_sram; + zephyr,flash = &cpuapp_rram; + }; +}; + +&cpuapp_sram { + status = "okay"; +}; + +&grtc { + owned-channels = <0 1 2 3 4 5 6 7 8 9 10 11>; + /* Channels 7-11 reserved for Zero Latency IRQs, 3-4 for FLPR */ + child-owned-channels = <3 4 7 8 9 10 11>; + status = "okay"; +}; + +&cpuapp_rram { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + boot_partition: partition@0 { + label = "mcuboot"; + reg = <0x0 DT_SIZE_K(64)>; + }; + slot0_partition: partition@10000 { + label = "image-0"; + reg = <0x10000 DT_SIZE_K(324)>; + }; + slot0_ns_partition: partition@61000 { + label = "image-0-nonsecure"; + reg = <0x61000 DT_SIZE_K(324)>; + }; + slot1_partition: partition@b2000 { + label = "image-1"; + reg = <0xb2000 DT_SIZE_K(324)>; + }; + slot1_ns_partition: partition@103000 { + label = "image-1-nonsecure"; + reg = <0x103000 DT_SIZE_K(324)>; + }; + /* 32k from 0x154000 to 0x15bfff reserved for TF-M partitions */ + storage_partition: partition@15c000 { + label = "storage"; + reg = <0x15c000 DT_SIZE_K(36)>; + }; + }; +}; +{% else %} +{% if not target['xip'] %} +/dts-v1/; +#include +#include "{{ board }}-pinctrl.dtsi" + +/ { + model = "{{ board_desc }}"; + compatible = "{{ vendor }},{{ board | replace("_", "-") }}-cpuflpr"; + + chosen { + zephyr,code-partition = &cpuflpr_code_partition; + zephyr,flash = &cpuflpr_rram; + zephyr,sram = &cpuflpr_sram; + }; +}; + +&cpuflpr_sram { + status = "okay"; + reg = <0x20028000 DT_SIZE_K(96)>; + ranges = <0x0 0x20028000 DT_SIZE_K(96)>; +}; + +&cpuflpr_rram { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + cpuflpr_code_partition: partition@0 { + label = "image-0"; + reg = <0x0 DT_SIZE_K(96)>; + }; + }; +}; + +&grtc { + owned-channels = <3 4>; + status = "okay"; +}; +{% else %} +#include "{{ board }}_{{soc}}_cpuflpr.dts" + +/ { + compatible = "{{ vendor }},{{ board | replace("_", "-") }}-cpuflpr-xip"; +}; + +&cpuflpr_sram { + reg = <0x2002f000 DT_SIZE_K(68)>; + ranges = <0x0 0x2002f000 DT_SIZE_K(68)>; +}; +{% endif %} +{% endif %} diff --git a/scripts/west_commands/genboard/templates/nrf54l/board.yml.jinja2 b/scripts/west_commands/genboard/templates/nrf54l/board.yml.jinja2 new file mode 100644 index 000000000000..bf653b1ff41d --- /dev/null +++ b/scripts/west_commands/genboard/templates/nrf54l/board.yml.jinja2 @@ -0,0 +1,8 @@ +board: + name: {{ board }} + vendor: {{ vendor }} + socs: + - name: {{ soc }} + variants: + - name: xip + cpucluster: cpuflpr diff --git a/scripts/west_commands/genboard/templates/nrf54l/board_defconfig.jinja2 b/scripts/west_commands/genboard/templates/nrf54l/board_defconfig.jinja2 new file mode 100644 index 000000000000..1b250ff96b28 --- /dev/null +++ b/scripts/west_commands/genboard/templates/nrf54l/board_defconfig.jinja2 @@ -0,0 +1,19 @@ +{% if target['core'] == 'cpuapp' %} +CONFIG_ARM_MPU=y +CONFIG_HW_STACK_PROTECTION=y + +CONFIG_NULL_POINTER_EXCEPTION_DETECTION_NONE=y + +CONFIG_CACHE_MANAGEMENT=y +CONFIG_EXTERNAL_CACHE=y + +CONFIG_SOC_NRF_FORCE_CONSTLAT=y +CONFIG_NRF_GRTC_START_SYSCOUNTER=y +{% else %} +{% if not target['xip'] %} +CONFIG_USE_DT_CODE_PARTITION=y +CONFIG_XIP=n +{% else %} +CONFIG_XIP=y +{% endif %} +{% endif %} diff --git a/scripts/west_commands/genboard/templates/nrf54l/board_twister.yml.jinja2 b/scripts/west_commands/genboard/templates/nrf54l/board_twister.yml.jinja2 new file mode 100644 index 000000000000..348d3df3968a --- /dev/null +++ b/scripts/west_commands/genboard/templates/nrf54l/board_twister.yml.jinja2 @@ -0,0 +1,11 @@ +identifier: {{ board }}/{{ soc }}/{{ target['core'] }}{{ '/xip' if target['xip'] }} +name: {{ board_desc }} +vendor: {{ vendor }} +arch: {{ target['arch'] }} +toolchain: + - zephyr +sysbuild: true +ram: {{ target['ram'] }} +flash: {{ target['flash'] }} +supported: + - gpio diff --git a/scripts/west_commands/genboard/templates/nrf54l/pre_dt_board.cmake b/scripts/west_commands/genboard/templates/nrf54l/pre_dt_board.cmake new file mode 100644 index 000000000000..519d7844635e --- /dev/null +++ b/scripts/west_commands/genboard/templates/nrf54l/pre_dt_board.cmake @@ -0,0 +1,2 @@ +# Suppress "unique_unit_address_if_enabled" to handle some overlaps +list(APPEND EXTRA_DTC_FLAGS "-Wno-unique_unit_address_if_enabled") diff --git a/scripts/west_commands/genboard/templates/nrf91/Kconfig.board.jinja2 b/scripts/west_commands/genboard/templates/nrf91/Kconfig.board.jinja2 new file mode 100644 index 000000000000..041c6af87e17 --- /dev/null +++ b/scripts/west_commands/genboard/templates/nrf91/Kconfig.board.jinja2 @@ -0,0 +1,7 @@ +config BOARD_{{ board | upper }} +{% if ncs_version < hwmv2_since %} + bool "{{ board_desc }}" + depends on SOC_{{ soc | upper }}_{{ variant | upper}} +{% else %} + select SOC_{{ soc | upper }}_{{ variant | upper}} +{% endif %} diff --git a/scripts/west_commands/genboard/templates/nrf91/Kconfig.defconfig.jinja2 b/scripts/west_commands/genboard/templates/nrf91/Kconfig.defconfig.jinja2 new file mode 100644 index 000000000000..8c7f1c54768a --- /dev/null +++ b/scripts/west_commands/genboard/templates/nrf91/Kconfig.defconfig.jinja2 @@ -0,0 +1,54 @@ +{% if ncs_version < hwmv2_since %} +config BOARD + default "{{ board }}" + +{% endif %} +{% if ncs_version < hwmv2_since %} +if BOARD_{{ board | upper }} || BOARD_{{ board | upper }}_NS +{% else %} +if BOARD_{{ board | upper }}_{{ soc | upper }} || BOARD_{{ board | upper }}_{{ soc | upper }}_NS +{% endif %} + +# For the secure version of the board the firmware is linked at the beginning of +# the flash, or into the code-partition defined in DT if it is intended to be +# loaded by MCUboot. If the secure firmware is to be combined with a non-secure +# image (TRUSTED_EXECUTION_SECURE=y), the secure FW image shall always be +# restricted to the size of its code partition. For the non-secure version of +# the board, the firmware must be linked into the code-partition (non-secure) +# defined in DT, regardless. Apply this configuration below by setting the +# Kconfig symbols used by the linker according to the information extracted from +# DT partitions. + +DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition + +config FLASH_LOAD_SIZE + default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) +{% if ncs_version < hwmv2_since %} + depends on BOARD_{{ board | upper }} && TRUSTED_EXECUTION_SECURE +{% else %} + depends on BOARD_{{ board | upper }}_{{ soc | upper }} && TRUSTED_EXECUTION_SECURE +{% endif %} + +{% if ncs_version < hwmv2_since %} +if BOARD_{{ board | upper }}_NS +{% else %} +if BOARD_{{ board | upper }}_{{ soc | upper }}_NS +{% endif %} + +config FLASH_LOAD_OFFSET + default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) + +config FLASH_LOAD_SIZE + default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) + +{% if ncs_version < hwmv2_since %} +endif # BOARD_{{ board | upper }}_NS +{% else %} +endif # BOARD_{{ board | upper }}_{{ soc | upper }}_NS +{% endif %} + +{% if ncs_version < hwmv2_since %} +endif # BOARD_{{ board | upper }} || BOARD_{{ board | upper }}_NS +{% else %} +endif # BOARD_{{ board | upper }}_{{ soc | upper }} || BOARD_{{ board | upper }}_{{ soc | upper }}_NS +{% endif %} diff --git a/scripts/west_commands/genboard/templates/nrf91/board-partitioning.dtsi.jinja2 b/scripts/west_commands/genboard/templates/nrf91/board-partitioning.dtsi.jinja2 new file mode 100644 index 000000000000..b8a304d4dedf --- /dev/null +++ b/scripts/west_commands/genboard/templates/nrf91/board-partitioning.dtsi.jinja2 @@ -0,0 +1,105 @@ +/* + * Default Flash planning + * + * Zephyr build with ARM TrustZone-M support, implies building Secure and + * Non-Secure Zephyr images. + * + * Secure image will be placed, by default, in flash0 (or in slot0, if MCUboot + * is present). Secure image will use sram0 for system memory. + * + * Non-Secure image will be placed in slot0_ns, and use sram0_ns for system + * memory. + * + * Note that the Secure image only requires knowledge of the beginning of the + * Non-Secure image (not its size). + */ +&flash0 { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + boot_partition: partition@0 { + label = "mcuboot"; + reg = <0x00000000 DT_SIZE_K(64)>; + }; + + slot0_partition: partition@10000 { + label = "image-0"; + reg = <0x00010000 DT_SIZE_K(256)>; + }; + +{% if ncs_version <= (2, 4, 0) %} + slot0_ns_partition: partition@50000 { + label = "image-0-nonsecure"; + reg = <0x00050000 DT_SIZE_K(192)>; + }; + + slot1_partition: partition@80000 { + label = "image-1"; + reg = <0x00085000 DT_SIZE_K(256)>; + }; + + slot1_ns_partition: partition@c0000 { + label = "image-1-nonsecure"; + reg = <0x000c5000 DT_SIZE_K(192)>; + }; + + scratch_partition: partition@f0000 { + label = "image-scratch"; + reg = <0x000f0000 DT_SIZE_K(40)>; + }; +{% else %} + slot0_ns_partition: partition@50000 { + label = "image-0-nonsecure"; + reg = <0x00050000 DT_SIZE_K(212)>; + }; + + slot1_partition: partition@85000 { + label = "image-1"; + reg = <0x00085000 DT_SIZE_K(256)>; + }; + + slot1_ns_partition: partition@c5000 { + label = "image-1-nonsecure"; + reg = <0x000c5000 DT_SIZE_K(212)>; + }; +{% endif %} + + storage_partition: partition@fa000 { + label = "storage"; + reg = <0x000fa000 DT_SIZE_K(24)>; + }; + }; +}; + + +/* Default SRAM planning when building with ARM TrustZone-M support: + * - Lowest 88 kB SRAM allocated to Secure image (sram0_s). + * - 40 kB SRAM reserved for and used by the modem library (sram0_modem). This + * memory is Non-Secure. + * - Upper 128 kB allocated to Non-Secure image (sram0_ns). When building with + * TF-M, both sram0_modem and sram0_ns are allocated to the Non-Secure image. + */ +/ { + reserved-memory { + #address-cells = <1>; + #size-cells = <1>; + ranges; + + /* Secure image memory */ + sram0_s: image_s@20000000 { + reg = <0x20000000 DT_SIZE_K(88)>; + }; + + /* Modem (shared) memory */ + sram0_modem: image_modem@20016000 { + reg = <0x20016000 DT_SIZE_K(40)>; + }; + + /* Non-Secure image memory */ + sram0_ns: image_ns@20020000 { + reg = <0x20020000 DT_SIZE_K(128)>; + }; + }; +}; diff --git a/scripts/west_commands/genboard/templates/nrf91/board-pinctrl.dtsi b/scripts/west_commands/genboard/templates/nrf91/board-pinctrl.dtsi new file mode 100644 index 000000000000..eb124f540995 --- /dev/null +++ b/scripts/west_commands/genboard/templates/nrf91/board-pinctrl.dtsi @@ -0,0 +1,2 @@ +&pinctrl { +}; diff --git a/scripts/west_commands/genboard/templates/nrf91/board.cmake.jinja2 b/scripts/west_commands/genboard/templates/nrf91/board.cmake.jinja2 new file mode 100644 index 000000000000..7182cb22eb86 --- /dev/null +++ b/scripts/west_commands/genboard/templates/nrf91/board.cmake.jinja2 @@ -0,0 +1,16 @@ +{% if ncs_version < hwmv2_since %} +if(CONFIG_BOARD_{{ board | upper }}_NS) +{% else %} +if(CONFIG_BOARD_{{ board | upper }}_{{ soc | upper }}_NS) +{% endif %} + set(TFM_PUBLIC_KEY_FORMAT "full") +endif() + +if(CONFIG_TFM_FLASH_MERGED_BINARY) + set_property(TARGET runners_yaml_props_target PROPERTY hex_file tfm_merged.hex) +endif() + +board_runner_args(jlink "--device={{ soc | replace("nrf", "nRF") }}_{{ 'xxAA' if soc == 'nrf9160' else 'xxCA' }}" "--speed=4000") + +include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) +include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) diff --git a/scripts/west_commands/genboard/templates/nrf91/board.dts.jinja2 b/scripts/west_commands/genboard/templates/nrf91/board.dts.jinja2 new file mode 100644 index 000000000000..2546d1eedcfd --- /dev/null +++ b/scripts/west_commands/genboard/templates/nrf91/board.dts.jinja2 @@ -0,0 +1,29 @@ +{% if target['ns'] %} +/dts-v1/; +#include +#include "{{ board }}-pinctrl.dtsi" +#include "{{ board }}-partitioning.dtsi" + +/ { + chosen { + zephyr,flash = &flash0; + zephyr,sram = &sram0_ns; + zephyr,code-partition = &slot0_ns_partition; + }; +}; +{% else %} +/dts-v1/; +#include +#include "{{ board }}-pinctrl.dtsi" +#include "{{ board }}-partitioning.dtsi" + +/ { + chosen { + zephyr,sram = &sram0_s; + zephyr,flash = &flash0; + zephyr,code-partition = &slot0_partition; + zephyr,sram-secure-partition = &sram0_s; + zephyr,sram-non-secure-partition = &sram0_ns; + }; +}; +{% endif %} diff --git a/scripts/west_commands/genboard/templates/nrf91/board.yml.jinja2 b/scripts/west_commands/genboard/templates/nrf91/board.yml.jinja2 new file mode 100644 index 000000000000..a18e19033232 --- /dev/null +++ b/scripts/west_commands/genboard/templates/nrf91/board.yml.jinja2 @@ -0,0 +1,7 @@ +board: + name: {{ board }} + vendor: {{ vendor }} + socs: + - name: {{ soc }} + variants: + - name: ns diff --git a/scripts/west_commands/genboard/templates/nrf91/board_defconfig.jinja2 b/scripts/west_commands/genboard/templates/nrf91/board_defconfig.jinja2 new file mode 100644 index 000000000000..dae3836484ec --- /dev/null +++ b/scripts/west_commands/genboard/templates/nrf91/board_defconfig.jinja2 @@ -0,0 +1,17 @@ +{% if ncs_version < hwmv2_since %} +CONFIG_SOC_SERIES_NRF91X=y +CONFIG_SOC_{{ soc | upper }}_{{ variant | upper }}=y +CONFIG_BOARD_{{ board | upper }}=y + +{% endif %} +CONFIG_ARM_MPU=y +CONFIG_HW_STACK_PROTECTION=y + +CONFIG_ARM_TRUSTZONE_M=y +{% if target.get('ns') %} +CONFIG_TRUSTED_EXECUTION_NONSECURE=y +{% endif %} + +{% if ncs_version <= (2, 6, 0) %} +CONFIG_PINCTRL=y +{% endif %} diff --git a/scripts/west_commands/genboard/templates/nrf91/board_twister.yml.jinja2 b/scripts/west_commands/genboard/templates/nrf91/board_twister.yml.jinja2 new file mode 100644 index 000000000000..2c93f456e540 --- /dev/null +++ b/scripts/west_commands/genboard/templates/nrf91/board_twister.yml.jinja2 @@ -0,0 +1,20 @@ +{% if ncs_version < hwmv2_since %} +identifier: {{ board }} +{% else %} +identifier: {{ board }}/{{ soc }}{{ '/ns' if target['ns'] else '' }} +{% endif %} +name: {{ board_desc }} +vendor: {{ vendor }} +type: mcu +arch: arm +{% if target['ns'] %} +ram: 128 +flash: 212 +{% else %} +ram: 88 +flash: 1024 +{% endif %} +toolchain: + - zephyr +supported: + - gpio diff --git a/scripts/west_commands/genboard/templates/nrf91/pre_dt_board.cmake b/scripts/west_commands/genboard/templates/nrf91/pre_dt_board.cmake new file mode 100644 index 000000000000..519d7844635e --- /dev/null +++ b/scripts/west_commands/genboard/templates/nrf91/pre_dt_board.cmake @@ -0,0 +1,2 @@ +# Suppress "unique_unit_address_if_enabled" to handle some overlaps +list(APPEND EXTRA_DTC_FLAGS "-Wno-unique_unit_address_if_enabled") diff --git a/scripts/west_commands/genboard/west-ncs-genboard-test.sh b/scripts/west_commands/genboard/west-ncs-genboard-test.sh new file mode 100755 index 000000000000..46b40d33123d --- /dev/null +++ b/scripts/west_commands/genboard/west-ncs-genboard-test.sh @@ -0,0 +1,151 @@ +#!/bin/bash + +set -e + +SCRIPTDIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) +NCS_BASE="$SCRIPTDIR/../../.." + +SOC=${1} + +declare -a NCS_VERSIONS=( + "2.0.0" + "2.1.0" + "2.2.0" + "2.3.0" + "2.4.0" + "2.5.0" + "2.6.0" + "2.7.0" + "2.7.99" +) + +declare -a SOCS=( + "nrf52805 caaa 2.0.0" + "nrf52810 qfaa 2.0.0" + "nrf52811 qfaa 2.0.0" + "nrf52820 qdaa 2.0.0" + "nrf52832 ciaa 2.0.0" + "nrf52832 qfaa 2.0.0" + "nrf52832 qfab 2.0.0" + "nrf52833 qdaa 2.5.0" + "nrf52833 qiaa 2.0.0" + "nrf52840 qfaa 2.5.0" + "nrf52840 qiaa 2.0.0" + "nrf5340 qkaa 2.0.0" + "nrf54l15 qfaa 2.7.0" + "nrf9131 laca 2.5.0" + "nrf9151 laca 2.6.0" + "nrf9160 sica 2.0.0" + "nrf9161 laca 2.5.0" +) + +HELLO_WORLD="$NCS_BASE/../zephyr/samples/hello_world" + +# https://stackoverflow.com/questions/4023830 +verlte() { + printf '%s\n' "$1" "$2" | sort -C -V +} + +verlt() { + ! verlte "$2" "$1" +} + +rm -rf $NCS_BASE/boards/arm/testvnd $NCS_BASE/boards/testvnd +BRANCH=$(git rev-parse --abbrev-ref HEAD) + +for soc in "${SOCS[@]}"; do + read -a socarr <<< "$soc" + + if [ ! -z "$SOC" ] && [ $SOC != ${socarr[0]} ]; then + echo "Skipping ${socarr[0]} (not requested)" + continue + fi + + for ncs_version in "${NCS_VERSIONS[@]}"; do + ncs_version_esc="${ncs_version//./_}" + + if verlt $ncs_version ${socarr[2]}; then + echo "Skipping ${socarr[0]}-${socarr[1]} for NCS $ncs_version (unsupported)" + continue; + fi + + board=brd_${socarr[0]}_${socarr[1]}_$ncs_version_esc + + echo "Generating board: $board" + + west ncs-genboard \ + -o $NCS_BASE/boards \ + -e "testvnd" \ + -b $board \ + -d "Test Board" \ + -s ${socarr[0]} \ + -v ${socarr[1]} \ + -n "$ncs_version" + done +done + +for ncs_version in "${NCS_VERSIONS[@]}" +do + ncs_version_esc="${ncs_version//./_}" + + echo "Switching to NCS $ncs_version" + + LATEST=".*99" + if [[ ${ncs_version} =~ $LATEST ]]; then + git checkout main + else + git checkout v$ncs_version + fi + west update + + for soc in "${SOCS[@]}"; do + read -a socarr <<< "$soc" + + if [ ! -z "$SOC" ] && [ $SOC != ${socarr[0]} ]; then + echo "Skipping ${socarr[0]} (not requested)" + continue + fi + + if verlt $ncs_version ${socarr[2]}; then + continue; + fi + + board=brd_${socarr[0]}_${socarr[1]}_$ncs_version_esc + + echo "Building for: $board" + + if [[ ${socarr[0]} == nrf52* ]]; then + west build -p -b $board $HELLO_WORLD + elif [[ ${socarr[0]} == nrf53* ]]; then + if verlt $ncs_version "2.7.0"; then + west build -p -b ${board}_cpuapp $HELLO_WORLD + if verlte "2.6.0" $ncs_version; then + west build -p -b ${board}_cpuapp_ns $HELLO_WORLD + fi + west build -p -b ${board}_cpunet $HELLO_WORLD + else + west build -p -b $board/${socarr[0]}/cpuapp $HELLO_WORLD + west build -p -b $board/${socarr[0]}/cpuapp/ns $HELLO_WORLD + west build -p -b $board/${socarr[0]}/cpunet $HELLO_WORLD + fi + elif [[ ${socarr[0]} == nrf54l* ]]; then + west build -p -b $board/${socarr[0]}/cpuapp $HELLO_WORLD + # west build -p -b $board/${socarr[0]}/cpuflpr $HELLO_WORLD + # west build -p -b $board/${socarr[0]}/cpuflpr/xip $HELLO_WORLD + elif [[ ${socarr[0]} == nrf91* ]]; then + if verlt $ncs_version "2.7.0"; then + west build -p -b $board $HELLO_WORLD + if verlte "2.6.0" $ncs_version; then + west build -p -b ${board}_ns $HELLO_WORLD + fi + else + west build -p -b $board/${socarr[0]} $HELLO_WORLD + west build -p -b $board/${socarr[0]}/ns $HELLO_WORLD + fi + fi + done +done + +rm -rf $NCS_BASE/boards/arm/brd_* $NCS_BASE/boards/testvnd +git checkout $BRANCH +west update diff --git a/scripts/west_commands/sbom/input_build.py b/scripts/west_commands/sbom/input_build.py index 2513919562ee..cdbbb03c43d8 100644 --- a/scripts/west_commands/sbom/input_build.py +++ b/scripts/west_commands/sbom/input_build.py @@ -16,6 +16,7 @@ from args import args from data_structure import Data, FileInfo from common import SbomException, command_execute +import yaml DEFAULT_BUILD_DIR = 'build' @@ -399,7 +400,13 @@ def test_tool(arg_name: str, cmake_var_name: str) -> str: return result try: - with open(build_dir / 'CMakeCache.txt', 'r') as fd: + domains = yaml.safe_load(open(os.path.join(build_dir, 'domains.yaml'), 'r')) + cmakecache = os.path.join(build_dir, domains['default'], 'CMakeCache.txt') + except FileNotFoundError: + cmakecache = os.path.join(build_dir, 'CMakeCache.txt') + + try: + with open(cmakecache, 'r') as fd: cmake_cache = fd.read() except FileNotFoundError as ex: raise SbomException('Cannot find "CMakeCache.txt".\n' @@ -427,9 +434,16 @@ def generate_input(data: Data): log.wrn('Fetching input files from a build directory is experimental for now.') check_external_tools(Path(args.build_dir[0][0])) for build_dir, *targets in args.build_dir: - if len(targets) == 0: - targets = [DEFAULT_TARGET] - log.dbg(f'INPUT: build directory: {build_dir}, targets: {targets}') - b = InputBuild(data, build_dir) - for target in targets: - b.generate_from_target(target) + try: + domains = yaml.safe_load(open(os.path.join(build_dir, 'domains.yaml'), 'r')) + domains = [d['name'] for d in domains['domains']] + except FileNotFoundError: + domains = ['.'] + for domain in domains: + domain_build_dir = Path(os.path.join(build_dir, domain)) + if len(targets) == 0: + targets = [DEFAULT_TARGET] + log.dbg(f'INPUT: build directory: {domain_build_dir}, targets: {targets}') + b = InputBuild(data, domain_build_dir) + for target in targets: + b.generate_from_target(target) diff --git a/scripts/west_commands/sbom/scancode_toolkit_detector.py b/scripts/west_commands/sbom/scancode_toolkit_detector.py index 3ee9ef0053cc..3819d9844234 100644 --- a/scripts/west_commands/sbom/scancode_toolkit_detector.py +++ b/scripts/west_commands/sbom/scancode_toolkit_detector.py @@ -64,7 +64,17 @@ def detect(data: Data, optional: bool): decoded = map(run_scancode, filtered) for result, file in zip(decoded, filtered): - for i in result['files'][0]['licenses']: + + current = result['files'][0] + if 'licenses' in current: + licenses = result['files'][0]['licenses'] + elif 'license_detections' in current: + licenses = result['files'][0]['license_detections'] + else: + print('No license information for {}'.format(current['path'])) + continue + + for i in licenses: friendly_id = '' if 'spdx_license_key' in i and i['spdx_license_key'] != '': diff --git a/snippets/emulated-gpio/icmsg/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/snippets/emulated-gpio/icmsg/boards/nrf54l15dk_nrf54l15_cpuapp.overlay index e598942eee45..9fb9821dc1d7 100644 --- a/snippets/emulated-gpio/icmsg/boards/nrf54l15dk_nrf54l15_cpuapp.overlay +++ b/snippets/emulated-gpio/icmsg/boards/nrf54l15dk_nrf54l15_cpuapp.overlay @@ -15,22 +15,22 @@ reg = <0x165000 DT_SIZE_K(96)>; }; - sram_rx: memory@20018000 { - reg = <0x20018000 0x0800>; + sram_rx: memory@2003c000 { + reg = <0x2003c000 0x0800>; }; - sram_tx: memory@20020000 { - reg = <0x20020000 0x0800>; + sram_tx: memory@2003c800 { + reg = <0x2003c800 0x0800>; }; }; - cpuflpr_sram_code_data: memory@20028000 { + cpuflpr_sram_code_data: memory@2003d000 { compatible = "mmio-sram"; - reg = <0x20028000 DT_SIZE_K(96)>; + reg = <0x2003d000 DT_SIZE_K(12)>; #address-cells = <1>; #size-cells = <1>; - ranges = <0x0 0x20028000 0x18000>; + ranges = <0x0 0x2003d000 0x3000>; }; }; @@ -39,7 +39,7 @@ compatible = "zephyr,ipc-icmsg"; tx-region = <&sram_tx>; rx-region = <&sram_rx>; - mboxes = <&cpuapp_vevif_rx 20>, <&cpuapp_vevif_tx 21>; + mboxes = <&cpuapp_vevif_rx 20>, <&cpuapp_vevif_tx 16>; mbox-names = "rx", "tx"; status = "okay"; }; @@ -47,8 +47,8 @@ }; &cpuapp_sram { - reg = <0x20000000 DT_SIZE_K(160)>; - ranges = <0x0 0x20000000 0x28000>; + reg = <0x20000000 DT_SIZE_K(244)>; + ranges = <0x0 0x20000000 0x3d000>; }; &cpuflpr_vpr { diff --git a/snippets/emulated-gpio/icmsg/emulated-gpio.overlay b/snippets/emulated-gpio/icmsg/emulated-gpio.overlay index 59e7421ed232..1c83a452fe22 100644 --- a/snippets/emulated-gpio/icmsg/emulated-gpio.overlay +++ b/snippets/emulated-gpio/icmsg/emulated-gpio.overlay @@ -7,7 +7,7 @@ status = "okay"; egpio: gpio { - compatible = "nordic,nrf-egpio"; + compatible = "nordic,nrfe-gpio"; gpio-controller; #gpio-cells = <0x2>; ngpios = <0x10>; diff --git a/snippets/emulated-gpio/mbox/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/snippets/emulated-gpio/mbox/boards/nrf54l15dk_nrf54l15_cpuapp.overlay index 887bc419206c..66506cae1187 100644 --- a/snippets/emulated-gpio/mbox/boards/nrf54l15dk_nrf54l15_cpuapp.overlay +++ b/snippets/emulated-gpio/mbox/boards/nrf54l15dk_nrf54l15_cpuapp.overlay @@ -15,35 +15,35 @@ reg = <0x165000 DT_SIZE_K(96)>; }; - sram_rx: memory@20018000 { - reg = <0x20018000 0x0800>; + sram_rx: memory@2003c000 { + reg = <0x2003c000 0x0800>; }; - sram_tx: memory@20020000 { - reg = <0x20020000 0x0800>; + sram_tx: memory@2003c800 { + reg = <0x2003c800 0x0800>; }; }; - cpuflpr_sram_code_data: memory@20028000 { + cpuflpr_sram_code_data: memory@2003d000 { compatible = "mmio-sram"; - reg = <0x20028000 DT_SIZE_K(96)>; + reg = <0x2003d000 DT_SIZE_K(12)>; #address-cells = <1>; #size-cells = <1>; - ranges = <0x0 0x20028000 0x18000>; + ranges = <0x0 0x2003d000 0x3000>; }; }; mbox_consumer { compatible = "vnd,mbox-consumer"; - mboxes = <&cpuapp_vevif_rx 20>, <&cpuapp_vevif_tx 21>; + mboxes = <&cpuapp_vevif_rx 20>, <&cpuapp_vevif_tx 16>; mbox-names = "rx", "tx"; }; }; &cpuapp_sram { - reg = <0x20000000 DT_SIZE_K(160)>; - ranges = <0x0 0x20000000 0x28000>; + reg = <0x20000000 DT_SIZE_K(244)>; + ranges = <0x0 0x20000000 0x3d000>; }; &cpuflpr_vpr { diff --git a/snippets/emulated-gpio/mbox/emulated-gpio.overlay b/snippets/emulated-gpio/mbox/emulated-gpio.overlay index 59e7421ed232..1c83a452fe22 100644 --- a/snippets/emulated-gpio/mbox/emulated-gpio.overlay +++ b/snippets/emulated-gpio/mbox/emulated-gpio.overlay @@ -7,7 +7,7 @@ status = "okay"; egpio: gpio { - compatible = "nordic,nrf-egpio"; + compatible = "nordic,nrfe-gpio"; gpio-controller; #gpio-cells = <0x2>; ngpios = <0x10>; diff --git a/snippets/hw-flow-control/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/snippets/hw-flow-control/boards/nrf54h20dk_nrf54h20_cpuapp.overlay new file mode 100644 index 000000000000..510aaa8067b9 --- /dev/null +++ b/snippets/hw-flow-control/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -0,0 +1,9 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +&uart136 { + hw-flow-control; +}; diff --git a/snippets/hw-flow-control/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/snippets/hw-flow-control/boards/nrf54l15dk_nrf54l15_cpuapp.overlay new file mode 100644 index 000000000000..dbc5e788b57a --- /dev/null +++ b/snippets/hw-flow-control/boards/nrf54l15dk_nrf54l15_cpuapp.overlay @@ -0,0 +1,9 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +&uart20 { + hw-flow-control; +}; diff --git a/snippets/nrf91-modem-trace-ram/modem-trace-ram.conf b/snippets/nrf91-modem-trace-ram/modem-trace-ram.conf new file mode 100644 index 000000000000..fa88c3d39421 --- /dev/null +++ b/snippets/nrf91-modem-trace-ram/modem-trace-ram.conf @@ -0,0 +1,10 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_NRF_MODEM_LIB_TRACE=y + +# Modem trace flash backend +CONFIG_NRF_MODEM_LIB_TRACE_BACKEND_RAM=y diff --git a/snippets/nrf91-modem-trace-ram/snippet.yml b/snippets/nrf91-modem-trace-ram/snippet.yml new file mode 100644 index 000000000000..7fd717f20de0 --- /dev/null +++ b/snippets/nrf91-modem-trace-ram/snippet.yml @@ -0,0 +1,3 @@ +name: nrf91-modem-trace-ram +append: + EXTRA_CONF_FILE: modem-trace-ram.conf diff --git a/snippets/nrf91-modem-trace-rtt/overlay-modem-trace-rtt.conf b/snippets/nrf91-modem-trace-rtt/overlay-modem-trace-rtt.conf new file mode 100644 index 000000000000..8ad46eb49d13 --- /dev/null +++ b/snippets/nrf91-modem-trace-rtt/overlay-modem-trace-rtt.conf @@ -0,0 +1,13 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_NRF_MODEM_LIB_TRACE=y + +# Modem trace RTT backend +CONFIG_NRF_MODEM_LIB_TRACE_BACKEND_RTT=y + +# RTT configuration +CONFIG_USE_SEGGER_RTT=y diff --git a/snippets/nrf91-modem-trace-rtt/snippet.yml b/snippets/nrf91-modem-trace-rtt/snippet.yml new file mode 100644 index 000000000000..b2d2f926171d --- /dev/null +++ b/snippets/nrf91-modem-trace-rtt/snippet.yml @@ -0,0 +1,3 @@ +name: nrf91-modem-trace-rtt +append: + EXTRA_CONF_FILE: overlay-modem-trace-rtt.conf diff --git a/snippets/wpa-supplicant-debug/overlay-wpa-supplicant-debug.conf b/snippets/wpa-supplicant-debug/overlay-wpa-supplicant-debug.conf index 6263418bc688..38a11e2e1557 100644 --- a/snippets/wpa-supplicant-debug/overlay-wpa-supplicant-debug.conf +++ b/snippets/wpa-supplicant-debug/overlay-wpa-supplicant-debug.conf @@ -16,4 +16,4 @@ CONFIG_NET_STATISTICS_USER_API=y CONFIG_LOG=y CONFIG_LOG_MODE_IMMEDIATE=y CONFIG_PRINTK=y -CONFIG_WPA_SUPP_LOG_LEVEL_DBG=y +CONFIG_WIFI_NM_WPA_SUPPLICANT_LOG_LEVEL_DBG=y diff --git a/snippets/zperf/zperf.conf b/snippets/zperf/zperf.conf index 9ca747e3f992..8010f9d3f773 100644 --- a/snippets/zperf/zperf.conf +++ b/snippets/zperf/zperf.conf @@ -9,4 +9,5 @@ CONFIG_NET_SHELL=y CONFIG_NET_ZPERF=y CONFIG_NET_CONTEXT_RCVTIMEO=y CONFIG_NET_SOCKETS=y +CONFIG_ZVFS_OPEN_MAX=9 CONFIG_NET_SOCKETS_POLL_MAX=9 diff --git a/subsys/bluetooth/controller/Kconfig b/subsys/bluetooth/controller/Kconfig index a998cd4212b1..a6901c679f43 100644 --- a/subsys/bluetooth/controller/Kconfig +++ b/subsys/bluetooth/controller/Kconfig @@ -37,6 +37,7 @@ config BT_LL_SOFTDEVICE select BT_CTLR_ADV_ISO_SUPPORT select BT_CTLR_PHY_2M_SUPPORT if HAS_HW_NRF_RADIO_BLE_2M select BT_CTLR_PHY_CODED_SUPPORT if HAS_HW_NRF_RADIO_BLE_CODED + select BT_CTLR_CHANNEL_SOUNDING_SUPPORT if HAS_HW_NRF_RADIO_CS select BT_HAS_HCI_VS select BT_CTLR_DF_SUPPORT if HAS_HW_NRF_RADIO_DFE select BT_CTLR_LE_POWER_CONTROL_SUPPORT @@ -573,5 +574,12 @@ config BT_CTLR_SDC_CIS_SUBEVENT_LENGTH_US If this parameter is set to zero, the subevent length is chosen by the controller. +config BT_CTLR_SDC_CS_COUNT + int "Number of concurrent connections supporting CS procedure" + default 1 + depends on BT_CTLR_CHANNEL_SOUNDING + help + Set the number of concurrent connections that can support Channel Sounding procedure. + endmenu endif # BT_LL_SOFTDEVICE diff --git a/subsys/bluetooth/controller/hci_driver.c b/subsys/bluetooth/controller/hci_driver.c index a4aeb98ce530..843b44221bf3 100644 --- a/subsys/bluetooth/controller/hci_driver.c +++ b/subsys/bluetooth/controller/hci_driver.c @@ -260,6 +260,14 @@ BUILD_ASSERT(!IS_ENABLED(CONFIG_BT_PERIPHERAL) || #define SDC_MEM_CHAN_SURV 0 #endif +#if defined(CONFIG_BT_CTLR_SDC_CS_COUNT) +#define SDC_MEM_CS_POOL \ + SDC_MEM_CS(CONFIG_BT_CTLR_SDC_CS_COUNT) + \ + SDC_MEM_CS_SETUP_PHASE_LINKS(SDC_CENTRAL_COUNT + PERIPHERAL_COUNT) +#else +#define SDC_MEM_CS_POOL 0 +#endif + #define MEMPOOL_SIZE ((PERIPHERAL_COUNT * PERIPHERAL_MEM_SIZE) + \ (SDC_CENTRAL_COUNT * CENTRAL_MEM_SIZE) + \ (SDC_ADV_SET_MEM_SIZE) + \ @@ -279,7 +287,8 @@ BUILD_ASSERT(!IS_ENABLED(CONFIG_BT_PERIPHERAL) || (SDC_MEM_BIS_SINK) + \ (SDC_MEM_BIS_SOURCE) + \ (SDC_MEM_ISO_RX_PDU_POOL) + \ - (SDC_MEM_ISO_TX_POOL)) + (SDC_MEM_ISO_TX_POOL) + \ + (SDC_MEM_CS_POOL)) #if defined(CONFIG_BT_SDC_ADDITIONAL_MEMORY) __aligned(8) uint8_t sdc_mempool[MEMPOOL_SIZE + CONFIG_BT_SDC_ADDITIONAL_MEMORY]; @@ -925,6 +934,17 @@ static int configure_supported_features(void) } } + if (IS_ENABLED(CONFIG_BT_CTLR_CHANNEL_SOUNDING)) { + err = sdc_support_channel_sounding_test(); + if (err) { + return -ENOTSUP; + } + err = sdc_support_channel_sounding(); + if (err) { + return -ENOTSUP; + } + } + return 0; } @@ -1188,6 +1208,16 @@ static int configure_memory_usage(void) } #endif +#if defined(CONFIG_BT_CTLR_SDC_CS_COUNT) + cfg.cs_count.count = CONFIG_BT_CTLR_SDC_CS_COUNT; + required_memory = sdc_cfg_set(SDC_DEFAULT_RESOURCE_CFG_TAG, + SDC_CFG_TYPE_CS_COUNT, + &cfg); + if (required_memory < 0) { + return required_memory; + } +#endif + LOG_DBG("BT mempool size: %u, required: %u", sizeof(sdc_mempool), required_memory); diff --git a/subsys/bluetooth/controller/hci_internal.c b/subsys/bluetooth/controller/hci_internal.c index e4b041a74fdf..3ac6df297a01 100644 --- a/subsys/bluetooth/controller/hci_internal.c +++ b/subsys/bluetooth/controller/hci_internal.c @@ -66,6 +66,15 @@ static bool command_generates_command_complete_event(uint16_t hci_opcode) case SDC_HCI_OPCODE_CMD_LE_CREATE_BIG_TEST: case SDC_HCI_OPCODE_CMD_LE_TERMINATE_BIG: case SDC_HCI_OPCODE_CMD_LE_SUBRATE_REQUEST: +#if defined(CONFIG_BT_CTLR_CHANNEL_SOUNDING) + case SDC_HCI_OPCODE_CMD_LE_CS_READ_REMOTE_SUPPORTED_CAPABILITIES: + case SDC_HCI_OPCODE_CMD_LE_CS_SECURITY_ENABLE: + case SDC_HCI_OPCODE_CMD_LE_CS_READ_REMOTE_FAE_TABLE: + case SDC_HCI_OPCODE_CMD_LE_CS_CREATE_CONFIG: + case SDC_HCI_OPCODE_CMD_LE_CS_REMOVE_CONFIG: + case SDC_HCI_OPCODE_CMD_LE_CS_PROCEDURE_ENABLE: + case SDC_HCI_OPCODE_CMD_LE_CS_TEST_END: +#endif /* CONFIG_BT_CTLR_CHANNEL_SOUNDING */ return false; default: return true; @@ -620,6 +629,22 @@ void hci_internal_supported_commands(sdc_hci_ip_supported_commands_t *cmds) #endif cmds->hci_le_subrate_request_command = 1; #endif /* CONFIG_BT_CTLR_SUBRATING */ +#if defined(CONFIG_BT_CTLR_CHANNEL_SOUNDING) + cmds->hci_le_cs_read_remote_fae_table = 1; + cmds->hci_le_cs_write_cached_remote_fae_table = 1; + cmds->hci_le_cs_create_config = 1; + cmds->hci_le_cs_remove_config = 1; + cmds->hci_le_cs_read_local_supported_capabilities = 1; + cmds->hci_le_cs_read_remote_supported_capabilities = 1; + cmds->hci_le_cs_write_cached_remote_supported_capabilities = 1; + cmds->hci_le_cs_test = 1; + cmds->hci_le_cs_test_end = 1; + cmds->hci_le_cs_security_enable = 1; + cmds->hci_le_cs_set_default_settings = 1; + cmds->hci_le_cs_set_channel_classification = 1; + cmds->hci_le_cs_set_procedure_parameters = 1; + cmds->hci_le_cs_procedure_enable = 1; +#endif /* CONFIG_BT_CTLR_CHANNEL_SOUNDING */ } #if defined(CONFIG_BT_HCI_VS) @@ -799,6 +824,10 @@ void hci_internal_le_supported_features( #if defined(CONFIG_BT_CTLR_SUBRATING) features->params.connection_subrating = 1; #endif +#if defined(CONFIG_BT_CTLR_CHANNEL_SOUNDING) + features->params.channel_sounding = 1; + features->params.channel_sounding_tone_quality_indication = 1; +#endif /* CONFIG_BT_CTLR_CHANNEL_SOUNDING */ } static void le_read_supported_states(uint8_t *buf) @@ -1557,6 +1586,45 @@ static uint8_t le_controller_cmd_put(uint8_t const * const cmd, return sdc_hci_cmd_le_subrate_request((void *)cmd_params); #endif /* CONFIG_BT_CTLR_SUBRATING */ +#if defined(CONFIG_BT_CTLR_CHANNEL_SOUNDING) + case SDC_HCI_OPCODE_CMD_LE_CS_READ_LOCAL_SUPPORTED_CAPABILITIES: + *param_length_out += + sizeof(sdc_hci_cmd_le_cs_read_local_supported_capabilities_return_t); + return sdc_hci_cmd_le_cs_read_local_supported_capabilities( + (void *)event_out_params); + case SDC_HCI_OPCODE_CMD_LE_CS_READ_REMOTE_SUPPORTED_CAPABILITIES: + return sdc_hci_cmd_le_cs_read_remote_supported_capabilities((void *)cmd_params); + case SDC_HCI_OPCODE_CMD_LE_CS_SECURITY_ENABLE: + return sdc_hci_cmd_le_cs_security_enable((void *)cmd_params); + case SDC_HCI_OPCODE_CMD_LE_CS_SET_DEFAULT_SETTINGS: + *param_length_out += sizeof(sdc_hci_cmd_le_cs_set_default_settings_return_t); + return sdc_hci_cmd_le_cs_set_default_settings((void *)cmd_params, + (void *)event_out_params); + case SDC_HCI_OPCODE_CMD_LE_CS_READ_REMOTE_FAE_TABLE: + return sdc_hci_cmd_le_cs_read_remote_fae_table((void *)cmd_params); + case SDC_HCI_OPCODE_CMD_LE_CS_WRITE_CACHED_REMOTE_FAE_TABLE: + *param_length_out += + sizeof(sdc_hci_cmd_le_cs_write_cached_remote_fae_table_return_t); + return sdc_hci_cmd_le_cs_write_cached_remote_fae_table((void *)cmd_params, + (void *)event_out_params); + case SDC_HCI_OPCODE_CMD_LE_CS_CREATE_CONFIG: + return sdc_hci_cmd_le_cs_create_config((void *)cmd_params); + case SDC_HCI_OPCODE_CMD_LE_CS_REMOVE_CONFIG: + return sdc_hci_cmd_le_cs_remove_config((void *)cmd_params); + case SDC_HCI_OPCODE_CMD_LE_CS_SET_CHANNEL_CLASSIFICATION: + return sdc_hci_cmd_le_cs_set_channel_classification((void *)cmd_params); + case SDC_HCI_OPCODE_CMD_LE_CS_SET_PROCEDURE_PARAMS: + *param_length_out += sizeof(sdc_hci_cmd_le_cs_set_procedure_params_return_t); + return sdc_hci_cmd_le_cs_set_procedure_params((void *)cmd_params, + (void *)event_out_params); + case SDC_HCI_OPCODE_CMD_LE_CS_PROCEDURE_ENABLE: + return sdc_hci_cmd_le_cs_procedure_enable((void *)cmd_params); + case SDC_HCI_OPCODE_CMD_LE_CS_TEST: + return sdc_hci_cmd_le_cs_test((void *)cmd_params); + case SDC_HCI_OPCODE_CMD_LE_CS_TEST_END: + return sdc_hci_cmd_le_cs_test_end(); +#endif /* CONFIG_BT_CTLR_CHANNEL_SOUNDING */ + default: return BT_HCI_ERR_UNKNOWN_CMD; } diff --git a/subsys/bluetooth/rpc/host/bt_rpc_gatt_host.c b/subsys/bluetooth/rpc/host/bt_rpc_gatt_host.c index fb81eb4f9c55..e24c5d464c1d 100644 --- a/subsys/bluetooth/rpc/host/bt_rpc_gatt_host.c +++ b/subsys/bluetooth/rpc/host/bt_rpc_gatt_host.c @@ -98,7 +98,7 @@ void bt_rpc_encode_gatt_attr(struct nrf_rpc_cbor_ctx *encoder, const struct bt_g int err; err = bt_rpc_gatt_attr_to_index(attr, &attr_index); - __ASSERT(err = 0, "Service attribute not found. Service database might be out of sync"); + __ASSERT(err == 0, "Service attribute not found. Service database might be out of sync"); nrf_rpc_encode_uint(encoder, attr_index); } diff --git a/subsys/bluetooth/services/fast_pair/CMakeLists.txt b/subsys/bluetooth/services/fast_pair/CMakeLists.txt index 879f06461a37..691ee6f38df3 100644 --- a/subsys/bluetooth/services/fast_pair/CMakeLists.txt +++ b/subsys/bluetooth/services/fast_pair/CMakeLists.txt @@ -12,16 +12,17 @@ zephyr_library_include_directories(include/common) # during Key-based Pairing write. zephyr_library_include_directories(${ZEPHYR_BASE}/subsys/bluetooth) -zephyr_library_sources_ifdef(CONFIG_BT_FAST_PAIR_ADVERTISING fp_advertising.c) -zephyr_library_sources_ifdef(CONFIG_BT_FAST_PAIR_AUTH fp_auth.c) -zephyr_library_sources_ifdef(CONFIG_BT_FAST_PAIR_GATT_SERVICE fp_gatt_service.c) -zephyr_library_sources_ifdef(CONFIG_BT_FAST_PAIR_KEYS fp_keys.c) -zephyr_library_sources_ifdef(CONFIG_BT_FAST_PAIR_REGISTRATION_DATA fp_registration_data.c) -zephyr_library_sources_ifdef(CONFIG_BT_FAST_PAIR_BATTERY fp_battery.c) -zephyr_library_sources_ifdef(CONFIG_BT_FAST_PAIR_STORAGE_INTEGRATION fp_storage_integration.c) - -zephyr_linker_sources_ifdef(CONFIG_BT_FAST_PAIR_ACTIVATION SECTIONS fp_activation.ld) -zephyr_library_sources_ifdef(CONFIG_BT_FAST_PAIR_ACTIVATION fp_activation.c) +zephyr_library_sources_ifdef(CONFIG_BT_FAST_PAIR_ADVERTISING fp_advertising.c) +zephyr_library_sources_ifdef(CONFIG_BT_FAST_PAIR_AUTH fp_auth.c) +zephyr_library_sources_ifdef(CONFIG_BT_FAST_PAIR_GATT_SERVICE fp_gatt_service.c) +zephyr_library_sources_ifdef(CONFIG_BT_FAST_PAIR_KEYS fp_keys.c) +zephyr_library_sources_ifdef(CONFIG_BT_FAST_PAIR_REGISTRATION_DATA fp_registration_data.c) +zephyr_library_sources_ifdef(CONFIG_BT_FAST_PAIR_BATTERY fp_battery.c) +zephyr_library_sources_ifdef(CONFIG_BT_FAST_PAIR_STORAGE_INTEGRATION fp_storage_integration.c) +zephyr_library_sources_ifdef(CONFIG_BT_FAST_PAIR_BOND_MANAGER fp_bond_manager.c) + +zephyr_linker_sources_ifdef(CONFIG_BT_FAST_PAIR_ACTIVATION SECTIONS fp_activation.ld) +zephyr_library_sources_ifdef(CONFIG_BT_FAST_PAIR_ACTIVATION fp_activation.c) if(CONFIG_BT_FAST_PAIR_CRYPTO) add_subdirectory(fp_crypto) diff --git a/subsys/bluetooth/services/fast_pair/Kconfig.fast_pair b/subsys/bluetooth/services/fast_pair/Kconfig.fast_pair index c738fca84e90..c24747deec27 100644 --- a/subsys/bluetooth/services/fast_pair/Kconfig.fast_pair +++ b/subsys/bluetooth/services/fast_pair/Kconfig.fast_pair @@ -140,10 +140,12 @@ if BT_FAST_PAIR_REGISTRATION_DATA config BT_FAST_PAIR_REGISTRATION_DATA_INIT_PRIORITY int range 0 9 - default 3 + default 0 help Fast Pair registration data module initialization priority. Used when registering initialization function to Fast Pair activation module. + This module should be initialized before all other Fast Pair modules to avoid using + Fast Pair subsystem when the Fast Pair provisioning data is not configured properly. endif # BT_FAST_PAIR_REGISTRATION_DATA @@ -170,6 +172,22 @@ config BT_FAST_PAIR_STORAGE_INTEGRATION_INIT_PRIORITY endif # BT_FAST_PAIR_STORAGE_INTEGRATION +config BT_FAST_PAIR_BOND_MANAGER + bool "Fast Pair bond management functionality [EXPERIMENTAL]" + select EXPERIMENTAL + select BT_FAST_PAIR_STORAGE_AK_BOND + help + If this option is enabled, the Fast Pair subsystem tracks the Bluetooth bonds created + through the Fast Pair Procedure and unpairs them if the Fast Pair Procedure is incomplete + or the Account Key associated with the bonds is removed. It also unpairs the Fast Pair + Bluetooth bonds on Fast Pair factory reset. Keep in mind that when the Fast Pair subsystem + is disabled, the Bluetooth bonds are not tracked. Do not perform operations on the Fast + Pair Bluetooth bonds apart from the Fast Pair factory reset when the Fast Pair subsystem + is disabled. When this option is enabled, non-volatile storage is used to store the bond + information. You can enable this option during DFU, but you cannot disable it during DFU + if you used it earlier unless you erase whole Fast Pair non-volatile storage. Otherwise, + the Fast Pair enable operation will fail. + module = BT_FAST_PAIR module-str = Fast Pair Service source "${ZEPHYR_BASE}/subsys/logging/Kconfig.template.log_config" diff --git a/subsys/bluetooth/services/fast_pair/fp_auth.c b/subsys/bluetooth/services/fast_pair/fp_auth.c index 8d1c90c129a3..79fe878b3cc9 100644 --- a/subsys/bluetooth/services/fast_pair/fp_auth.c +++ b/subsys/bluetooth/services/fast_pair/fp_auth.c @@ -15,6 +15,7 @@ LOG_MODULE_DECLARE(fast_pair, CONFIG_BT_FAST_PAIR_LOG_LEVEL); #include "fp_activation.h" #include "fp_auth.h" #include "fp_keys.h" +#include "fp_storage_ak_bond.h" #define EMPTY_PASSKEY 0xffffffff #define USED_PASSKEY 0xfffffffe @@ -68,15 +69,25 @@ static void clear_conn_context(const struct bt_conn *conn) static int send_auth_confirm(struct bt_conn *conn) { - int err = bt_conn_auth_passkey_confirm(conn); + int err; + + if (IS_ENABLED(CONFIG_BT_FAST_PAIR_BOND_MANAGER)) { + /* Saving potential bond. */ + err = fp_keys_bond_save(conn); + if (err) { + LOG_ERR("Failed to save potential bond %d", err); + return err; + } + } + err = bt_conn_auth_passkey_confirm(conn); if (err) { LOG_ERR("Failed to confirm passkey (err: %d)", err); - } else { - LOG_DBG("Confirmed passkey"); + return err; } + LOG_DBG("Confirmed passkey"); - return err; + return 0; } static int send_auth_cancel(struct bt_conn *conn) @@ -212,6 +223,18 @@ static void pairing_complete(struct bt_conn *conn, bool bonded) } if (bt_conn_get_security(conn) >= BT_SECURITY_L4) { + if (IS_ENABLED(CONFIG_BT_FAST_PAIR_BOND_MANAGER) && bonded) { + struct bt_conn_info conn_info; + int err; + + err = bt_conn_get_info(conn, &conn_info); + if (err) { + LOG_ERR("Failed to get local conn info (err %d)", err); + return; + } + + fp_storage_ak_bond_conn_confirm(conn, conn_info.le.dst); + } fp_keys_bt_auth_progress(conn, true); } else { LOG_ERR("Invalid conn security level after pairing: %p", (void *)conn); diff --git a/subsys/bluetooth/services/fast_pair/fp_bond_manager.c b/subsys/bluetooth/services/fast_pair/fp_bond_manager.c new file mode 100644 index 000000000000..7721effe22c3 --- /dev/null +++ b/subsys/bluetooth/services/fast_pair/fp_bond_manager.c @@ -0,0 +1,166 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include + +#include + +#include +LOG_MODULE_DECLARE(fast_pair, CONFIG_BT_FAST_PAIR_LOG_LEVEL); + +#include "fp_activation.h" +#include "fp_storage_ak_bond.h" + +struct bond_find_ctx { + bool bond_found; + const bt_addr_le_t *bond_addr; +}; + +static bool is_enabled; + +static void identity_resolved(struct bt_conn *conn, const bt_addr_le_t *rpa, + const bt_addr_le_t *identity) +{ + if (!bt_fast_pair_is_ready()) { + return; + } + + LOG_DBG("Identity resolved"); + + fp_storage_ak_bond_conn_addr_update(conn, identity); +} + +static void disconnected(struct bt_conn *conn, uint8_t reason) +{ + if (!bt_fast_pair_is_ready()) { + return; + } + + fp_storage_ak_bond_conn_finalize(conn); +} + +BT_CONN_CB_DEFINE(conn_callbacks) = { + .disconnected = disconnected, + .identity_resolved = identity_resolved, +}; + +static void bond_deleted(uint8_t id, const bt_addr_le_t *peer) +{ + if (!bt_fast_pair_is_ready()) { + return; + } + + fp_storage_ak_bond_delete(peer); +} + +static struct bt_conn_auth_info_cb conn_auth_info_callbacks = { + .bond_deleted = bond_deleted, +}; + +static void bond_address_cmp(const struct bt_bond_info *info, void *user_data) +{ + struct bond_find_ctx *ctx = user_data; + + if (bt_addr_le_eq(ctx->bond_addr, &info->addr)) { + __ASSERT_NO_MSG(!ctx->bond_found); + ctx->bond_found = true; + } +} + +static int bond_identity_find(uint8_t *identity, const bt_addr_le_t *addr) +{ + struct bond_find_ctx ctx = { + .bond_found = false, + .bond_addr = addr, + }; + + for (uint8_t id = 0; id < CONFIG_BT_ID_MAX; id++) { + bt_foreach_bond(id, bond_address_cmp, &ctx); + if (ctx.bond_found) { + if (identity) { + *identity = id; + } + } + } + + return ctx.bond_found ? 0 : -ESRCH; +} + +static int bond_remove(const bt_addr_le_t *addr) +{ + uint8_t identity; + int err; + + err = bond_identity_find(&identity, addr); + if (err) { + return err; + } + + return bt_unpair(identity, addr); +} + +static bool is_addr_bonded(const bt_addr_le_t *addr) +{ + return !bond_identity_find(NULL, addr); +} + +static const struct fp_storage_ak_bond_bt_request_cb bt_request_cb = { + .bond_remove = bond_remove, + .is_addr_bonded = is_addr_bonded, +}; + +static int bt_request_cb_register(void) +{ + fp_storage_ak_bond_bt_request_cb_register(&bt_request_cb); + return 0; +} + +static int bond_manager_init(void) +{ + if (is_enabled) { + LOG_WRN("fp_bond_manager module already initialized"); + return 0; + } + + int err; + + err = bt_conn_auth_info_cb_register(&conn_auth_info_callbacks); + if (err) { + return err; + } + + is_enabled = true; + + return 0; +} + +static int bond_manager_uninit(void) +{ + if (!is_enabled) { + LOG_WRN("fp_bond_manager module already uninitialized"); + return 0; + } + + int err; + + is_enabled = false; + + err = bt_conn_auth_info_cb_unregister(&conn_auth_info_callbacks); + if (err) { + return err; + } + + return 0; +} + +/* Register fp_storage_ak_bond_bt_request_cb callback structure to be able to remove Bluetooth + * bonds during Fast Pair storage factory reset even if the Fast Pair is not enabled. + */ +SYS_INIT(bt_request_cb_register, APPLICATION, CONFIG_APPLICATION_INIT_PRIORITY); + +FP_ACTIVATION_MODULE_REGISTER(fp_bond_manager, FP_ACTIVATION_INIT_PRIORITY_DEFAULT, + bond_manager_init, bond_manager_uninit); diff --git a/subsys/bluetooth/services/fast_pair/fp_keys.c b/subsys/bluetooth/services/fast_pair/fp_keys.c index c749979b3542..f795b8d9e559 100644 --- a/subsys/bluetooth/services/fast_pair/fp_keys.c +++ b/subsys/bluetooth/services/fast_pair/fp_keys.c @@ -19,6 +19,7 @@ LOG_MODULE_DECLARE(fast_pair, CONFIG_BT_FAST_PAIR_LOG_LEVEL); #include "fp_crypto.h" #include "fp_common.h" #include "fp_storage_ak.h" +#include "fp_storage_ak_bond.h" #include "fp_storage_pn.h" #define EMPTY_AES_KEY_BYTE 0xff @@ -370,7 +371,7 @@ int fp_keys_store_account_key(const struct bt_conn *conn, const struct fp_accoun LOG_WRN("Received invalid Account Key"); return -EINVAL; } - err = fp_storage_ak_save(account_key); + err = fp_storage_ak_save(account_key, conn); if (!err) { LOG_DBG("Account Key stored"); } else { @@ -533,5 +534,40 @@ static int fp_keys_uninit(void) return 0; } +int fp_keys_bond_save(const struct bt_conn *conn) +{ + if (!IS_ENABLED(CONFIG_BT_FAST_PAIR_BOND_MANAGER)) { + __ASSERT_NO_MSG(false); + return -ENOTSUP; + } + __ASSERT_NO_MSG(bt_fast_pair_is_ready()); + + struct fp_procedure *proc = &fp_procedures[bt_conn_index(conn)]; + struct bt_conn_info conn_info; + int err; + + err = bt_conn_get_info(conn, &conn_info); + if (err) { + LOG_ERR("Failed to get local conn info (err %d)", err); + return err; + } + + if (proc->state == FP_STATE_USE_TEMP_KEY) { + /* Initial pairing - the Account Key is not written yet. */ + err = fp_storage_ak_bond_conn_create(conn, conn_info.le.dst, NULL); + } else if (proc->state == FP_STATE_USE_TEMP_ACCOUNT_KEY) { + /* Subsequent pairing - the Account Key is already known. */ + struct fp_account_key account_key; + + memcpy(account_key.key, proc->aes_key, sizeof(account_key.key)); + err = fp_storage_ak_bond_conn_create(conn, conn_info.le.dst, &account_key); + } else { + __ASSERT_NO_MSG(false); + err = -EACCES; + } + + return err; +} + FP_ACTIVATION_MODULE_REGISTER(fp_keys, FP_ACTIVATION_INIT_PRIORITY_DEFAULT, fp_keys_init, fp_keys_uninit); diff --git a/subsys/bluetooth/services/fast_pair/fp_storage/Kconfig.fp_storage b/subsys/bluetooth/services/fast_pair/fp_storage/Kconfig.fp_storage index 9e0553eb0a31..17b586336716 100644 --- a/subsys/bluetooth/services/fast_pair/fp_storage/Kconfig.fp_storage +++ b/subsys/bluetooth/services/fast_pair/fp_storage/Kconfig.fp_storage @@ -8,6 +8,7 @@ config BT_FAST_PAIR_STORAGE bool default y select SETTINGS + select BT_FAST_PAIR_STORAGE_AK help Add Fast Pair storage source files. @@ -32,6 +33,22 @@ config BT_FAST_PAIR_STORAGE_OWNER_ACCOUNT_KEY help Enable support for the Owner Account Key in the Storage module. +config BT_FAST_PAIR_STORAGE_AK_BOND + bool + help + Enable support for the bond management in the Storage module. If this options is enabled, + the Storage module tracks the Bluetooth bonds created through the Fast Pair Procedure and + requests to unpair them if the Fast Pair Procedure is incomplete or the Account Key + associated with the bonds is removed. It also requests to unpair the Fast Pair Bluetooth + bonds on Fast Pair factory reset. + +config BT_FAST_PAIR_STORAGE_AK + bool + depends on BT_FAST_PAIR_STORAGE_AK_BACKEND_STANDARD || \ + BT_FAST_PAIR_STORAGE_AK_BACKEND_MINIMAL + help + Enable support for the Account Key in the Storage module. + choice BT_FAST_PAIR_STORAGE_AK_BACKEND prompt "Account Key storage backend selection" help @@ -48,6 +65,7 @@ config BT_FAST_PAIR_STORAGE_AK_BACKEND_STANDARD config BT_FAST_PAIR_STORAGE_AK_BACKEND_MINIMAL bool "Account Key storage minimal backend" depends on BT_FAST_PAIR_STORAGE_OWNER_ACCOUNT_KEY + depends on !BT_FAST_PAIR_STORAGE_AK_BOND help Select Account Key storage minimal backend. It allows for storing only one Account Key, that is assumed to be an Owner Account Key. diff --git a/subsys/bluetooth/services/fast_pair/fp_storage/fp_storage_ak.c b/subsys/bluetooth/services/fast_pair/fp_storage/fp_storage_ak.c index efd3e0f4a880..7c712b85eb6c 100644 --- a/subsys/bluetooth/services/fast_pair/fp_storage/fp_storage_ak.c +++ b/subsys/bluetooth/services/fast_pair/fp_storage/fp_storage_ak.c @@ -15,12 +15,35 @@ #include "fp_common.h" #include "fp_storage_ak.h" +#include "fp_storage_ak_bond.h" #include "fp_storage_ak_priv.h" #include "fp_storage_manager.h" #include LOG_MODULE_DECLARE(fp_storage, CONFIG_FP_STORAGE_LOG_LEVEL); +#define FP_BOND_INFO_AK_ID_UNKNOWN (0) +BUILD_ASSERT(FP_BOND_INFO_AK_ID_UNKNOWN == (ACCOUNT_KEY_MIN_ID - 1)); + +/* Non-volatile bond information that is stored in the Settings subsystem. */ +struct fp_bond_info_nv { + uint8_t account_key_metadata_id; + bt_addr_le_t addr; +}; + +struct fp_bond_info { + const void *conn_ctx; + bool bonded; + struct fp_bond_info_nv nv; +}; + +static const struct fp_storage_ak_bond_bt_request_cb *bt_request_cb; +static struct fp_bond_info fp_bonds[FP_BONDS_ARRAY_LEN]; + +#define FP_BONDS_FOREACH(_iterator) \ + for (struct fp_bond_info *_iterator = fp_bonds; \ + _iterator <= &fp_bonds[ARRAY_SIZE(fp_bonds) - 1]; _iterator++) + static struct fp_account_key account_key_list[ACCOUNT_KEY_CNT]; static uint8_t account_key_metadata[ACCOUNT_KEY_CNT]; static uint8_t account_key_count; @@ -30,48 +53,68 @@ static uint8_t account_key_order[ACCOUNT_KEY_CNT]; static int settings_set_err; static bool is_enabled; -static int fp_settings_load_ak(const char *name, size_t len, settings_read_cb read_cb, void *cb_arg) +static int fp_settings_data_read(void *data, size_t data_len, + size_t read_len, settings_read_cb read_cb, void *cb_arg) { int rc; - uint8_t id; - uint8_t index; - struct account_key_data data; - const char *name_suffix; - size_t name_suffix_len; - if (len != sizeof(data)) { + if (read_len != data_len) { return -EINVAL; } - rc = read_cb(cb_arg, &data, sizeof(data)); + rc = read_cb(cb_arg, data, data_len); if (rc < 0) { return rc; } - if (rc != sizeof(data)) { + if (rc != data_len) { return -EINVAL; } - id = ACCOUNT_KEY_METADATA_FIELD_GET(data.account_key_metadata, ID); - if ((id < ACCOUNT_KEY_MIN_ID) || (id > ACCOUNT_KEY_MAX_ID)) { - return -EINVAL; - } + return 0; +} + +static ssize_t index_from_settings_name_get(const char *name_suffix, size_t max_suffix_len) +{ + size_t name_suffix_len; - index = account_key_id_to_idx(id); - name_suffix = &name[sizeof(SETTINGS_AK_NAME_PREFIX) - 1]; name_suffix_len = strlen(name_suffix); - if ((name_suffix_len < 1) || (name_suffix_len > SETTINGS_AK_NAME_MAX_SUFFIX_LEN)) { + if ((name_suffix_len < 1) || (name_suffix_len > max_suffix_len)) { return -EINVAL; } - for (size_t i = 0; i < strlen(name_suffix); i++) { + for (size_t i = 0; i < name_suffix_len; i++) { if (!isdigit(name_suffix[i])) { return -EINVAL; } } - if (index != atoi(name_suffix)) { + return atoi(name_suffix); +} + +static int fp_settings_load_ak(const char *name, size_t len, settings_read_cb read_cb, void *cb_arg) +{ + int err; + uint8_t id; + uint8_t index; + struct account_key_data data; + ssize_t name_index; + + err = fp_settings_data_read(&data, sizeof(data), len, read_cb, cb_arg); + if (err) { + return err; + } + + id = ACCOUNT_KEY_METADATA_FIELD_GET(data.account_key_metadata, ID); + if ((id < ACCOUNT_KEY_MIN_ID) || (id > ACCOUNT_KEY_MAX_ID)) { + return -EINVAL; + } + + index = account_key_id_to_idx(id); + name_index = index_from_settings_name_get(&name[sizeof(SETTINGS_AK_NAME_PREFIX) - 1], + SETTINGS_AK_NAME_MAX_SUFFIX_LEN); + if ((name_index < 0) || (index != name_index)) { return -EINVAL; } @@ -87,21 +130,31 @@ static int fp_settings_load_ak(const char *name, size_t len, settings_read_cb re static int fp_settings_load_ak_order(size_t len, settings_read_cb read_cb, void *cb_arg) { - int rc; + return fp_settings_data_read(account_key_order, sizeof(account_key_order), len, read_cb, + cb_arg); +} - if (len != sizeof(account_key_order)) { - return -EINVAL; - } +static int fp_settings_load_bond(const char *name, size_t len, settings_read_cb read_cb, + void *cb_arg) +{ + int err; + ssize_t index; + struct fp_bond_info_nv bond_nv; - rc = read_cb(cb_arg, account_key_order, len); - if (rc < 0) { - return rc; + err = fp_settings_data_read(&bond_nv, sizeof(bond_nv), len, read_cb, cb_arg); + if (err) { + return err; } - if (rc != len) { + index = index_from_settings_name_get(&name[sizeof(SETTINGS_BOND_INFO_NAME_PREFIX) - 1], + SETTINGS_BOND_INFO_NAME_MAX_SUFFIX_LEN); + if ((index < 0) || (index >= ARRAY_SIZE(fp_bonds))) { return -EINVAL; } + fp_bonds[index].nv = bond_nv; + + LOG_DBG("Bond loaded successfully"); return 0; } @@ -113,6 +166,10 @@ static int fp_settings_set(const char *name, size_t len, settings_read_cb read_c err = fp_settings_load_ak(name, len, read_cb, cb_arg); } else if (!strncmp(name, SETTINGS_AK_ORDER_KEY_NAME, sizeof(SETTINGS_AK_ORDER_KEY_NAME))) { err = fp_settings_load_ak_order(len, read_cb, cb_arg); + } else if (IS_ENABLED(CONFIG_BT_FAST_PAIR_STORAGE_AK_BOND) && + !strncmp(name, SETTINGS_BOND_INFO_NAME_PREFIX, + sizeof(SETTINGS_BOND_INFO_NAME_PREFIX) - 1)) { + err = fp_settings_load_bond(name, len, read_cb, cb_arg); } else { err = -ENOENT; } @@ -152,6 +209,46 @@ static uint8_t next_account_key_id(void) return bump_ak_id(get_least_recent_key_id()); } +static int fp_settings_validate_ak(void) +{ + uint8_t id; + int first_zero_idx = -1; + + for (size_t i = 0; i < ACCOUNT_KEY_CNT; i++) { + id = ACCOUNT_KEY_METADATA_FIELD_GET(account_key_metadata[i], ID); + if (id == 0) { + first_zero_idx = i; + break; + } + + if (account_key_id_to_idx(id) != i) { + return -EINVAL; + } + } + + if (first_zero_idx != -1) { + for (size_t i = 0; i < first_zero_idx; i++) { + id = ACCOUNT_KEY_METADATA_FIELD_GET(account_key_metadata[i], ID); + if (id != ACCOUNT_KEY_MIN_ID + i) { + return -EINVAL; + } + } + + for (size_t i = first_zero_idx + 1; i < ACCOUNT_KEY_CNT; i++) { + id = ACCOUNT_KEY_METADATA_FIELD_GET(account_key_metadata[i], ID); + if (id != 0) { + return -EINVAL; + } + } + + account_key_count = first_zero_idx; + } else { + account_key_count = ACCOUNT_KEY_CNT; + } + + return 0; +} + static void ak_order_update_ram(uint8_t used_id) { bool id_found = false; @@ -177,7 +274,7 @@ static void ak_order_update_ram(uint8_t used_id) account_key_order[0] = used_id; } -static int validate_ak_order(void) +static int fp_settings_validate_ak_order(void) { int err; size_t ak_order_update_count = 0; @@ -224,49 +321,192 @@ static int validate_ak_order(void) return 0; } -static int fp_settings_validate(void) +static int fp_settings_suffixed_name_gen(char *name, size_t name_max_size, const char *name_prefix, + uint8_t index) +{ + int n; + + n = snprintf(name, name_max_size, "%s%u", name_prefix, index); + __ASSERT_NO_MSG(n < name_max_size); + if (n < 0) { + return n; + } + + return 0; +} + +static int ak_name_gen(char *name, size_t name_len, uint8_t index) +{ + __ASSERT_NO_MSG(name_len == SETTINGS_AK_NAME_MAX_SIZE); + return fp_settings_suffixed_name_gen(name, name_len, SETTINGS_AK_FULL_PREFIX, index); +} + +static int fp_bond_info_name_gen(char *name, size_t name_len, uint8_t index) +{ + __ASSERT_NO_MSG(name_len == SETTINGS_BOND_INFO_NAME_MAX_SIZE); + return fp_settings_suffixed_name_gen(name, name_len, SETTINGS_BOND_INFO_FULL_PREFIX, index); +} + +static size_t fp_bond_info_idx_get(struct fp_bond_info *bond) +{ + __ASSERT_NO_MSG((bond >= fp_bonds) && (bond <= &fp_bonds[ARRAY_SIZE(fp_bonds) - 1])); + return bond - fp_bonds; +} + +static int fp_bond_info_settings_delete(struct fp_bond_info *bond) { - uint8_t id; - int first_zero_idx = -1; int err; + char name[SETTINGS_BOND_INFO_NAME_MAX_SIZE]; - if (settings_set_err) { - return settings_set_err; + err = fp_bond_info_name_gen(name, sizeof(name), fp_bond_info_idx_get(bond)); + if (err) { + return err; } - for (size_t i = 0; i < ACCOUNT_KEY_CNT; i++) { - id = ACCOUNT_KEY_METADATA_FIELD_GET(account_key_metadata[i], ID); - if (id == 0) { - first_zero_idx = i; - break; + err = settings_delete(name); + if (err) { + return err; + } + + return 0; +} + +static int bond_remove(struct fp_bond_info *bond, bool bt_stack_bond_remove) +{ + int err; + + __ASSERT_NO_MSG(!bt_addr_le_eq(&bond->nv.addr, BT_ADDR_LE_ANY)); + + if (bt_stack_bond_remove) { + __ASSERT_NO_MSG(bt_request_cb); + + err = bt_request_cb->bond_remove(&bond->nv.addr); + if (err) { + if (err == -ESRCH) { + LOG_DBG("Bond not found in the Bluetooth stack. " + "Continuing the removal operation"); + } else { + LOG_ERR("Failed to remove Bluetooth bond (err %d)", err); + return err; + } } + } - if (account_key_id_to_idx(id) != i) { - return -EINVAL; + /* Bond entry might have been deleted earlier by the fp_storage_ak_bond_delete. */ + if (!bt_addr_le_eq(&bond->nv.addr, BT_ADDR_LE_ANY)) { + err = fp_bond_info_settings_delete(bond); + if (err) { + LOG_ERR("Failed to delete Fast Pair bond from Settings (err %d)", err); + return err; } + + *bond = (struct fp_bond_info){0}; } - if (first_zero_idx != -1) { - for (size_t i = 0; i < first_zero_idx; i++) { - id = ACCOUNT_KEY_METADATA_FIELD_GET(account_key_metadata[i], ID); - if (id != ACCOUNT_KEY_MIN_ID + i) { - return -EINVAL; + return 0; +} + +static int fp_bond_info_duplicates_handle(void) +{ + FP_BONDS_FOREACH(bond) { + bool duplicate_found = false; + bt_addr_le_t addr = bond->nv.addr; + int err; + + if (bt_addr_le_eq(&bond->nv.addr, BT_ADDR_LE_ANY)) { + continue; + } + + for (struct fp_bond_info *duplicate = bond + 1; + duplicate <= &fp_bonds[ARRAY_SIZE(fp_bonds) - 1]; duplicate++) { + if (bt_addr_le_eq(&duplicate->nv.addr, &addr)) { + /* Error during Fast Pair Procedure. */ + LOG_DBG("Removing duplicated bond entries at bootup"); + if (!duplicate_found) { + duplicate_found = true; + err = bond_remove(duplicate, true); + } else { + err = bond_remove(duplicate, false); + } + if (err) { + LOG_ERR("bond_remove failed (err %d)", err); + return err; + } } } - for (size_t i = first_zero_idx + 1; i < ACCOUNT_KEY_CNT; i++) { - id = ACCOUNT_KEY_METADATA_FIELD_GET(account_key_metadata[i], ID); - if (id != 0) { - return -EINVAL; + /* The module that handles Bluetooth bond request callbacks calls + * fp_storage_ak_bond_delete to remove fp_bond_info when a Bluetooth bond is + * deleted for any reason. Because of this, the fp_bond_info might have already + * been cleared at this point. + */ + if (duplicate_found && bt_addr_le_eq(&bond->nv.addr, &addr)) { + err = bond_remove(bond, false); + if (err) { + LOG_ERR("bond_remove failed (err %d)", err); + return err; } } + } - account_key_count = first_zero_idx; - } else { - account_key_count = ACCOUNT_KEY_CNT; + return 0; +} + +static int invalid_bonds_purge(bool skip_ongoing_procedures) +{ + FP_BONDS_FOREACH(bond) { + int err; + uint8_t ak_idx; + + if (bt_addr_le_eq(&bond->nv.addr, BT_ADDR_LE_ANY)) { + continue; + } + + if (!bond->bonded || + (bond->nv.account_key_metadata_id == FP_BOND_INFO_AK_ID_UNKNOWN)) { + if (!skip_ongoing_procedures) { + LOG_DBG("Removing invalid Fast Pair bond"); + err = bond_remove(bond, true); + if (err) { + LOG_ERR("bond_remove failed (err %d)", err); + return err; + } + } + + continue; + } + + ak_idx = account_key_id_to_idx(bond->nv.account_key_metadata_id); + if (bond->nv.account_key_metadata_id != + ACCOUNT_KEY_METADATA_FIELD_GET(account_key_metadata[ak_idx], ID)) { + LOG_DBG("Removing bond associated with invalid Account Key"); + err = bond_remove(bond, true); + if (err) { + LOG_ERR("bond_remove failed (err %d)", err); + return err; + } + } + } + + return 0; +} + +static int fp_settings_validate_fp_bond_info(void) +{ + /* Assert that zero-initialized addresses are equal to BT_ADDR_LE_ANY. */ + static const bt_addr_le_t addr; + int err; + + __ASSERT_NO_MSG(bt_addr_le_eq(&addr, BT_ADDR_LE_ANY)); + ARG_UNUSED(addr); + + /* Duplicates must be removed before purging invalid bonds. */ + err = fp_bond_info_duplicates_handle(); + if (err) { + return err; } - err = validate_ak_order(); + err = invalid_bonds_purge(false); if (err) { return err; } @@ -274,6 +514,34 @@ static int fp_settings_validate(void) return 0; } +static int fp_settings_validate(void) +{ + int err; + + if (settings_set_err) { + return settings_set_err; + } + + err = fp_settings_validate_ak(); + if (err) { + return err; + } + + err = fp_settings_validate_ak_order(); + if (err) { + return err; + } + + if (IS_ENABLED(CONFIG_BT_FAST_PAIR_STORAGE_AK_BOND)) { + err = fp_settings_validate_fp_bond_info(); + if (err) { + return err; + } + } + + return 0; +} + int fp_storage_ak_count(void) { if (!is_enabled) { @@ -336,20 +604,61 @@ int fp_storage_ak_find(struct fp_account_key *account_key, return -ESRCH; } -static int ak_name_gen(char *name, uint8_t index) +static struct fp_bond_info *fp_bond_info_by_conn_get(const void *conn_ctx) { - int n; + FP_BONDS_FOREACH(bond) { + if (bond->conn_ctx == conn_ctx) { + return bond; + } + } - n = snprintf(name, SETTINGS_AK_NAME_MAX_SIZE, "%s%u", SETTINGS_AK_FULL_PREFIX, index); - __ASSERT_NO_MSG(n < SETTINGS_AK_NAME_MAX_SIZE); - if (n < 0) { - return n; + return NULL; +} + +static struct fp_bond_info *fp_bond_info_free_get(void) +{ + FP_BONDS_FOREACH(bond) { + if (bt_addr_le_eq(&bond->nv.addr, BT_ADDR_LE_ANY)) { + return bond; + } + } + + return NULL; +} + +static struct fp_bond_info *fp_bond_info_by_addr_bonded_get(const bt_addr_le_t *addr) +{ + FP_BONDS_FOREACH(bond) { + if (bond->bonded && bt_addr_le_eq(&bond->nv.addr, addr)) { + return bond; + } + } + + return NULL; +} + +static int fp_bond_info_settings_save(struct fp_bond_info *bond, + const struct fp_bond_info *bond_rollback_copy) +{ + int err; + char name[SETTINGS_BOND_INFO_NAME_MAX_SIZE]; + + err = fp_bond_info_name_gen(name, sizeof(name), fp_bond_info_idx_get(bond)); + if (err) { + *bond = *bond_rollback_copy; + return err; + } + + err = settings_save_one(name, &bond->nv, sizeof(bond->nv)); + if (err) { + *bond = *bond_rollback_copy; + return err; } return 0; } -int fp_storage_ak_save(const struct fp_account_key *account_key) +int fp_storage_ak_save(const struct fp_account_key *account_key, const void *conn_ctx) { if (!is_enabled) { return -EACCES; @@ -361,6 +670,9 @@ int fp_storage_ak_save(const struct fp_account_key *account_key) char name[SETTINGS_AK_NAME_MAX_SIZE]; int err; + struct fp_bond_info *bond; + bool ak_overwritten = false; + for (size_t i = 0; i < account_key_count; i++) { if (!memcmp(account_key->key, account_key_list[i].key, FP_ACCOUNT_KEY_LEN)) { LOG_INF("Account Key already saved - skipping."); @@ -378,11 +690,35 @@ int fp_storage_ak_save(const struct fp_account_key *account_key) ACCOUNT_KEY_METADATA_FIELD_SET(data.account_key_metadata, ID, id); data.account_key = *account_key; - err = ak_name_gen(name, index); + err = ak_name_gen(name, sizeof(name), index); if (err) { return err; } + if (IS_ENABLED(CONFIG_BT_FAST_PAIR_STORAGE_AK_BOND)) { + struct fp_bond_info bond_rollback_copy; + + __ASSERT_NO_MSG(conn_ctx); + + bond = fp_bond_info_by_conn_get(conn_ctx); + if (!bond) { + return -EINVAL; + } + + __ASSERT(bond->bonded, "An fp_bond writing an Account Key must be already bonded"); + + bond_rollback_copy = *bond; + + bond->nv.account_key_metadata_id = id; + + err = fp_bond_info_settings_save(bond, &bond_rollback_copy); + if (err) { + return err; + } + } else { + ARG_UNUSED(conn_ctx); + } + err = settings_save_one(name, &data, sizeof(data)); if (err) { return err; @@ -393,6 +729,13 @@ int fp_storage_ak_save(const struct fp_account_key *account_key) if (account_key_count < ACCOUNT_KEY_CNT) { account_key_count++; + } else { + ak_overwritten = true; + } + + if (IS_ENABLED(CONFIG_BT_FAST_PAIR_STORAGE_AK_BOND)) { + /* Procedure finished successfully. Setting conn_ctx to NULL. */ + bond->conn_ctx = NULL; } ak_order_update_ram(id); @@ -405,9 +748,223 @@ int fp_storage_ak_save(const struct fp_account_key *account_key) "order may change at reboot."); } + if (IS_ENABLED(CONFIG_BT_FAST_PAIR_STORAGE_AK_BOND) && ak_overwritten) { + /* Account Key overwritten. Remove bonds related with overwritten Account Key. */ + err = invalid_bonds_purge(true); + if (err) { + LOG_ERR("invalid_bonds_purge failed (err %d). Ignoring the error and " + "continuing. There might be some invalid bonds present in the " + "Fast Pair AK storage subsystem.", err); + } + } + return 0; } +static int ak_id_get(uint8_t *id, const struct fp_account_key *account_key) +{ + for (size_t i = 0; i < account_key_count; i++) { + if (!memcmp(account_key_list[i].key, account_key->key, FP_ACCOUNT_KEY_LEN)) { + *id = ACCOUNT_KEY_METADATA_FIELD_GET(account_key_metadata[i], ID); + return 0; + } + } + + return -ESRCH; +} + +void fp_storage_ak_bond_bt_request_cb_register(const struct fp_storage_ak_bond_bt_request_cb *cb) +{ + if (!IS_ENABLED(CONFIG_BT_FAST_PAIR_STORAGE_AK_BOND)) { + __ASSERT_NO_MSG(false); + return; + } + + __ASSERT_NO_MSG(cb && cb->bond_remove && cb->is_addr_bonded); + + bt_request_cb = cb; +} + +int fp_storage_ak_bond_conn_create(const void *conn_ctx, const bt_addr_le_t *addr, + const struct fp_account_key *account_key) +{ + if (!IS_ENABLED(CONFIG_BT_FAST_PAIR_STORAGE_AK_BOND)) { + __ASSERT_NO_MSG(false); + return -ENOTSUP; + } + + if (!is_enabled) { + return -EACCES; + } + + int err; + uint8_t id; + struct fp_bond_info *bond; + struct fp_bond_info bond_rollback_copy = (struct fp_bond_info){0}; + + if (account_key) { + err = ak_id_get(&id, account_key); + if (err) { + return err; + } + } else { + /* The actual ID will be determined during Account Key write. */ + id = FP_BOND_INFO_AK_ID_UNKNOWN; + } + + bond = fp_bond_info_free_get(); + if (!bond) { + return -ENOMEM; + } + + bond->conn_ctx = conn_ctx; + bond->bonded = false; + bond->nv.account_key_metadata_id = id; + bond->nv.addr = *addr; + + err = fp_bond_info_settings_save(bond, &bond_rollback_copy); + if (err) { + return err; + } + + return 0; +} + +void fp_storage_ak_bond_conn_confirm(const void *conn_ctx, const bt_addr_le_t *addr) +{ + if (!IS_ENABLED(CONFIG_BT_FAST_PAIR_STORAGE_AK_BOND)) { + __ASSERT_NO_MSG(false); + return; + } + + if (!is_enabled) { + return; + } + + struct fp_bond_info *bond_confirmed; + int err; + + __ASSERT_NO_MSG(bt_addr_le_is_identity(addr)); + + bond_confirmed = fp_bond_info_by_conn_get(conn_ctx); + if (!bond_confirmed) { + LOG_ERR("Bond not found in Fast Pair storage"); + return; + } + __ASSERT_NO_MSG(bt_addr_le_eq(&bond_confirmed->nv.addr, addr)); + + bond_confirmed->bonded = true; + + /* Remove bonded duplicates that were overwritten by new bond. */ + FP_BONDS_FOREACH(bond) { + if ((bond->conn_ctx != conn_ctx) && bond->bonded && + bt_addr_le_eq(&bond->nv.addr, addr)) { + /* Only one bonded duplicate can be present here. */ + err = bond_remove(bond, false); + if (err) { + LOG_ERR("bond_remove failed (err %d)", err); + } else { + LOG_DBG("Removed duplicated bond"); + } + + break; + } + } + + if (bond_confirmed->nv.account_key_metadata_id != FP_BOND_INFO_AK_ID_UNKNOWN) { + /* Account Key already associated (subsequent pairing procedure). + * Procedure finished successfully. Setting conn_ctx to NULL. + */ + bond_confirmed->conn_ctx = NULL; + } +} + +void fp_storage_ak_bond_conn_addr_update(const void *conn_ctx, const bt_addr_le_t *new_addr) +{ + if (!IS_ENABLED(CONFIG_BT_FAST_PAIR_STORAGE_AK_BOND)) { + __ASSERT_NO_MSG(false); + return; + } + + if (!is_enabled) { + return; + } + + int err; + struct fp_bond_info *bond; + struct fp_bond_info bond_rollback_copy; + + bond = fp_bond_info_by_conn_get(conn_ctx); + if (!bond) { + return; + } + bond_rollback_copy = *bond; + + bond->nv.addr = *new_addr; + + err = fp_bond_info_settings_save(bond, &bond_rollback_copy); + if (err) { + return; + } +} + +void fp_storage_ak_bond_conn_finalize(const void *conn_ctx) +{ + if (!IS_ENABLED(CONFIG_BT_FAST_PAIR_STORAGE_AK_BOND)) { + __ASSERT_NO_MSG(false); + return; + } + + if (!is_enabled) { + return; + } + + struct fp_bond_info *bond; + int err; + + bond = fp_bond_info_by_conn_get(conn_ctx); + if (!bond) { + return; + } + + /* If at this point the conn_ctx is not set to NULL, the procedure is incomplete. */ + err = bond_remove(bond, true); + if (err) { + LOG_ERR("bond_remove failed (err %d)", err); + } +} + +void fp_storage_ak_bond_delete(const bt_addr_le_t *addr) +{ + if (!IS_ENABLED(CONFIG_BT_FAST_PAIR_STORAGE_AK_BOND)) { + __ASSERT_NO_MSG(false); + return; + } + + if (!is_enabled) { + return; + } + + LOG_DBG("Bluetooth bond deleted"); + FP_BONDS_FOREACH(unused) { + struct fp_bond_info *bond; + int err; + + /* In some edge cases, while enabling and validating bonds there might be more than + * one bonded bond present. + */ + bond = fp_bond_info_by_addr_bonded_get(addr); + if (!bond) { + break; + } + + err = bond_remove(bond, false); + if (err) { + LOG_ERR("bond_remove failed (err %d)", err); + } + } +} + void fp_storage_ak_ram_clear(void) { memset(account_key_list, 0, sizeof(account_key_list)); @@ -416,6 +973,11 @@ void fp_storage_ak_ram_clear(void) memset(account_key_order, 0, sizeof(account_key_order)); + if (IS_ENABLED(CONFIG_BT_FAST_PAIR_STORAGE_AK_BOND)) { + memset(fp_bonds, 0, sizeof(fp_bonds)); + bt_request_cb = NULL; + } + settings_set_err = 0; is_enabled = false; @@ -435,6 +997,25 @@ static int fp_storage_ak_init(void) return 0; } + if (IS_ENABLED(CONFIG_BT_FAST_PAIR_STORAGE_AK_BOND)) { + __ASSERT_NO_MSG(bt_request_cb); + } + + if (IS_ENABLED(CONFIG_BT_FAST_PAIR_STORAGE_AK_BOND)) { + FP_BONDS_FOREACH(bond) { + /* If Fast Pair was disabled before the peer that performed the unsuccessful + * Fast Pair Procedure disconnected, there may be a conn_ctx not set to + * NULL. All conn_ctx should be set to NULL at this point. + */ + bond->conn_ctx = NULL; + + bond->bonded = bt_request_cb->is_addr_bonded(&bond->nv.addr); + if (bond->bonded) { + LOG_DBG("Loaded bond has been found in the Bluetooth bond list"); + } + } + } + err = fp_settings_validate(); if (err) { return err; @@ -447,7 +1028,13 @@ static int fp_storage_ak_init(void) static int fp_storage_ak_uninit(void) { + if (!is_enabled) { + LOG_WRN("fp_storage_ak module already uninitialized"); + return 0; + } + is_enabled = false; + return 0; } @@ -456,7 +1043,7 @@ static int fp_storage_ak_delete(uint8_t index) int err; char name[SETTINGS_AK_NAME_MAX_SIZE]; - err = ak_name_gen(name, index); + err = ak_name_gen(name, sizeof(name), index); if (err) { return err; } @@ -473,6 +1060,7 @@ static int fp_storage_ak_reset(void) { int err; bool was_enabled = is_enabled; + const struct fp_storage_ak_bond_bt_request_cb *registered_bt_request_cb; if (was_enabled) { err = fp_storage_ak_uninit(); @@ -488,12 +1076,34 @@ static int fp_storage_ak_reset(void) } } + if (IS_ENABLED(CONFIG_BT_FAST_PAIR_STORAGE_AK_BOND)) { + FP_BONDS_FOREACH(bond) { + if (bt_addr_le_eq(&bond->nv.addr, BT_ADDR_LE_ANY)) { + continue; + } + + err = bond_remove(bond, true); + if (err) { + LOG_ERR("bond_remove failed (err %d)", err); + } + } + } + err = settings_delete(SETTINGS_AK_ORDER_FULL_NAME); if (err) { return err; } + if (IS_ENABLED(CONFIG_BT_FAST_PAIR_STORAGE_AK_BOND)) { + registered_bt_request_cb = bt_request_cb; + } + fp_storage_ak_ram_clear(); + + if (IS_ENABLED(CONFIG_BT_FAST_PAIR_STORAGE_AK_BOND)) { + bt_request_cb = registered_bt_request_cb; + } + if (was_enabled) { err = fp_storage_ak_init(); if (err) { diff --git a/subsys/bluetooth/services/fast_pair/fp_storage/fp_storage_ak_minimal.c b/subsys/bluetooth/services/fast_pair/fp_storage/fp_storage_ak_minimal.c index 79ddb388510f..a4ea5620ccff 100644 --- a/subsys/bluetooth/services/fast_pair/fp_storage/fp_storage_ak_minimal.c +++ b/subsys/bluetooth/services/fast_pair/fp_storage/fp_storage_ak_minimal.c @@ -141,11 +141,13 @@ int fp_storage_ak_find(struct fp_account_key *account_key, return -ESRCH; } -int fp_storage_ak_save(const struct fp_account_key *account_key) +int fp_storage_ak_save(const struct fp_account_key *account_key, const void *conn_ctx) { int err; struct account_key_data data; + ARG_UNUSED(conn_ctx); + if (!is_enabled) { return -EACCES; } diff --git a/subsys/bluetooth/services/fast_pair/fp_storage/include/fp_storage_ak.h b/subsys/bluetooth/services/fast_pair/fp_storage/include/fp_storage_ak.h index bf7af939a28a..3a26839f7213 100644 --- a/subsys/bluetooth/services/fast_pair/fp_storage/include/fp_storage_ak.h +++ b/subsys/bluetooth/services/fast_pair/fp_storage/include/fp_storage_ak.h @@ -41,10 +41,13 @@ typedef bool (*fp_storage_ak_check_cb)(const struct fp_account_key *account_key, /** Save Account Key. * * @param[in] account_key Account Key to be saved. + * @param[in] conn_ctx Connection object associated with the Account Key. It is used to associate + * the Bluetooth bond with the Account Key if + * the CONFIG_BT_FAST_PAIR_STORAGE_AK_BOND Kconfig option is enabled. * * @return 0 If the operation was successful. Otherwise, a (negative) error code is returned. */ -int fp_storage_ak_save(const struct fp_account_key *account_key); +int fp_storage_ak_save(const struct fp_account_key *account_key, const void *conn_ctx); /** Get number of stored Account Keys. * diff --git a/subsys/bluetooth/services/fast_pair/fp_storage/include/fp_storage_ak_bond.h b/subsys/bluetooth/services/fast_pair/fp_storage/include/fp_storage_ak_bond.h new file mode 100644 index 000000000000..8e863dfa8449 --- /dev/null +++ b/subsys/bluetooth/services/fast_pair/fp_storage/include/fp_storage_ak_bond.h @@ -0,0 +1,144 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef _FP_STORAGE_AK_BOND_H_ +#define _FP_STORAGE_AK_BOND_H_ + +#include +#include +#include + +#include "fp_common.h" + +/** + * @defgroup fp_storage_ak_bond Fast Pair storage of associations between Account Keys and BLE bonds + * @brief Internal API for Fast Pair storage of associations between Account Keys and BLE bonds + * + * Used only when the CONFIG_BT_FAST_PAIR_STORAGE_AK_BOND Kconfig option is enabled. + * + * @{ + */ + +#ifdef __cplusplus +extern "C" { +#endif + +/** Create and save the Account Key association with the potential Bluetooth bond that is being + * established from the active connection. + * + * The module links the Account Key information with the Bluetooth bond and stores + * it in the NVM. The association and the Bluetooth bond will be deleted if the bond is not + * confirmed using the @ref fp_storage_ak_bond_conn_confirm API before the bonding process is + * finalized using the @ref fp_storage_ak_bond_conn_finalize API and also, in case of the Fast Pair + * initial pairing procedure, if the Account Key is not written by the conn before the + * the @ref fp_storage_ak_bond_conn_finalize API is called. + * + * @param[in] conn_ctx Connection context associated with the potential the Bluetooth bond. + * @param[in] addr The Bluetooth address of the potential bond. + * @param[in] account_key Account Key that the bond is associated with. It can be set to NULL in + * case of the initial pairing Procedure, when the Account Key is not known + * yet. + * + * @return 0 If the operation was successful. Otherwise, a (negative) error code is returned. + */ +int fp_storage_ak_bond_conn_create(const void *conn_ctx, const bt_addr_le_t *addr, + const struct fp_account_key *account_key); + +/** Indicate that the potential Bluetooth bond has been confirmed. + * + * It confirms the potential Bluetooth bond associated with an Account Key. The association should + * be earlier created using the @ref fp_storage_ak_bond_conn_create API. In case of the Fast Pair + * initial pairing procedure, the Account Key write is required to happen after calling this + * function to fully confirm the association between Account Key and BLE bond. + * + * @param[in] conn_ctx Connection context associated with the Bluetooth bond. + * @param[in] addr The Bluetooth address of the bond. + */ +void fp_storage_ak_bond_conn_confirm(const void *conn_ctx, const bt_addr_le_t *addr); + +/** Indicate that the bonding process has been finalized. + * + * It relates to the Account Key association with the Bluetooth bond that was created + * earlier using the @ref fp_storage_ak_bond_conn_create API. This function should be called when + * the BLE conn disconnects to let the storage subsystem clean up incomplete bonds. + * + * If the @ref fp_storage_ak_bond_conn_create API has not been called for this conn earlier, + * the call is ignored. + * + * @param[in] conn_ctx Connection context associated with the Bluetooth bond. + */ +void fp_storage_ak_bond_conn_finalize(const void *conn_ctx); + +/** Update the address of the Bluetooth bond associated with the Account Key. + * + * The update has to be done when the address is resolved. + * If the @ref fp_storage_ak_bond_conn_create API has not been called for this conn earlier, + * the call is ignored. + * + * @param[in] conn_ctx Connection context associated with the Bluetooth bond. + * @param[in] addr The Bluetooth address of the bond. + */ +void fp_storage_ak_bond_conn_addr_update(const void *conn_ctx, const bt_addr_le_t *new_addr); + +/** Delete the Account Key association with the Bluetooth bond. + * + * The function needs to be called when a Bluetooth bond is removed to let the storage module + * clean up the association. If the @ref fp_storage_ak_bond_conn_create API has not been called for + * this address earlier, the call is ignored. + * + * @param[in] addr The Bluetooth address of the bond. + */ +void fp_storage_ak_bond_delete(const bt_addr_le_t *addr); + +/** Bluetooth bond request callback structure. */ +struct fp_storage_ak_bond_bt_request_cb { + /** @brief Remove the Bluetooth bond. + * + * This callback is called to request the removal of the Bluetooth bond from the Bluetooth + * subsystem. + * + * @param[in] addr The Bluetooth address of the bond to be removed. + * + * @return 0 If the operation was successful. Otherwise, a (negative) error code is + * returned. + */ + int (*bond_remove)(const bt_addr_le_t *addr); + + /** @brief Check if the Bluetooth address is bonded. + * + * This callback is called to check if there is a Bluetooth bond saved in the Bluetooth + * subsystem with the given Bluetooth address. + * + * @param[in] addr The Bluetooth address. + * + * @return true when the Bluetooth address is bonded, false otherwise. + */ + bool (*is_addr_bonded)(const bt_addr_le_t *addr); +}; + +/** Register Bluetooth bond request callbacks. + * + * This function registers an instance of request callbacks. The registered instance needs to + * persist in the memory after this function exits, as it is used directly without the copy + * operation. It is possible to register only one instance of callbacks with this API. + * + * This function must be called before initialiazing the Fast Pair storage with the + * @ref fp_storage_init API and also before performing the Fast Pair factory reset to ensure that + * the callbacks are available during those operations. + * + * @param cb Callback struct. + */ +void fp_storage_ak_bond_bt_request_cb_register(const struct fp_storage_ak_bond_bt_request_cb *cb); + +#ifdef __cplusplus +} +#endif + +/** + * @} + */ + +#endif /* _FP_STORAGE_AK_BOND_H_ */ diff --git a/subsys/bluetooth/services/fast_pair/fp_storage/include_priv/fp_storage_ak_priv.h b/subsys/bluetooth/services/fast_pair/fp_storage/include_priv/fp_storage_ak_priv.h index 9c557c27bba6..46d3782ab9ad 100644 --- a/subsys/bluetooth/services/fast_pair/fp_storage/include_priv/fp_storage_ak_priv.h +++ b/subsys/bluetooth/services/fast_pair/fp_storage/include_priv/fp_storage_ak_priv.h @@ -46,6 +46,30 @@ extern "C" { #define SETTINGS_AK_NAME_MAX_SIZE \ (sizeof(SETTINGS_AK_FULL_PREFIX) + SETTINGS_AK_NAME_MAX_SUFFIX_LEN) +/** Settings key name prefix for bond. */ +#define SETTINGS_BOND_INFO_NAME_PREFIX "bond_info" + +/** Full settings key name prefix for bond (including subtree name). */ +#define SETTINGS_BOND_INFO_FULL_PREFIX \ + (SETTINGS_AK_SUBTREE_NAME SETTINGS_NAME_SEPARATOR_STR SETTINGS_BOND_INFO_NAME_PREFIX) + +/** Max length of suffix (bond index) in settings key name for bond. */ +#define SETTINGS_BOND_INFO_NAME_MAX_SUFFIX_LEN 2 + +/** Max length of settings key for bond. */ +#define SETTINGS_BOND_INFO_NAME_MAX_SIZE \ + (sizeof(SETTINGS_BOND_INFO_FULL_PREFIX) + SETTINGS_BOND_INFO_NAME_MAX_SUFFIX_LEN) + +#if CONFIG_BT_FAST_PAIR_STORAGE_AK_BOND && defined(CONFIG_BT_MAX_PAIRED) && \ + defined(CONFIG_BT_MAX_CONN) +/** Length of the Fast Pair bonds arrays. */ +#define FP_BONDS_ARRAY_LEN (CONFIG_BT_MAX_PAIRED + CONFIG_BT_MAX_CONN) +#else +/** Length of the Fast Pair bonds arrays. */ +#define FP_BONDS_ARRAY_LEN (0) +#endif +BUILD_ASSERT(FP_BONDS_ARRAY_LEN <= 100, "The array index must fit on 2 digits"); + /** Settings key name for Account Key order. */ #define SETTINGS_AK_ORDER_KEY_NAME "order" diff --git a/subsys/bluetooth/services/fast_pair/include/fp_auth.h b/subsys/bluetooth/services/fast_pair/include/fp_auth.h index cc07bf44ea5c..6056d0e51df6 100644 --- a/subsys/bluetooth/services/fast_pair/include/fp_auth.h +++ b/subsys/bluetooth/services/fast_pair/include/fp_auth.h @@ -29,8 +29,12 @@ extern "C" { /** Start Fast Pair Bluetooth authentication procedure. * * The Fast Pair authentication subsystem takes over Zephyr Bluetooth authentication callbacks to - * perform Bluetooth pairing according to the Fast Pair procedure. The procedure can be used only - * if connected peer is Fast Pair Seeker. Otherwise regular pairing must be used. + * perform Bluetooth pairing according to the Fast Pair procedure. The procedure can be used only if + * connected peer is Fast Pair Seeker. Otherwise regular pairing must be used. + * + * If the CONFIG_BT_FAST_PAIR_BOND_MANAGER Kconfig is enabled, the subsystem also uses the Fast Pair + * Keys module to save Account Key association with the potential Bluetooth bond in the Account Key + * storage module. * * @param[in] conn Pointer to Bluetooth connection (determines Fast Pair Seeker). * @param[in] send_pairing_req Boolean informing if Provider should send pairing request. diff --git a/subsys/bluetooth/services/fast_pair/include/fp_keys.h b/subsys/bluetooth/services/fast_pair/include/fp_keys.h index d39a2de74317..a28df0e430b2 100644 --- a/subsys/bluetooth/services/fast_pair/include/fp_keys.h +++ b/subsys/bluetooth/services/fast_pair/include/fp_keys.h @@ -179,6 +179,17 @@ void fp_keys_bt_auth_progress(const struct bt_conn *conn, bool authenticated); */ void fp_keys_drop_key(const struct bt_conn *conn); +/** Save Account Key association with the potential Bluetooth bond in the AK storage module. + * The Fast Pair Keys module links the Account Key information with the Bluetooth bond and stores + * it in the NVM memory. The association and the Bluetooth bond will be deleted if the pairing + * fails or the Fast Pair Procedure is incomplete. + * + * @param[in] conn Connection object associated with the potential Bluetooth bond. + * + * @return 0 If the operation was successful. Otherwise, a (negative) error code is returned. + */ +int fp_keys_bond_save(const struct bt_conn *conn); + #ifdef __cplusplus } #endif diff --git a/subsys/bluetooth/services/fast_pair/use_case/Kconfig b/subsys/bluetooth/services/fast_pair/use_case/Kconfig index 60c4c0f4b1ca..445696328ff4 100644 --- a/subsys/bluetooth/services/fast_pair/use_case/Kconfig +++ b/subsys/bluetooth/services/fast_pair/use_case/Kconfig @@ -30,6 +30,7 @@ config BT_FAST_PAIR_USE_CASE_INPUT_DEVICE select BT_FAST_PAIR_SUBSEQUENT_PAIRING select BT_DIS select BT_DIS_FW_REV + imply BT_FAST_PAIR_BOND_MANAGER help Select the input device Fast Pair use case. Input device is a Human Interface Device (HID) such as a mouse, keyboard, remote control or a gaming pad that lets the user @@ -42,6 +43,7 @@ config BT_FAST_PAIR_USE_CASE_LOCATOR_TAG bool "Locator tag use case" select BT_FAST_PAIR_FMDN select BT_FAST_PAIR_FMDN_DULT + select BT_FAST_PAIR_USE_CASE_UNSUPPORTED_BOND_MANAGER select BT_FAST_PAIR_USE_CASE_UNSUPPORTED_GATT_SERVICE_MODEL_ID select BT_FAST_PAIR_USE_CASE_UNSUPPORTED_SUBSEQUENT_PAIRING select BT_FAST_PAIR_USE_CASE_UNSUPPORTED_PN @@ -63,6 +65,7 @@ config BT_FAST_PAIR_USE_CASE_MOUSE select BT_FAST_PAIR_SUBSEQUENT_PAIRING select BT_DIS select BT_DIS_FW_REV + imply BT_FAST_PAIR_BOND_MANAGER help Select the mouse Fast Pair use case. Mouse is a Human Interface Device (HID) that lets the user interact with electronic devices such as a PC. This Kconfig option configures @@ -73,6 +76,10 @@ config BT_FAST_PAIR_USE_CASE_MOUSE endchoice # Collection of unsupported Fast Pair features that can be selected by the use case Kconfig. +config BT_FAST_PAIR_USE_CASE_UNSUPPORTED_BOND_MANAGER + bool + depends on !BT_FAST_PAIR_BOND_MANAGER + config BT_FAST_PAIR_USE_CASE_UNSUPPORTED_GATT_SERVICE_MODEL_ID bool depends on !BT_FAST_PAIR_GATT_SERVICE_MODEL_ID diff --git a/subsys/bootloader/Kconfig b/subsys/bootloader/Kconfig index 36c5d3d1a844..1d2948fe5c32 100644 --- a/subsys/bootloader/Kconfig +++ b/subsys/bootloader/Kconfig @@ -75,9 +75,6 @@ config SB_SIGNING_KEY_FILE Specifies the private key used for signing the firmware image. The hash of the corresponding public key is stored as the first entry in the list of public key hashes in the provision hex file. - This value can also be set by exporting an environment variable - named 'SB_SIGNING_KEY_FILE' or passing - '-DSB_SIGNING_KEY_FILE=/path/to/my/pem' when running cmake. See also SB_PUBLIC_KEY_FILES. config SB_SIGNING_COMMAND @@ -241,4 +238,9 @@ rsource "bl_crypto/Kconfig" rsource "bl_validation/Kconfig" rsource "bl_storage/Kconfig" +config MCUBOOT_COMPRESSED_IMAGE_SUPPORT_ENABLED + bool "MCUboot compressed image support" + help + This is a Kconfig which is informative only, the value should not be changed. + endmenu diff --git a/subsys/bootloader/cmake/debug_keys.cmake b/subsys/bootloader/cmake/debug_keys.cmake index 80ebb8270069..75c4141cc96b 100644 --- a/subsys/bootloader/cmake/debug_keys.cmake +++ b/subsys/bootloader/cmake/debug_keys.cmake @@ -16,22 +16,6 @@ set(PUB_CMD ) # Check if PEM file is specified by user, if not, create one. - -# First, check environment variables. Only use if not specified in command line. -if (DEFINED ENV{SB_SIGNING_KEY_FILE} AND NOT SB_SIGNING_KEY_FILE) - if (NOT EXISTS "$ENV{SB_SIGNING_KEY_FILE}") - message(FATAL_ERROR "ENV points to non-existing PEM file '$ENV{SB_SIGNING_KEY_FILE}'") - else() - set(SIGNATURE_PRIVATE_KEY_FILE $ENV{SB_SIGNING_KEY_FILE}) - endif() -endif() - -# Next, check command line arguments -if (DEFINED SB_SIGNING_KEY_FILE) - set(SIGNATURE_PRIVATE_KEY_FILE ${SB_SIGNING_KEY_FILE}) -endif() - -# Check if debug sign key should be generated. if( "${CONFIG_SB_SIGNING_KEY_FILE}" STREQUAL "") message(WARNING " -------------------------------------------------------------- diff --git a/subsys/dfu/dfu_target/CMakeLists.txt b/subsys/dfu/dfu_target/CMakeLists.txt index 0233ba927a64..588f4470fa1f 100644 --- a/subsys/dfu/dfu_target/CMakeLists.txt +++ b/subsys/dfu/dfu_target/CMakeLists.txt @@ -29,6 +29,9 @@ zephyr_library_sources_ifdef(CONFIG_DFU_TARGET_SMP zephyr_library_sources(src/dfu_stream_flatten.c) if (CONFIG_DFU_TARGET_SUIT) zephyr_library_sources(src/dfu_target_suit.c) + zephyr_library_link_libraries(suit_memory_layout_interface) + zephyr_library_link_libraries(suit_envelope_info) + zephyr_library_link_libraries_ifdef(CONFIG_SUIT_CACHE_RW suit_cache_interface) if (CONFIG_SSF_SUIT_SERVICE_ENABLED) zephyr_library_link_libraries(suit_utils) endif() diff --git a/subsys/dfu/dfu_target/Kconfig b/subsys/dfu/dfu_target/Kconfig index aee333b77060..cbdee019e5a5 100644 --- a/subsys/dfu/dfu_target/Kconfig +++ b/subsys/dfu/dfu_target/Kconfig @@ -117,14 +117,42 @@ config DFU_TARGET_SUIT bool "SUIT DFU target support" default y depends on SUIT + depends on SUIT_ENVELOPE_INFO imply MPU_ALLOW_FLASH_WRITE select SUIT_UTILS select ZCBOR select ZCBOR_CANONICAL + select FLASH + select STREAM_FLASH select DFU_TARGET_STREAM help Enable support for updates using DFU target based on SUIT +if DFU_TARGET_SUIT + +config DFU_TARGET_SUIT_CACHE_PROCESSING + bool "SUIT cache processing" + default y + depends on SUIT_CACHE_RW + help + Enable SUIT cache processing to process images IDs higher than 0. + This allows to store the image in the cache partitions and + assign them to be processed by SUIT. + +config DFU_TARGET_SUIT_INITIALIZE_SUIT + bool "Initialize the SUIT DFU library" + help + Initialize the SUIT library during the system startup. + +config DFU_TARGET_REBOOT_RESET_DELAY_MS + int "Set reboot reset delay in milliseconds" + default 0 + help + Set the delay in milliseconds for resetting the device after a reboot + function is called. + +endif # DFU_TARGET_SUIT + module=DFU_TARGET module-dep=LOG module-str=Device Firmware Upgrade diff --git a/subsys/dfu/dfu_target/src/dfu_target.c b/subsys/dfu/dfu_target/src/dfu_target.c index ee69bd6e428e..0260396d5699 100644 --- a/subsys/dfu/dfu_target/src/dfu_target.c +++ b/subsys/dfu/dfu_target/src/dfu_target.c @@ -127,7 +127,8 @@ int dfu_target_init(int img_type, int img_num, size_t file_size, dfu_target_call * abort and to change the image number. */ if (new_target == current_target && img_type != DFU_TARGET_IMAGE_TYPE_MODEM_DELTA && - img_type != DFU_TARGET_IMAGE_TYPE_SMP && current_img_num == img_num) { + img_type != DFU_TARGET_IMAGE_TYPE_SMP && current_img_num == img_num && + img_type != DFU_TARGET_IMAGE_TYPE_SUIT) { return 0; } diff --git a/subsys/dfu/dfu_target/src/dfu_target_suit.c b/subsys/dfu/dfu_target/src/dfu_target_suit.c index 07a6ffdd848b..09a817c87440 100644 --- a/subsys/dfu/dfu_target/src/dfu_target_suit.c +++ b/subsys/dfu/dfu_target/src/dfu_target_suit.c @@ -12,28 +12,24 @@ #ifdef CONFIG_SSF_SUIT_SERVICE_ENABLED #include #endif /* CONFIG_SSF_SUIT_SERVICE_ENABLED */ -#include +#include +#ifdef CONFIG_DFU_TARGET_SUIT_CACHE_PROCESSING +#include +#endif +#include LOG_MODULE_REGISTER(dfu_target_suit, CONFIG_DFU_TARGET_LOG_LEVEL); #define IS_ALIGNED_32(POINTER) (((uintptr_t)(const void *)(POINTER)) % 4 == 0) -#define DFU_PARTITION_LABEL dfu_partition -#define DFU_PARTITION_OFFSET FIXED_PARTITION_OFFSET(DFU_PARTITION_LABEL) -#define DFU_PARTITION_DEVICE FIXED_PARTITION_DEVICE(DFU_PARTITION_LABEL) -#define DFU_PARTITION_ADDRESS suit_plat_mem_nvm_ptr_get(DFU_PARTITION_OFFSET) -#define DFU_PARTITION_SIZE FIXED_PARTITION_SIZE(DFU_PARTITION_LABEL) +#define ENVELOPE_IMAGE_NUMBER 0 static uint8_t *stream_buf; static size_t stream_buf_len; static size_t stream_buf_bytes; static size_t image_size; - -bool dfu_target_suit_identify(const void *const buf) -{ - /* Not implemented */ - return -ENOSYS; -} +static size_t image_num; +static bool stream_flash_in_use; int dfu_target_suit_set_buf(uint8_t *buf, size_t len) { @@ -55,7 +51,8 @@ int dfu_target_suit_init(size_t file_size, int img_num, dfu_target_callback_t cb { ARG_UNUSED(cb); const struct device *flash_dev; - int err; + static struct suit_nvm_device_info device_info; + int err = 0; stream_buf_bytes = 0; image_size = 0; @@ -65,48 +62,80 @@ int dfu_target_suit_init(size_t file_size, int img_num, dfu_target_callback_t cb return -ENODEV; } - if (file_size > DFU_PARTITION_SIZE) { - LOG_ERR("Requested file too big to fit in flash %zu > 0x%x", file_size, - DFU_PARTITION_SIZE); + if (ENVELOPE_IMAGE_NUMBER == img_num) { + /* Get info about dfu_partition to store the envelope */ + err = suit_dfu_partition_device_info_get(&device_info); + } else { +#ifdef CONFIG_DFU_TARGET_SUIT_CACHE_PROCESSING + /* Cache partitions ids starts from 0, whereas image number 0 is reserved for + * dfu_partition. Decrease img_num value by 1 to reach the correct DFU cache + * partition id. + */ + err = suit_dfu_cache_rw_device_info_get(img_num - 1, &device_info); +#else + return -ENOTSUP; +#endif + } + + if (err != SUIT_PLAT_SUCCESS) { + return -ENXIO; + } + + if (file_size > device_info.partition_size) { + LOG_ERR("Requested file for image %d too big to fit in flash %zu > %zu", img_num, + file_size, device_info.partition_size); return -EFBIG; } - flash_dev = DFU_PARTITION_DEVICE; + flash_dev = device_info.fdev; if (!device_is_ready(flash_dev)) { LOG_ERR("Failed to get device for suit storage"); return -EFAULT; } + if (stream_flash_in_use) { + LOG_ERR("Stream flash is already in use"); + return -EBUSY; + } + err = dfu_target_stream_init( &(struct dfu_target_stream_init){.id = "suit_dfu", .fdev = flash_dev, .buf = stream_buf, .len = stream_buf_len, - .offset = (uintptr_t)DFU_PARTITION_OFFSET, - .size = DFU_PARTITION_SIZE, + .offset = (uintptr_t)device_info.partition_offset, + .size = device_info.partition_size, .cb = NULL}); if (err < 0) { LOG_ERR("dfu_target_stream_init failed %d", err); + stream_flash_in_use = false; return err; } + stream_flash_in_use = true; + image_num = img_num; + return 0; } int dfu_target_suit_offset_get(size_t *out) { - int err = 0; - - err = dfu_target_stream_offset_get(out); - if (err == 0) { - *out += stream_buf_bytes; + if (0 != dfu_target_stream_offset_get(out)) { + return -EFAULT; } - return err; + *out += stream_buf_bytes; + + return 0; } int dfu_target_suit_write(const void *const buf, size_t len) { + if (!stream_flash_in_use) { + LOG_ERR("Stream flash is not in use"); + return -EFAULT; + } + stream_buf_bytes = (stream_buf_bytes + len) % stream_buf_len; return dfu_target_stream_write(buf, len); @@ -114,39 +143,46 @@ int dfu_target_suit_write(const void *const buf, size_t len) int dfu_target_suit_done(bool successful) { - int err = 0; + stream_flash_in_use = false; - dfu_target_suit_offset_get(&image_size); - err = dfu_target_stream_done(successful); + int err = dfu_target_stream_done(successful); if (err != 0) { LOG_ERR("dfu_target_stream_done error %d", err); return err; } + if (ENVELOPE_IMAGE_NUMBER == image_num) { + + /* Inform SUIT that envelope has been received */ + err = suit_dfu_candidate_envelope_stored(); + if (err != 0) { + LOG_ERR("suit_dfu_candidate_envelope_stored error %d", err); + return err; + } + } + if (successful) { stream_buf_bytes = 0; } else { LOG_INF("SUIT envelope upgrade aborted."); } - return err; + return 0; } int dfu_target_suit_schedule_update(int img_num) { - LOG_INF("Schedule update"); + /* img_num is not needed for SUIT */ + (void)img_num; - suit_plat_mreg_t update_candidate[] = { - { - .mem = DFU_PARTITION_ADDRESS, - .size = image_size, - }, - }; + LOG_INF("Schedule update"); - suit_ssf_err_t err = suit_trigger_update(update_candidate, ARRAY_SIZE(update_candidate)); + /* Process the saved envelope */ + int err = suit_dfu_candidate_preprocess(); - if (err != SUIT_PLAT_SUCCESS) { - return -EIO; + if (err != 0) { + LOG_ERR("suit_dfu_candidate_preprocess error %d", err); + return err; } return 0; @@ -154,6 +190,46 @@ int dfu_target_suit_schedule_update(int img_num) int dfu_target_suit_reset(void) { + int rc = dfu_target_stream_reset(); + + if (rc != 0) { + LOG_ERR("dfu_target_stream_reset error %d", rc); + return rc; + } + + suit_ssf_err_t err = suit_dfu_cleanup(); + + stream_flash_in_use = false; stream_buf_bytes = 0; - return dfu_target_stream_reset(); + image_num = 0; + + if (err != SUIT_PLAT_SUCCESS) { + LOG_ERR("Failed to cleanup SUIT DFU"); + rc = -EIO; + } + + return 0; } + +int dfu_target_suit_reboot(void) +{ + k_msleep(CONFIG_DFU_TARGET_REBOOT_RESET_DELAY_MS); + + suit_ssf_err_t err = suit_dfu_update_start(); + + if (err < 0) { + LOG_ERR("Failed to start firmware upgrade!"); + return err; + } + + return 0; +} + +#ifdef CONFIG_DFU_TARGET_SUIT_INITIALIZE_SUIT +int dfu_target_suit_init_suit(void) +{ + return suit_dfu_initialize(); +} + +SYS_INIT(dfu_target_suit_init_suit, APPLICATION, 0); +#endif /* CONFIG_DFU_TARGET_SUIT_INITIALIZE_SUIT */ diff --git a/subsys/dm/timeslot_queue.c b/subsys/dm/timeslot_queue.c index bc2a438531ea..549a9e374c14 100644 --- a/subsys/dm/timeslot_queue.c +++ b/subsys/dm/timeslot_queue.c @@ -65,7 +65,6 @@ static bool is_request_exist(struct dm_request *req) int timeslot_queue_append(struct dm_request *req, uint32_t start_ref_tick, uint32_t window_len_us, uint32_t timeslot_len_us) { - uint32_t distance; uint32_t start_time; uint32_t delay; size_t list_size; @@ -84,13 +83,19 @@ int timeslot_queue_append(struct dm_request *req, uint32_t start_ref_tick, return -EAGAIN; } + /* Check that the new timeslot does not overlap with a previous one. + * Timeslots are added with a fixed distance from "now" and are therefore + * always appended to the end of the queue. This means that we only + * need to check that the start of the new timeslot does not fall into + * the last timeslot in the queue. + */ list_lock(); last = SYS_SLIST_PEEK_TAIL_CONTAINER(×lot_list, last, node); list_unlock(); - distance = time_distance_get(last->timeslot_req.start_time, start_time); - if (distance < US_TO_RTC_TICKS(last->timeslot_req.timeslot_length_us + - MIN_TIME_BETWEEN_TIMESLOTS_US)) { + if (start_time < last->timeslot_req.start_time + + US_TO_RTC_TICKS(last->timeslot_req.timeslot_length_us + + MIN_TIME_BETWEEN_TIMESLOTS_US)) { return -EBUSY; } } diff --git a/subsys/esb/esb.c b/subsys/esb/esb.c index 59e84dee05f4..454a6e5a6b1f 100644 --- a/subsys/esb/esb.c +++ b/subsys/esb/esb.c @@ -546,6 +546,24 @@ static void update_rf_payload_format_esb_dpl(uint32_t payload_length) packet_config.balen = (esb_addr.addr_length - 1); packet_config.statlen = 0; packet_config.maxlen = CONFIG_ESB_MAX_PAYLOAD_LENGTH; +#if defined(RADIO_PCNF0_PLEN_Msk) + if (esb_cfg.bitrate == ESB_BITRATE_2MBPS) { + packet_config.plen = NRF_RADIO_PREAMBLE_LENGTH_16BIT; + } + +#if defined(RADIO_MODE_MODE_Ble_2Mbit) + if (esb_cfg.bitrate == ESB_BITRATE_2MBPS_BLE) { + packet_config.plen = NRF_RADIO_PREAMBLE_LENGTH_16BIT; + } +#endif /* defined(RADIO_MODE_MODE_Ble_2Mbit) */ + +#if defined(RADIO_MODE_MODE_Nrf_4Mbit0_5) || defined(RADIO_MODE_MODE_Nrf_4Mbit_0BT6) + if (esb_cfg.bitrate == ESB_BITRATE_4MBPS) { + packet_config.plen = NRF_RADIO_PREAMBLE_LENGTH_16BIT; + } +#endif /* defined(RADIO_MODE_MODE_Nrf_4Mbit0_5) || defined(RADIO_MODE_MODE_Nrf_4Mbit_0BT6) */ + +#endif /* defined(RADIO_PCNF0_PLEN_Msk) */ nrf_radio_packet_configure(NRF_RADIO, &packet_config); } @@ -593,6 +611,11 @@ static void update_radio_addresses(uint8_t update_mask) static nrf_radio_txpower_t dbm_to_nrf_radio_txpower(int8_t tx_power) { switch (tx_power) { +#if defined(RADIO_TXPOWER_TXPOWER_Neg100dBm) + case -100: + return RADIO_TXPOWER_TXPOWER_Neg100dBm; +#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg100dBm) */ + #if defined(RADIO_TXPOWER_TXPOWER_Neg70dBm) case -70: return RADIO_TXPOWER_TXPOWER_Neg70dBm; @@ -611,14 +634,24 @@ static nrf_radio_txpower_t dbm_to_nrf_radio_txpower(int8_t tx_power) return RADIO_TXPOWER_TXPOWER_Neg30dBm; #endif /* defined(RADIO_TXPOWER_TXPOWER_Neg30dBm) */ -#if defined(RADIO_TXPOWER_TXPOWER_Neg26dBm) - case -26: - return RADIO_TXPOWER_TXPOWER_Neg26dBm; -#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg26dBm) */ +#if defined(RADIO_TXPOWER_TXPOWER_Neg28dBm) + case -28: + return RADIO_TXPOWER_TXPOWER_Neg28dBm; +#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg28dBm) */ + +#if defined(RADIO_TXPOWER_TXPOWER_Neg22dBm) + case -22: + return RADIO_TXPOWER_TXPOWER_Neg22dBm; +#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg22dBm) */ case -20: return RADIO_TXPOWER_TXPOWER_Neg20dBm; +#if defined(RADIO_TXPOWER_TXPOWER_Neg18dBm) + case -18: + return RADIO_TXPOWER_TXPOWER_Neg18dBm; +#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg18dBm) */ + case -16: return RADIO_TXPOWER_TXPOWER_Neg16dBm; @@ -774,11 +807,11 @@ static bool update_radio_bitrate(void) switch (esb_cfg.bitrate) { -#if defined(RADIO_MODE_MODE_Nrf_4Mbit0_5) +#if defined(RADIO_MODE_MODE_Nrf_4Mbit0_5) || defined(RADIO_MODE_MODE_Nrf_4Mbit_0BT6) case ESB_BITRATE_4MBPS: wait_for_ack_timeout_us = RX_ACK_TIMEOUT_US_4MBPS; break; -#endif /* defined(RADIO_MODE_MODE_Nrf_4Mbit0_5) */ +#endif /* defined(RADIO_MODE_MODE_Nrf_4Mbit0_5) || define(RADIO_MODE_MODE_Nrf_4Mbit_0BT6) */ case ESB_BITRATE_2MBPS: @@ -1748,6 +1781,12 @@ int esb_init(const struct esb_config *config) *(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); +#endif + return 0; } diff --git a/subsys/mgmt/suitfu/CMakeLists.txt b/subsys/mgmt/suitfu/CMakeLists.txt index 87ee1bab5697..7a271cb211cb 100644 --- a/subsys/mgmt/suitfu/CMakeLists.txt +++ b/subsys/mgmt/suitfu/CMakeLists.txt @@ -22,7 +22,7 @@ zephyr_library_sources( zephyr_library_sources_ifdef(CONFIG_MGMT_SUITFU_GRP_IMG src/suitfu_mgmt_img.c) zephyr_library_sources_ifdef(CONFIG_MGMT_SUITFU_GRP_SUIT src/suitfu_mgmt_suit.c) -zephyr_library_sources_ifdef(CONFIG_MGMT_SUITFU_GRP_OS src/suitfu_mgmt_suit_os.c) +zephyr_library_sources_ifdef(CONFIG_MGMT_SUITFU_GRP_OS_BOOTLOADER_INFO_HOOK src/suitfu_mgmt_suit_os.c) zephyr_library_sources_ifdef(CONFIG_MGMT_SUITFU_GRP_SUIT_MFSTS_STATE src/suitfu_mgmt_suit_mfsts_state.c) zephyr_library_sources_ifdef(CONFIG_MGMT_SUITFU_GRP_SUIT_CAND_ENV_UPLOAD src/suitfu_mgmt_suit_cand_env_upload.c) zephyr_library_sources_ifdef(CONFIG_MGMT_SUITFU_GRP_SUIT_IMAGE_FETCH src/suitfu_mgmt_suit_image_fetch.c) diff --git a/subsys/mgmt/suitfu/Kconfig b/subsys/mgmt/suitfu/Kconfig index 47fada94bfec..d2cb7248932a 100644 --- a/subsys/mgmt/suitfu/Kconfig +++ b/subsys/mgmt/suitfu/Kconfig @@ -35,11 +35,12 @@ config MGMT_SUITFU_GRP_IMG # The IMG MGMT group is substituted, not extended by the SUIT variant depends on !MCUMGR_GRP_IMG -config MGMT_SUITFU_GRP_OS - bool "Bootloader identification, handlers for OS management" +config MGMT_SUITFU_GRP_OS_BOOTLOADER_INFO_HOOK + bool "Bootloader identification hook" default y - # The IMG MGMT OS bootloader info is substituted, not extended by the SUIT variant - depends on !MCUMGR_GRP_OS_BOOTLOADER_INFO + depends on MCUMGR_GRP_OS_BOOTLOADER_INFO + select MCUMGR_GRP_OS_BOOTLOADER_INFO_HOOK + select MCUMGR_MGMT_NOTIFICATION_HOOKS config MGMT_SUITFU_GRP_SUIT bool "Extended SUIT commands over USER group" diff --git a/subsys/mgmt/suitfu/src/suitfu_mgmt.c b/subsys/mgmt/suitfu/src/suitfu_mgmt.c index a9fc96feb85d..40366c89319d 100644 --- a/subsys/mgmt/suitfu/src/suitfu_mgmt.c +++ b/subsys/mgmt/suitfu/src/suitfu_mgmt.c @@ -258,6 +258,9 @@ int suitfu_mgmt_init(void) k_work_queue_start(&system_update_work_queue, system_update_stack_area, K_THREAD_STACK_SIZEOF(system_update_stack_area), K_HIGHEST_THREAD_PRIO, NULL); +#ifdef CONFIG_MGMT_SUITFU_GRP_OS_BOOTLOADER_INFO_HOOK + suitfu_mgmt_register_bootloader_info_hook(); +#endif /* CONFIG_MGMT_SUITFU_GRP_OS_BOOTLOADER_INFO_HOOK */ return suit_dfu_initialize(); } diff --git a/subsys/mgmt/suitfu/src/suitfu_mgmt_img.c b/subsys/mgmt/suitfu/src/suitfu_mgmt_img.c index df0cb938d7f6..6b082ea968f8 100644 --- a/subsys/mgmt/suitfu/src/suitfu_mgmt_img.c +++ b/subsys/mgmt/suitfu/src/suitfu_mgmt_img.c @@ -255,8 +255,12 @@ static int suitfu_mgmt_img_state_read(struct smp_streamer *ctx) } if (ok) { +#if !CONFIG_SUIT_RECOVERY ok = ENCODE_FLAG(zse, "bootable", 1) && ENCODE_FLAG(zse, "confirmed", 1) && ENCODE_FLAG(zse, "active", 1) && ENCODE_FLAG(zse, "permanent", 1); +#else + ok = ENCODE_FLAG(zse, "pending", 1); +#endif LOG_DBG("Manifest flags encoded: %d", ok); } diff --git a/subsys/mgmt/suitfu/src/suitfu_mgmt_priv.h b/subsys/mgmt/suitfu/src/suitfu_mgmt_priv.h index a27f79bf686b..c289dace7820 100644 --- a/subsys/mgmt/suitfu/src/suitfu_mgmt_priv.h +++ b/subsys/mgmt/suitfu/src/suitfu_mgmt_priv.h @@ -162,6 +162,11 @@ int suitfu_mgmt_suit_cache_raw_upload(struct smp_streamer *ctx); */ int suitfu_mgmt_suit_cleanup(struct smp_streamer *ctx); +/** + * @brief Register OS Management Bootloader Info hook to return SUIT bootloader name. + */ +void suitfu_mgmt_register_bootloader_info_hook(void); + #ifdef __cplusplus } #endif diff --git a/subsys/mgmt/suitfu/src/suitfu_mgmt_suit_os.c b/subsys/mgmt/suitfu/src/suitfu_mgmt_suit_os.c index cd2d1d3bf1b5..6c6cb85ae7b6 100644 --- a/subsys/mgmt/suitfu/src/suitfu_mgmt_suit_os.c +++ b/subsys/mgmt/suitfu/src/suitfu_mgmt_suit_os.c @@ -5,37 +5,45 @@ */ #include -#include #include -#include -#include -#include +#include +#include #include "suitfu_mgmt_priv.h" -int suitfu_mgmt_suit_bootloader_info_read(struct smp_streamer *ctxt) +static enum mgmt_cb_return bootloader_info_hook(uint32_t event, enum mgmt_cb_return prev_status, + int32_t *rc, uint16_t *group, bool *abort_more, + void *data, size_t data_size) { - zcbor_state_t *zse = ctxt->writer->zs; - zcbor_state_t *zsd = ctxt->reader->zs; - struct zcbor_string query = { 0 }; - size_t decoded = 0; - bool ok; - - struct zcbor_map_decode_key_val bootloader_info[] = { - ZCBOR_MAP_DECODE_KEY_DECODER("query", zcbor_tstr_decode, &query), - }; - - if (zcbor_map_decode_bulk(zsd, bootloader_info, ARRAY_SIZE(bootloader_info), &decoded)) { - return MGMT_ERR_EINVAL; + struct os_mgmt_bootloader_info_data *bootloader_info_data; + + if ((event != MGMT_EVT_OP_OS_MGMT_BOOTLOADER_INFO) + || (data_size != sizeof(*bootloader_info_data))) { + *rc = MGMT_ERR_EUNKNOWN; + return MGMT_CB_ERROR_RC; } + bootloader_info_data = data; + /* If no parameter is recognized then just introduce the bootloader. */ - if (decoded == 0) { - ok = zcbor_tstr_put_lit(zse, "bootloader") && - zcbor_tstr_put_lit(zse, "SUIT"); + if (*(bootloader_info_data->decoded) == 0) { + bool ok = zcbor_tstr_put_lit(bootloader_info_data->zse, "bootloader") && + zcbor_tstr_put_lit(bootloader_info_data->zse, "SUIT"); + + *rc = (ok ? MGMT_ERR_EOK : MGMT_ERR_EMSGSIZE); } else { - return MGMT_ERR_ENOTSUP; + *rc = MGMT_ERR_ENOTSUP; } - return ok ? MGMT_ERR_EOK : MGMT_ERR_EMSGSIZE; + return MGMT_CB_ERROR_RC; +} + +static struct mgmt_callback cmd_bootloader_info_cb = { + .callback = bootloader_info_hook, + .event_id = MGMT_EVT_OP_OS_MGMT_BOOTLOADER_INFO, +}; + +void suitfu_mgmt_register_bootloader_info_hook(void) +{ + mgmt_callback_register(&cmd_bootloader_info_cb); } diff --git a/subsys/mpsl/pm/mpsl_pm_utils.c b/subsys/mpsl/pm/mpsl_pm_utils.c index 9e5925d7003a..04a81bcfa4c9 100644 --- a/subsys/mpsl/pm/mpsl_pm_utils.c +++ b/subsys/mpsl/pm/mpsl_pm_utils.c @@ -26,8 +26,6 @@ LOG_MODULE_REGISTER(mpsl_pm_utils, CONFIG_MPSL_LOG_LEVEL); static void m_work_handler(struct k_work *work); static K_WORK_DELAYABLE_DEFINE(pm_work, m_work_handler); -#define RETRY_TIME_MAX_US (UINT32_MAX - TIME_TO_REGISTER_EVENT_IN_ZEPHYR_US) - static uint8_t m_pm_prev_flag_value; static bool m_pm_event_is_registered; static uint32_t m_prev_lat_value_us; @@ -73,12 +71,32 @@ void mpsl_pm_utils_work_handler(void) /* In case we missed a state and are in zero-latency, set low-latency.*/ m_update_latency_request(PM_MAX_LATENCY_HCI_COMMANDS_US); - /* Event scheduled */ - if (params.event_time_abs_us > UINT32_MAX) { - mpsl_work_schedule(&pm_work, K_USEC(RETRY_TIME_MAX_US)); + /* Note: Considering an overflow could only happen if the system runs many years, + * it needen't be considered here. + */ + int64_t current_time_us = k_uptime_get() * 1000; + uint64_t relative_time_us = params.event_time_abs_us - current_time_us; + uint64_t max_cycles_until_event = k_us_to_cyc_floor64(relative_time_us); + + if (max_cycles_until_event > UINT32_MAX) { + /* The event is too far in the future and would + * exceed the 32-bit cycle limit. + */ + uint64_t event_delay_us = params.event_time_abs_us - current_time_us - + TIME_TO_REGISTER_EVENT_IN_ZEPHYR_US; +#ifdef CONFIG_TIMEOUT_64BIT + mpsl_work_schedule(&pm_work, K_USEC(event_delay_us)); +#else + if (event_delay_us > UINT32_MAX) { + mpsl_work_schedule(&pm_work, K_USEC(UINT32_MAX)); + } else { + mpsl_work_schedule(&pm_work, K_USEC((uint32_t)event_delay_us)); + } +#endif return; } + /* Event scheduled */ if (m_pm_event_is_registered) { pm_policy_event_update(&m_evt, k_us_to_cyc_floor32(params.event_time_abs_us)); diff --git a/subsys/net/CMakeLists.txt b/subsys/net/CMakeLists.txt index ec4625da2e11..6a52bf3c0599 100644 --- a/subsys/net/CMakeLists.txt +++ b/subsys/net/CMakeLists.txt @@ -8,3 +8,4 @@ add_subdirectory(lib) add_subdirectory_ifdef(CONFIG_OPENTHREAD_RPC openthread/rpc) add_subdirectory_ifdef(CONFIG_L2_WIFI_CONNECTIVITY l2_wifi_if_conn) add_subdirectory_ifdef(CONFIG_OPENTHREAD_REPORT openthread/report) +add_subdirectory_ifdef(CONFIG_NET_L2_OPENTHREAD openthread/settings_check) diff --git a/subsys/net/lib/mqtt_helper/Kconfig b/subsys/net/lib/mqtt_helper/Kconfig index f59c935886d0..ec4bc282b906 100644 --- a/subsys/net/lib/mqtt_helper/Kconfig +++ b/subsys/net/lib/mqtt_helper/Kconfig @@ -85,7 +85,7 @@ config MQTT_HELPER_PAYLOAD_BUFFER_LEN config MQTT_HELPER_PROVISION_CERTIFICATES bool "Run-time provisioning of certificates" - depends on (BOARD_QEMU_X86 || BOARD_NATIVE_POSIX || BOARD_NRF7002DK_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF5340_CPUAPP_NS) && MQTT_LIB_TLS + depends on TLS_CREDENTIALS default y imply MBEDTLS_PEM_CERTIFICATE_FORMAT if MBEDTLS help diff --git a/subsys/net/lib/nrf_cloud/Kconfig b/subsys/net/lib/nrf_cloud/Kconfig index 26b4e78a9aef..7c5bb0552d2e 100644 --- a/subsys/net/lib/nrf_cloud/Kconfig +++ b/subsys/net/lib/nrf_cloud/Kconfig @@ -107,6 +107,23 @@ config NRF_CLOUD_JWT_SOURCE_CUSTOM help JWTs are created and signed by the nRF Cloud library, not the modem. The signing key is obtained from the TLS credentials module. + +config NRF_CLOUD_AWS_CA_CERT_SIZE_THRESHOLD + int "Root CA size above which AWS cert is likely present" + default 1150 + help + This value is necessarily inexact as the underlying PEM data varies + a bit in size when credentials are rotated or replaced. This is useful + to determine if a sectag likely contains only an AWS root CA + certificate. + +config NRF_CLOUD_COAP_CA_CERT_SIZE_THRESHOLD + int "Root CA size above which a CoAP cert is likely present" + default 550 + help + This necessarily inexact value is useful to determine if a sectag + likely contains only a CoAP root CA certificate. + endmenu # "Credentials" rsource "Kconfig.nrf_cloud_client_id" diff --git a/subsys/net/lib/nrf_cloud/Kconfig.nrf_cloud_coap b/subsys/net/lib/nrf_cloud/Kconfig.nrf_cloud_coap index f1741401f20d..2f1561caa937 100644 --- a/subsys/net/lib/nrf_cloud/Kconfig.nrf_cloud_coap +++ b/subsys/net/lib/nrf_cloud/Kconfig.nrf_cloud_coap @@ -23,6 +23,22 @@ config NRF_CLOUD_COAP_SERVER_HOSTNAME config NRF_CLOUD_COAP_SEC_TAG int "Security tag for credentials" default NRF_CLOUD_SEC_TAG + help + Security tag containing the nRF Cloud CoAP CA certificate and private key required for + the DTLS connection to nRF Cloud. + NRF_CLOUD_COAP_JWT_SEC_TAG defaults to the same sec tag value, so the private key + is also used for authentication. + +config NRF_CLOUD_COAP_JWT_SEC_TAG + int "[For Debug Use] Security tag for JWT credentials" + default NRF_CLOUD_COAP_SEC_TAG + help + Security tag containing the private key used to sign CoAP JWTs for nRF Cloud + authentication. + The private key in this sec tag must have its corresponding public key registered for + the device on nRF Cloud. + Using this option allows for a different private key to be stored in + NRF_CLOUD_COAP_SEC_TAG that can be used to decrypt DTLS traffic. config NRF_CLOUD_COAP_SERVER_PORT int "CoAP server port" @@ -52,7 +68,7 @@ endif # WIFI config NRF_CLOUD_COAP_DOWNLOADS bool "Download files using CoAP instead of HTTP" depends on NRF_CLOUD_COAP - select EXPERIMENTAL + default y if NRF_CLOUD_FOTA_POLL || NRF_CLOUD_PGPS help Use nRF Cloud CoAP's proxy download resource to download files for FOTA and P-GPS. When enabled, the Kconfig option COAP_EXTENDED_OPTIONS_LEN_VALUE must be increased diff --git a/subsys/net/lib/nrf_cloud/Kconfig.nrf_cloud_fota b/subsys/net/lib/nrf_cloud/Kconfig.nrf_cloud_fota index b23436f508e5..4a2d47c7a5bd 100644 --- a/subsys/net/lib/nrf_cloud/Kconfig.nrf_cloud_fota +++ b/subsys/net/lib/nrf_cloud/Kconfig.nrf_cloud_fota @@ -130,7 +130,6 @@ endif # NRF_CLOUD_FOTA_FULL_MODEM_UPDATE config NRF_CLOUD_FOTA_SMP bool "SMP FOTA updates" - depends on NRF_CLOUD_FOTA select NRF_MCUMGR_SMP_CLIENT select EXPERIMENTAL help diff --git a/subsys/net/lib/nrf_cloud/coap/src/nrfc_dtls.c b/subsys/net/lib/nrf_cloud/coap/src/nrfc_dtls.c index 4adc7777e306..f2aff1b623ca 100644 --- a/subsys/net/lib/nrf_cloud/coap/src/nrfc_dtls.c +++ b/subsys/net/lib/nrf_cloud/coap/src/nrfc_dtls.c @@ -26,13 +26,13 @@ #include #include #endif +#include #include "nrfc_dtls.h" #include LOG_MODULE_REGISTER(dtls, CONFIG_NRF_CLOUD_COAP_LOG_LEVEL); -static int sectag = CONFIG_NRF_CLOUD_COAP_SEC_TAG; static bool dtls_cid_active; static bool cid_supported = true; static bool keepopen_supported; @@ -66,6 +66,7 @@ static int get_device_ip_address(uint8_t *d4_addr) int nrfc_dtls_setup(int sock) { int err; + int sectag; uint8_t d4_addr[4]; /* once connected, cache the connection info */ @@ -87,7 +88,9 @@ int nrfc_dtls_setup(int sock) return -errno; } + sectag = nrf_cloud_sec_tag_get(); LOG_DBG(" sectag: %d", sectag); + err = setsockopt(sock, SOL_TLS, TLS_SEC_TAG_LIST, §ag, sizeof(sectag)); if (err) { LOG_ERR("Error setting sectag list: %d", -errno); diff --git a/subsys/net/lib/nrf_cloud/src/nrf_cloud_alert.c b/subsys/net/lib/nrf_cloud/src/nrf_cloud_alert.c index 9ac7d5de6634..e6d34cad5e11 100644 --- a/subsys/net/lib/nrf_cloud/src/nrf_cloud_alert.c +++ b/subsys/net/lib/nrf_cloud/src/nrf_cloud_alert.c @@ -195,7 +195,7 @@ void nrf_cloud_alert_control_set(bool enable) if (!IS_ENABLED(CONFIG_NRF_CLOUD_ALERT)) { return; } - LOG_DBG("Changing alerts_enabled from:%d to:%d", alerts_enabled, enable); + LOG_INF("Changing alerts enabled from:%d to:%d", alerts_enabled, enable); if (alerts_enabled != enable) { alerts_enabled = enable; } diff --git a/subsys/net/lib/nrf_cloud/src/nrf_cloud_codec_internal.c b/subsys/net/lib/nrf_cloud/src/nrf_cloud_codec_internal.c index c28a55c93c58..f5fff7523632 100644 --- a/subsys/net/lib/nrf_cloud/src/nrf_cloud_codec_internal.c +++ b/subsys/net/lib/nrf_cloud/src/nrf_cloud_codec_internal.c @@ -2248,6 +2248,8 @@ int nrf_cloud_rest_fota_execution_decode(const char *const response, job->type = NRF_CLOUD_FOTA_BOOTLOADER; } else if (!strcmp(type, NRF_CLOUD_FOTA_TYPE_APP)) { job->type = NRF_CLOUD_FOTA_APPLICATION; + } else if (!strcmp(type, NRF_CLOUD_FOTA_TYPE_SMP)) { + job->type = NRF_CLOUD_FOTA_SMP; } else { LOG_WRN("Unhandled FOTA type: %s", type); job->type = NRF_CLOUD_FOTA_TYPE__INVALID; diff --git a/subsys/net/lib/nrf_cloud/src/nrf_cloud_credentials.c b/subsys/net/lib/nrf_cloud/src/nrf_cloud_credentials.c index eb81855a274d..587e1f54e4fe 100644 --- a/subsys/net/lib/nrf_cloud/src/nrf_cloud_credentials.c +++ b/subsys/net/lib/nrf_cloud/src/nrf_cloud_credentials.c @@ -147,6 +147,30 @@ int nrf_cloud_credentials_configured_check(void) } } + if (IS_ENABLED(CONFIG_NRF_CLOUD_MQTT) || IS_ENABLED(CONFIG_NRF_CLOUD_REST)) { + if (!cs.ca_aws && cs.ca_coap) { + /* There is a CA, but not large enough to be correct */ + LOG_WRN("Connection using MQTT or REST may fail as the size of the CA " + "cert indicates it is a CoAP root CA."); + ret = -ENOPROTOOPT; + } + } + + if (IS_ENABLED(CONFIG_NRF_CLOUD_COAP)) { + if (!cs.ca_coap && cs.ca_aws) { + LOG_WRN("Connection using CoAP " + "may fail as the size of the CA cert indicates " + "CoAP CA certificate is missing but AWS CA is present."); + ret = -ENOPROTOOPT; + } else if (!IS_ENABLED(CONFIG_NRF_CLOUD_COAP_DOWNLOADS)) { + if (cs.ca && (!cs.ca_coap || !cs.ca_aws)) { + LOG_WRN("Connection using CoAP and downloading using HTTP " + "may fail as the size of the CA cert indicates both " + "CoAP and AWS root CA certs are not present."); + ret = -ENOPROTOOPT; + } + } + } return ret; } @@ -177,6 +201,34 @@ static int cred_exists(uint32_t sec_tag, int type, bool *exists) return err; } +static int cred_size_get(uint32_t sec_tag, int type, size_t *cred_sz) +{ + int err; + + *cred_sz = 0; /* We just want to determine the size */ + +#if defined(CONFIG_NRF_CLOUD_CREDENTIALS_MGMT_MODEM) + uint8_t buf[1]; + + err = modem_key_mgmt_read(sec_tag, (enum modem_key_mgmt_cred_type)cred_type[type], + buf, cred_sz); + if (err && (err != -ENOMEM)) { + LOG_ERR("modem_key_mgmt_read() failed for type %d in sec tag %u, error: %d", + (enum modem_key_mgmt_cred_type)cred_type[type], sec_tag, err); + } else { + err = 0; + } +#else + err = tls_credential_get(sec_tag, (enum tls_credential_type)cred_type[type], + NULL, cred_sz); + if (err == -EFBIG) { /* Error expected since we only want the size */ + err = 0; + } +#endif + + return err; +} + int nrf_cloud_credentials_check(struct nrf_cloud_credentials_status *const cs) { if (!cs) { @@ -192,27 +244,56 @@ int nrf_cloud_credentials_check(struct nrf_cloud_credentials_status *const cs) ret = cred_exists(cs->sec_tag, CA_CERT, &exists); if (ret < 0) { + LOG_ERR("Error checking CA exists"); return -EIO; } cs->ca = exists; + if (exists) { + ret = cred_size_get(cs->sec_tag, CA_CERT, &cs->ca_size); + if (ret < 0) { + LOG_ERR("Error checking CA size"); + return -EIO; + } + /* These flags are approximate and only useful for logging to help diagnose + * possible provisioning mistakes. + */ + size_t coap_min_sz = CONFIG_NRF_CLOUD_COAP_CA_CERT_SIZE_THRESHOLD; + size_t aws_min_sz = CONFIG_NRF_CLOUD_AWS_CA_CERT_SIZE_THRESHOLD; + size_t combined_min_sz = aws_min_sz + coap_min_sz; + + if (cs->ca_size > combined_min_sz) { + cs->ca_aws = true; + cs->ca_coap = true; + } else if (cs->ca_size > aws_min_sz) { + cs->ca_aws = true; + } else if (cs->ca_size > coap_min_sz) { + cs->ca_coap = true; + } + } ret = cred_exists(cs->sec_tag, CLIENT_CERT, &exists); if (ret < 0) { + LOG_ERR("Error checking client cert exists"); return -EIO; } cs->client_cert = exists; ret = cred_exists(cs->sec_tag, PRIVATE_KEY, &exists); if (ret < 0) { + LOG_ERR("Error checking private key exists"); return -EIO; } cs->prv_key = exists; - LOG_DBG("Sec Tag: %u, CA: %s, Client Cert: %s, Private Key: %s", + LOG_INF("Sec Tag: %u; CA: %s, Client Cert: %s, Private Key: %s", cs->sec_tag, cs->ca ? "Yes" : "No", cs->client_cert ? "Yes" : "No", cs->prv_key ? "Yes" : "No"); + LOG_INF("CA Size: %zd, AWS: %s, CoAP: %s", + cs->ca_size, + cs->ca_aws ? "Likely" : "Unlikely", + cs->ca_coap ? "Likely" : "Unlikely"); return 0; } diff --git a/subsys/net/lib/nrf_cloud/src/nrf_cloud_download.c b/subsys/net/lib/nrf_cloud/src/nrf_cloud_download.c index 5cb9405dcaed..35e34c350714 100644 --- a/subsys/net/lib/nrf_cloud/src/nrf_cloud_download.c +++ b/subsys/net/lib/nrf_cloud/src/nrf_cloud_download.c @@ -72,7 +72,7 @@ static int coap_dl_connect_and_auth(void) static int fota_dl_evt_send(const struct download_client_evt *evt) { -#if defined(CONFIG_FOTA_DOWNLOAD) +#if defined(CONFIG_FOTA_DOWNLOAD_EXTERNAL_DL) return fota_download_external_evt_handle(evt); #endif return -ENOTSUP; @@ -293,12 +293,16 @@ static int coap_dl(struct nrf_cloud_download_data *const dl) } if (dl->type == NRF_CLOUD_DL_TYPE_FOTA) { +#if defined(CONFIG_FOTA_DOWNLOAD_EXTERNAL_DL) ret = fota_download_external_start(dl->host, file_path, dl->fota.expected_type, (size_t)dl->fota.img_sz); if (ret) { LOG_ERR("Failed to start FOTA download, error: %d", ret); return ret; } +#else + return -ENOTSUP; +#endif } return coap_dl_start(dl, 0); @@ -388,11 +392,6 @@ static int fota_start(struct nrf_cloud_download_data *const dl) { #if defined(CONFIG_FOTA_DOWNLOAD) - /* Download using CoAP if enabled */ -#if defined(CONFIG_NRF_CLOUD_COAP_DOWNLOADS) - return coap_dl(dl); -#endif /* CONFIG_NRF_CLOUD_COAP_DOWNLOADS */ - if (dl->fota.expected_type == DFU_TARGET_IMAGE_TYPE_SMP) { /* This needs to be called to set the SMP flag in fota_download */ smp_fota_dl_util_init(&dl->fota); @@ -401,6 +400,11 @@ static int fota_start(struct nrf_cloud_download_data *const dl) (void)fota_download_init(dl->fota.cb); } + /* Download using CoAP if enabled */ +#if defined(CONFIG_NRF_CLOUD_COAP_DOWNLOADS) + return coap_dl(dl); +#endif /* CONFIG_NRF_CLOUD_COAP_DOWNLOADS */ + return fota_download_start_with_image_type(dl->host, dl->path, dl->dl_cfg.sec_tag_count ? dl->dl_cfg.sec_tag_list[0] : -1, dl->dl_cfg.pdn_id, dl->dl_cfg.frag_size_override, dl->fota.expected_type); diff --git a/subsys/net/lib/nrf_cloud/src/nrf_cloud_fota.c b/subsys/net/lib/nrf_cloud/src/nrf_cloud_fota.c index b73a75509cd1..8ad69005d5df 100644 --- a/subsys/net/lib/nrf_cloud/src/nrf_cloud_fota.c +++ b/subsys/net/lib/nrf_cloud/src/nrf_cloud_fota.c @@ -32,9 +32,6 @@ #include #include #endif -#if defined(CONFIG_NRF_CLOUD_FOTA_SMP) -#include -#endif LOG_MODULE_REGISTER(nrf_cloud_fota, CONFIG_NRF_CLOUD_FOTA_LOG_LEVEL); @@ -232,16 +229,13 @@ int nrf_cloud_fota_init(struct nrf_cloud_fota_init_param const *const init) event_cb = init->evt_cb; -#if defined(CONFIG_NRF_CLOUD_FOTA_SMP) - ret = mcumgr_smp_client_init((dfu_target_reset_cb_t)init->smp_reset_cb); - if (ret != 0) { - LOG_ERR("Failed to init SMP client, error: %d", ret); - return ret; + if (IS_ENABLED(CONFIG_NRF_CLOUD_FOTA_SMP)) { + ret = nrf_cloud_fota_smp_client_init(init->smp_reset_cb); + if (ret) { + return ret; + } } - (void)nrf_cloud_fota_smp_version_read(); -#endif /* CONFIG_NRF_CLOUD_FOTA_SMP */ - if (initialized) { return 0; } diff --git a/subsys/net/lib/nrf_cloud/src/nrf_cloud_fota_common.c b/subsys/net/lib/nrf_cloud/src/nrf_cloud_fota_common.c index b31680614a56..f8c359e8669e 100644 --- a/subsys/net/lib/nrf_cloud/src/nrf_cloud_fota_common.c +++ b/subsys/net/lib/nrf_cloud/src/nrf_cloud_fota_common.c @@ -265,6 +265,7 @@ int nrf_cloud_fota_fmfu_apply(void) err = fmfu_fdev_load(fmfu_buf, sizeof(fmfu_buf), fmfu_dev.dev, fmfu_dev.offset); if (err != 0) { LOG_ERR("Failed to apply full modem update, error: %d", err); + (void)nrf_modem_lib_shutdown(); (void)nrf_modem_lib_init(); return err; } @@ -581,3 +582,20 @@ int nrf_cloud_fota_smp_version_get(char **smp_ver_out) #endif return -ENOTSUP; } + +int nrf_cloud_fota_smp_client_init(const void *smp_reset_cb) +{ + int ret = -ENOTSUP; + +#if defined(CONFIG_NRF_CLOUD_FOTA_SMP) + ret = mcumgr_smp_client_init((dfu_target_reset_cb_t)smp_reset_cb); + if (ret != 0) { + LOG_ERR("Failed to init SMP client, error: %d", ret); + return ret; + } + + (void)nrf_cloud_fota_smp_version_read(); +#endif /* CONFIG_NRF_CLOUD_FOTA_SMP */ + + return ret; +} diff --git a/subsys/net/lib/nrf_cloud/src/nrf_cloud_fota_poll.c b/subsys/net/lib/nrf_cloud/src/nrf_cloud_fota_poll.c index 57edba913d32..c506edb4fa07 100644 --- a/subsys/net/lib/nrf_cloud/src/nrf_cloud_fota_poll.c +++ b/subsys/net/lib/nrf_cloud/src/nrf_cloud_fota_poll.c @@ -302,6 +302,13 @@ int nrf_cloud_fota_poll_init(struct nrf_cloud_fota_poll_ctx *ctx) ctx->full_modem_fota_supported = true; #endif + if (IS_ENABLED(CONFIG_NRF_CLOUD_FOTA_SMP)) { + err = nrf_cloud_fota_smp_client_init(ctx->smp_reset_cb); + if (err) { + return err; + } + } + err = fota_download_init(http_fota_dl_handler); if (err) { LOG_ERR("Failed to initialize FOTA download, error: %d", err); @@ -435,6 +442,14 @@ static int start_download(void) ret = -EFTYPE; } break; + case NRF_CLOUD_FOTA_SMP: + if (IS_ENABLED(CONFIG_NRF_CLOUD_FOTA_SMP)) { + ctx_ptr->img_type = DFU_TARGET_IMAGE_TYPE_SMP; + } else { + LOG_ERR("Not configured for SMP FOTA"); + ret = -EFTYPE; + } + break; default: LOG_ERR("Unhandled FOTA type: %d", job.type); return -EFTYPE; @@ -531,6 +546,21 @@ static void handle_download_succeeded_and_reboot(struct nrf_cloud_fota_poll_ctx } #endif +#if defined(CONFIG_NRF_CLOUD_FOTA_SMP) + if (job.type == NRF_CLOUD_FOTA_SMP) { + bool reboot_required = false; + + LOG_INF("Installing SMP FOTA update..."); + err = nrf_cloud_pending_fota_job_process(&pending_job, &reboot_required); + if (err < 0) { + LOG_ERR("Failed to install SMP FOTA update %d", err); + pending_job.validate = NRF_CLOUD_FOTA_VALIDATE_FAIL; + } else { + pending_job.validate = NRF_CLOUD_FOTA_VALIDATE_PASS; + } + } +#endif + err = nrf_cloud_fota_settings_save(&pending_job); if (err) { LOG_WRN("FOTA job will be marked as successful without validation"); diff --git a/subsys/net/lib/nrf_cloud/src/nrf_cloud_info.c b/subsys/net/lib/nrf_cloud/src/nrf_cloud_info.c index cf99fb1b204a..a2dffec55698 100644 --- a/subsys/net/lib/nrf_cloud/src/nrf_cloud_info.c +++ b/subsys/net/lib/nrf_cloud/src/nrf_cloud_info.c @@ -106,6 +106,7 @@ int nrf_cloud_print_details(void) #if defined(CONFIG_NRF_CLOUD_VERBOSE_DETAILS) const char *protocol = "Unknown"; const char *host_name = "Unknown"; + const char *download_protocol; char buf[100]; err = nrf_cloud_get_imei(buf, sizeof(buf)); @@ -137,9 +138,19 @@ int nrf_cloud_print_details(void) protocol = "REST"; host_name = CONFIG_NRF_CLOUD_REST_HOST_NAME; #endif - LOG_INF("Protocol: %s", protocol); - LOG_INF("Sec tag: %d", nrf_cloud_sec_tag_get()); - LOG_INF("Host name: %s", host_name); +#if defined(CONFIG_NRF_CLOUD_COAP_DOWNLOADS) + download_protocol = "CoAP"; +#else + download_protocol = "HTTPS"; +#endif + LOG_INF("Protocol: %s", protocol); + LOG_INF("Download protocol: %s", download_protocol); + LOG_INF("Sec tag: %d", nrf_cloud_sec_tag_get()); + LOG_INF("Host name: %s", host_name); + +#if defined(CONFIG_NRF_CLOUD_COAP) + LOG_INF("-CoAP JWT: %d", nrf_cloud_sec_tag_coap_jwt_get()); +#endif #endif /* CONFIG_NRF_CLOUD_VERBOSE_DETAILS */ diff --git a/subsys/net/lib/nrf_cloud/src/nrf_cloud_jwt.c b/subsys/net/lib/nrf_cloud/src/nrf_cloud_jwt.c index 7819427258ce..d5e731d9535f 100644 --- a/subsys/net/lib/nrf_cloud/src/nrf_cloud_jwt.c +++ b/subsys/net/lib/nrf_cloud/src/nrf_cloud_jwt.c @@ -470,13 +470,15 @@ int nrf_cloud_jwt_generate(uint32_t time_valid_s, char *const jwt_buf, size_t jw const char *id_ptr; struct jwt_data jwt = { .audience = NULL, - .sec_tag = nrf_cloud_sec_tag_get(), .key = JWT_KEY_TYPE_CLIENT_PRIV, .alg = JWT_ALG_TYPE_ES256, .jwt_buf = jwt_buf, .jwt_sz = jwt_buf_sz }; + jwt.sec_tag = IS_ENABLED(CONFIG_NRF_CLOUD_COAP) ? + nrf_cloud_sec_tag_coap_jwt_get() : nrf_cloud_sec_tag_get(); + #if defined(CONFIG_MODEM_JWT) /* Check if modem time is valid */ char buf[GET_TIME_RSP_SZ]; diff --git a/subsys/net/lib/nrf_cloud/src/nrf_cloud_log.c b/subsys/net/lib/nrf_cloud/src/nrf_cloud_log.c index b299e0888102..4f0476a15a4e 100644 --- a/subsys/net/lib/nrf_cloud/src/nrf_cloud_log.c +++ b/subsys/net/lib/nrf_cloud/src/nrf_cloud_log.c @@ -305,7 +305,7 @@ int nrf_cloud_log_control_get(void) void nrf_cloud_log_level_set(int level) { if (nrf_cloud_log_level != level) { - LOG_DBG("Changing log level from:%d to:%d", nrf_cloud_log_level, level); + LOG_INF("Changing cloud log level from:%d to:%d", nrf_cloud_log_level, level); nrf_cloud_log_level = level; } else { LOG_DBG("No change in log level from %d", level); @@ -319,7 +319,7 @@ void nrf_cloud_log_enable(bool enable) logs_backend_enable(enable); #endif enabled = enable; - LOG_DBG("enabled = %d", enabled); + LOG_INF("Changing cloud logging enabled to:%d", enabled); } } diff --git a/subsys/net/lib/nrf_cloud/src/nrf_cloud_pgps_utils.c b/subsys/net/lib/nrf_cloud/src/nrf_cloud_pgps_utils.c index 02c538aa23d8..eab4e8cd83dc 100644 --- a/subsys/net/lib/nrf_cloud/src/nrf_cloud_pgps_utils.c +++ b/subsys/net/lib/nrf_cloud/src/nrf_cloud_pgps_utils.c @@ -543,7 +543,7 @@ static int download_client_callback(const struct download_client_evt *event) } break; case DOWNLOAD_CLIENT_EVT_DONE: - LOG_INF("Download client done"); + LOG_DBG("Download client done"); break; case DOWNLOAD_CLIENT_EVT_ERROR: { if ((event->error == -ECANCELED) && IS_ENABLED(CONFIG_NRF_CLOUD_COAP_DOWNLOADS)) { diff --git a/subsys/net/lib/nrf_cloud/src/nrf_cloud_sec_tag.c b/subsys/net/lib/nrf_cloud/src/nrf_cloud_sec_tag.c index 2dd50000dd17..d93cc9c7414b 100644 --- a/subsys/net/lib/nrf_cloud/src/nrf_cloud_sec_tag.c +++ b/subsys/net/lib/nrf_cloud/src/nrf_cloud_sec_tag.c @@ -26,3 +26,18 @@ sec_tag_t nrf_cloud_sec_tag_get(void) { return nrf_cloud_sec_tag; } + +#if defined(CONFIG_NRF_CLOUD_COAP) +static sec_tag_t coap_jwt_sec_tag = CONFIG_NRF_CLOUD_COAP_JWT_SEC_TAG; + +void nrf_cloud_sec_tag_coap_jwt_set(const sec_tag_t sec_tag) +{ + coap_jwt_sec_tag = sec_tag; + LOG_DBG("CoAP JWT sec tag updated: %d", coap_jwt_sec_tag); +} + +sec_tag_t nrf_cloud_sec_tag_coap_jwt_get(void) +{ + return coap_jwt_sec_tag; +} +#endif /* CONFIG_NRF_CLOUD_COAP */ diff --git a/subsys/net/lib/nrf_provisioning/src/nrf_provisioning.c b/subsys/net/lib/nrf_provisioning/src/nrf_provisioning.c index 24df108f1d83..c2582f0d9766 100644 --- a/subsys/net/lib/nrf_provisioning/src/nrf_provisioning.c +++ b/subsys/net/lib/nrf_provisioning/src/nrf_provisioning.c @@ -493,7 +493,7 @@ int nrf_provisioning_schedule(void) /* To even the load on server side */ retry_s += spread_s; - LOG_DBG("Connecting in %llds", retry_s); + LOG_INF("Checking for provisioning commands in %llds seconds", retry_s); reschedule = false; return retry_s; diff --git a/subsys/net/openthread/Kconfig b/subsys/net/openthread/Kconfig index 722192c70a74..22d771f64101 100644 --- a/subsys/net/openthread/Kconfig +++ b/subsys/net/openthread/Kconfig @@ -33,7 +33,7 @@ endchoice config OPENTHREAD_NRF_SECURITY_PSA bool select NRF_SECURITY - select MBEDTLS_ENABLE_HEAP if !OPENTHREAD_COPROCESSOR_RCP + select MBEDTLS_ENABLE_HEAP if (!OPENTHREAD_COPROCESSOR_RCP && !BUILD_WITH_TFM && !PSA_SSF_CRYPTO_CLIENT) select MBEDTLS_TLS_LIBRARY if (OPENTHREAD_JOINER || OPENTHREAD_COMMISSIONER || OPENTHREAD_COAPS) select MBEDTLS_PEM_PARSE_C if (OPENTHREAD_COAPS || OPENTHREAD_BLE_TCAT) select PSA_WANT_ALG_HKDF @@ -121,7 +121,7 @@ config OPENTHREAD_MBEDTLS_DEBUG config OPENTHREAD_THREAD_STACK_SIZE int "OpenThread thread stack size" default 1224 if OPENTHREAD_COPROCESSOR_RCP - default 6752 if (OPENTHREAD_COMMISSIONER || OPENTHREAD_JOINER) && PSA_CRYPTO_DRIVER_CRACEN + default 7168 if (OPENTHREAD_COMMISSIONER || OPENTHREAD_JOINER) && PSA_CRYPTO_DRIVER_CRACEN default 6240 if (OPENTHREAD_COMMISSIONER || OPENTHREAD_JOINER) default 6144 if PSA_CRYPTO_DRIVER_CRACEN default 3168 diff --git a/subsys/net/openthread/Kconfig.defconfig b/subsys/net/openthread/Kconfig.defconfig index 8c46d6de81be..0a78cc50adff 100644 --- a/subsys/net/openthread/Kconfig.defconfig +++ b/subsys/net/openthread/Kconfig.defconfig @@ -19,7 +19,7 @@ config OPENTHREAD_LIBRARY_AVAILABLE # Switch: # - To `y` when libraries for the current OpenThread revision are provided # - To `n` on the next OpenThread upmerge - default n + default y depends on OPENTHREAD_THREAD_VERSION_1_3 || OPENTHREAD_THREAD_VERSION_1_4 depends on (OPENTHREAD_NORDIC_LIBRARY_MASTER && (SOC_NRF52840 || SOC_NRF54L15_CPUAPP)) || \ OPENTHREAD_NORDIC_LIBRARY_FTD || OPENTHREAD_NORDIC_LIBRARY_MTD @@ -30,20 +30,6 @@ choice OPENTHREAD_IMPLEMENTATION default OPENTHREAD_LIBRARY if OPENTHREAD_LIBRARY_AVAILABLE endchoice -if SOC_NRF54H20_CPUAPP - -#To be removed -config MBOX - bool - default y - -#To be removed -config MBOX_NRFX_IDS - bool - default y - -endif - choice LIBC_IMPLEMENTATION default NEWLIB_LIBC endchoice @@ -92,6 +78,9 @@ config NET_PKT_TX_COUNT default 4 if OPENTHREAD_COPROCESSOR_RCP default 16 +config OPENTHREAD_CLI_TCP_ENABLE + default n + config OPENTHREAD_DYNAMIC_STORE_FRAME_AHEAD_COUNTER bool default y @@ -101,8 +90,7 @@ config OPENTHREAD_MANUAL_START default y choice OPENTHREAD_SECURITY - default OPENTHREAD_NRF_SECURITY_PSA_CHOICE if (SOC_FAMILY_NORDIC_NRF && !SOC_NRF54H20_CPUAPP) - default OPENTHREAD_NRF_SECURITY_CHOICE if SOC_NRF54H20_CPUAPP + default OPENTHREAD_NRF_SECURITY_PSA_CHOICE if SOC_FAMILY_NORDIC_NRF endchoice config MBEDTLS_PROMPTLESS @@ -254,20 +242,6 @@ endif # OPENTHREAD_CSL_RECEIVER endif # !OPENTHREAD_THREAD_VERSION_1_1 -if OPENTHREAD_THREAD_VERSION_1_4 - -# Thread 1.4 dependencies -config OPENTHREAD_TCP_ENABLE - default y - -config OPENTHREAD_CLI_TCP_ENABLE - default n - -config OPENTHREAD_DNS_CLIENT_OVER_TCP - default y - -endif # OPENTHREAD_THREAD_VERSION_1_4 - if OPENTHREAD_COPROCESSOR_RCP config MBEDTLS_PSA_KEY_SLOT_COUNT diff --git a/subsys/net/openthread/rpc/Kconfig b/subsys/net/openthread/rpc/Kconfig index 157ca5cb4a0f..f2c5748e5cd4 100644 --- a/subsys/net/openthread/rpc/Kconfig +++ b/subsys/net/openthread/rpc/Kconfig @@ -24,7 +24,6 @@ choice OPENTHREAD_RPC_ROLE_CHOICE config OPENTHREAD_RPC_CLIENT bool "OpenThread over RPC client" - depends on NETWORKING help Enables OpenThread over RPC client role that uses nRF RPC library to invoke OpenThread functions on the remote core. @@ -39,6 +38,15 @@ config OPENTHREAD_RPC_SERVER endchoice +config OPENTHREAD_RPC_NET_IF + bool "OpenThread over RPC network interface" + default y + depends on NETWORKING + help + Enables OpenThread RPC commands for sending and receiving IPv6 packets + to/from the OpenThread stack. For the RPC client role, it additionally + creates a Zephyr network interface that employs these commands. + menu "OpenThread over RPC client configuration" depends on OPENTHREAD_RPC_CLIENT diff --git a/subsys/net/openthread/rpc/client/CMakeLists.txt b/subsys/net/openthread/rpc/client/CMakeLists.txt index 159ad4553fb0..85675867cd0c 100644 --- a/subsys/net/openthread/rpc/client/CMakeLists.txt +++ b/subsys/net/openthread/rpc/client/CMakeLists.txt @@ -11,7 +11,6 @@ zephyr_library_sources( ot_rpc_coap.c ot_rpc_diag.c ot_rpc_dataset.c - ot_rpc_if.c ot_rpc_instance.c ot_rpc_ip6.c ot_rpc_link.c @@ -22,6 +21,8 @@ zephyr_library_sources( ot_rpc_udp.c ) +zephyr_library_sources_ifdef(CONFIG_OPENTHREAD_RPC_NET_IF ot_rpc_if.c) + zephyr_library_include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/../common ) diff --git a/subsys/net/openthread/rpc/client/ot_rpc_if.c b/subsys/net/openthread/rpc/client/ot_rpc_if.c index 171d41e09926..c49b639f336b 100644 --- a/subsys/net/openthread/rpc/client/ot_rpc_if.c +++ b/subsys/net/openthread/rpc/client/ot_rpc_if.c @@ -159,26 +159,23 @@ static int ot_rpc_l2_enable(struct net_if *iface, bool state) { const size_t cbor_buffer_size = 1; struct nrf_rpc_cbor_ctx ctx; - int error = 0; - - const otExtAddress *mac = otLinkGetExtendedAddress(0); if (!state) { otRemoveStateChangeCallback(NULL, ot_state_changed_handler, iface); } - net_if_set_link_addr(iface, (uint8_t *)mac->m8, 8, NET_LINK_IEEE802154); - NRF_RPC_CBOR_ALLOC(&ot_group, ctx, cbor_buffer_size); zcbor_bool_put(ctx.zs, state); nrf_rpc_cbor_cmd_no_err(&ot_group, OT_RPC_CMD_IF_ENABLE, &ctx, ot_rpc_decode_void, NULL); if (state) { + net_if_set_link_addr(iface, (uint8_t *)otLinkGetExtendedAddress(NULL)->m8, + OT_EXT_ADDRESS_SIZE, NET_LINK_IEEE802154); update_netif_addrs(iface); otSetStateChangedCallback(NULL, ot_state_changed_handler, iface); } - return error; + return 0; } static enum net_l2_flags ot_rpc_l2_flags(struct net_if *iface) @@ -195,7 +192,6 @@ static int ot_rpc_dev_init(const struct device *dev) static void ot_rpc_if_init(struct net_if *iface) { - /* TODO: auto-start the interface when nRF RPC transport is ready? */ net_if_flag_set(iface, NET_IF_NO_AUTO_START); net_if_flag_set(iface, NET_IF_IPV6_NO_ND); net_if_flag_set(iface, NET_IF_IPV6_NO_MLD); diff --git a/subsys/net/openthread/rpc/client/ot_rpc_thread.c b/subsys/net/openthread/rpc/client/ot_rpc_thread.c index b86607063fb7..e21d3416235a 100644 --- a/subsys/net/openthread/rpc/client/ot_rpc_thread.c +++ b/subsys/net/openthread/rpc/client/ot_rpc_thread.c @@ -145,7 +145,7 @@ otDeviceRole otThreadGetDeviceRole(otInstance *aInstance) otError otThreadSetLinkMode(otInstance *aInstance, otLinkModeConfig aConfig) { struct nrf_rpc_cbor_ctx ctx; - uint8_t mode_mask; + uint8_t mode_mask = 0; ARG_UNUSED(aInstance); diff --git a/subsys/net/openthread/rpc/server/CMakeLists.txt b/subsys/net/openthread/rpc/server/CMakeLists.txt index 1eeffb0cb41d..968a885d7ee7 100644 --- a/subsys/net/openthread/rpc/server/CMakeLists.txt +++ b/subsys/net/openthread/rpc/server/CMakeLists.txt @@ -19,11 +19,12 @@ zephyr_library_sources( ) zephyr_library_sources_ifdef(CONFIG_NET_L2_OPENTHREAD - ot_rpc_if.c ot_rpc_diag.c ot_rpc_udp.c ) +zephyr_library_sources_ifdef(CONFIG_OPENTHREAD_RPC_NET_IF ot_rpc_if.c) + zephyr_library_include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/../common ) diff --git a/subsys/net/openthread/settings_check/CMakeLists.txt b/subsys/net/openthread/settings_check/CMakeLists.txt new file mode 100644 index 000000000000..289ff415bdd4 --- /dev/null +++ b/subsys/net/openthread/settings_check/CMakeLists.txt @@ -0,0 +1,23 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# This script checks if NVS settings backend is used with nRF54L SoC target and prints +# the warning that the recommended backend is ZMS due to the RRAM design. + +if (CONFIG_SOC_SERIES_NRF54LX AND CONFIG_SETTINGS_NVS) + message(WARNING " ###################################################################################\n" + " # #\n" + " # Your application uses NVS backend for the settings storage that is not #\n" + " # optimal solution for the nRF54L SoC family and it may negatively impact #\n" + " # the non-volatile RRAM life-time. #\n" + " # #\n" + " # The recommended settings backend for nRF54L SoC family is ZMS. #\n" + " # You can enable it by selecting CONFIG_SETTINGS_ZMS=y and CONFIG_ZMS=y. #\n" + " # Please note that the other Kconfig options related to NVS like cache #\n" + " # or block size will require alignment on the ZMS side as well. #\n" + " # #\n" + " ###################################################################################\n") +endif() diff --git a/subsys/nrf_rpc/Kconfig b/subsys/nrf_rpc/Kconfig index 7ecc4d13996a..95df5beb182a 100644 --- a/subsys/nrf_rpc/Kconfig +++ b/subsys/nrf_rpc/Kconfig @@ -84,6 +84,29 @@ config NRF_RPC_UART_RX_THREAD_STACK_SIZE thread is responsible for consuming data received over the UART, and passing decoded nRF RPC packets to the nRF RPC core. +config NRF_RPC_UART_RELIABLE + bool "UART reliability" + help + Enables acknowledgment functionality for each frame sent over UART. + +if NRF_RPC_UART_RELIABLE + +config NRF_RPC_UART_ACK_WAITING_TIME + int "Time window to receive acknowledgment" + default 50 + help + Defines time in milliseconds during which the device waits + for acknowledgment for sent data. + +config NRF_RPC_UART_TX_ATTEMPTS + int "Number of transmitting attempts" + default 3 + help + Number of transmitting attempts, after which sender gives up if + acknowledgment has not been received yet. + +endif # NRF_RPC_UART_RELIABLE + endmenu # "nRF RPC over UART configuration" config NRF_RPC_CBOR diff --git a/subsys/nrf_rpc/nrf_rpc_uart.c b/subsys/nrf_rpc/nrf_rpc_uart.c index 867fba52e318..2f6e8f59271b 100644 --- a/subsys/nrf_rpc/nrf_rpc_uart.c +++ b/subsys/nrf_rpc/nrf_rpc_uart.c @@ -22,6 +22,17 @@ enum { HDLC_CHAR_DELIMITER = 0x7e, }; +enum flip_state { + FLIP_ZERO, + FLIP_ONE, + FLIP_ANY +}; + +struct trx_flips { + uint8_t tx_flip : 2; + uint8_t rx_flip : 2; +}; + typedef enum { HDLC_STATE_UNSYNC, HDLC_STATE_FRAME_START, @@ -50,13 +61,102 @@ struct nrf_rpc_uart { uint8_t rx_packet[CONFIG_NRF_RPC_UART_MAX_PACKET_SIZE]; size_t rx_packet_len; + /* Ack waiting semaphore */ + struct k_sem ack_sem; + uint16_t ack_payload; + struct k_mutex ack_tx_lock; + struct trx_flips flips; + /* TX lock */ struct k_mutex tx_lock; }; #define CRC_SIZE sizeof(uint16_t) -static int hdlc_decode_byte(struct nrf_rpc_uart *uart_tr, uint8_t byte) +static void send_byte(const struct device *dev, uint8_t byte); + +static void ack_rx(struct nrf_rpc_uart *uart_tr) +{ + if (!IS_ENABLED(CONFIG_NRF_RPC_UART_RELIABLE)) { + return; + } + + if (uart_tr->rx_packet_len == CRC_SIZE) { + uart_tr->ack_payload = sys_get_le16(uart_tr->rx_packet); + k_sem_give(&uart_tr->ack_sem); + k_yield(); + } +} + +static void ack_tx(struct nrf_rpc_uart *uart_tr, uint16_t ack_pld) +{ + uint8_t ack[2]; + + if (!IS_ENABLED(CONFIG_NRF_RPC_UART_RELIABLE)) { + return; + } + + sys_put_le16(ack_pld, ack); + k_mutex_lock(&uart_tr->ack_tx_lock, K_FOREVER); + LOG_HEXDUMP_DBG(ack, sizeof(ack), "Tx ack"); + + uart_poll_out(uart_tr->uart, HDLC_CHAR_DELIMITER); + + send_byte(uart_tr->uart, ack[0]); + send_byte(uart_tr->uart, ack[1]); + + uart_poll_out(uart_tr->uart, HDLC_CHAR_DELIMITER); + + k_mutex_unlock(&uart_tr->ack_tx_lock); +} + +static uint16_t tx_flip(struct nrf_rpc_uart *uart_tr, uint16_t crc_val) +{ + if (!IS_ENABLED(CONFIG_NRF_RPC_UART_RELIABLE)) { + return crc_val; + } + + if (uart_tr->flips.tx_flip == FLIP_ZERO) { + crc_val &= 0x7fffu; + uart_tr->flips.tx_flip = FLIP_ONE; + } else { + crc_val |= 0x8000u; + uart_tr->flips.tx_flip = FLIP_ZERO; + } + + return crc_val; +} + +static bool rx_flip_check(struct nrf_rpc_uart *uart_tr, uint16_t crc_val) +{ + if (!IS_ENABLED(CONFIG_NRF_RPC_UART_RELIABLE)) { + return false; + } + + if (uart_tr->flips.rx_flip == FLIP_ZERO && (crc_val & 0x8000u) == 0) { + uart_tr->flips.rx_flip = FLIP_ONE; + return false; + } else if (uart_tr->flips.rx_flip == FLIP_ONE && (crc_val & 0x8000u) == 0x8000u) { + uart_tr->flips.rx_flip = FLIP_ZERO; + return false; + } else if (uart_tr->flips.rx_flip == FLIP_ANY) { + uart_tr->flips.rx_flip = crc_val & 0x8000u ? FLIP_ZERO : FLIP_ONE; + return false; + } + + return true; +} + +static bool crc_compare(uint16_t rx_crc, uint16_t calc_crc) +{ + if (IS_ENABLED(CONFIG_NRF_RPC_UART_RELIABLE)) { + return (rx_crc & 0x7fffu) == (calc_crc & 0x7fffu); + } + + return rx_crc == calc_crc; +} + +static void hdlc_decode_byte(struct nrf_rpc_uart *uart_tr, uint8_t byte) { /* TODO: handle frame buffer overflow */ @@ -79,12 +179,11 @@ static int hdlc_decode_byte(struct nrf_rpc_uart *uart_tr, uint8_t byte) if (uart_tr->rx_packet_len > CRC_SIZE) { uart_tr->rx_packet_len -= CRC_SIZE; } else { + ack_rx(uart_tr); uart_tr->rx_packet_len = 0; uart_tr->hdlc_state = HDLC_STATE_UNSYNC; } } - - return 0; } static void work_handler(struct k_work *work) @@ -101,9 +200,7 @@ static void work_handler(struct k_work *work) len = ring_buf_get_claim(&uart_tr->rx_ringbuf, &data, CONFIG_NRF_RPC_UART_MAX_PACKET_SIZE); for (size_t i = 0; i < len; i++) { - if (hdlc_decode_byte(uart_tr, data[i]) != 0) { - continue; - } + hdlc_decode_byte(uart_tr, data[i]); if (uart_tr->hdlc_state != HDLC_STATE_FRAME_FOUND) { continue; @@ -112,16 +209,24 @@ static void work_handler(struct k_work *work) crc_received = sys_get_le16(uart_tr->rx_packet + uart_tr->rx_packet_len); crc_calculated = crc16_ccitt(0xffff, uart_tr->rx_packet, uart_tr->rx_packet_len); - if (crc_calculated != crc_received) { - LOG_ERR("Invalid CRC, calculated %x received %x", crc_calculated, + if (!crc_compare(crc_received, crc_calculated)) { + LOG_ERR("Invalid CRC, calculated %4x received %4x", crc_calculated, crc_received); uart_tr->rx_packet_len = 0; uart_tr->hdlc_state = HDLC_STATE_UNSYNC; return; } - uart_tr->receive_callback(transport, uart_tr->rx_packet, - uart_tr->rx_packet_len, uart_tr->receive_ctx); + ack_tx(uart_tr, crc_received); + + if (rx_flip_check(uart_tr, crc_received)) { + LOG_WRN("Duplicated frame was filtered (crc:%#4x)", crc_received); + } else { + uart_tr->receive_callback(transport, uart_tr->rx_packet, + uart_tr->rx_packet_len, + uart_tr->receive_ctx); + } + uart_tr->rx_packet_len = 0; uart_tr->hdlc_state = HDLC_STATE_UNSYNC; } @@ -210,6 +315,13 @@ static int init(const struct nrf_rpc_tr *transport, nrf_rpc_tr_receive_handler_t k_mutex_init(&uart_tr->tx_lock); + if (IS_ENABLED(CONFIG_NRF_RPC_UART_RELIABLE)) { + k_mutex_init(&uart_tr->ack_tx_lock); + k_sem_init(&uart_tr->ack_sem, 0, 1); + uart_tr->flips.tx_flip = FLIP_ZERO; + uart_tr->flips.rx_flip = FLIP_ANY; + } + k_work_queue_init(&uart_tr->rx_workq); k_work_queue_start(&uart_tr->rx_workq, uart_tr->rx_workq_stack, K_THREAD_STACK_SIZEOF(uart_tr->rx_workq_stack), K_PRIO_PREEMPT(0), NULL); @@ -237,29 +349,62 @@ static void send_byte(const struct device *dev, uint8_t byte) static int send(const struct nrf_rpc_tr *transport, const uint8_t *data, size_t length) { uint8_t crc[2]; + uint16_t crc_val; + bool acked = true; struct nrf_rpc_uart *uart_tr = transport->ctx; + k_mutex_lock(&uart_tr->tx_lock, K_FOREVER); + LOG_HEXDUMP_DBG(data, length, "Sending frame"); - k_mutex_lock(&uart_tr->tx_lock, K_FOREVER); +#if CONFIG_NRF_RPC_UART_RELIABLE + int attempts = 0; - uart_poll_out(uart_tr->uart, HDLC_CHAR_DELIMITER); + acked = false; - for (size_t i = 0; i < length; i++) { - send_byte(uart_tr->uart, data[i]); - } + do { + attempts++; + k_mutex_lock(&uart_tr->ack_tx_lock, K_FOREVER); + k_sem_reset(&uart_tr->ack_sem); +#endif /* CONFIG_NRF_RPC_UART_RELIABLE */ - sys_put_le16(crc16_ccitt(0xffff, data, length), crc); - send_byte(uart_tr->uart, crc[0]); - send_byte(uart_tr->uart, crc[1]); + uart_poll_out(uart_tr->uart, HDLC_CHAR_DELIMITER); - uart_poll_out(uart_tr->uart, HDLC_CHAR_DELIMITER); + for (size_t i = 0; i < length; i++) { + send_byte(uart_tr->uart, data[i]); + } + + crc_val = crc16_ccitt(0xffff, data, length); + crc_val = tx_flip(uart_tr, crc_val); + sys_put_le16(crc_val, crc); + send_byte(uart_tr->uart, crc[0]); + send_byte(uart_tr->uart, crc[1]); + + uart_poll_out(uart_tr->uart, HDLC_CHAR_DELIMITER); + +#if CONFIG_NRF_RPC_UART_RELIABLE + k_mutex_unlock(&uart_tr->ack_tx_lock); + if (k_sem_take(&uart_tr->ack_sem, K_MSEC(CONFIG_NRF_RPC_UART_ACK_WAITING_TIME)) == + 0) { + acked = uart_tr->ack_payload == crc_val; + if (!acked) { + LOG_WRN("Wrong ack. Expected: %#4x. Received: %#4x.", crc_val, + uart_tr->ack_payload); + } else { + LOG_DBG("Acked successfully."); + } + } else { + LOG_WRN("Ack timeout expired."); + } + + } while (!acked && attempts < CONFIG_NRF_RPC_UART_TX_ATTEMPTS); +#endif /* CONFIG_NRF_RPC_UART_RELIABLE */ k_free((void *)data); k_mutex_unlock(&uart_tr->tx_lock); - return 0; + return acked ? 0 : -EPROTO; } static void *tx_buf_alloc(const struct nrf_rpc_tr *transport, size_t *size) diff --git a/subsys/nrf_security/CMakeLists.txt b/subsys/nrf_security/CMakeLists.txt index 3574fe3d3da2..ba2ae96196a2 100644 --- a/subsys/nrf_security/CMakeLists.txt +++ b/subsys/nrf_security/CMakeLists.txt @@ -117,8 +117,7 @@ target_compile_definitions(psa_crypto_library_config # The name and intent of this comes from TF-M distribution add_library(psa_interface INTERFACE) -# In nRF54L this configuration is required for the HUK keys to work -if(CONFIG_SOC_SERIES_NRF54LX AND (CONFIG_HW_UNIQUE_KEY OR CONFIG_IDENTITY_KEY)) +if(CONFIG_MBEDTLS_ENABLE_BUILTIN_KEYS) # Add config files required for PSA crypto interface target_compile_definitions(psa_interface INTERFACE diff --git a/subsys/nrf_security/Kconfig b/subsys/nrf_security/Kconfig index d1c3097522b5..f797de96fedc 100644 --- a/subsys/nrf_security/Kconfig +++ b/subsys/nrf_security/Kconfig @@ -53,6 +53,13 @@ config PSA_PROMPTLESS if NRF_SECURITY +config MBEDTLS_ENABLE_BUILTIN_KEYS + bool + default y if SOC_SERIES_NRF54LX && (HW_UNIQUE_KEY || IDENTITY_KEY) + default y if SOC_SERIES_NRF54HX && (SOC_NRF54H20_CPUSEC) + help + Promptless option used to control if MBEDTLS should have support for builtin keys or not. + config MBEDTLS_CFG_FILE string "mbed TLS configuration file" default "nrf-config.h" diff --git a/subsys/nrf_security/Kconfig.legacy b/subsys/nrf_security/Kconfig.legacy index fdfa8f8cd0df..101dc9561111 100644 --- a/subsys/nrf_security/Kconfig.legacy +++ b/subsys/nrf_security/Kconfig.legacy @@ -21,8 +21,13 @@ config MBEDTLS_MEMORY_BUFFER_ALLOC_C default y config MBEDTLS_THREADING_C - bool + bool "Threading support for Mbed TLS and PSA crypto" default y if CC3XX_BACKEND || MBEDTLS_PSA_CRYPTO_C + help + Threading support is used when PSA crypto is built locally or + when legacy APIs implemented using CryptoCell is in use. + Note: If this configuration is disabled then PSA crypto APIs + aren't thread-safe. This configuration is not used when TF-M is enabled. config MBEDTLS_BASE64_C bool @@ -66,6 +71,7 @@ config MBEDTLS_THREADING_ALT bool default y if CC3XX_BACKEND || MBEDTLS_PSA_CRYPTO_C depends on !BUILD_WITH_TFM + depends on MBEDTLS_THREADING_C # Legacy configurations for _ALT defines config MBEDTLS_AES_SETKEY_ENC_ALT diff --git a/subsys/nrf_security/src/drivers/cracen/Kconfig b/subsys/nrf_security/src/drivers/cracen/Kconfig index 31d22598c23b..577c910b3657 100644 --- a/subsys/nrf_security/src/drivers/cracen/Kconfig +++ b/subsys/nrf_security/src/drivers/cracen/Kconfig @@ -16,7 +16,7 @@ if PSA_CRYPTO_DRIVER_CRACEN config CRACEN_LOAD_MICROCODE bool - depends on SOC_SERIES_NRF54LX || SOC_SERIES_NRF54HX + depends on (SOC_SERIES_NRF54LX && !SOC_NRF54L20) || SOC_SERIES_NRF54HX default y help Prompt-less configuration to load the CRACEN microcode. diff --git a/subsys/nrf_security/src/drivers/cracen/common/include/cracen/lib_kmu.h b/subsys/nrf_security/src/drivers/cracen/common/include/cracen/lib_kmu.h index 423a521ac387..2a10cdeac751 100644 --- a/subsys/nrf_security/src/drivers/cracen/common/include/cracen/lib_kmu.h +++ b/subsys/nrf_security/src/drivers/cracen/common/include/cracen/lib_kmu.h @@ -58,7 +58,7 @@ enum lib_kmu_rev_policy { /** * @brief Source struct for KMU slot provisioning. */ -struct kmu_src_t { +struct kmu_src { /** Asset contents/value. */ uint32_t value[4]; /** Revocation policy. */ @@ -66,7 +66,7 @@ struct kmu_src_t { /** 32-bit destination address. Cannot point to SICR and must be on a * 128-bit boundary. */ - uint8_t *dest; + uint32_t dest; /** 32 bits of any clear-text metadata that belongs with the key slot. */ uint32_t metadata; @@ -81,7 +81,7 @@ struct kmu_src_t { * @return -LIB_KMU_ERROR If the operation returned an error. * @return -LIB_KMU_NULL_POINTER If the KMU source is NULL. */ -int lib_kmu_provision_slot(int slot_id, struct kmu_src_t *kmu_src); +int lib_kmu_provision_slot(int slot_id, struct kmu_src *kmu_src); /** @brief Push the KMU slot to its destination address. * diff --git a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/blkcipher.c b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/blkcipher.c index 61df8592892a..f148e68e4ce6 100644 --- a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/blkcipher.c +++ b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/blkcipher.c @@ -401,7 +401,6 @@ psa_status_t cracen_cipher_update(cracen_cipher_operation_t *operation, const ui size_t *output_length) { __ASSERT_NO_MSG(input != NULL || input_length == 0); - __ASSERT_NO_MSG(output != NULL); __ASSERT_NO_MSG(output_length != NULL); int sx_status = SX_ERR_UNINITIALIZED_OBJ; @@ -412,7 +411,7 @@ psa_status_t cracen_cipher_update(cracen_cipher_operation_t *operation, const ui return PSA_SUCCESS; } - if (output_size < input_length + operation->unprocessed_input_bytes) { + if (output == NULL || output_size < input_length + operation->unprocessed_input_bytes) { return PSA_ERROR_BUFFER_TOO_SMALL; } 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 f47c78dd9ea6..b9624f5d0dd1 100644 --- a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/kmu.c +++ b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/kmu.c @@ -27,6 +27,8 @@ */ #define PROVISIONING_SLOT 250 +#define SECONDARY_SLOT_METADATA_VALUE UINT32_MAX + extern mbedtls_threading_mutex_t cracen_mutex_symmetric; /* The section .nrf_kmu_reserved_push_area is placed at the top RAM address @@ -236,13 +238,27 @@ int cracen_kmu_clean_key(const uint8_t *user_data) * @brief Checks whether this is the secondary slot. If true, the metadata resides in * one of the previous slots; */ -bool is_secondary_slot(kmu_metadata *metadata) +static bool is_secondary_slot(kmu_metadata *metadata) { - uint32_t value = 0xffffffff; + const uint32_t value = SECONDARY_SLOT_METADATA_VALUE; + _Static_assert(sizeof(value) == sizeof(*metadata)); return memcmp(&value, metadata, sizeof(value)) == 0; } +static psa_status_t read_primary_slot_metadata(unsigned int slot_id, kmu_metadata *metadata) +{ + const int kmu_status = lib_kmu_read_metadata(slot_id, (uint32_t *)metadata); + + if (kmu_status == -LIB_KMU_REVOKED) { + return PSA_ERROR_NOT_PERMITTED; + } + if (kmu_status == -LIB_KMU_ERROR || is_secondary_slot(metadata)) { + return PSA_ERROR_DOES_NOT_EXIST; + } + return PSA_SUCCESS; +} + static bool can_sign(const psa_key_attributes_t *key_attr) { return (psa_get_key_usage_flags(key_attr) & PSA_KEY_USAGE_SIGN_MESSAGE) || @@ -292,7 +308,7 @@ static psa_status_t clean_up_unfinished_provisioning(void) */ static psa_status_t set_provisioning_in_progress(uint32_t slot_id, uint32_t num_slots) { - struct kmu_src_t kmu_desc = {}; + struct kmu_src kmu_desc = {}; kmu_desc.metadata = slot_id << 8 | num_slots; kmu_desc.rpolicy = LIB_KMU_REV_POLICY_ROTATING; @@ -700,6 +716,10 @@ psa_status_t cracen_kmu_provision(const psa_key_attributes_t *key_attr, int slot switch (metadata.key_usage_scheme) { case CRACEN_KMU_KEY_USAGE_SCHEME_PROTECTED: + /* Only AES keys are supported. */ + if (psa_get_key_type(key_attr) != PSA_KEY_TYPE_AES) { + return PSA_ERROR_NOT_SUPPORTED; + } push_address = (uint8_t *)CRACEN_PROTECTED_RAM_AES_KEY0; /* Only 128, 192 and 256 bit keys are supported. */ if (key_buffer_size != 16 && key_buffer_size != 24 && key_buffer_size != 32) { @@ -756,13 +776,14 @@ psa_status_t cracen_kmu_provision(const psa_key_attributes_t *key_attr, int slot } } - struct kmu_src_t kmu_desc = {}; + struct kmu_src kmu_desc = {}; for (size_t i = 0; i < num_slots; i++) { - kmu_desc.dest = push_address + (CRACEN_KMU_SLOT_KEY_SIZE * i); - kmu_desc.metadata = UINT32_MAX; + kmu_desc.dest = (uint32_t)push_address + (CRACEN_KMU_SLOT_KEY_SIZE * i); if (i == 0) { - memcpy(&kmu_desc.metadata, &metadata, sizeof(metadata)); + memcpy(&kmu_desc.metadata, &metadata, sizeof(kmu_desc.metadata)); + } else { + kmu_desc.metadata = SECONDARY_SLOT_METADATA_VALUE; } kmu_desc.rpolicy = metadata.rpolicy; memcpy(kmu_desc.value, key_buffer + CRACEN_KMU_SLOT_KEY_SIZE * i, @@ -792,18 +813,12 @@ psa_status_t cracen_kmu_provision(const psa_key_attributes_t *key_attr, int slot psa_status_t cracen_kmu_get_key_slot(mbedtls_svc_key_id_t key_id, psa_key_lifetime_t *lifetime, psa_drv_slot_number_t *slot_number) { - kmu_metadata metadata; - unsigned int slot_id = CRACEN_PSA_GET_KMU_SLOT(MBEDTLS_SVC_KEY_ID_GET_KEY_ID(key_id)); + kmu_metadata metadata; + const psa_status_t ret = read_primary_slot_metadata(slot_id, &metadata); - int kmu_status = lib_kmu_read_metadata((int)slot_id, (uint32_t *)&metadata); - - if (kmu_status == -LIB_KMU_REVOKED) { - return PSA_ERROR_NOT_PERMITTED; - } - - if (kmu_status == -LIB_KMU_ERROR || is_secondary_slot(&metadata)) { - return PSA_ERROR_DOES_NOT_EXIST; + if (ret != PSA_SUCCESS) { + return ret; } psa_key_persistence_t read_only = metadata.rpolicy == LIB_KMU_REV_POLICY_ROTATING @@ -845,18 +860,13 @@ psa_status_t cracen_kmu_get_builtin_key(psa_drv_slot_number_t slot_number, size_t key_buffer_size, size_t *key_buffer_length) { kmu_metadata metadata; - int kmu_status = lib_kmu_read_metadata((int)slot_number, (uint32_t *)&metadata); - - if (kmu_status == -LIB_KMU_REVOKED) { - return PSA_ERROR_NOT_PERMITTED; - } + psa_status_t status = read_primary_slot_metadata(slot_number, &metadata); - if (kmu_status == -LIB_KMU_ERROR || is_secondary_slot(&metadata)) { - return PSA_ERROR_DOES_NOT_EXIST; + if (status != PSA_SUCCESS) { + return status; } - psa_status_t status = clean_up_unfinished_provisioning(); - + status = clean_up_unfinished_provisioning(); if (status != PSA_SUCCESS) { return status; } diff --git a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/lib_kmu.c b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/lib_kmu.c index 18b519791258..d5db9789bb88 100644 --- a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/lib_kmu.c +++ b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/lib_kmu.c @@ -12,10 +12,7 @@ #include -#if !defined(__NRF_TFM__) -#include #include -#endif #include @@ -65,7 +62,7 @@ static int trigger_task_and_wait_for_event_or_error(volatile uint32_t *task, return result; } -int lib_kmu_provision_slot(int slot_id, struct kmu_src_t *kmu_src) +int lib_kmu_provision_slot(int slot_id, struct kmu_src *kmu_src) { if (kmu_src == NULL) { return -LIB_KMU_NULL_PNT; @@ -80,7 +77,15 @@ int lib_kmu_provision_slot(int slot_id, struct kmu_src_t *kmu_src) int result = 1; -#if !defined(__NRF_TFM__) +#if defined(__NRF_TFM__) + nrf_rramc_config_t rramc_config; + + nrf_rramc_config_get(NRF_RRAMC_S, &rramc_config); + const uint8_t orig_write_buf_size = rramc_config.write_buff_size; + + rramc_config.write_buff_size = 0; + nrf_rramc_config_set(NRF_RRAMC_S, &rramc_config); +#else nrfx_rramc_write_enable_set(true, 0); #endif @@ -90,7 +95,10 @@ int lib_kmu_provision_slot(int slot_id, struct kmu_src_t *kmu_src) result = trigger_task_and_wait_for_event_or_error(&(NRF_KMU_S->TASKS_PROVISION), &(NRF_KMU_S->EVENTS_PROVISIONED)); -#if !defined(__NRF_TFM__) +#if defined(__NRF_TFM__) + rramc_config.write_buff_size = orig_write_buf_size; + nrf_rramc_config_set(NRF_RRAMC_S, &rramc_config); +#else nrfx_rramc_write_enable_set(false, 0); #endif diff --git a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/platform_keys/platform_keys.c b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/platform_keys/platform_keys.c index 59ad5a8785c0..db38e88c0d0a 100644 --- a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/platform_keys/platform_keys.c +++ b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/platform_keys/platform_keys.c @@ -607,6 +607,7 @@ psa_status_t cracen_platform_keys_provision(const psa_key_attributes_t *attribut key.sicr.type = psa_get_key_type(attributes); key.sicr.bits = psa_get_key_bits(attributes); + /* Generate the 4 first bytes of the nonce, the rest are padded with zeros */ status = psa_generate_random((uint8_t *)key.sicr.nonce, sizeof(key.sicr.nonce[0])); if (status != PSA_SUCCESS) { return status; @@ -662,6 +663,7 @@ psa_status_t cracen_platform_keys_provision(const psa_key_attributes_t *attribut NRF_MRAMC_Type *mramc = (NRF_MRAMC_Type *)DT_REG_ADDR(DT_NODELABEL(mramc)); nrf_mramc_config_t mramc_config, mramc_config_write_enabled; + nrf_mramc_readynext_timeout_t readynext_timeout, short_readynext_timeout; nrf_mramc_config_get(mramc, &mramc_config); mramc_config_write_enabled = mramc_config; @@ -671,7 +673,6 @@ psa_status_t cracen_platform_keys_provision(const psa_key_attributes_t *attribut nrf_mramc_config_set(mramc, &mramc_config_write_enabled); - memcpy(key.sicr.nonce_addr, &key.sicr.nonce, sizeof(key.sicr.nonce)); memcpy(key.sicr.attr_addr, &attr, sizeof(attr)); if (key.sicr.type == PSA_KEY_TYPE_AES) { memcpy(key.sicr.key_buffer, encrypted_key, key_buffer_size); @@ -679,8 +680,19 @@ psa_status_t cracen_platform_keys_provision(const psa_key_attributes_t *attribut memcpy(key.sicr.key_buffer, key_buffer, key_buffer_size); } + nrf_mramc_readynext_timeout_get(mramc, &readynext_timeout); + + /* Ensure that nonce is committed to MRAM by setting MRAMC READYNEXT timeout to 0 */ + short_readynext_timeout.value = 0; + short_readynext_timeout.direct_write = true; + nrf_mramc_readynext_timeout_set(mramc, &short_readynext_timeout); + + /* Only store the 4 first bytes of the nonce, the rest are padded with zeros */ + memcpy(key.sicr.nonce_addr, &key.sicr.nonce, sizeof(key.sicr.nonce[0])); + /* Restore MRAMC config */ nrf_mramc_config_set(mramc, &mramc_config); + nrf_mramc_readynext_timeout_set(mramc, &readynext_timeout); return status; } diff --git a/subsys/nrf_security/src/psa_crypto_driver_wrappers.c b/subsys/nrf_security/src/psa_crypto_driver_wrappers.c index 0c6c5c30371f..7dd288646bfd 100644 --- a/subsys/nrf_security/src/psa_crypto_driver_wrappers.c +++ b/subsys/nrf_security/src/psa_crypto_driver_wrappers.c @@ -19,9 +19,9 @@ #if defined(MBEDTLS_PSA_CRYPTO_C) -#if defined(CONFIG_HW_UNIQUE_KEY_WRITE_ON_CRYPTO_INIT) && !defined(CONFIG_BUILD_WITH_TFM) +#if defined(CONFIG_HW_UNIQUE_KEY_WRITE_ON_CRYPTO_INIT) #include -#endif /* CONFIG_HW_UNIQUE_KEY_WRITE_ON_CRYPTO_INIT && !CONFIG_BUILD_WITH_TFM */ +#endif /* CONFIG_HW_UNIQUE_KEY_WRITE_ON_CRYPTO_INIT */ #if defined(MBEDTLS_PSA_CRYPTO_DRIVERS) @@ -139,7 +139,7 @@ psa_status_t prng_test_generate_random(uint8_t *output, size_t output_size); #endif -#if defined(CONFIG_HW_UNIQUE_KEY_WRITE_ON_CRYPTO_INIT) && !defined(CONFIG_BUILD_WITH_TFM) +#if defined(CONFIG_HW_UNIQUE_KEY_WRITE_ON_CRYPTO_INIT) static psa_status_t hw_unique_key_provisioning(void) { if (!hw_unique_key_are_any_written()) { @@ -152,7 +152,7 @@ static psa_status_t hw_unique_key_provisioning(void) return PSA_SUCCESS; } -#endif /* CONFIG_HW_UNIQUE_KEY_WRITE_ON_CRYPTO_INIT && !CONFIG_BUILD_WITH_TFM */ +#endif /* CONFIG_HW_UNIQUE_KEY_WRITE_ON_CRYPTO_INIT */ psa_status_t psa_driver_wrapper_init(void) { @@ -173,12 +173,12 @@ 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) && !defined(CONFIG_BUILD_WITH_TFM) +#if defined(CONFIG_HW_UNIQUE_KEY_WRITE_ON_CRYPTO_INIT) status = hw_unique_key_provisioning(); if (status != PSA_SUCCESS) { return status; } -#endif /* CONFIG_HW_UNIQUE_KEY_WRITE_ON_CRYPTO_INIT && !CONFIG_BUILD_WITH_TFM */ +#endif /* CONFIG_HW_UNIQUE_KEY_WRITE_ON_CRYPTO_INIT */ return PSA_SUCCESS; } diff --git a/subsys/nrf_security/src/utils/nrf_security_utils.cmake b/subsys/nrf_security/src/utils/nrf_security_utils.cmake index 8f1ff4f5b7c9..d68358528528 100644 --- a/subsys/nrf_security/src/utils/nrf_security_utils.cmake +++ b/subsys/nrf_security/src/utils/nrf_security_utils.cmake @@ -35,7 +35,7 @@ else() # it seems to be to link with a full path instead. target_link_libraries(nrf_security_utils PRIVATE - ${CMAKE_BINARY_DIR}/zephyr/kernel/libkernel.a + ${Zephyr-Kernel_BINARY_DIR}/zephyr/kernel/libkernel.a ) endif() diff --git a/subsys/partition_manager/CMakeLists.txt b/subsys/partition_manager/CMakeLists.txt index 65d063e1347a..c69e54ca6962 100644 --- a/subsys/partition_manager/CMakeLists.txt +++ b/subsys/partition_manager/CMakeLists.txt @@ -60,7 +60,7 @@ if (CONFIG_BOARD_HAS_NRF5_BOOTLOADER) ncs_add_partition_manager_config(pm.yml.nrf5_mbr) endif() -if (CONFIG_SETTINGS_FCB OR CONFIG_SETTINGS_NVS) +if (CONFIG_SETTINGS_FCB OR CONFIG_SETTINGS_NVS OR CONFIG_SETTINGS_ZMS) ncs_add_partition_manager_config(pm.yml.settings) endif() @@ -76,6 +76,10 @@ if (CONFIG_NVS AND NOT CONFIG_SETTINGS_NVS) ncs_add_partition_manager_config(pm.yml.nvs) endif() +if (CONFIG_ZMS AND NOT CONFIG_SETTINGS_ZMS) + ncs_add_partition_manager_config(pm.yml.zms) +endif() + if (CONFIG_NRF_MODEM_LIB) ncs_add_partition_manager_config(pm.yml.libmodem) endif() diff --git a/subsys/partition_manager/Kconfig b/subsys/partition_manager/Kconfig index e6f397dba61b..8499886c3946 100644 --- a/subsys/partition_manager/Kconfig +++ b/subsys/partition_manager/Kconfig @@ -72,7 +72,7 @@ rsource "Kconfig.template.partition_region" endif -if SETTINGS_FCB || SETTINGS_NVS +if SETTINGS_FCB || SETTINGS_NVS || SETTINGS_ZMS partition=SETTINGS_STORAGE partition-size=0x2000 rsource "Kconfig.template.partition_config" @@ -94,6 +94,13 @@ rsource "Kconfig.template.partition_config" rsource "Kconfig.template.partition_region" endif +if ZMS && !SETTINGS_ZMS +partition=ZMS_STORAGE +partition-size=0x6000 +rsource "Kconfig.template.partition_config" +rsource "Kconfig.template.partition_region" +endif + if ZIGBEE && !SOC_NRF52833 partition=ZBOSS_NVRAM partition-size=0x8000 @@ -245,4 +252,10 @@ config PM_SRAM_SIZE default 0x40000 if SOC_NRF54L15_CPUFLPR # Because the cpuapp_rram DT node is deleted in nrf54l15_cpuflpr.dtsi default $(dt_node_reg_size_hex,/soc/memory@20000000) +config PM_USE_CONFIG_SRAM_SIZE + bool + help + Hidden option that, if set, will use the Kconfig value of PM_SRAM_SIZE for the SRAM size + value instead of the partition-manager project generated output value + endmenu # Partition Manager diff --git a/subsys/partition_manager/pm.yml.tfm b/subsys/partition_manager/pm.yml.tfm index 0f4a63dfb3e0..16da64d82872 100644 --- a/subsys/partition_manager/pm.yml.tfm +++ b/subsys/partition_manager/pm.yml.tfm @@ -26,7 +26,7 @@ tfm_storage: # In nRF54L15 we place the tfm_storage partitions before the # TF-M non-secure application to avoid splitting the secure/non-secure # partitions more than necessary. -#if defined(CONFIG_SOC_NRF54L15_ENGA_CPUAPP) || defined(CONFIG_SOC_NRF54L15_CPUAPP) +#if defined(CONFIG_SOC_NRF54L15_CPUAPP) tfm_ps: placement: @@ -81,7 +81,7 @@ tfm_otp_nv_counters: inside: tfm_storage size: CONFIG_PM_PARTITION_SIZE_TFM_OTP_NV_COUNTERS -#endif /* (CONFIG_SOC_NRF54L15_ENGA_CPUAPP || CONFIG_SOC_NRF54L15_CPUAPP)*/ +#endif /* CONFIG_SOC_NRF54L15_CPUAPP */ #endif /* CONFIG_PM_PARTITION_TFM_STORAGE */ diff --git a/subsys/partition_manager/pm.yml.zms b/subsys/partition_manager/pm.yml.zms new file mode 100644 index 000000000000..43f475cba253 --- /dev/null +++ b/subsys/partition_manager/pm.yml.zms @@ -0,0 +1,33 @@ +#include + +# In nRF54L15 we place the TF-M non-secure storage partitions after the +# TF-M non-secure application to avoid splitting the secure/non-secure +# partitions more than necessary. +#if defined(CONFIG_SOC_NRF54L15_ENGA_CPUAPP) || defined(CONFIG_SOC_NRF54L15_CPUAPP) +zms_storage: + placement: + after: [app] + before: [end] +#ifdef CONFIG_PM_PARTITION_REGION_ZMS_STORAGE_EXTERNAL + region: external_flash +#else + inside: [nonsecure_storage] +#endif + size: CONFIG_PM_PARTITION_SIZE_ZMS_STORAGE + + +#else +zms_storage: + placement: + before: [tfm_storage, end] +#ifdef CONFIG_PM_PARTITION_REGION_ZMS_STORAGE_EXTERNAL + region: external_flash +#else +#ifdef CONFIG_BUILD_WITH_TFM + align: {start: CONFIG_NRF_TRUSTZONE_FLASH_REGION_SIZE} +#endif + inside: [nonsecure_storage] +#endif + size: CONFIG_PM_PARTITION_SIZE_ZMS_STORAGE + +#endif /* (CONFIG_SOC_NRF54L15_ENGA_CPUAPP || CONFIG_SOC_NRF54L15_CPUAPP) */ diff --git a/subsys/sdfw_services/transport/Kconfig b/subsys/sdfw_services/transport/Kconfig index efc5cc1964b1..8de6827e4ace 100644 --- a/subsys/sdfw_services/transport/Kconfig +++ b/subsys/sdfw_services/transport/Kconfig @@ -8,7 +8,6 @@ config SSF_NRF_RPC bool default y imply NRF_RPC - imply MBOX_NRFX_IDS if SSF_NRF_RPC rsource "nrf_rpc/Kconfig" diff --git a/subsys/suit/envelope_info/include/suit_envelope_info.h b/subsys/suit/envelope_info/include/suit_envelope_info.h index a206dae914f4..a70a447dc35e 100644 --- a/subsys/suit/envelope_info/include/suit_envelope_info.h +++ b/subsys/suit/envelope_info/include/suit_envelope_info.h @@ -33,6 +33,13 @@ suit_plat_err_t suit_dfu_partition_envelope_info_get(const uint8_t **address, si */ suit_plat_err_t suit_dfu_partition_device_info_get(struct suit_nvm_device_info *device_info); +/** + * @brief Chcecks if dfu partition is empty. + * + * @return true if empty, false otherwise + */ +bool suit_dfu_partition_is_empty(void); + #ifdef __cplusplus } #endif diff --git a/subsys/suit/envelope_info/src/suit_envelope_info.c b/subsys/suit/envelope_info/src/suit_envelope_info.c index 1029ad71cb21..2db567c3931b 100644 --- a/subsys/suit/envelope_info/src/suit_envelope_info.c +++ b/subsys/suit/envelope_info/src/suit_envelope_info.c @@ -48,7 +48,7 @@ suit_plat_err_t suit_dfu_partition_envelope_info_get(const uint8_t **address, si uintptr_t mapped_address = 0; if (!suit_memory_nvm_address_to_global_address(&device_offset, &mapped_address)) { - LOG_ERR("Cannot obtain memory-mapped DFU Partition address"); + LOG_ERR("Cannot obtain memory-mapped DFU partition address"); return SUIT_PLAT_ERR_IO; } @@ -56,7 +56,7 @@ suit_plat_err_t suit_dfu_partition_envelope_info_get(const uint8_t **address, si size_t envelope_size = DFU_PARTITION_SIZE; if (*((uint32_t *)envelope_address) == EMPTY_STORAGE_VALUE) { - LOG_DBG("DFU Partition empty"); + LOG_DBG("DFU partition empty"); return SUIT_PLAT_ERR_NOT_FOUND; } @@ -108,3 +108,26 @@ suit_plat_err_t suit_dfu_partition_device_info_get(struct suit_nvm_device_info * return SUIT_PLAT_SUCCESS; } + +bool suit_dfu_partition_is_empty(void) +{ + struct nvm_address device_offset = { + .fdev = DFU_PARTITION_DEVICE, + .offset = DFU_PARTITION_OFFSET, + }; + + uintptr_t mapped_address = 0; + + if (!suit_memory_nvm_address_to_global_address(&device_offset, &mapped_address)) { + LOG_ERR("Cannot obtain memory-mapped DFU partition address"); + return false; + } + + for (size_t i = 0; i < DFU_PARTITION_SIZE / sizeof(uint32_t); i++) { + if (*(((uint32_t *)mapped_address) + i) != EMPTY_STORAGE_VALUE) { + return false; + } + } + + return true; +} diff --git a/subsys/suit/execution_mode/Kconfig b/subsys/suit/execution_mode/Kconfig index 2a851db38455..07316434fb68 100644 --- a/subsys/suit/execution_mode/Kconfig +++ b/subsys/suit/execution_mode/Kconfig @@ -6,3 +6,7 @@ config SUIT_EXECUTION_MODE bool "Enable SUIT execution mode module" + +config APP_LINK_WITH_SUIT_EXECUTION_MODE + bool + default y diff --git a/subsys/suit/execution_mode/include/suit_execution_mode.h b/subsys/suit/execution_mode/include/suit_execution_mode.h index bb5d55510f0f..e0ad434eba78 100644 --- a/subsys/suit/execution_mode/include/suit_execution_mode.h +++ b/subsys/suit/execution_mode/include/suit_execution_mode.h @@ -7,6 +7,7 @@ #ifndef SUIT_EXECUTION_MODE_H__ #define SUIT_EXECUTION_MODE_H__ +#include #include #ifdef __cplusplus @@ -27,6 +28,7 @@ typedef enum { EXECUTION_MODE_FAIL_MPI_UNSUPPORTED, EXECUTION_MODE_FAIL_INVOKE_RECOVERY, EXECUTION_MODE_FAIL_INSTALL_NORDIC_TOP, + EXECUTION_MODE_FAIL_STARTUP, } suit_execution_mode_t; /** @@ -46,6 +48,69 @@ suit_execution_mode_t suit_execution_mode_get(void); */ suit_plat_err_t suit_execution_mode_set(suit_execution_mode_t mode); +/** + * @brief Update execution mode as a result of interrupted startup procedure. + * + * @details The main purpose of this API is to get out of the non-final state + * (i.e. update candidate is detected and the orchestrator entry will + * start processing it) if the startup procedure is interrupted + * between suit_orchestrator_init(), which schedules processing of + * manifests and suit_orchestrator_entry(), which executes scheduled + * operations. This situation may occur as a result of BICR or UICR + * misconfiguration. + * Since execution mode value is used to check if the it is allowed to + * modify memory regions, the mode should be changed to one of the + * FAILED states in such case to unblock device recovery procedures. + * + * @note This API will set the execution mode to EXECUTION_MODE_FAIL_STARTUP + * only if the current mode indicates a transient state. + */ +void suit_execution_mode_startup_failed(void); + +/** + * @brief Check if SUIT is processing installed manifests. + * + * @details Certain operations are not available if the SUIT orchestrator is + * actively using the SUIT processor (and SUIT decoder) states. + * Moreover, modifying manifests while they are processed might result + * in security bridges. + * To allow external modules (i.e. memory lease mechanisms) to check + * if the SUIT orchestrator is booting manifests without exposing all + * of the details about execution mode, this API may be used. + */ +bool suit_execution_mode_booting(void); + +/** + * @brief Check if SUIT is processing an update candidate. + * + * @details Certain operations are not available if the SUIT orchestrator is + * actively using the SUIT processor (and SUIT decoder) states. + * Moreover, modifying DFU partition while update canidates they are + * processed might result in security bridges. + * To allow external modules (i.e. memory lease mechanisms) to check + * if the SUIT orchestrator is updating manifests without exposing all + * of the details about execution mode, this API may be used. + */ +bool suit_execution_mode_updating(void); + +/** + * @brief Check if SUIT failed to process OEM manifests. + * + * @details Certain operations must be enabled or disabled if SUIT orchestrator + * logic fails to initialize. + * The most common reason for such failure is the misconfiguration of + * the MPI area. + * Although this failure modifies the execution mode, it is not + * reflected by the suit_orchestrator_init() return code, so the rest + * of the system (UICR allocation, ADAC server) can take place. + * Due to that, some modules must rely on the execution mode to set + * the permissions for their operation. To allow them to check + * if the SUIT orchestrator is in one of the FAILED states without + * exposing all of the details about execution mode, this API may be + * used. + */ +bool suit_execution_mode_failed(void); + #ifdef __cplusplus } #endif diff --git a/subsys/suit/execution_mode/src/suit_execution_mode.c b/subsys/suit/execution_mode/src/suit_execution_mode.c index a3e7e5a0c093..b9ffba4e322a 100644 --- a/subsys/suit/execution_mode/src/suit_execution_mode.c +++ b/subsys/suit/execution_mode/src/suit_execution_mode.c @@ -23,3 +23,162 @@ suit_plat_err_t suit_execution_mode_set(suit_execution_mode_t mode) return SUIT_PLAT_ERR_INVAL; } + +void suit_execution_mode_startup_failed(void) +{ + switch (current_execution_mode) { + /* SUIT boot or update not yet started. */ + case EXECUTION_MODE_STARTUP: + /* System is unprovisioned, SUIT updates Nordic components. */ + case EXECUTION_MODE_FAIL_INSTALL_NORDIC_TOP: + /* SUIT processes update candiadate. */ + case EXECUTION_MODE_INSTALL: + /* SUIT processes recovery update. */ + case EXECUTION_MODE_INSTALL_RECOVERY: + /* SUIT boots from root manifest. */ + case EXECUTION_MODE_INVOKE: + /* SUIT boots from recovery manifest. */ + case EXECUTION_MODE_INVOKE_RECOVERY: + current_execution_mode = EXECUTION_MODE_FAIL_STARTUP; + break; + + /* System not booted, application MPI missing. */ + case EXECUTION_MODE_FAIL_NO_MPI: + /* System not booted, invalid MPI format. */ + case EXECUTION_MODE_FAIL_MPI_INVALID: + /* System not booted, Nordic and root class IDs not configured. */ + case EXECUTION_MODE_FAIL_MPI_INVALID_MISSING: + /* System not booted, MPI misconfigured. */ + case EXECUTION_MODE_FAIL_MPI_UNSUPPORTED: + /* System not booted, unable to boot recovery manifest. */ + case EXECUTION_MODE_FAIL_INVOKE_RECOVERY: + /* System booted from root manifest. */ + case EXECUTION_MODE_POST_INVOKE: + /* System booted from recovery manifest. */ + case EXECUTION_MODE_POST_INVOKE_RECOVERY: + /* System failed before invoking SUIT orchestrator. */ + case EXECUTION_MODE_FAIL_STARTUP: + break; + /* default case deliberately excluded to get warnings if missing an enum case. */ + } +} + +bool suit_execution_mode_booting(void) +{ + switch (current_execution_mode) { + /* SUIT processes update candiadate. */ + case EXECUTION_MODE_INSTALL: + /* SUIT processes recovery update. */ + case EXECUTION_MODE_INSTALL_RECOVERY: + /* System is unprovisioned, SUIT updates Nordic components. */ + case EXECUTION_MODE_FAIL_INSTALL_NORDIC_TOP: + /* System booted from root manifest. */ + case EXECUTION_MODE_POST_INVOKE: + /* System booted from recovery manifest. */ + case EXECUTION_MODE_POST_INVOKE_RECOVERY: + /* System not booted, application MPI missing. */ + case EXECUTION_MODE_FAIL_NO_MPI: + /* System not booted, invalid MPI format. */ + case EXECUTION_MODE_FAIL_MPI_INVALID: + /* System not booted, Nordic and root class IDs not configured. */ + case EXECUTION_MODE_FAIL_MPI_INVALID_MISSING: + /* System not booted, MPI misconfigured. */ + case EXECUTION_MODE_FAIL_MPI_UNSUPPORTED: + /* System not booted, unable to boot recovery manifest. */ + case EXECUTION_MODE_FAIL_INVOKE_RECOVERY: + /* System failed before invoking SUIT orchestrator. */ + case EXECUTION_MODE_FAIL_STARTUP: + return false; + + /* SUIT boot or update not yet started. */ + case EXECUTION_MODE_STARTUP: + /* SUIT boots from root manifest. */ + case EXECUTION_MODE_INVOKE: + /* SUIT boots from recovery manifest. */ + case EXECUTION_MODE_INVOKE_RECOVERY: + break; + /* default case deliberately excluded to get warnings if missing an enum case. */ + } + + return true; +} + +bool suit_execution_mode_updating(void) +{ + switch (current_execution_mode) { + /* SUIT boots from root manifest. */ + case EXECUTION_MODE_INVOKE: + /* SUIT boots from recovery manifest. */ + case EXECUTION_MODE_INVOKE_RECOVERY: + /* System booted from root manifest. */ + case EXECUTION_MODE_POST_INVOKE: + /* System booted from recovery manifest. */ + case EXECUTION_MODE_POST_INVOKE_RECOVERY: + /* System not booted, application MPI missing. */ + case EXECUTION_MODE_FAIL_NO_MPI: + /* System not booted, invalid MPI format. */ + case EXECUTION_MODE_FAIL_MPI_INVALID: + /* System not booted, Nordic and root class IDs not configured. */ + case EXECUTION_MODE_FAIL_MPI_INVALID_MISSING: + /* System not booted, MPI misconfigured. */ + case EXECUTION_MODE_FAIL_MPI_UNSUPPORTED: + /* System not booted, unable to boot recovery manifest. */ + case EXECUTION_MODE_FAIL_INVOKE_RECOVERY: + /* System failed before invoking SUIT orchestrator. */ + case EXECUTION_MODE_FAIL_STARTUP: + return false; + + /* SUIT boot or update not yet started. */ + case EXECUTION_MODE_STARTUP: + /* SUIT processes update candiadate. */ + case EXECUTION_MODE_INSTALL: + /* SUIT processes recovery update. */ + case EXECUTION_MODE_INSTALL_RECOVERY: + /* System is unprovisioned, SUIT updates Nordic components. */ + case EXECUTION_MODE_FAIL_INSTALL_NORDIC_TOP: + break; + /* default case deliberately excluded to get warnings if missing an enum case. */ + } + + return true; +} + +bool suit_execution_mode_failed(void) +{ + switch (current_execution_mode) { + /* SUIT boot or update not yet started. */ + case EXECUTION_MODE_STARTUP: + /* SUIT processes update candiadate. */ + case EXECUTION_MODE_INSTALL: + /* SUIT processes recovery update. */ + case EXECUTION_MODE_INSTALL_RECOVERY: + /* SUIT boots from root manifest. */ + case EXECUTION_MODE_INVOKE: + /* SUIT boots from recovery manifest. */ + case EXECUTION_MODE_INVOKE_RECOVERY: + /* System booted from root manifest. */ + case EXECUTION_MODE_POST_INVOKE: + /* System booted from recovery manifest. */ + case EXECUTION_MODE_POST_INVOKE_RECOVERY: + /* System is unprovisioned, SUIT updates Nordic components. */ + case EXECUTION_MODE_FAIL_INSTALL_NORDIC_TOP: + return false; + + /* System not booted, application MPI missing. */ + case EXECUTION_MODE_FAIL_NO_MPI: + /* System not booted, invalid MPI format. */ + case EXECUTION_MODE_FAIL_MPI_INVALID: + /* System not booted, Nordic and root class IDs not configured. */ + case EXECUTION_MODE_FAIL_MPI_INVALID_MISSING: + /* System not booted, MPI misconfigured. */ + case EXECUTION_MODE_FAIL_MPI_UNSUPPORTED: + /* System not booted, unable to boot recovery manifest. */ + case EXECUTION_MODE_FAIL_INVOKE_RECOVERY: + /* System failed before invoking SUIT orchestrator. */ + case EXECUTION_MODE_FAIL_STARTUP: + break; + /* default case deliberately excluded to get warnings if missing an enum case. */ + } + + return true; +} diff --git a/subsys/suit/mci/CMakeLists.txt b/subsys/suit/mci/CMakeLists.txt index 3281a1a95ed4..b0807dbb58cb 100644 --- a/subsys/suit/mci/CMakeLists.txt +++ b/subsys/suit/mci/CMakeLists.txt @@ -15,5 +15,6 @@ zephyr_library_sources_ifdef(CONFIG_SUIT_MCI_IMPL_NRF54H20_SDFW src/suit_mci_nrf zephyr_library_sources(src/suit_generic_ids.c) zephyr_library_link_libraries(suit_mci) +zephyr_library_link_libraries(suit_utils) zephyr_library_link_libraries_ifdef(CONFIG_SUIT_STORAGE suit_storage_interface) zephyr_library_link_libraries(suit_execution_mode) diff --git a/subsys/suit/mci/include/suit_mci.h b/subsys/suit/mci/include/suit_mci.h index 50b0eab3acb5..7e57ea803cf8 100644 --- a/subsys/suit/mci/include/suit_mci.h +++ b/subsys/suit/mci/include/suit_mci.h @@ -160,6 +160,25 @@ mci_err_t suit_mci_manifest_class_id_validate(const suit_manifest_class_id_t *cl mci_err_t suit_mci_signing_key_id_validate(const suit_manifest_class_id_t *class_id, uint32_t key_id); +#ifdef CONFIG_ZTEST +/** + * @brief Return key ID bits assigned to the manifest. + * + * @details This API is dedicated for tests that import volatile keys during setup. + * In such case, the key ID is returned by PSA APIs and cannot be predicted. + * + * @param[in] class_id Manifest class id + * @param[out] key_id Identifier of key utilized for manifest signing. + * + * @retval SUIT_PLAT_SUCCESS on success + * @retval SUIT_PLAT_ERR_INVAL invalid parameter, i.e. null pointer + * @retval MCI_ERR_MANIFESTCLASSID manifest class id unsupported + * @retval MCI_ERR_WRONGKEYID provided key ID is invalid for signing + * for provided manifest class + */ +mci_err_t suit_mci_signing_key_id_get(const suit_manifest_class_id_t *class_id, uint32_t *key_id); +#endif /* CONFIG_ZTEST */ + /** * @brief Verifies if manifest with specific class id is entitled to start (invoke) code on specific * processor diff --git a/subsys/suit/mci/src/suit_mci_nrf54h20.c b/subsys/suit/mci/src/suit_mci_nrf54h20.c index 70b9fefbfe9c..fab2e25ac3fa 100644 --- a/subsys/suit/mci/src/suit_mci_nrf54h20.c +++ b/subsys/suit/mci/src/suit_mci_nrf54h20.c @@ -5,6 +5,7 @@ */ #include #include +#include #include #include #include @@ -375,6 +376,43 @@ mci_err_t suit_mci_memory_access_rights_validate(const suit_manifest_class_id_t return MCI_ERR_MANIFESTCLASSID; } + /* If the SUIT orchestrator is currently processing update candidate, + * block all MEM components (regardless of the manifest class ID) + * that points to the DFU partition, or any other region that contains + * update candidate. + * This check is necessary to ensure that the digest of the + * authenticated digest of manifest or involved new firmware components + * remains unchanged during the whole update procedure. + */ + if (suit_execution_mode_updating()) { + const suit_plat_mreg_t *update_regions = NULL; + size_t update_regions_len = 0; + suit_plat_err_t plat_err = + suit_storage_update_cand_get(&update_regions, &update_regions_len); + + if (plat_err != SUIT_PLAT_SUCCESS) { + /* Should never happen as the execution mode indicates processing of + * a pending update candiadate. + */ + return SUIT_PLAT_ERR_CRASH; + } + + /* Ensure that the regions are mutually exclusive. + * + * The condition below is a negation of the following condition: + * (start_a) >= (start_b + size_b) + * or + * (start_b) >= (start_a + size_a) + */ + for (size_t i = 0; i < update_regions_len; i++) { + if ((((uint8_t *)address) < + (update_regions[i].mem + update_regions[i].size)) && + (update_regions[i].mem < (((uint8_t *)address) + mem_size))) { + return MCI_ERR_NOACCESS; + } + } + } + switch (role) { case SUIT_MANIFEST_UNKNOWN: return MCI_ERR_MANIFESTCLASSID; @@ -385,9 +423,10 @@ mci_err_t suit_mci_memory_access_rights_validate(const suit_manifest_class_id_t return MCI_ERR_NOACCESS; case SUIT_MANIFEST_SEC_SDFW: - /* Sec manifest - TODO - implement checks based on UICR/SICR + /* SDFW & SDFW Recovery manifest - ability to operate on memory ranges intentionally + * blocked. */ - return SUIT_PLAT_SUCCESS; + return MCI_ERR_NOACCESS; case SUIT_MANIFEST_SEC_SYSCTRL: /* Sysctrl manifest - TODO - implement checks based on UICR/SICR diff --git a/subsys/suit/metadata/include/suit_metadata.h b/subsys/suit/metadata/include/suit_metadata.h index 9532e14e5d09..02977484d1d1 100644 --- a/subsys/suit/metadata/include/suit_metadata.h +++ b/subsys/suit/metadata/include/suit_metadata.h @@ -109,6 +109,21 @@ typedef enum { SUIT_MANIFEST_RAD_LOCAL_2 = 0x32, } suit_manifest_role_t; +/* Manifest domain nibble. */ +typedef enum { + /** Manifest domain uninitialized (invalid). */ + SUIT_MANIFEST_DOMAIN_UNKNOWN = 0x00, + + /** Manifest domain for Nordic-controlled manifests. */ + SUIT_MANIFEST_DOMAIN_SEC = 0x10, + + /** Manifest domain for Application-controlled manifests. */ + SUIT_MANIFEST_DOMAIN_APP = 0x20, + + /** Manifest domain for Radio-controlled manifests. */ + SUIT_MANIFEST_DOMAIN_RAD = 0x30, +} suit_manifest_domain_t; + /** The 128-bit UUID, used for identifying vendors as well as classes. */ typedef struct { uint8_t raw[16]; diff --git a/subsys/suit/orchestrator/include/suit_orchestrator.h b/subsys/suit/orchestrator/include/suit_orchestrator.h index 75d5669aa08b..f7470e490298 100644 --- a/subsys/suit/orchestrator/include/suit_orchestrator.h +++ b/subsys/suit/orchestrator/include/suit_orchestrator.h @@ -14,14 +14,31 @@ extern "C" { /** * @brief Initialize the SUIT orchestrator before it can be used. * - * @return 0 on success, non-zero value otherwise. + * @retval 0 if successful. + * @retval -EFAULT if internal module initialization failed. + * @retval -EROFS if unable to access SUIT storage area. + * @retval -EIO if unable to modify internal state. */ int suit_orchestrator_init(void); /** * @brief Main function of the orchestrator, starting boot or update. * - * @return 0 on success, negative value otherwise. + * + * @retval 0 if successful. + * @retval -EPERM if application MPI is missing (invalid digest). + * @retval -EOVERFLOW if MPI has invalid format (i.e. version, values). + * @retval -EBADF if essential (Nordic, root) roles are unprovisioned. + * @retval -ENOTSUP if provided MPI configuration is not supported. + * @retval -EINVAL if called in invalid SUIT execution mode. + * @retval -EFAULT if internal error encountered. + * @retval -EIO if unable to modify SUIT storage area. + * @retval -ENOENT if attemmpted to boot non-existing manifest. + * @retval -ENOEXEC if unable to find or parse installed or candidate manifest. + * @retval -EILSEQ if manifest sequence execution failed. + * @retval -EMSGSIZE if update candidate size is invalid. + * @retval -EACCES if update candiadate manifest is invalid. + * @retval -ESRCH if update candiadate manifest class is unsupported. */ int suit_orchestrator_entry(void); diff --git a/subsys/suit/orchestrator/src/suit_orchestrator_sdfw.c b/subsys/suit/orchestrator/src/suit_orchestrator_sdfw.c index 01920d38537a..098f3cfa63a9 100644 --- a/subsys/suit/orchestrator/src/suit_orchestrator_sdfw.c +++ b/subsys/suit/orchestrator/src/suit_orchestrator_sdfw.c @@ -24,8 +24,6 @@ LOG_MODULE_REGISTER(suit_orchestrator, CONFIG_SUIT_LOG_LEVEL); -#define SUIT_PROCESSOR_ERR_TO_ZEPHYR_ERR(err) ((err) == SUIT_SUCCESS ? 0 : -EACCES) - #define SUIT_PLAT_ERR_TO_ZEPHYR_ERR(err) ((err) == SUIT_PLAT_SUCCESS ? 0 : -EACCES) enum suit_orchestrator_state { @@ -91,12 +89,12 @@ static int validate_update_candidate_address_and_size(const uint8_t *addr, size_ { if (addr == NULL || addr == (void *)EMPTY_STORAGE_VALUE) { LOG_DBG("Invalid update candidate address: %p", (void *)addr); - return -EFAULT; + return -EMSGSIZE; } if (size == 0 || size == EMPTY_STORAGE_VALUE) { LOG_DBG("Invalid update candidate size: %d", size); - return -EFAULT; + return -EMSGSIZE; } if (suit_validator_validate_update_candidate_location(addr, size) != SUIT_PLAT_SUCCESS) { @@ -112,11 +110,11 @@ static int initialize_dfu_cache(const suit_plat_mreg_t *update_regions, size_t u struct dfu_cache cache = {0}; if (update_regions == NULL || update_regions_len < 1) { - return -EINVAL; + return -EMSGSIZE; } if ((update_regions_len - 1) > ARRAY_SIZE(cache.pools)) { - return -EINVAL; + return -EMSGSIZE; } cache.pools_count = update_regions_len - 1; @@ -131,7 +129,11 @@ static int initialize_dfu_cache(const suit_plat_mreg_t *update_regions, size_t u cache.pools[i - 1].size = update_regions[i].size; } - return SUIT_PLAT_ERR_TO_ZEPHYR_ERR(suit_dfu_cache_initialize(&cache)); + if (suit_dfu_cache_initialize(&cache) != SUIT_PLAT_SUCCESS) { + return -EACCES; + } + + return 0; } static int validate_update_candidate_manifest(uint8_t *manifest_address, size_t manifest_size) @@ -148,31 +150,31 @@ static int validate_update_candidate_manifest(uint8_t *manifest_address, size_t NULL, NULL); if (err != SUIT_SUCCESS) { LOG_ERR("Unable to read update candidate manifest metadata: %d", err); - return SUIT_PROCESSOR_ERR_TO_ZEPHYR_ERR(err); + return -ENOEXEC; } err = suit_plat_decode_manifest_class_id(&manifest_component_id, &manifest_class_id); if (err != SUIT_PLAT_SUCCESS) { LOG_ERR("Failed to parse update candidate manifest class ID: %d", err); - return SUIT_PROCESSOR_ERR_TO_ZEPHYR_ERR(SUIT_ERR_MANIFEST_VALIDATION); + return -ESRCH; } err = suit_mci_independent_update_policy_get(manifest_class_id, &policy); if (err != SUIT_PLAT_SUCCESS) { LOG_ERR("Failed to read independent updateability policy: %d", err); - return SUIT_PROCESSOR_ERR_TO_ZEPHYR_ERR(SUIT_ERR_UNSUPPORTED_COMPONENT_ID); + return -ESRCH; } if (policy != SUIT_INDEPENDENT_UPDATE_ALLOWED) { LOG_ERR("Independent updates of the provided update candidate denied."); - return SUIT_PROCESSOR_ERR_TO_ZEPHYR_ERR(SUIT_ERR_AUTHENTICATION); + return -EACCES; } err = suit_process_sequence(manifest_address, manifest_size, SUIT_SEQ_PARSE); if (err != SUIT_SUCCESS) { LOG_ERR("Failed to validate update candidate manifest: %d", err); - return SUIT_PROCESSOR_ERR_TO_ZEPHYR_ERR(err); + return -ENOEXEC; } return 0; @@ -185,7 +187,7 @@ static int clear_update_candidate(void) err = suit_storage_update_cand_set(NULL, 0); if (err != SUIT_PLAT_SUCCESS) { LOG_ERR("Failed to clear update candidate: %d", err); - return SUIT_PLAT_ERR_TO_ZEPHYR_ERR(err); + return -EIO; } LOG_DBG("Update candidate cleared"); @@ -202,7 +204,7 @@ static int update_path(void) if ((err != SUIT_PLAT_SUCCESS) || (update_regions_len < 1)) { LOG_ERR("Failed to get update candidate data: %d", err); - return SUIT_PLAT_ERR_TO_ZEPHYR_ERR(err); + return -EMSGSIZE; } LOG_DBG("Update candidate address: %p", (void *)update_regions[0].mem); @@ -239,7 +241,7 @@ static int update_path(void) err = 0; } else { LOG_ERR("Failed to execute suit-candidate-verification: %d", err); - return SUIT_PROCESSOR_ERR_TO_ZEPHYR_ERR(err); + return -EILSEQ; } } LOG_DBG("suit-candidate-verification successful"); @@ -248,7 +250,7 @@ static int update_path(void) SUIT_SEQ_INSTALL); if (err != SUIT_SUCCESS) { LOG_ERR("Failed to execute suit-install: %d", err); - return SUIT_PROCESSOR_ERR_TO_ZEPHYR_ERR(err); + return -EILSEQ; } LOG_INF("suit-install successful"); @@ -281,7 +283,7 @@ static int boot_envelope(const suit_manifest_class_id_t *class_id) SUIT_SEQ_PARSE); if (err != SUIT_SUCCESS) { LOG_ERR("Failed to validate installed manifest: %d", err); - return SUIT_PROCESSOR_ERR_TO_ZEPHYR_ERR(err); + return -ENOEXEC; } LOG_DBG("Validated installed manifest"); @@ -295,7 +297,7 @@ static int boot_envelope(const suit_manifest_class_id_t *class_id) &version.len, NULL, NULL, &seq_num); if (err != SUIT_SUCCESS) { LOG_ERR("Failed to read manifest version and digest: %d", err); - return SUIT_PROCESSOR_ERR_TO_ZEPHYR_ERR(err); + return -ENOEXEC; } LOG_INF("Booting from manifest version: %d.%d.%d-%d.%d, sequence: 0x%x", version.raw[0], version.raw[1], version.raw[2], -version.raw[3], version.raw[4], seq_num); @@ -304,7 +306,7 @@ static int boot_envelope(const suit_manifest_class_id_t *class_id) SUIT_SEQ_VALIDATE); if (err != SUIT_SUCCESS) { LOG_ERR("Failed to execute suit-validate: %d", err); - return SUIT_PROCESSOR_ERR_TO_ZEPHYR_ERR(err); + return -EILSEQ; } LOG_INF("Processed suit-validate"); @@ -317,7 +319,7 @@ static int boot_envelope(const suit_manifest_class_id_t *class_id) err = 0; } else { LOG_ERR("Failed to execute suit-load: %d", err); - return SUIT_PROCESSOR_ERR_TO_ZEPHYR_ERR(err); + return -EILSEQ; } } LOG_INF("Processed suit-load"); @@ -326,7 +328,7 @@ static int boot_envelope(const suit_manifest_class_id_t *class_id) SUIT_SEQ_INVOKE); if (err != SUIT_SUCCESS) { LOG_ERR("Failed to execute suit-invoke: %d", err); - return SUIT_PROCESSOR_ERR_TO_ZEPHYR_ERR(err); + return -EILSEQ; } LOG_INF("Processed suit-invoke"); @@ -343,7 +345,7 @@ static int boot_path(bool emergency) (const suit_manifest_class_id_t **)&class_ids_to_boot, &class_ids_to_boot_len); if (mci_ret != SUIT_PLAT_SUCCESS) { LOG_ERR("Unable to get invoke order (MCI err: %d)", mci_ret); - return SUIT_PLAT_ERR_TO_ZEPHYR_ERR(mci_ret); + return -ENOEXEC; } for (size_t i = 0; i < class_ids_to_boot_len; i++) { @@ -384,7 +386,7 @@ int suit_orchestrator_init(void) if (err != SUIT_SUCCESS) { LOG_ERR("Failed to initialize suit processor: %d", err); - return SUIT_PROCESSOR_ERR_TO_ZEPHYR_ERR(err); + return -EFAULT; } suit_plat_err_t plat_err = suit_storage_init(); @@ -413,12 +415,12 @@ int suit_orchestrator_init(void) break; default: LOG_ERR("Failed to init suit storage: %d", plat_err); - return SUIT_PLAT_ERR_TO_ZEPHYR_ERR(plat_err); + return -EROFS; } if (plat_err != SUIT_PLAT_SUCCESS) { LOG_ERR("Setting execution mode failed state failed: %d", plat_err); - return SUIT_PLAT_ERR_TO_ZEPHYR_ERR(plat_err); + return -EIO; } plat_err = suit_storage_update_cand_get(&update_regions, &update_regions_len); @@ -429,25 +431,25 @@ int suit_orchestrator_init(void) if (mci_err != SUIT_PLAT_SUCCESS) { LOG_ERR("Failed to init MCI for SDFW update: %d", mci_err); - return SUIT_PLAT_ERR_TO_ZEPHYR_ERR(mci_err); + return -EFAULT; } plat_err = suit_execution_mode_set(EXECUTION_MODE_FAIL_INSTALL_NORDIC_TOP); if (plat_err != SUIT_PLAT_SUCCESS) { LOG_ERR("Setting SDFW update execution mode failed: %d", plat_err); - return SUIT_PLAT_ERR_TO_ZEPHYR_ERR(plat_err); + return -EIO; } } LOG_WRN("Execution mode in a FAILED state"); - return SUIT_PLAT_SUCCESS; + return 0; } mci_err_t mci_err = suit_mci_init(); if (mci_err != SUIT_PLAT_SUCCESS) { LOG_ERR("Failed to init MCI: %d", mci_err); - return SUIT_PLAT_ERR_TO_ZEPHYR_ERR(mci_err); + return -EFAULT; } plat_err = suit_storage_update_cand_get(&update_regions, &update_regions_len); @@ -481,7 +483,7 @@ int suit_orchestrator_init(void) if (plat_err != SUIT_PLAT_SUCCESS) { LOG_ERR("Setting execution mode failed: %d", plat_err); - return SUIT_PLAT_ERR_TO_ZEPHYR_ERR(plat_err); + return -EIO; } LOG_DBG("SUIT orchestrator init ok"); @@ -512,12 +514,15 @@ static int suit_orchestrator_run(void) break; case EXECUTION_MODE_FAIL_NO_MPI: + return -EPERM; case EXECUTION_MODE_FAIL_MPI_INVALID: + return -EOVERFLOW; case EXECUTION_MODE_FAIL_MPI_INVALID_MISSING: + return -EBADF; case EXECUTION_MODE_FAIL_MPI_UNSUPPORTED: - case EXECUTION_MODE_FAIL_INVOKE_RECOVERY: - return -EFAULT; + return -ENOTSUP; + case EXECUTION_MODE_FAIL_INVOKE_RECOVERY: case EXECUTION_MODE_STARTUP: case EXECUTION_MODE_POST_INVOKE: case EXECUTION_MODE_POST_INVOKE_RECOVERY: diff --git a/subsys/suit/orchestrator_app/Kconfig b/subsys/suit/orchestrator_app/Kconfig index 81edcf7310ab..c221e3579acf 100644 --- a/subsys/suit/orchestrator_app/Kconfig +++ b/subsys/suit/orchestrator_app/Kconfig @@ -14,4 +14,9 @@ config SUIT_ORCHESTRATOR_APP_CANDIDATE_PROCESSING bool "Enable processing of the candidate envelope by the SUIT application orchestrator" depends on SUIT_ENVELOPE_INFO +config SUIT_CLEANUP_ON_INIT + bool "Performs cleanup on DFU and DFU cache partitions as part of initialization" + depends on SUIT_ORCHESTRATOR_APP_CANDIDATE_PROCESSING + default y + endif # SUIT_ORCHESTRATOR_APP diff --git a/subsys/suit/orchestrator_app/src/suit_orchestrator_app.c b/subsys/suit/orchestrator_app/src/suit_orchestrator_app.c index e909cce2dc74..046b29ed2724 100644 --- a/subsys/suit/orchestrator_app/src/suit_orchestrator_app.c +++ b/subsys/suit/orchestrator_app/src/suit_orchestrator_app.c @@ -34,6 +34,12 @@ LOG_MODULE_REGISTER(suit_dfu, CONFIG_SUIT_LOG_LEVEL); static int dfu_partition_erase(void) { + + if (suit_dfu_partition_is_empty()) { + LOG_DBG("DFU partition is arleady erased"); + return 0; + } + struct suit_nvm_device_info device_info; int err = suit_dfu_partition_device_info_get(&device_info); @@ -45,6 +51,7 @@ static int dfu_partition_erase(void) return -ENODEV; } + LOG_DBG("Erasing DFU partition"); int rc = flash_erase(device_info.fdev, device_info.partition_offset, device_info.partition_size); if (rc < 0) { @@ -61,8 +68,6 @@ int suit_dfu_initialize(void) LOG_DBG("Enter"); struct suit_nvm_device_info device_info; - const uint8_t *uc_env_addr = NULL; - size_t uc_env_size = 0; int err = suit_dfu_partition_device_info_get(&device_info); if (err != SUIT_PLAT_SUCCESS) { @@ -73,6 +78,13 @@ int suit_dfu_initialize(void) LOG_INF("DFU partition detected, addr: %p, size %d bytes", (void *)device_info.mapped_address, device_info.partition_size); +#if CONFIG_SUIT_CLEANUP_ON_INIT + suit_dfu_cleanup(); + +#else /* CONFIG_SUIT_CLEANUP_ON_INIT */ + const uint8_t *uc_env_addr = NULL; + size_t uc_env_size = 0; + err = suit_dfu_partition_envelope_info_get(&uc_env_addr, &uc_env_size); if (err == SUIT_PLAT_SUCCESS) { LOG_INF("Update candidate envelope detected, addr: %p, size %d bytes", @@ -83,6 +95,8 @@ int suit_dfu_initialize(void) suit_dfu_cache_validate_content(); #endif /* CONFIG_SUIT_CACHE_RW */ +#endif /* CONFIG_SUIT_CLEANUP_ON_INIT */ + #if CONFIG_SUIT_STREAM_IPC_PROVIDER suit_ipc_streamer_provider_init(); #endif diff --git a/subsys/suit/platform/sdfw/CMakeLists.txt b/subsys/suit/platform/sdfw/CMakeLists.txt index bd37ea39a75b..29bea83cafde 100644 --- a/subsys/suit/platform/sdfw/CMakeLists.txt +++ b/subsys/suit/platform/sdfw/CMakeLists.txt @@ -38,6 +38,7 @@ zephyr_library_link_libraries_ifdef(CONFIG_SUIT_STREAM suit_stream_sources_inter zephyr_library_link_libraries_ifdef(CONFIG_SUIT_SINK_SELECTOR suit_sink_selector_interface) zephyr_library_link_libraries_ifdef(CONFIG_SUIT_DEVCONFIG suit_storage_interface) zephyr_library_link_libraries_ifdef(CONFIG_SUIT_STORAGE suit_storage_interface) +zephyr_library_link_libraries_ifdef(CONFIG_SUIT_PLAT_CHECK_COMPONENT_COMPATIBILITY suit_storage_interface) zephyr_library_link_libraries_ifdef(CONFIG_SUIT_STREAM_SOURCE_MEMPTR suit_stream_sources_interface) zephyr_library_link_libraries_ifdef(CONFIG_SUIT_DEVCONFIG suit_mci) zephyr_library_link_libraries_ifdef(CONFIG_SUIT_AUTHENTICATE suit_mci) diff --git a/subsys/suit/platform/sdfw/src/suit_plat_authenticate.c b/subsys/suit/platform/sdfw/src/suit_plat_authenticate.c index e813d56362e0..40e90105637d 100644 --- a/subsys/suit/platform/sdfw/src/suit_plat_authenticate.c +++ b/subsys/suit/platform/sdfw/src/suit_plat_authenticate.c @@ -75,6 +75,14 @@ int suit_plat_authenticate_manifest(struct zcbor_string *manifest_component_id, return SUIT_ERR_AUTHENTICATION; } +#ifdef CONFIG_ZTEST + ret = suit_mci_signing_key_id_get(class_id, &public_key_id); + if (ret != SUIT_PLAT_SUCCESS) { + LOG_ERR("Unable to find volatile key ID: MCI err %i", ret); + return SUIT_ERR_AUTHENTICATION; + } +#endif /* CONFIG_ZTEST */ + #ifdef MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER mbedtls_svc_key_id_t key; diff --git a/subsys/suit/platform/sdfw/src/suit_plat_component_compatibility.c b/subsys/suit/platform/sdfw/src/suit_plat_component_compatibility.c index 42932a1d79d1..2129c0820ba4 100644 --- a/subsys/suit/platform/sdfw/src/suit_plat_component_compatibility.c +++ b/subsys/suit/platform/sdfw/src/suit_plat_component_compatibility.c @@ -7,6 +7,7 @@ #include #include #include +#include /* -1 indicates no boot capability for given cpu id */ #define NO_BOOT_CAPABILITY_CPU_ID 255 @@ -14,6 +15,7 @@ int suit_plat_component_compatibility_check(const suit_manifest_class_id_t *class_id, struct zcbor_string *component_id) { + suit_manifest_role_t role = SUIT_MANIFEST_UNKNOWN; suit_manifest_class_id_t *decoded_class_id; suit_component_type_t type = SUIT_COMPONENT_TYPE_UNSUPPORTED; intptr_t address; @@ -37,6 +39,10 @@ int suit_plat_component_compatibility_check(const suit_manifest_class_id_t *clas return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; } + if (suit_storage_mpi_role_get(class_id, &role) != SUIT_PLAT_SUCCESS) { + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + switch (type) { case SUIT_COMPONENT_TYPE_MEM: /* Decode component_id */ @@ -57,6 +63,7 @@ int suit_plat_component_compatibility_check(const suit_manifest_class_id_t *clas return SUIT_ERR_UNAUTHORIZED_COMPONENT; } break; + case SUIT_COMPONENT_TYPE_SOC_SPEC: if (suit_plat_decode_component_number(component_id, &number) != SUIT_PLAT_SUCCESS) { return SUIT_ERR_DECODING; @@ -67,12 +74,37 @@ int suit_plat_component_compatibility_check(const suit_manifest_class_id_t *clas return SUIT_ERR_UNAUTHORIZED_COMPONENT; } break; + case SUIT_COMPONENT_TYPE_CAND_MFST: + if (suit_plat_decode_component_number(component_id, &number) != SUIT_PLAT_SUCCESS) { + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + + if ((role != SUIT_MANIFEST_SEC_TOP) && (role != SUIT_MANIFEST_APP_ROOT) && + (role != SUIT_MANIFEST_APP_RECOVERY)) { + return SUIT_ERR_UNAUTHORIZED_COMPONENT; + } + break; + case SUIT_COMPONENT_TYPE_CAND_IMG: + if (suit_plat_decode_component_number(component_id, &number) != SUIT_PLAT_SUCCESS) { + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + + if ((role == SUIT_MANIFEST_SEC_TOP) || (role == SUIT_MANIFEST_APP_ROOT)) { + return SUIT_ERR_UNAUTHORIZED_COMPONENT; + } + break; + case SUIT_COMPONENT_TYPE_CACHE_POOL: if (suit_plat_decode_component_number(component_id, &number) != SUIT_PLAT_SUCCESS) { return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; } + + if ((role == SUIT_MANIFEST_SEC_TOP) || (role == SUIT_MANIFEST_SEC_SDFW) || + (role == SUIT_MANIFEST_SEC_SYSCTRL) || (role == SUIT_MANIFEST_APP_ROOT)) { + return SUIT_ERR_UNAUTHORIZED_COMPONENT; + } break; case SUIT_COMPONENT_TYPE_INSTLD_MFST: @@ -90,6 +122,7 @@ int suit_plat_component_compatibility_check(const suit_manifest_class_id_t *clas } break; + default: return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; } diff --git a/subsys/suit/storage/CMakeLists.txt b/subsys/suit/storage/CMakeLists.txt index ee1b63e8de69..2419619991a8 100644 --- a/subsys/suit/storage/CMakeLists.txt +++ b/subsys/suit/storage/CMakeLists.txt @@ -8,6 +8,7 @@ zephyr_interface_library_named(suit_storage_interface) target_include_directories(suit_storage_interface INTERFACE include) target_link_libraries(suit_storage_interface INTERFACE suit_metadata) target_link_libraries(suit_storage_interface INTERFACE suit_platform_err) +target_link_libraries(suit_storage_interface INTERFACE suit_utils) zephyr_library() zephyr_library_sources_ifdef(CONFIG_SUIT_STORAGE_LAYOUT_TEST src/suit_storage_test.c) diff --git a/subsys/suit/storage/Kconfig b/subsys/suit/storage/Kconfig index 1f711f3a3a2a..7ec33016c228 100644 --- a/subsys/suit/storage/Kconfig +++ b/subsys/suit/storage/Kconfig @@ -22,8 +22,7 @@ choice SUIT_STORAGE_LAYOUT config SUIT_STORAGE_LAYOUT_NRF54H20 bool "nRF54H20" - depends on SUIT_CRYPTO - select PSA_WANT_ALG_SHA_256 + select PSA_WANT_ALG_SHA_256 if SUIT_CRYPTO config SUIT_STORAGE_LAYOUT_TEST bool "tests" diff --git a/subsys/suit/storage/include/suit_storage.h b/subsys/suit/storage/include/suit_storage.h index 47065776d2ea..674269f872fb 100644 --- a/subsys/suit/storage/include/suit_storage.h +++ b/subsys/suit/storage/include/suit_storage.h @@ -181,6 +181,20 @@ suit_plat_err_t suit_storage_report_save(size_t index, const uint8_t *buf, size_ */ suit_plat_err_t suit_storage_report_read(size_t index, const uint8_t **buf, size_t *len); +/** + * @brief Purge all manifests, NVVs as well as MPIs assigned to the domain. + * + * @note By default, NVVs are locates in the Application manifest domain. + * + * @param[in] domain Manifest domain to purge. + * + * @retval SUIT_PLAT_SUCCESS if area was successfully erased. + * @retval SUIT_PLAT_ERR_INVAL if one of the input arguments is invalid (i.e. NULL). + * @retval SUIT_PLAT_ERR_HW_NOT_READY if NVM controller is unavailable. + * @retval SUIT_PLAT_ERR_IO if unable to change NVM contents. + */ +suit_plat_err_t suit_storage_purge(suit_manifest_domain_t domain); + #ifdef __cplusplus } #endif diff --git a/subsys/suit/storage/src/suit_storage_nrf54h20.c b/subsys/suit/storage/src/suit_storage_nrf54h20.c index 8f223e439092..fe42e2c551c4 100644 --- a/subsys/suit/storage/src/suit_storage_nrf54h20.c +++ b/subsys/suit/storage/src/suit_storage_nrf54h20.c @@ -8,7 +8,9 @@ #include #include #include +#ifdef CONFIG_SUIT_CRYPTO #include +#endif /* CONFIG_SUIT_CRYPTO */ LOG_MODULE_REGISTER(suit_storage, CONFIG_SUIT_LOG_LEVEL); @@ -277,9 +279,10 @@ static suit_plat_err_t find_manifest_area(suit_manifest_role_t role, const uint8 static suit_plat_err_t sha256_check(const uint8_t *addr, size_t size, const suit_storage_digest_t *exp_digest) { + suit_plat_err_t err = SUIT_PLAT_ERR_AUTHENTICATION; +#ifdef CONFIG_SUIT_CRYPTO const psa_algorithm_t psa_alg = PSA_ALG_SHA_256; const size_t exp_digest_length = PSA_HASH_LENGTH(psa_alg); - suit_plat_err_t err = SUIT_PLAT_ERR_AUTHENTICATION; psa_hash_operation_t operation = {0}; if ((addr == NULL) || (exp_digest == NULL)) { @@ -334,6 +337,7 @@ static suit_plat_err_t sha256_check(const uint8_t *addr, size_t size, } } } +#endif /* CONFIG_SUIT_CRYPTO */ return err; } @@ -350,9 +354,10 @@ static suit_plat_err_t sha256_check(const uint8_t *addr, size_t size, */ static suit_plat_err_t sha256_get(const uint8_t *addr, size_t size, suit_storage_digest_t *digest) { + suit_plat_err_t err = SUIT_PLAT_ERR_AUTHENTICATION; +#ifdef CONFIG_SUIT_CRYPTO const psa_algorithm_t psa_alg = PSA_ALG_SHA_256; size_t digest_length = PSA_HASH_LENGTH(psa_alg); - suit_plat_err_t err = SUIT_PLAT_ERR_AUTHENTICATION; psa_hash_operation_t operation = {0}; if ((addr == NULL) || (digest == NULL)) { @@ -398,6 +403,7 @@ static suit_plat_err_t sha256_get(const uint8_t *addr, size_t size, suit_storage LOG_ERR("psa_hash_abort error %d", status); } } +#endif /* CONFIG_SUIT_CRYPTO */ return err; } @@ -1061,3 +1067,67 @@ suit_plat_err_t suit_storage_report_read(size_t index, const uint8_t **buf, size return suit_storage_report_internal_read(area_addr, area_size, buf, len); } + +suit_plat_err_t suit_storage_purge(suit_manifest_domain_t domain) +{ + struct suit_storage_nordic *nordic_storage = + (struct suit_storage_nordic *)SUIT_STORAGE_NORDIC_ADDRESS; + struct suit_storage_rad *rad_storage = (struct suit_storage_rad *)SUIT_STORAGE_RAD_ADDRESS; + struct suit_storage_app *app_storage = (struct suit_storage_app *)SUIT_STORAGE_APP_ADDRESS; + const struct device *fdev = SUIT_PLAT_INTERNAL_NVM_DEV; + suit_plat_err_t ret = SUIT_PLAT_SUCCESS; + int err = 0; + + if (!device_is_ready(fdev)) { + return SUIT_PLAT_ERR_HW_NOT_READY; + } + + switch (domain) { + case SUIT_MANIFEST_DOMAIN_APP: + /* Clear regular entry, inluding NVV and NVV backup. */ + err = flash_erase(fdev, + suit_plat_mem_nvm_offset_get((uint8_t *)&app_storage->app_area), + sizeof(app_storage->app_area)); + if (err == 0) { + /* Clear MPI backup. */ + err = flash_erase(fdev, + suit_plat_mem_nvm_offset_get( + (uint8_t *)&nordic_storage->nordic.app_mpi_bak), + sizeof(nordic_storage->nordic.app_mpi_bak)); + } + + /* Clear reports (incl. recovery flag and update candidate info). */ + ret = suit_storage_report_clear(0); + break; + + case SUIT_MANIFEST_DOMAIN_RAD: + /* Clear regular entry. */ + err = flash_erase(fdev, + suit_plat_mem_nvm_offset_get((uint8_t *)&rad_storage->rad_area), + sizeof(rad_storage->rad_area)); + if (err == 0) { + /* Clear MPI backup. */ + err = flash_erase(fdev, + suit_plat_mem_nvm_offset_get( + (uint8_t *)&nordic_storage->nordic.rad_mpi_bak), + sizeof(nordic_storage->nordic.rad_mpi_bak)); + } + break; + + default: + return SUIT_PLAT_ERR_INVAL; + } + + /* Reinitialize SUIT storage internal structures. + * Ignore return code as an init failure on erased SUIT storage area + * does not indicate that the purge failed. + */ + (void)suit_storage_init(); + + /* In case of IO error, ignore the suit processor return code. */ + if (err != 0) { + return SUIT_PLAT_ERR_IO; + } + + return ret; +} diff --git a/subsys/suit/storage/src/suit_storage_test.c b/subsys/suit/storage/src/suit_storage_test.c index 4aedafd2b59f..df74315482d1 100644 --- a/subsys/suit/storage/src/suit_storage_test.c +++ b/subsys/suit/storage/src/suit_storage_test.c @@ -383,3 +383,72 @@ suit_plat_err_t suit_storage_report_read(size_t index, const uint8_t **buf, size return suit_storage_report_internal_read(area_addr, area_size, buf, len); } + +suit_plat_err_t suit_storage_purge(suit_manifest_domain_t domain) +{ + struct suit_storage *storage = (struct suit_storage *)SUIT_STORAGE_ADDRESS; + uint8_t *update_addr = storage->update.erase_block; + size_t update_size = sizeof(storage->update.erase_block); + const struct device *fdev = SUIT_PLAT_INTERNAL_NVM_DEV; + suit_plat_err_t ret = SUIT_PLAT_SUCCESS; + suit_manifest_role_t roles[] = { + SUIT_MANIFEST_APP_ROOT, + SUIT_MANIFEST_APP_LOCAL_1, + SUIT_MANIFEST_APP_RECOVERY, + }; + int err = 0; + const uint8_t *addr = NULL; + size_t size = 0; + + if (!device_is_ready(fdev)) { + return SUIT_PLAT_ERR_HW_NOT_READY; + } + + switch (domain) { + case SUIT_MANIFEST_DOMAIN_APP: + for (size_t i = 0; i < ARRAY_SIZE(roles); i++) { + ret = find_manifest_area(roles[i], &addr, &size); + if (ret != SUIT_PLAT_SUCCESS) { + LOG_ERR("Unable to find area for envelope with role 0x%x%s.", + roles[i], suit_role_name_get(roles[i])); + continue; + } + + /* Clear regular entry. */ + err = flash_erase(fdev, suit_plat_mem_nvm_offset_get((uint8_t *)addr), + size); + if (err != 0) { + break; + } + } + + /* Clear update candidate info. */ + if (err == 0) { + err = flash_erase(fdev, suit_plat_mem_nvm_offset_get(update_addr), + update_size); + } + + /* Clear reports. */ + for (size_t i = 0; i < SUIT_N_REPORTS; i++) { + if (ret == SUIT_PLAT_SUCCESS) { + ret = suit_storage_report_clear(i); + } + } + break; + default: + return SUIT_PLAT_ERR_INVAL; + } + + /* Reinitialize SUIT storage internal structures. + * Ignore return code as an init failure on erased SUIT storage area + * does not indicate that the purge failed. + */ + (void)suit_storage_init(); + + /* In case of IO error, ignore the suit processor return code. */ + if (err != 0) { + return SUIT_PLAT_ERR_IO; + } + + return ret; +} diff --git a/subsys/trusted_storage/Kconfig b/subsys/trusted_storage/Kconfig index f40f52cbc0b9..27ead4ff62a9 100644 --- a/subsys/trusted_storage/Kconfig +++ b/subsys/trusted_storage/Kconfig @@ -158,9 +158,9 @@ choice TRUSTED_STORAGE_STORAGE_BACKEND config TRUSTED_STORAGE_STORAGE_BACKEND_SETTINGS bool "Settings storage backend" - depends on SETTINGS_NVS + depends on SETTINGS_NVS || SETTINGS_ZMS help - Use the Settings subsystem with NVS to store the assets + Use the Settings subsystem to store the assets config TRUSTED_STORAGE_STORAGE_BACKEND_CUSTOM bool "Custom storage backend" diff --git a/sysbuild/CMakeLists.txt b/sysbuild/CMakeLists.txt index 48db9417867f..cefa364b3cc5 100644 --- a/sysbuild/CMakeLists.txt +++ b/sysbuild/CMakeLists.txt @@ -346,6 +346,21 @@ function(${SYSBUILD_CURRENT_MODULE_NAME}_pre_cmake) set_config_bool(mcuboot CONFIG_USE_NRF53_MULTI_IMAGE_WITHOUT_UPGRADE_ONLY y) endif() endif() + + # Apply image compression support options + if(SB_CONFIG_MCUBOOT_COMPRESSED_IMAGE_SUPPORT) + set_config_bool(mcuboot CONFIG_NRF_COMPRESS y) + set_config_bool(mcuboot CONFIG_NRF_COMPRESS_DECOMPRESSION y) + set_config_bool(mcuboot CONFIG_NRF_COMPRESS_LZMA y) + set_config_bool(mcuboot CONFIG_NRF_COMPRESS_LZMA_VERSION_LZMA2 y) + set_config_bool(mcuboot CONFIG_NRF_COMPRESS_ARM_THUMB y) + set_config_bool(mcuboot CONFIG_NRF_COMPRESS_CLEANUP y) + set_config_bool(mcuboot CONFIG_BOOT_DECOMPRESSION y) + set_config_bool(${DEFAULT_IMAGE} CONFIG_MCUBOOT_COMPRESSED_IMAGE_SUPPORT_ENABLED y) + else() + set_config_bool(mcuboot CONFIG_BOOT_DECOMPRESSION n) + set_config_bool(${DEFAULT_IMAGE} CONFIG_MCUBOOT_COMPRESSED_IMAGE_SUPPORT_ENABLED n) + endif() endif() if(SB_CONFIG_SECURE_BOOT_APPCORE) diff --git a/sysbuild/Kconfig.mcuboot b/sysbuild/Kconfig.mcuboot index 9af7b1d4e62a..c1dcd48de71a 100644 --- a/sysbuild/Kconfig.mcuboot +++ b/sysbuild/Kconfig.mcuboot @@ -44,6 +44,15 @@ config MCUBOOT_HW_DOWNGRADE_PREVENTION_COUNTER_VALUE endif # MCUBOOT_HARDWARE_DOWNGRADE_PREVENTION +config MCUBOOT_COMPRESSED_IMAGE_SUPPORT + bool "Compressed image support" + depends on MCUBOOT_MODE_OVERWRITE_ONLY + depends on MCUBOOT_UPDATEABLE_IMAGES = "1" + depends on !BOOT_ENCRYPTION + help + When enabled, supports loading compressed images using LZMA2 to the secondary slot which + will then be decompressed and loaded to the primary slot. + config MCUBOOT_MAX_UPDATEABLE_IMAGES int default 4 diff --git a/sysbuild/Kconfig.suit b/sysbuild/Kconfig.suit index e2d4575c0e9c..7336c561ed24 100644 --- a/sysbuild/Kconfig.suit +++ b/sysbuild/Kconfig.suit @@ -65,6 +65,12 @@ config SUIT_BASE_MANIFEST_VARIANT help Base manifest variant used during the build. +config SUIT_MULTI_IMAGE_PACKAGE_BUILD + bool "Create multi-image DFU for SUIT envelope and cache images" + help + Build DFU Multi Image package that contains a manifest file followed by SUIT envelope + and selected cache image files. + endif # SUIT_ENVELOPE config SUIT_BUILD_RECOVERY diff --git a/tests/benchmarks/current_consumption/system_off/CMakeLists.txt b/tests/benchmarks/current_consumption/system_off/CMakeLists.txt index 6a90b1a932d0..31873da5c017 100644 --- a/tests/benchmarks/current_consumption/system_off/CMakeLists.txt +++ b/tests/benchmarks/current_consumption/system_off/CMakeLists.txt @@ -5,7 +5,11 @@ # cmake_minimum_required(VERSION 3.20.0) +set(KCONFIG_ROOT $ENV{ZEPHYR_BASE}/samples/boards/nordic/system_off/Kconfig) find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) project(system_off) target_sources(app PRIVATE $ENV{ZEPHYR_BASE}/samples/boards/nordic/system_off/src/main.c) +if(CONFIG_APP_USE_RETAINED_MEM) + target_sources(app PRIVATE $ENV{ZEPHYR_BASE}/samples/boards/nordic/system_off/src/retained.c) +endif() diff --git a/tests/benchmarks/current_consumption/system_off/boards/nrf54l15dk_nrf54l15_cpuapp_ret_mem.overlay b/tests/benchmarks/current_consumption/system_off/boards/nrf54l15dk_nrf54l15_cpuapp_ret_mem.overlay new file mode 100644 index 000000000000..838f039feeee --- /dev/null +++ b/tests/benchmarks/current_consumption/system_off/boards/nrf54l15dk_nrf54l15_cpuapp_ret_mem.overlay @@ -0,0 +1,23 @@ +/ { + cpuapp_sram@2002e000 { + compatible = "zephyr,memory-region", "mmio-sram"; + reg = <0x2002e000 DT_SIZE_K(4)>; + zephyr,memory-region = "RetainedMem"; + status = "okay"; + + retainedmem0: retainedmem { + compatible = "zephyr,retained-ram"; + status = "okay"; + }; + }; + + aliases { + retainedmemdevice = &retainedmem0; + }; +}; + +&cpuapp_sram { + /* Shrink SRAM size to avoid overlap with retained memory region */ + reg = <0x20000000 DT_SIZE_K(184)>; + ranges = <0x0 0x20000000 0x2e000>; +}; diff --git a/tests/benchmarks/current_consumption/system_off/testcase.yaml b/tests/benchmarks/current_consumption/system_off/testcase.yaml index 8d008c92a390..f2abe7519c05 100644 --- a/tests/benchmarks/current_consumption/system_off/testcase.yaml +++ b/tests/benchmarks/current_consumption/system_off/testcase.yaml @@ -15,3 +15,21 @@ tests: pytest_root: - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_power_consumption_with_wakeups" timeout: 80 + benchmarks.current_consumption.systemoff.gpio_wakeup_retained_mem: + platform_allow: + - nrf54l15dk/nrf54l15/cpuapp + integration_platforms: + - nrf54l15dk/nrf54l15/cpuapp + extra_args: + - "DTC_OVERLAY_FILE= + boards/nrf54l15dk_nrf54l15_cpuapp_gpio_wakeup.overlay; + boards/nrf54l15dk_nrf54l15_cpuapp_ret_mem.overlay" + extra_configs: + - CONFIG_APP_USE_RETAINED_MEM=y + - CONFIG_RETAINED_MEM=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_power_consumption_with_wakeups" + timeout: 80 diff --git a/tests/benchmarks/multicore/idle/CMakeLists.txt b/tests/benchmarks/multicore/idle/CMakeLists.txt index 2b80b145ce7a..9d54a11e5d3d 100644 --- a/tests/benchmarks/multicore/idle/CMakeLists.txt +++ b/tests/benchmarks/multicore/idle/CMakeLists.txt @@ -7,8 +7,9 @@ cmake_minimum_required(VERSION 3.20.0) find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) -if (NOT SYSBUILD) - message(WARNING + +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() diff --git a/tests/benchmarks/multicore/idle/boards/nrf54h20dk_nrf54h20_cpuapp_s2ram.overlay b/tests/benchmarks/multicore/idle/boards/nrf54h20dk_nrf54h20_cpuapp_s2ram.overlay deleted file mode 100644 index c9b5aee2aa93..000000000000 --- a/tests/benchmarks/multicore/idle/boards/nrf54h20dk_nrf54h20_cpuapp_s2ram.overlay +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -/ { - power-states { - idle: idle { - compatible = "zephyr,power-state"; - power-state-name = "suspend-to-idle"; - min-residency-us = <100000>; - }; - - s2ram: s2ram { - compatible = "zephyr,power-state"; - power-state-name = "suspend-to-ram"; - min-residency-us = <800000>; - }; - }; -}; - -&cpu { - cpu-power-states = <&idle &s2ram>; -}; diff --git a/tests/benchmarks/multicore/idle/testcase.yaml b/tests/benchmarks/multicore/idle/testcase.yaml index 6568c6c69b3b..d7396e436c41 100644 --- a/tests/benchmarks/multicore/idle/testcase.yaml +++ b/tests/benchmarks/multicore/idle/testcase.yaml @@ -76,7 +76,6 @@ tests: remote_CONFIG_PM=y remote_CONFIG_POWEROFF=y remote_CONFIG_CONSOLE=n remote_CONFIG_UART_CONSOLE=n remote_CONFIG_SERIAL=n remote_CONFIG_GPIO=n remote_CONFIG_BOOT_BANNER=n remote_CONFIG_NRFS_MRAM_SERVICE_ENABLED=n - DTC_OVERLAY_FILE="boards/nrf54h20dk_nrf54h20_cpuapp_s2ram.overlay" harness: pytest harness_config: fixture: ppk_power_measure @@ -98,7 +97,7 @@ tests: remote_CONFIG_PM=y remote_CONFIG_POWEROFF=y remote_CONFIG_CONSOLE=n remote_CONFIG_UART_CONSOLE=n remote_CONFIG_SERIAL=n remote_CONFIG_GPIO=n remote_CONFIG_BOOT_BANNER=n remote_CONFIG_NRFS_MRAM_SERVICE_ENABLED=n - DTC_OVERLAY_FILE="boards/nrf54h20dk_nrf54h20_cpuapp_s2ram.overlay;boards/nrf54h20dk_nrf54h20_cpuapp_ram_high_usage.overlay" + DTC_OVERLAY_FILE="boards/nrf54h20dk_nrf54h20_cpuapp_ram_high_usage.overlay" harness: pytest harness_config: fixture: ppk_power_measure @@ -120,7 +119,7 @@ tests: remote_CONFIG_PM=y remote_CONFIG_POWEROFF=y remote_CONFIG_CONSOLE=n remote_CONFIG_UART_CONSOLE=n remote_CONFIG_SERIAL=n remote_CONFIG_GPIO=n remote_CONFIG_BOOT_BANNER=n remote_CONFIG_NRFS_MRAM_SERVICE_ENABLED=n - DTC_OVERLAY_FILE="boards/nrf54h20dk_nrf54h20_cpuapp_s2ram.overlay;boards/nrf54h20dk_nrf54h20_cpuapp_ram_low_usage.overlay" + DTC_OVERLAY_FILE="boards/nrf54h20dk_nrf54h20_cpuapp_ram_low_usage.overlay" harness: pytest harness_config: fixture: ppk_power_measure diff --git a/tests/benchmarks/multicore/idle_adc/CMakeLists.txt b/tests/benchmarks/multicore/idle_adc/CMakeLists.txt new file mode 100644 index 000000000000..c8df5a0216d6 --- /dev/null +++ b/tests/benchmarks/multicore/idle_adc/CMakeLists.txt @@ -0,0 +1,18 @@ +# +# Copyright (c) 2024 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_adc) + +target_sources(app PRIVATE src/main.c) diff --git a/tests/benchmarks/multicore/idle_adc/Kconfig.sysbuild b/tests/benchmarks/multicore/idle_adc/Kconfig.sysbuild new file mode 100644 index 000000000000..0898eb292938 --- /dev/null +++ b/tests/benchmarks/multicore/idle_adc/Kconfig.sysbuild @@ -0,0 +1,10 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" + +config REMOTE_BOARD + string "The board used for remote target" diff --git a/tests/benchmarks/multicore/idle_adc/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/benchmarks/multicore/idle_adc/boards/nrf54h20dk_nrf54h20_cpuapp.overlay new file mode 100644 index 000000000000..46b819a6047f --- /dev/null +++ b/tests/benchmarks/multicore/idle_adc/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -0,0 +1,30 @@ +/ { + aliases { + adc0 = &adc; + sw = &loopback; + }; + buttons { + compatible = "gpio-keys"; + loopback: loopback { + gpios = <&gpio1 3 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&adc { + #address-cells = <1>; + #size-cells = <0>; + + channel@0 { + reg = <0>; + zephyr,gain = "ADC_GAIN_1"; + zephyr,reference = "ADC_REF_INTERNAL"; + zephyr,acquisition-time = ; + zephyr,input-positive = ; + }; + +}; + +&gpio1 { + status = "okay"; +}; diff --git a/tests/benchmarks/multicore/idle_adc/prj.conf b/tests/benchmarks/multicore/idle_adc/prj.conf new file mode 100644 index 000000000000..5675c3d5121a --- /dev/null +++ b/tests/benchmarks/multicore/idle_adc/prj.conf @@ -0,0 +1,19 @@ +CONFIG_ADC=y +CONFIG_GPIO=y + +CONFIG_PM=y +CONFIG_PM_S2RAM=y +CONFIG_PM_S2RAM_CUSTOM_MARKING=y +CONFIG_PM_DEVICE=y +CONFIG_PM_DEVICE_RUNTIME=y +CONFIG_POWEROFF=y +CONFIG_BOOT_BANNER=n +CONFIG_NRFS_MRAM_SERVICE_ENABLED=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_adc/remote/CMakeLists.txt b/tests/benchmarks/multicore/idle_adc/remote/CMakeLists.txt new file mode 100644 index 000000000000..97caab4871c3 --- /dev/null +++ b/tests/benchmarks/multicore/idle_adc/remote/CMakeLists.txt @@ -0,0 +1,12 @@ +# +# Copyright (c) 2024 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(remote) + +target_sources(app PRIVATE src/main.c) diff --git a/tests/benchmarks/multicore/idle_adc/remote/prj.conf b/tests/benchmarks/multicore/idle_adc/remote/prj.conf new file mode 100644 index 000000000000..e8e5e87638d8 --- /dev/null +++ b/tests/benchmarks/multicore/idle_adc/remote/prj.conf @@ -0,0 +1,8 @@ +CONFIG_PM=y +CONFIG_POWEROFF=y +CONFIG_CONSOLE=n +CONFIG_UART_CONSOLE=n +CONFIG_SERIAL=n +CONFIG_GPIO=n +CONFIG_BOOT_BANNER=n +CONFIG_NRFS_MRAM_SERVICE_ENABLED=n diff --git a/tests/benchmarks/multicore/idle_adc/remote/src/main.c b/tests/benchmarks/multicore/idle_adc/remote/src/main.c new file mode 100644 index 000000000000..005f6ad837fa --- /dev/null +++ b/tests/benchmarks/multicore/idle_adc/remote/src/main.c @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include + +int main(void) +{ + k_msleep(500); + while (1) { + k_msleep(2000); + } + + return 0; +} diff --git a/tests/benchmarks/multicore/idle_adc/src/main.c b/tests/benchmarks/multicore/idle_adc/src/main.c new file mode 100644 index 000000000000..51a54a333562 --- /dev/null +++ b/tests/benchmarks/multicore/idle_adc/src/main.c @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#define ADC_NODE DT_ALIAS(adc0) +#define ADC_LOW_LEVEL 0 +#define ADC_HIGH_LEVEL 4092 + +static const struct device *adc = DEVICE_DT_GET(ADC_NODE); +static const struct gpio_dt_spec gpio = GPIO_DT_SPEC_GET(DT_ALIAS(sw), gpios); + +int adc_setup(void) +{ + int ret; + /* Get the number of channels defined on the DTS. */ + static const struct adc_channel_cfg channel_cfgs[] = { +DT_FOREACH_CHILD_SEP(ADC_NODE, ADC_CHANNEL_CFG_DT, (,))}; + + ret = adc_channel_setup(adc, &channel_cfgs[0]); + return ret; +} + +int main(void) +{ + int err; + uint16_t channel_reading[5]; + int16_t sample_value; + + /* Options for the sequence sampling. */ + const struct adc_sequence_options options = { + .extra_samplings = 1, + .interval_us = 0, + }; + + struct adc_sequence sequence = { + .buffer = channel_reading, + /* buffer size in bytes, not number of samples */ + .buffer_size = sizeof(channel_reading), + .resolution = 12, + .options = &options, + .channels = 1, + }; + + err = gpio_pin_configure_dt(&gpio, GPIO_OUTPUT); + __ASSERT_NO_MSG(err == 0); + err = adc_setup(); + __ASSERT_NO_MSG(err == 0); + + while (1) { + gpio_pin_set_dt(&gpio, 1); + err = adc_read(adc, &sequence); + sample_value = channel_reading[0]; + __ASSERT_NO_MSG(sample_value == ADC_HIGH_LEVEL); + k_sleep(K_SECONDS(1)); + gpio_pin_set_dt(&gpio, 0); + err = adc_read(adc, &sequence); + sample_value = channel_reading[0]; + __ASSERT_NO_MSG(sample_value == ADC_LOW_LEVEL); + k_sleep(K_SECONDS(1)); + } + return 0; +} diff --git a/tests/benchmarks/multicore/idle_adc/sysbuild.cmake b/tests/benchmarks/multicore/idle_adc/sysbuild.cmake new file mode 100644 index 000000000000..8bf5d7bdb3c1 --- /dev/null +++ b/tests/benchmarks/multicore/idle_adc/sysbuild.cmake @@ -0,0 +1,22 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# 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() + +# Add remote project +ExternalZephyrProject_Add( + APPLICATION remote + SOURCE_DIR ${APP_DIR}/remote + BOARD ${SB_CONFIG_REMOTE_BOARD} + BOARD_REVISION ${BOARD_REVISION} + ) + +# Add a dependency so that the remote image will be built and flashed first +add_dependencies(idle_adc remote) +# Add dependency so that the remote image is flashed first. +sysbuild_add_dependencies(FLASH idle_adc remote) diff --git a/tests/benchmarks/multicore/idle_adc/sysbuild/nrf54h20dk_nrf54h20_cpurad.conf b/tests/benchmarks/multicore/idle_adc/sysbuild/nrf54h20dk_nrf54h20_cpurad.conf new file mode 100644 index 000000000000..dd863e78d993 --- /dev/null +++ b/tests/benchmarks/multicore/idle_adc/sysbuild/nrf54h20dk_nrf54h20_cpurad.conf @@ -0,0 +1 @@ +SB_CONFIG_REMOTE_BOARD="nrf54h20dk/nrf54h20/cpurad" diff --git a/tests/benchmarks/multicore/idle_adc/testcase.yaml b/tests/benchmarks/multicore/idle_adc/testcase.yaml new file mode 100644 index 000000000000..33ab2001dcea --- /dev/null +++ b/tests/benchmarks/multicore/idle_adc/testcase.yaml @@ -0,0 +1,19 @@ +common: + sysbuild: true + depends_on: adc + tags: ci_build ci_tests_benchmarks_multicore adc ppk_power_measure + +tests: + benchmarks.multicore.idle_adc.nrf54h20dk_cpuapp_cpurad.s2ram: + harness: pytest + platform_allow: + - nrf54h20dk/nrf54h20/cpuapp + integration_platforms: + - nrf54h20dk/nrf54h20/cpuapp + extra_args: + - FILE_SUFFIX=s2ram + - SB_CONF_FILE=sysbuild/nrf54h20dk_nrf54h20_cpurad.conf + harness_config: + fixture: gpio_loopback + pytest_root: + - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_power_consumption_adc" diff --git a/tests/benchmarks/multicore/idle_gpio/CMakeLists.txt b/tests/benchmarks/multicore/idle_gpio/CMakeLists.txt index 0b908cb8ae8f..b93dba64d2a6 100644 --- a/tests/benchmarks/multicore/idle_gpio/CMakeLists.txt +++ b/tests/benchmarks/multicore/idle_gpio/CMakeLists.txt @@ -7,8 +7,9 @@ cmake_minimum_required(VERSION 3.20.0) find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) -if (NOT SYSBUILD) - message(WARNING + +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() diff --git a/tests/benchmarks/multicore/idle_gpio/boards/nrf54h20dk_nrf54h20_cpuapp_s2ram.overlay b/tests/benchmarks/multicore/idle_gpio/boards/nrf54h20dk_nrf54h20_cpuapp_s2ram.overlay index 05e508acb880..1255cbde1eff 100644 --- a/tests/benchmarks/multicore/idle_gpio/boards/nrf54h20dk_nrf54h20_cpuapp_s2ram.overlay +++ b/tests/benchmarks/multicore/idle_gpio/boards/nrf54h20dk_nrf54h20_cpuapp_s2ram.overlay @@ -5,19 +5,6 @@ */ / { - power-states { - idle: idle { - compatible = "zephyr,power-state"; - power-state-name = "suspend-to-idle"; - min-residency-us = <100000>; - }; - - s2ram: s2ram { - compatible = "zephyr,power-state"; - power-state-name = "suspend-to-ram"; - min-residency-us = <800000>; - }; - }; aliases { /delete-property/ sw1; }; @@ -25,10 +12,6 @@ /delete-node/ &button1; -&cpu { - cpu-power-states = <&idle &s2ram>; -}; - &gpiote130 { status = "okay"; owned-channels = <0>; diff --git a/tests/benchmarks/multicore/idle_gpio/testcase.yaml b/tests/benchmarks/multicore/idle_gpio/testcase.yaml index 93774b0d01bf..ee442d395585 100644 --- a/tests/benchmarks/multicore/idle_gpio/testcase.yaml +++ b/tests/benchmarks/multicore/idle_gpio/testcase.yaml @@ -38,7 +38,7 @@ tests: remote_DTC_OVERLAY_FILE="boards/nrf54h20dk_nrf54h20_cpurad_s2ram.overlay;boards/wakeup_from_uart_pins.overlay" harness: pytest harness_config: - fixture: ppk_power_measure + fixture: gpio_loopback pytest_root: - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_power_consumption_with_wakeups_two_cores" timeout: 120 diff --git a/tests/benchmarks/multicore/idle_outside_of_main/CMakeLists.txt b/tests/benchmarks/multicore/idle_outside_of_main/CMakeLists.txt index 9fc5bce31c40..b225296a5514 100644 --- a/tests/benchmarks/multicore/idle_outside_of_main/CMakeLists.txt +++ b/tests/benchmarks/multicore/idle_outside_of_main/CMakeLists.txt @@ -7,6 +7,7 @@ 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" diff --git a/tests/benchmarks/multicore/idle_outside_of_main/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/benchmarks/multicore/idle_outside_of_main/boards/nrf54h20dk_nrf54h20_cpuapp.overlay deleted file mode 100644 index 8251081a067b..000000000000 --- a/tests/benchmarks/multicore/idle_outside_of_main/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - - / { - power-states { - idle: idle { - compatible = "zephyr,power-state"; - power-state-name = "suspend-to-idle"; - min-residency-us = <100000>; - }; - - s2ram: s2ram { - compatible = "zephyr,power-state"; - power-state-name = "suspend-to-ram"; - min-residency-us = <800000>; - }; - }; -}; - -&cpu { - cpu-power-states = <&idle &s2ram>; -}; diff --git a/tests/benchmarks/multicore/idle_outside_of_main/testcase.yaml b/tests/benchmarks/multicore/idle_outside_of_main/testcase.yaml index 58125a9ebc1f..b165921785ee 100644 --- a/tests/benchmarks/multicore/idle_outside_of_main/testcase.yaml +++ b/tests/benchmarks/multicore/idle_outside_of_main/testcase.yaml @@ -1,6 +1,6 @@ common: sysbuild: true - tags: ci_build ci_tests_benchmarks_multicore + tags: ci_build ci_tests_benchmarks_multicore ppk_power_measure tests: benchmarks.multicore.idle_outside_of_main.nrf54h20dk_cpuapp_cpurad.s2ram: @@ -14,4 +14,4 @@ tests: harness_config: fixture: ppk_power_measure pytest_root: - - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_power_consumption_simple" + - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_power_consumption_s2ram_outside_of_main" diff --git a/tests/benchmarks/multicore/idle_spim/CMakeLists.txt b/tests/benchmarks/multicore/idle_spim/CMakeLists.txt index 2c5a47a64444..7e443682f8fd 100644 --- a/tests/benchmarks/multicore/idle_spim/CMakeLists.txt +++ b/tests/benchmarks/multicore/idle_spim/CMakeLists.txt @@ -7,6 +7,7 @@ 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" diff --git a/tests/benchmarks/multicore/idle_spim/boards/nrf54h20dk_nrf54h20_cpuapp_s2ram.overlay b/tests/benchmarks/multicore/idle_spim/boards/nrf54h20dk_nrf54h20_cpuapp_s2ram.overlay deleted file mode 100644 index 8251081a067b..000000000000 --- a/tests/benchmarks/multicore/idle_spim/boards/nrf54h20dk_nrf54h20_cpuapp_s2ram.overlay +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - - / { - power-states { - idle: idle { - compatible = "zephyr,power-state"; - power-state-name = "suspend-to-idle"; - min-residency-us = <100000>; - }; - - s2ram: s2ram { - compatible = "zephyr,power-state"; - power-state-name = "suspend-to-ram"; - min-residency-us = <800000>; - }; - }; -}; - -&cpu { - cpu-power-states = <&idle &s2ram>; -}; diff --git a/tests/benchmarks/multicore/idle_spim/prj.conf b/tests/benchmarks/multicore/idle_spim/prj.conf index 489e37033428..4909c00f4cfb 100644 --- a/tests/benchmarks/multicore/idle_spim/prj.conf +++ b/tests/benchmarks/multicore/idle_spim/prj.conf @@ -10,6 +10,8 @@ CONFIG_POWEROFF=y CONFIG_BOOT_BANNER=n CONFIG_NRFS_MRAM_SERVICE_ENABLED=n +CONFIG_ASSERT=y + # Enable for debugging purposes only CONFIG_PRINTK=n CONFIG_LOG=n diff --git a/tests/benchmarks/multicore/idle_spim/src/main.c b/tests/benchmarks/multicore/idle_spim/src/main.c index a1b5fbddcc8d..7e388d74dec8 100644 --- a/tests/benchmarks/multicore/idle_spim/src/main.c +++ b/tests/benchmarks/multicore/idle_spim/src/main.c @@ -18,9 +18,9 @@ LOG_MODULE_REGISTER(idle_spim); static struct spi_dt_spec spim_spec = SPI_DT_SPEC_GET(DT_NODELABEL(bmi270), SPI_OP_MODE_MASTER | SPI_MODE, 0); -int spi_read_register(uint8_t register_address, uint8_t *register_value) +void spi_read_register(uint8_t register_address, uint8_t *register_value) { - int err; + int rc; uint8_t tx_buffer[3] = {register_address | SPI_READ_MASK, 0xFF, 0xFF}; uint8_t rx_buffer[3]; @@ -29,32 +29,25 @@ int spi_read_register(uint8_t register_address, uint8_t *register_value) struct spi_buf rx_spi_bufs = {.buf = rx_buffer, .len = sizeof(rx_buffer)}; struct spi_buf_set rx_spi_buf_set = {.buffers = &rx_spi_bufs, .count = 1}; - err = spi_transceive_dt(&spim_spec, &tx_spi_buf_set, &rx_spi_buf_set); + rc = spi_transceive_dt(&spim_spec, &tx_spi_buf_set, &rx_spi_buf_set); + __ASSERT(rc == 0, "Error: spi_transceive_dt, err: %d\n", rc); *register_value = rx_buffer[2]; - printk("'spi_transceive_dt', err: %d, rx_data: %x %x %x\n", err, rx_buffer[0], rx_buffer[1], + printk("'spi_transceive_dt', rx_data: %x %x %x\n", rx_buffer[0], rx_buffer[1], rx_buffer[2]); - return err; } int main(void) { - int err; + bool status; uint8_t response; - err = spi_is_ready_dt(&spim_spec); - if (!err) { - printk("Error: SPI device is not ready, err: %d\n", err); - return -1; - } + status = spi_is_ready_dt(&spim_spec); + __ASSERT(status, "Error: SPI device is not ready"); while (1) { for (int read_index = 0; read_index < SPI_READ_COUNT; read_index++) { - err = spi_read_register(CHIP_ID_REGISTER_ADDRESS, &response); - if (!err) { - printk("SPI read returned error: %d\n", err); - return -1; - } + spi_read_register(CHIP_ID_REGISTER_ADDRESS, &response); printk("Chip ID: 0x%x\n", response); } k_msleep(2000); diff --git a/tests/benchmarks/multicore/idle_spim/testcase.yaml b/tests/benchmarks/multicore/idle_spim/testcase.yaml index 067f1196fb9c..8e2c4f66a01e 100644 --- a/tests/benchmarks/multicore/idle_spim/testcase.yaml +++ b/tests/benchmarks/multicore/idle_spim/testcase.yaml @@ -1,19 +1,19 @@ common: sysbuild: true depends_on: spi - tags: ci_build ci_tests_benchmarks_multicore spim + tags: ci_build ci_tests_benchmarks_multicore spim ppk_power_measure tests: benchmarks.multicore.idle_spim.nrf54h20dk_cpuapp_cpurad.s2ram: harness: pytest platform_allow: - nrf54h20dk/nrf54h20/cpuapp + integration_platforms: + - nrf54h20dk/nrf54h20/cpuapp extra_args: - SHIELD=pca63566 - - FILE_SUFFIX=s2ram - SB_CONF_FILE=sysbuild/nrf54h20dk_nrf54h20_cpurad.conf - - DTC_OVERLAY_FILE="boards/nrf54h20dk_nrf54h20_cpuapp_s2ram.overlay" harness_config: - fixture: ppk_power_measure + fixture: pca63566 pytest_root: - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_power_consumption_spim" diff --git a/tests/benchmarks/multicore/idle_twim/CMakeLists.txt b/tests/benchmarks/multicore/idle_twim/CMakeLists.txt index 016dcf300373..0816cff95b0c 100644 --- a/tests/benchmarks/multicore/idle_twim/CMakeLists.txt +++ b/tests/benchmarks/multicore/idle_twim/CMakeLists.txt @@ -7,6 +7,7 @@ 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" diff --git a/tests/benchmarks/multicore/idle_twim/boards/nrf54h20dk_nrf54h20_cpuapp_s2ram.overlay b/tests/benchmarks/multicore/idle_twim/boards/nrf54h20dk_nrf54h20_cpuapp_s2ram.overlay deleted file mode 100644 index a1e708928fc2..000000000000 --- a/tests/benchmarks/multicore/idle_twim/boards/nrf54h20dk_nrf54h20_cpuapp_s2ram.overlay +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -/ { - power-states { - idle: idle { - compatible = "zephyr,power-state"; - power-state-name = "suspend-to-idle"; - min-residency-us = <100000>; - }; - - s2ram: s2ram { - compatible = "zephyr,power-state"; - power-state-name = "suspend-to-ram"; - min-residency-us = <800000>; - }; - }; -}; - -&cpu { - cpu-power-states = <&idle &s2ram>; -}; diff --git a/tests/benchmarks/multicore/idle_twim/prj.conf b/tests/benchmarks/multicore/idle_twim/prj.conf index 14800b9482c3..00ce790f15d9 100644 --- a/tests/benchmarks/multicore/idle_twim/prj.conf +++ b/tests/benchmarks/multicore/idle_twim/prj.conf @@ -11,6 +11,8 @@ CONFIG_GPIO=n CONFIG_BOOT_BANNER=n CONFIG_NRFS_MRAM_SERVICE_ENABLED=n +CONFIG_ASSERT=y + # Enable for debugging purposes only CONFIG_PRINTK=n CONFIG_LOG=n diff --git a/tests/benchmarks/multicore/idle_twim/src/main.c b/tests/benchmarks/multicore/idle_twim/src/main.c index f57e59e5939d..e513d29599ae 100644 --- a/tests/benchmarks/multicore/idle_twim/src/main.c +++ b/tests/benchmarks/multicore/idle_twim/src/main.c @@ -27,9 +27,11 @@ static const struct device *const i2c_device = DEVICE_DT_GET(I2C_TEST_NODE); */ static uint8_t read_sensor_register(uint8_t register_address) { + int rc; uint8_t response; - i2c_reg_read_byte(i2c_device, DEVICE_ADDRESS, register_address, &response); + rc = i2c_reg_read_byte(i2c_device, DEVICE_ADDRESS, register_address, &response); + __ASSERT_NO_MSG(rc == 0); printk("I2C read reg, addr: 0x%x, val: 0x%x\n", register_address, response); return response; } diff --git a/tests/benchmarks/multicore/idle_twim/testcase.yaml b/tests/benchmarks/multicore/idle_twim/testcase.yaml index 1620423e0e34..c7c4eb96c8b0 100644 --- a/tests/benchmarks/multicore/idle_twim/testcase.yaml +++ b/tests/benchmarks/multicore/idle_twim/testcase.yaml @@ -1,19 +1,19 @@ common: sysbuild: true depends_on: i2c - tags: ci_build ci_tests_benchmarks_multicore twim + tags: ci_build ci_tests_benchmarks_multicore twim ppk_power_measure tests: benchmarks.multicore.idle_twim.nrf54h20dk_cpuapp_cpurad.s2ram: harness: pytest platform_allow: - nrf54h20dk/nrf54h20/cpuapp + integration_platforms: + - nrf54h20dk/nrf54h20/cpuapp extra_args: - SHIELD=pca63566 - - FILE_SUFFIX=s2ram - SB_CONF_FILE=sysbuild/nrf54h20dk_nrf54h20_cpurad.conf - - DTC_OVERLAY_FILE="boards/nrf54h20dk_nrf54h20_cpuapp_s2ram.overlay" harness_config: - fixture: ppk_power_measure + fixture: pca63566 pytest_root: - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_power_consumption_twim" diff --git a/tests/benchmarks/multicore/idle_uarte/CMakeLists.txt b/tests/benchmarks/multicore/idle_uarte/CMakeLists.txt index 35caa16f1267..3940e075baa2 100644 --- a/tests/benchmarks/multicore/idle_uarte/CMakeLists.txt +++ b/tests/benchmarks/multicore/idle_uarte/CMakeLists.txt @@ -7,6 +7,7 @@ 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" diff --git a/tests/benchmarks/multicore/idle_uarte/boards/nrf54h20dk_nrf54h20_common.dtsi b/tests/benchmarks/multicore/idle_uarte/boards/nrf54h20dk_nrf54h20_cpuapp.overlay similarity index 100% rename from tests/benchmarks/multicore/idle_uarte/boards/nrf54h20dk_nrf54h20_common.dtsi rename to tests/benchmarks/multicore/idle_uarte/boards/nrf54h20dk_nrf54h20_cpuapp.overlay diff --git a/tests/benchmarks/multicore/idle_uarte/boards/nrf54h20dk_nrf54h20_cpuapp_s2ram.overlay b/tests/benchmarks/multicore/idle_uarte/boards/nrf54h20dk_nrf54h20_cpuapp_s2ram.overlay deleted file mode 100644 index e2220569808e..000000000000 --- a/tests/benchmarks/multicore/idle_uarte/boards/nrf54h20dk_nrf54h20_cpuapp_s2ram.overlay +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -#include "nrf54h20dk_nrf54h20_common.dtsi" - - / { - power-states { - idle: idle { - compatible = "zephyr,power-state"; - power-state-name = "suspend-to-idle"; - min-residency-us = <100000>; - }; - - s2ram: s2ram { - compatible = "zephyr,power-state"; - power-state-name = "suspend-to-ram"; - min-residency-us = <800000>; - }; - }; -}; - -&cpu { - cpu-power-states = <&idle &s2ram>; -}; diff --git a/tests/benchmarks/multicore/idle_uarte/prj.conf b/tests/benchmarks/multicore/idle_uarte/prj.conf index b0c7890c2a90..59785a532261 100644 --- a/tests/benchmarks/multicore/idle_uarte/prj.conf +++ b/tests/benchmarks/multicore/idle_uarte/prj.conf @@ -1,6 +1,7 @@ CONFIG_SERIAL=y CONFIG_MAIN_STACK_SIZE=2048 CONFIG_UART_ASYNC_API=y +CONFIG_UART_USE_RUNTIME_CONFIGURE=y CONFIG_PM=y CONFIG_PM_S2RAM=y diff --git a/tests/benchmarks/multicore/idle_uarte/src/main.c b/tests/benchmarks/multicore/idle_uarte/src/main.c index f54ca19df1eb..97e3916fa475 100644 --- a/tests/benchmarks/multicore/idle_uarte/src/main.c +++ b/tests/benchmarks/multicore/idle_uarte/src/main.c @@ -83,8 +83,9 @@ int main(void) return -1; } + /* UART is disabled so expect error. */ err = uart_rx_disable(uart_dev); - if (err != 0) { + if (err != -EFAULT) { printk("Unexpected error when disabling RX: %d\n", err); return -1; } diff --git a/tests/benchmarks/multicore/idle_uarte/testcase.yaml b/tests/benchmarks/multicore/idle_uarte/testcase.yaml index 9597ae08a210..eed60f335988 100644 --- a/tests/benchmarks/multicore/idle_uarte/testcase.yaml +++ b/tests/benchmarks/multicore/idle_uarte/testcase.yaml @@ -1,18 +1,18 @@ common: sysbuild: true depends_on: gpio - tags: ci_build ci_tests_benchmarks_multicore uarte + tags: ci_build ci_tests_benchmarks_multicore uarte ppk_power_measure tests: benchmarks.multicore.idle_uarte.nrf54h20dk_cpuapp_cpurad.s2ram: harness: pytest platform_allow: - nrf54h20dk/nrf54h20/cpuapp + integration_platforms: + - nrf54h20dk/nrf54h20/cpuapp extra_args: - - FILE_SUFFIX=s2ram - SB_CONF_FILE=sysbuild/nrf54h20dk_nrf54h20_cpurad.conf - - DTC_OVERLAY_FILE="boards/nrf54h20dk_nrf54h20_cpuapp_s2ram.overlay" harness_config: - fixture: ppk_power_measure + fixture: gpio_loopback pytest_root: - - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_power_consumption" + - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_power_consumption_uarte" diff --git a/tests/benchmarks/multicore/idle_with_pwm/CMakeLists.txt b/tests/benchmarks/multicore/idle_with_pwm/CMakeLists.txt new file mode 100644 index 000000000000..cde55c996f81 --- /dev/null +++ b/tests/benchmarks/multicore/idle_with_pwm/CMakeLists.txt @@ -0,0 +1,19 @@ +# +# Copyright (c) 2024 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_with_pwm) + +target_sources(app PRIVATE src/main.c) diff --git a/tests/benchmarks/multicore/idle_with_pwm/Kconfig b/tests/benchmarks/multicore/idle_with_pwm/Kconfig new file mode 100644 index 000000000000..a63b31a208e4 --- /dev/null +++ b/tests/benchmarks/multicore/idle_with_pwm/Kconfig @@ -0,0 +1,15 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +config TEST_SLEEP_DURATION_MS + int "Amount of time (in miliseconds) the core is sleeping" + default 1000 + help + Set sleep duration to TEST_SLEEP_DURATION_MS miliseconds. + Based on the value of 'min-residency-us' specified for each power state defined in the DTS, + core enters the lowest possible power state. + +source "Kconfig.zephyr" diff --git a/tests/benchmarks/multicore/idle_with_pwm/Kconfig.sysbuild b/tests/benchmarks/multicore/idle_with_pwm/Kconfig.sysbuild new file mode 100644 index 000000000000..0898eb292938 --- /dev/null +++ b/tests/benchmarks/multicore/idle_with_pwm/Kconfig.sysbuild @@ -0,0 +1,10 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" + +config REMOTE_BOARD + string "The board used for remote target" diff --git a/tests/benchmarks/multicore/idle_with_pwm/README.rst b/tests/benchmarks/multicore/idle_with_pwm/README.rst new file mode 100644 index 000000000000..9fe1d12c9bdf --- /dev/null +++ b/tests/benchmarks/multicore/idle_with_pwm/README.rst @@ -0,0 +1,76 @@ +.. _multicore_idle_with_pwm_test: + +PWM in low power states test +############################ + +.. contents:: + :local: + :depth: 2 + +This test benchmarks the idle behavior of an application that runs on multiple cores and uses the PWM driver to light up a LED. + +The test scenario repeats forever the following: + +* Gradually increase PWM duty cycle from 0% to 50% for one second (the LED lights up), power state active. +* Set PWM duty cycle to 0% for one second (PWM disabled, the LED is OFF), power state low. + +Requirements +************ + +The test supports the following development kit: + +.. table-from-rows:: /includes/sample_board_rows.txt + :header: heading + :rows: nrf54h20dk_nrf54h20_cpuapp + +Overview +******** + +The test demonstrates the use of PWM with low power modes. + +The code stored in the :file:`main.c` file is compiled for both application and radio cores. +The application core uses pwm130 to generate PWM signal on **LED2**. +The radio core uses pwm131 to generate PWM signal on GPIO port 0, pin 7. + +There are three test configurations in the :file:`testcase.yaml`. + +* ``benchmarks.multicore.idle_with_pwm.nrf54h20dk_cpuapp_cpurad.s2ram`` + + This configuration uses Kconfigs that enable entering low power modes. + Logging is disabled. + Core sleeps for time sufficient to enter the ``suspend-to-ram`` power state. + +* ``benchmarks.multicore.idle_with_pwm.nrf54h20dk_cpuapp_cpurad.sleep`` + + This configuration uses Kconfigs that enable entering low power modes. + Logging is disabled. + Core sleeps for time sufficient to enter the ``suspend-to-idle`` power state. + +* ``benchmarks.multicore.idle_with_pwm.nrf54h20dk_cpuapp_cpurad.no_sleep`` + + You can use this configuration for debug purposes. + Logging is enabled while power mode is disabled. + +Building and running +******************** + +.. |test path| replace:: :file:`tests/benchmarks/multicore/idle_with_pwm` + +.. include:: /includes/build_and_run_test.txt + +To build the test, use configuration setups from the :file:`testcase.yaml` file using the ``-T`` option. +See the example: + +.. code-block:: console + + west build -p -b nrf54h20dk/nrf54h20/cpuapp -T benchmarks.multicore.idle_with_pwm.nrf54h20dk_cpuapp_cpurad.s2ram . + +Testing +======= + +After programming the test to your development kit, complete the following steps to test it: + +1. Connect the PPK2 Power Profiler Kit or other current measurement device. +#. Reset the kit. +#. Observe the **LED2** brightness (or use oscilloscope to collect the PWM signal on port 0, pin 7). +#. When the **LED2** is off, the power profiler indicates low current consumption resulting from both cores being in low power mode. diff --git a/tests/benchmarks/multicore/idle_with_pwm/prj.conf b/tests/benchmarks/multicore/idle_with_pwm/prj.conf new file mode 100644 index 000000000000..bbe2b1d251b5 --- /dev/null +++ b/tests/benchmarks/multicore/idle_with_pwm/prj.conf @@ -0,0 +1,3 @@ +CONFIG_PRINTK=y +CONFIG_LOG=y +CONFIG_PWM=y diff --git a/tests/benchmarks/multicore/idle_with_pwm/prj_s2ram.conf b/tests/benchmarks/multicore/idle_with_pwm/prj_s2ram.conf new file mode 100644 index 000000000000..a1e7eba93d69 --- /dev/null +++ b/tests/benchmarks/multicore/idle_with_pwm/prj_s2ram.conf @@ -0,0 +1,15 @@ +CONFIG_PM=y +CONFIG_PM_S2RAM=y +CONFIG_POWEROFF=y +CONFIG_PM_S2RAM_CUSTOM_MARKING=y + +CONFIG_PM_DEVICE=y +CONFIG_PM_DEVICE_RUNTIME=y + +CONFIG_CONSOLE=n +CONFIG_UART_CONSOLE=n +CONFIG_SERIAL=n +CONFIG_BOOT_BANNER=n +CONFIG_NRFS_MRAM_SERVICE_ENABLED=n + +CONFIG_PWM=y diff --git a/tests/benchmarks/multicore/idle_with_pwm/remote/CMakeLists.txt b/tests/benchmarks/multicore/idle_with_pwm/remote/CMakeLists.txt new file mode 100644 index 000000000000..3f79e49afb26 --- /dev/null +++ b/tests/benchmarks/multicore/idle_with_pwm/remote/CMakeLists.txt @@ -0,0 +1,12 @@ +# +# Copyright (c) 2024 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(remote) + +target_sources(app PRIVATE ../src/main.c) diff --git a/tests/benchmarks/multicore/idle_with_pwm/remote/Kconfig b/tests/benchmarks/multicore/idle_with_pwm/remote/Kconfig new file mode 100644 index 000000000000..a63b31a208e4 --- /dev/null +++ b/tests/benchmarks/multicore/idle_with_pwm/remote/Kconfig @@ -0,0 +1,15 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +config TEST_SLEEP_DURATION_MS + int "Amount of time (in miliseconds) the core is sleeping" + default 1000 + help + Set sleep duration to TEST_SLEEP_DURATION_MS miliseconds. + Based on the value of 'min-residency-us' specified for each power state defined in the DTS, + core enters the lowest possible power state. + +source "Kconfig.zephyr" diff --git a/tests/benchmarks/multicore/idle_with_pwm/remote/boards/nrf54h20dk_nrf54h20_cpurad.overlay b/tests/benchmarks/multicore/idle_with_pwm/remote/boards/nrf54h20dk_nrf54h20_cpurad.overlay new file mode 100644 index 000000000000..5fcd71d3a39c --- /dev/null +++ b/tests/benchmarks/multicore/idle_with_pwm/remote/boards/nrf54h20dk_nrf54h20_cpurad.overlay @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/ { + aliases { + pwm-led0 = &pwm_gpio; + }; + + pwmleds { + compatible = "pwm-leds"; + pwm_gpio: pwm_gpio { + pwms = <&pwm131 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>; + }; + }; +}; + +&pinctrl { + /omit-if-no-ref/ pwm131_default: pwm131_default { + group1 { + psels = ; + }; + }; + + /omit-if-no-ref/ pwm131_sleep: pwm131_sleep { + group1 { + psels = ; + low-power-enable; + }; + }; +}; + +&pwm131 { + status = "okay"; + pinctrl-0 = <&pwm131_default>; + pinctrl-1 = <&pwm131_sleep>; + pinctrl-names = "default", "sleep"; + memory-regions = <&cpurad_dma_region>; +}; diff --git a/tests/benchmarks/multicore/idle_with_pwm/remote/prj.conf b/tests/benchmarks/multicore/idle_with_pwm/remote/prj.conf new file mode 100644 index 000000000000..bbe2b1d251b5 --- /dev/null +++ b/tests/benchmarks/multicore/idle_with_pwm/remote/prj.conf @@ -0,0 +1,3 @@ +CONFIG_PRINTK=y +CONFIG_LOG=y +CONFIG_PWM=y diff --git a/tests/benchmarks/multicore/idle_with_pwm/remote/prj_s2ram.conf b/tests/benchmarks/multicore/idle_with_pwm/remote/prj_s2ram.conf new file mode 100644 index 000000000000..0345ed9c78e1 --- /dev/null +++ b/tests/benchmarks/multicore/idle_with_pwm/remote/prj_s2ram.conf @@ -0,0 +1,10 @@ +CONFIG_PM=y +CONFIG_POWEROFF=y + +CONFIG_CONSOLE=n +CONFIG_UART_CONSOLE=n +CONFIG_SERIAL=n +CONFIG_BOOT_BANNER=n +CONFIG_NRFS_MRAM_SERVICE_ENABLED=n + +CONFIG_PWM=y diff --git a/tests/benchmarks/multicore/idle_with_pwm/src/main.c b/tests/benchmarks/multicore/idle_with_pwm/src/main.c new file mode 100644 index 000000000000..3db01d4fda3a --- /dev/null +++ b/tests/benchmarks/multicore/idle_with_pwm/src/main.c @@ -0,0 +1,97 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +LOG_MODULE_REGISTER(idle_with_pwm, LOG_LEVEL_INF); + +#include +#include +#include + +#if IS_ENABLED(CONFIG_SOC_NRF54H20_CPUAPP) +/* Alias pwm-led0 = &pwm_led2 */ +static const struct pwm_dt_spec pwm_led = PWM_DT_SPEC_GET(DT_ALIAS(pwm_led0)); +#elif IS_ENABLED(CONFIG_SOC_NRF54H20_CPURAD) +/* Alias pwm-led0 = &pwm_led3 */ +static const struct pwm_dt_spec pwm_led = PWM_DT_SPEC_GET(DT_ALIAS(pwm_led0)); +#else +#error "Invalid core selected." +#endif + +#define PWM_STEPS_PER_SEC (50) + +int main(void) +{ + int ret; + unsigned int cnt = 0; + uint32_t pwm_period; + uint32_t pulse_min; + uint32_t pulse_max; + int32_t pulse_step; + uint32_t current_pulse_width; + + if (!pwm_is_ready_dt(&pwm_led)) { + LOG_ERR("Device %s is not ready.", pwm_led.dev->name); + return -ENODEV; + } + + /* + * In case the default pwm_period value cannot be set for + * some PWM hardware, decrease its value until it can. + */ + pwm_period = PWM_USEC(200U); + LOG_INF("Testing PWM period of %d us for channel %d", + pwm_period, pwm_led.channel); + while (pwm_set_dt(&pwm_led, pwm_period, pwm_period) != 0) { + pwm_period /= 2U; + LOG_INF("Decreasing period to %u", pwm_period); + } + + /* + * There is no distinct change in LED brightness for high PWM duty cycles. + * Thus limit duty cycle to [0; max/2]. + */ + pulse_min = 0; + pulse_max = pwm_period / 2; + pulse_step = (pulse_max - pulse_min) / PWM_STEPS_PER_SEC; + LOG_DBG("Period is %u nsec", pwm_period); + LOG_DBG("PWM pulse width varies from %u to %u with %u step", + pulse_min, pulse_max, pulse_step); + + LOG_INF("Multicore idle_with_pwm test on %s", CONFIG_BOARD_TARGET); + LOG_INF("Core will sleep for %d ms", CONFIG_TEST_SLEEP_DURATION_MS); + + while (1) { + LOG_INF("Multicore idle_with_pwm test iteration %u", cnt++); + + /* Light up LED */ + current_pulse_width = pulse_min; + for (int i = 0; i < PWM_STEPS_PER_SEC; i++) { + /* set pulse width */ + ret = pwm_set_dt(&pwm_led, pwm_period, current_pulse_width); + if (ret) { + LOG_ERR("pwm_set_dt(%u, %u) returned %d", + pwm_period, current_pulse_width, ret); + return ret; + } + current_pulse_width += pulse_step; + k_msleep(1000 / PWM_STEPS_PER_SEC); + } + + /* Disable PWM / LED OFF */ + ret = pwm_set_dt(&pwm_led, 0, 0); + if (ret) { + LOG_ERR("pwm_set_dt(%u, %u) returned %d", + 0, 0, ret); + return ret; + } + + /* Sleep / enter low power state */ + k_msleep(CONFIG_TEST_SLEEP_DURATION_MS); + } + + return 0; +} diff --git a/tests/benchmarks/multicore/idle_with_pwm/sysbuild.cmake b/tests/benchmarks/multicore/idle_with_pwm/sysbuild.cmake new file mode 100644 index 000000000000..7af563e1ccc6 --- /dev/null +++ b/tests/benchmarks/multicore/idle_with_pwm/sysbuild.cmake @@ -0,0 +1,22 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# 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() + +# Add remote project +ExternalZephyrProject_Add( + APPLICATION remote + SOURCE_DIR ${APP_DIR}/remote + BOARD ${SB_CONFIG_REMOTE_BOARD} + BOARD_REVISION ${BOARD_REVISION} + ) + +# Add a dependency so that the remote image will be built and flashed first +add_dependencies(idle_with_pwm remote) +# Add dependency so that the remote image is flashed first. +sysbuild_add_dependencies(FLASH idle_with_pwm remote) diff --git a/tests/benchmarks/multicore/idle_with_pwm/sysbuild/nrf54h20dk_nrf54h20_cpurad.conf b/tests/benchmarks/multicore/idle_with_pwm/sysbuild/nrf54h20dk_nrf54h20_cpurad.conf new file mode 100644 index 000000000000..dd863e78d993 --- /dev/null +++ b/tests/benchmarks/multicore/idle_with_pwm/sysbuild/nrf54h20dk_nrf54h20_cpurad.conf @@ -0,0 +1 @@ +SB_CONFIG_REMOTE_BOARD="nrf54h20dk/nrf54h20/cpurad" diff --git a/tests/benchmarks/multicore/idle_with_pwm/testcase.yaml b/tests/benchmarks/multicore/idle_with_pwm/testcase.yaml new file mode 100644 index 000000000000..62af8ca65501 --- /dev/null +++ b/tests/benchmarks/multicore/idle_with_pwm/testcase.yaml @@ -0,0 +1,46 @@ +common: + sysbuild: true + tags: ci_build ci_tests_benchmarks_multicore + platform_allow: + - nrf54h20dk/nrf54h20/cpuapp + integration_platforms: + - nrf54h20dk/nrf54h20/cpuapp + +tests: + benchmarks.multicore.idle_with_pwm.nrf54h20dk_cpuapp_cpurad.no_sleep: + extra_args: + SB_CONF_FILE=sysbuild/nrf54h20dk_nrf54h20_cpurad.conf + harness: console + harness_config: + type: multi_line + ordered: true + regex: + - "Multicore idle_with_pwm test on" + - "Multicore idle_with_pwm test iteration 0" + - "Multicore idle_with_pwm test iteration 1" + + benchmarks.multicore.idle_with_pwm.nrf54h20dk_cpuapp_cpurad.idle: + tags: ppk_power_measure + extra_args: + SB_CONF_FILE=sysbuild/nrf54h20dk_nrf54h20_cpurad.conf + idle_with_pwm_CONF_FILE=prj_s2ram.conf + remote_CONF_FILE=prj_s2ram.conf + idle_with_pwm_CONFIG_TEST_SLEEP_DURATION_MS=500 + remote_CONFIG_TEST_SLEEP_DURATION_MS=500 + 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_idle" + + benchmarks.multicore.idle_with_pwm.nrf54h20dk_cpuapp_cpurad.s2ram: + tags: ppk_power_measure + extra_args: + SB_CONF_FILE=sysbuild/nrf54h20dk_nrf54h20_cpurad.conf + idle_with_pwm_CONF_FILE=prj_s2ram.conf + remote_CONF_FILE=prj_s2ram.conf + 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" diff --git a/tests/benchmarks/power_consumption/common/main.c b/tests/benchmarks/power_consumption/common/main.c index 279939cd2564..f9a9f5ff4d4d 100644 --- a/tests/benchmarks/power_consumption/common/main.c +++ b/tests/benchmarks/power_consumption/common/main.c @@ -32,8 +32,10 @@ K_TIMER_DEFINE(timer, timer_handler, NULL); int main(void) { + int rc; - gpio_pin_configure_dt(&led, GPIO_OUTPUT_ACTIVE); + rc = gpio_pin_configure_dt(&led, GPIO_OUTPUT_ACTIVE); + __ASSERT_NO_MSG(rc == 0); k_timer_start(&timer, K_SECONDS(1), K_SECONDS(1)); diff --git a/tests/benchmarks/power_consumption/gpio/CMakeLists.txt b/tests/benchmarks/power_consumption/gpio/CMakeLists.txt index 10455ae2d5fd..5998ab175592 100644 --- a/tests/benchmarks/power_consumption/gpio/CMakeLists.txt +++ b/tests/benchmarks/power_consumption/gpio/CMakeLists.txt @@ -1,10 +1,11 @@ # -# Copyright (c) 2024 Nordic Semiconductor +# Copyright (c) 2024 Nordic Semiconductor ASA # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # -cmake_minimum_required(VERSION 3.13.1) +cmake_minimum_required(VERSION 3.20.0) + find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) zephyr_include_directories(include) diff --git a/tests/benchmarks/power_consumption/gpio/Kconfig.sysbuild b/tests/benchmarks/power_consumption/gpio/Kconfig.sysbuild new file mode 100644 index 000000000000..0898eb292938 --- /dev/null +++ b/tests/benchmarks/power_consumption/gpio/Kconfig.sysbuild @@ -0,0 +1,10 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" + +config REMOTE_BOARD + string "The board used for remote target" diff --git a/tests/benchmarks/power_consumption/gpio/boards/nrf54h20dk_nrf54h20_cpuapp.conf b/tests/benchmarks/power_consumption/gpio/boards/nrf54h20dk_nrf54h20_cpuapp.conf new file mode 100644 index 000000000000..69e8854dad9d --- /dev/null +++ b/tests/benchmarks/power_consumption/gpio/boards/nrf54h20dk_nrf54h20_cpuapp.conf @@ -0,0 +1,8 @@ +# Enable runtime power management for peripheral +CONFIG_PM_DEVICE=y +CONFIG_PM_DEVICE_RUNTIME=y + +CONFIG_PM=y +CONFIG_PM_S2RAM=y +CONFIG_POWEROFF=y +CONFIG_PM_S2RAM_CUSTOM_MARKING=y diff --git a/tests/benchmarks/power_consumption/gpio/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/benchmarks/power_consumption/gpio/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index ddd53862fae2..0d182bd14198 100644 --- a/tests/benchmarks/power_consumption/gpio/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/tests/benchmarks/power_consumption/gpio/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -1,18 +1,4 @@ / { - power-states { - idle: idle { - compatible = "zephyr,power-state"; - power-state-name = "suspend-to-idle"; - min-residency-us = <100000>; - }; - - s2ram: s2ram { - compatible = "zephyr,power-state"; - power-state-name = "suspend-to-ram"; - min-residency-us = <800000>; - }; - }; - aliases { out0 = &output0; in0 = &input0; @@ -37,6 +23,7 @@ }; }; -&cpu { - cpu-power-states = <&idle &s2ram>; +&gpiote130 { + status = "okay"; + owned-channels = <0>; }; diff --git a/tests/benchmarks/power_consumption/gpio/prj.conf b/tests/benchmarks/power_consumption/gpio/prj.conf index 03d9e7a01369..02dddfb7f787 100644 --- a/tests/benchmarks/power_consumption/gpio/prj.conf +++ b/tests/benchmarks/power_consumption/gpio/prj.conf @@ -1,14 +1,8 @@ -# Enable runtime power management for peripheral -CONFIG_PM_DEVICE=y -CONFIG_PM_DEVICE_RUNTIME=y - -CONFIG_PM=y -CONFIG_PM_S2RAM=y -CONFIG_POWEROFF=y -CONFIG_PM_S2RAM_CUSTOM_MARKING=y CONFIG_GPIO=y CONFIG_CONSOLE=n CONFIG_UART_CONSOLE=n CONFIG_SERIAL=n CONFIG_BOOT_BANNER=n CONFIG_NRFS_MRAM_SERVICE_ENABLED=n + +CONFIG_ASSERT=y diff --git a/tests/benchmarks/power_consumption/gpio/remote/CMakeLists.txt b/tests/benchmarks/power_consumption/gpio/remote/CMakeLists.txt new file mode 100644 index 000000000000..97caab4871c3 --- /dev/null +++ b/tests/benchmarks/power_consumption/gpio/remote/CMakeLists.txt @@ -0,0 +1,12 @@ +# +# Copyright (c) 2024 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(remote) + +target_sources(app PRIVATE src/main.c) diff --git a/tests/benchmarks/power_consumption/gpio/remote/boards/nrf54h20dk_nrf54h20_cpurad.overlay b/tests/benchmarks/power_consumption/gpio/remote/boards/nrf54h20dk_nrf54h20_cpurad.overlay new file mode 100644 index 000000000000..c00bfcbf9464 --- /dev/null +++ b/tests/benchmarks/power_consumption/gpio/remote/boards/nrf54h20dk_nrf54h20_cpurad.overlay @@ -0,0 +1,10 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +&uart135 { + status = "disabled"; + /delete-property/memory-regions; +}; diff --git a/tests/benchmarks/power_consumption/gpio/remote/prj.conf b/tests/benchmarks/power_consumption/gpio/remote/prj.conf new file mode 100644 index 000000000000..e8e5e87638d8 --- /dev/null +++ b/tests/benchmarks/power_consumption/gpio/remote/prj.conf @@ -0,0 +1,8 @@ +CONFIG_PM=y +CONFIG_POWEROFF=y +CONFIG_CONSOLE=n +CONFIG_UART_CONSOLE=n +CONFIG_SERIAL=n +CONFIG_GPIO=n +CONFIG_BOOT_BANNER=n +CONFIG_NRFS_MRAM_SERVICE_ENABLED=n diff --git a/tests/benchmarks/power_consumption/gpio/remote/src/main.c b/tests/benchmarks/power_consumption/gpio/remote/src/main.c new file mode 100644 index 000000000000..61b5b084a585 --- /dev/null +++ b/tests/benchmarks/power_consumption/gpio/remote/src/main.c @@ -0,0 +1,14 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include + +int main(void) +{ + k_sleep(K_FOREVER); + + return 0; +} diff --git a/tests/benchmarks/power_consumption/gpio/src/driver_test.c b/tests/benchmarks/power_consumption/gpio/src/driver_test.c index 75e1dd17cd7e..01799d1ea0e2 100644 --- a/tests/benchmarks/power_consumption/gpio/src/driver_test.c +++ b/tests/benchmarks/power_consumption/gpio/src/driver_test.c @@ -18,20 +18,41 @@ static struct gpio_callback input_active_cb_data; void input_active(const struct device *dev, struct gpio_callback *cb, uint32_t pins) { - gpio_pin_toggle_dt(&led); + int rc; + + rc = gpio_pin_toggle_dt(&led); + __ASSERT_NO_MSG(rc == 0); } void thread_definition(void) { - gpio_pin_configure_dt(&output, GPIO_OUTPUT); - gpio_pin_configure_dt(&input, GPIO_INPUT); + int rc; + + rc = gpio_is_ready_dt(&input); + __ASSERT_NO_MSG(rc == 0); + + rc = gpio_is_ready_dt(&output); + __ASSERT_NO_MSG(rc == 0); + + rc = gpio_pin_configure_dt(&input, GPIO_INPUT); + __ASSERT_NO_MSG(rc == 0); + + rc = gpio_pin_configure_dt(&output, GPIO_OUTPUT); + __ASSERT_NO_MSG(rc == 0); + + rc = gpio_pin_interrupt_configure_dt(&input, GPIO_INT_LEVEL_ACTIVE); + __ASSERT_NO_MSG(rc == 0); - gpio_pin_interrupt_configure_dt(&input, GPIO_INT_EDGE_TO_ACTIVE); gpio_init_callback(&input_active_cb_data, input_active, BIT(input.pin)); - gpio_add_callback(input.port, &input_active_cb_data); + gpio_add_callback_dt(&input, &input_active_cb_data); while (1) { - gpio_pin_toggle_dt(&output); + rc = gpio_pin_set_dt(&output, 0); + __ASSERT_NO_MSG(rc == 0); + rc = gpio_pin_set_dt(&output, 1); + __ASSERT_NO_MSG(rc == 0); + rc = gpio_pin_set_dt(&output, 0); + k_msleep(10); } } diff --git a/tests/benchmarks/power_consumption/gpio/sysbuild.cmake b/tests/benchmarks/power_consumption/gpio/sysbuild.cmake new file mode 100644 index 000000000000..1d2405fd7f5a --- /dev/null +++ b/tests/benchmarks/power_consumption/gpio/sysbuild.cmake @@ -0,0 +1,20 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +if(NOT "${SB_CONFIG_REMOTE_BOARD}" STREQUAL "") + # Add remote project + ExternalZephyrProject_Add( + APPLICATION remote + SOURCE_DIR ${APP_DIR}/remote + BOARD ${SB_CONFIG_REMOTE_BOARD} + BOARD_REVISION ${BOARD_REVISION} + ) + + # Add a dependency so that the remote image will be built and flashed first + add_dependencies(gpio remote) + # Add dependency so that the remote image is flashed first. + sysbuild_add_dependencies(FLASH gpio remote) +endif() diff --git a/tests/benchmarks/power_consumption/gpio/sysbuild/nrf54h20dk_nrf54h20_cpurad.conf b/tests/benchmarks/power_consumption/gpio/sysbuild/nrf54h20dk_nrf54h20_cpurad.conf new file mode 100644 index 000000000000..dd863e78d993 --- /dev/null +++ b/tests/benchmarks/power_consumption/gpio/sysbuild/nrf54h20dk_nrf54h20_cpurad.conf @@ -0,0 +1 @@ +SB_CONFIG_REMOTE_BOARD="nrf54h20dk/nrf54h20/cpurad" diff --git a/tests/benchmarks/power_consumption/gpio/testcase.yaml b/tests/benchmarks/power_consumption/gpio/testcase.yaml index 44d364f388a4..789663a210a2 100644 --- a/tests/benchmarks/power_consumption/gpio/testcase.yaml +++ b/tests/benchmarks/power_consumption/gpio/testcase.yaml @@ -9,14 +9,17 @@ tests: - nrf54l15dk/nrf54l15/cpuapp harness: pytest harness_config: - fixture: ppk_power_measure + fixture: gpio_loopback pytest_root: - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_placeholder" benchmarks.power_consumption.gpio_nrf54h: + sysbuild: true integration_platforms: - nrf54h20dk/nrf54h20/cpuapp platform_allow: - nrf54h20dk/nrf54h20/cpuapp + extra_args: + - SB_CONF_FILE=sysbuild/nrf54h20dk_nrf54h20_cpurad.conf harness: pytest harness_config: fixture: gpio_loopback diff --git a/tests/benchmarks/power_consumption/timer_waiting/src/driver_test.c b/tests/benchmarks/power_consumption/timer_waiting/src/driver_test.c index a00936718afd..e392c02a175d 100644 --- a/tests/benchmarks/power_consumption/timer_waiting/src/driver_test.c +++ b/tests/benchmarks/power_consumption/timer_waiting/src/driver_test.c @@ -6,45 +6,32 @@ #include #include -#include #define ALARM_CHANNEL_ID (0) -#define LED0_NODE DT_ALIAS(led0) -static const struct gpio_dt_spec led = GPIO_DT_SPEC_GET(LED0_NODE, gpios); const struct device *const counter_dev = DEVICE_DT_GET(DT_ALIAS(counter)); -static bool state = true; - struct counter_alarm_cfg counter_cfg; -void counter_handler(const struct device *counter_dev, uint8_t id, uint32_t ticks, void *user_data) +void counter_handler(const struct device *counter_dev, uint8_t chan_id, + uint32_t ticks, void *user_data) { - counter_set_channel_alarm(counter_dev, ALARM_CHANNEL_ID, user_data); - gpio_pin_configure_dt(&led, GPIO_OUTPUT_ACTIVE); - for (int i = 1000000UL; i > 0; i--) { - if (state == true) { - state = false; - gpio_pin_set_dt(&led, 1); - } else { - state = true; - gpio_pin_set_dt(&led, 0); - } - } - gpio_pin_configure_dt(&led, GPIO_OUTPUT_INACTIVE); + k_busy_wait(500000); + counter_stop(counter_dev); } int main(void) { - counter_start(counter_dev); - - counter_cfg.flags = 0; - counter_cfg.ticks = counter_us_to_ticks(counter_dev, 1000000UL); - counter_cfg.callback = counter_handler; - counter_cfg.user_data = &counter_cfg; + while (1) { + k_msleep(1500); + counter_start(counter_dev); - counter_set_channel_alarm(counter_dev, ALARM_CHANNEL_ID, &counter_cfg); + counter_cfg.flags = 0; + counter_cfg.ticks = counter_us_to_ticks(counter_dev, 1000000UL); + counter_cfg.callback = counter_handler; + counter_cfg.user_data = &counter_cfg; - while (1) { - k_sleep(K_FOREVER); + counter_set_channel_alarm(counter_dev, ALARM_CHANNEL_ID, &counter_cfg); + k_msleep(1500); } + return 0; } diff --git a/tests/drivers/gpio/egpio_basic_api/CMakeLists.txt b/tests/drivers/gpio/egpio_basic_api/CMakeLists.txt new file mode 100644 index 000000000000..a89186ec9ca3 --- /dev/null +++ b/tests/drivers/gpio/egpio_basic_api/CMakeLists.txt @@ -0,0 +1,12 @@ +# +# Copyright (c) 2024 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(egpio_basic_api) + +FILE(GLOB app_sources src/test*.c) +target_sources(app PRIVATE ${app_sources}) diff --git a/tests/drivers/gpio/egpio_basic_api/README.txt b/tests/drivers/gpio/egpio_basic_api/README.txt new file mode 100644 index 000000000000..ca7a86d0c003 --- /dev/null +++ b/tests/drivers/gpio/egpio_basic_api/README.txt @@ -0,0 +1,18 @@ +eGPIO 2-Pin Test +############### + +This application tests the eGPIO subsystem using a hardware configuration +where two GPIOs are directly wired together. The test pins are +identified through a test-specific devicetree binding in the `dts/` +subdirectory, implemented for specific boards by overlay files in the +`boards/` directory. + +Only boards for which an overlay is present can pass this test. Boards +without an overlay, or for which the required wiring is not provided, +will fail with an error like this: + + Validate device GPIO_0 + Check egpio output 10 connected to GPIO_1 input 14 + FATAL output pin not wired to input pin? (out high => in low) + +No special build options are required to make use of the overlay. diff --git a/tests/drivers/gpio/egpio_basic_api/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/tests/drivers/gpio/egpio_basic_api/boards/nrf54l15dk_nrf54l15_cpuapp.overlay new file mode 100644 index 000000000000..539bbadfd637 --- /dev/null +++ b/tests/drivers/gpio/egpio_basic_api/boards/nrf54l15dk_nrf54l15_cpuapp.overlay @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/ { + resources { + compatible = "test-egpio"; + out-gpios = <&egpio 10 0>; + in-gpios = <&gpio1 14 0>; + }; +}; + +&gpiote20 { + status = "okay"; +}; + +&gpio1 { + status = "okay"; +}; diff --git a/tests/drivers/gpio/egpio_basic_api/dts/bindings/test-egpio.yaml b/tests/drivers/gpio/egpio_basic_api/dts/bindings/test-egpio.yaml new file mode 100644 index 000000000000..98e50baffdef --- /dev/null +++ b/tests/drivers/gpio/egpio_basic_api/dts/bindings/test-egpio.yaml @@ -0,0 +1,27 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +description: | + This binding provides resources required to build and run the + tests/drivers/gpio/egpio_basic_api test in Zephyr. + +compatible: "test-egpio" + +properties: + out-gpios: + type: phandle-array + required: true + description: | + Identity of an eGPIO that will be configured as an output. + This must be on the GPIO instance to which FLPR has access, + and physically connected to in-gpios. + + in-gpios: + type: phandle-array + required: true + description: | + Identity of a hardware GPIO that will be configured as an input. + This must be physically connected to out-gpios. diff --git a/tests/drivers/gpio/egpio_basic_api/prj.conf b/tests/drivers/gpio/egpio_basic_api/prj.conf new file mode 100644 index 000000000000..19b08c690ec6 --- /dev/null +++ b/tests/drivers/gpio/egpio_basic_api/prj.conf @@ -0,0 +1,2 @@ +CONFIG_GPIO=y +CONFIG_ZTEST=y diff --git a/tests/drivers/gpio/egpio_basic_api/src/test_egpio.h b/tests/drivers/gpio/egpio_basic_api/src/test_egpio.h new file mode 100644 index 000000000000..c35700bd6c50 --- /dev/null +++ b/tests/drivers/gpio/egpio_basic_api/src/test_egpio.h @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef __TEST_EGPIO_H__ +#define __TEST_EGPIO_H__ + +#include +#include +#include +#include + +#if DT_NODE_HAS_STATUS(DT_INST(0, test_egpio), okay) + +/* Execution of the test requires hardware configuration described in + * devicetree. See the test, egpio_basic_api binding local to this test + * for details. + */ +#define DEV_OUT DT_GPIO_CTLR(DT_INST(0, test_egpio), out_gpios) +#define DEV_IN DT_GPIO_CTLR(DT_INST(0, test_egpio), in_gpios) +#define DEV DEV_OUT +#define PIN_OUT DT_GPIO_PIN(DT_INST(0, test_egpio), out_gpios) +#define PIN_OUT_FLAGS DT_GPIO_FLAGS(DT_INST(0, test_egpio), out_gpios) +#define PIN_IN DT_GPIO_PIN(DT_INST(0, test_egpio), in_gpios) +#define PIN_IN_FLAGS DT_GPIO_FLAGS(DT_INST(0, test_egpio), in_gpios) +#else +#error Unsupported board +#endif + +#ifndef PIN_OUT +/* For build-only testing use fixed pins. */ +#define PIN_OUT 10 +#define PIN_IN 14 +#endif + +#define MAX_INT_CNT 3 +struct drv_data { + struct gpio_callback gpio_cb; + gpio_flags_t mode; + int index; + int aux; +}; + +void test_egpio_pin_read_write(void); +void test_egpio_callback_add_remove(void); +void test_egpio_callback_self_remove(void); +void test_egpio_callback_enable_disable(void); +void test_egpio_callback_variants(void); + +void test_egpio_port(void); + +void test_egpio_deprecated(void); + +#endif /* __TEST_EGPIO_H__ */ diff --git a/tests/drivers/gpio/egpio_basic_api/src/test_egpio_port.c b/tests/drivers/gpio/egpio_basic_api/src/test_egpio_port.c new file mode 100644 index 000000000000..28f8015058b5 --- /dev/null +++ b/tests/drivers/gpio/egpio_basic_api/src/test_egpio_port.c @@ -0,0 +1,482 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + + +#include "test_egpio.h" + +#define ALL_BITS ((gpio_port_value_t)-1) + +static const struct device *const dev_out = DEVICE_DT_GET(DEV_OUT); +static const struct device *const dev_in = DEVICE_DT_GET(DEV_IN); + +/* Delay after pull input config to allow signal to settle. The value + * selected is conservative (higher than may be necessary). + */ +#define PULL_DELAY_US 1000U + +/* Short-hand for a checked read of PIN_IN raw state */ +static bool raw_in(void) +{ + k_busy_wait(PULL_DELAY_US); + gpio_port_value_t v; + int rc = gpio_port_get_raw(dev_in, &v); + + zassert_equal(rc, 0, + "raw_in failed"); + return (v & BIT(PIN_IN)) ? true : false; +} + +/* Short-hand for a checked write of PIN_OUT raw state */ +static void raw_out(bool set) +{ + int rc; + + if (set) { + rc = gpio_port_set_bits_raw(dev_out, BIT(PIN_OUT)); + } else { + rc = gpio_port_clear_bits_raw(dev_out, BIT(PIN_OUT)); + } + zassert_equal(rc, 0, + "raw_out failed"); + k_busy_wait(PULL_DELAY_US); +} + +/* Short-hand for a checked write of PIN_OUT logic state */ +static void logic_out(bool set) +{ + int rc; + + if (set) { + rc = gpio_port_set_bits(dev_out, BIT(PIN_OUT)); + } else { + rc = gpio_port_clear_bits(dev_out, BIT(PIN_OUT)); + } + zassert_equal(rc, 0, + "raw_out failed"); + k_busy_wait(PULL_DELAY_US); +} + +/* Verify device, configure for physical in and out, verify + * connection, verify raw_in(). + */ +static int setup(void) +{ + int rc; + gpio_port_value_t v1; + + TC_PRINT("Validate device %s\n", dev_out->name); + zassert_true(device_is_ready(dev_out), "GPIO dev_out is not ready"); + + TC_PRINT("Validate device %s\n", dev_in->name); + zassert_true(device_is_ready(dev_in), "GPIO dev_out is not ready"); + + TC_PRINT("Check e%s output %d connected to %s input %d\n", dev_out->name, + PIN_OUT, dev_in->name, PIN_IN); + + rc = gpio_pin_configure(dev_in, PIN_IN, GPIO_INPUT); + zassert_equal(rc, 0, + "pin config input failed"); + + /* Test output low */ + rc = gpio_pin_configure(dev_out, PIN_OUT, GPIO_OUTPUT_LOW); + zassert_equal(rc, 0, + "pin config output low failed"); + + k_busy_wait(PULL_DELAY_US); + + rc = gpio_port_get_raw(dev_in, &v1); + zassert_equal(rc, 0, + "get raw low failed"); + if (raw_in() != false) { + TC_PRINT("FATAL output pin not wired to input pin? (out low => in high)\n"); + while (true) { + k_sleep(K_FOREVER); + } + } + + zassert_equal(v1 & BIT(PIN_IN), 0, + "out low does not read low"); + + /* Disconnect output */ + rc = gpio_pin_configure(dev_out, PIN_OUT, GPIO_DISCONNECTED); + if (rc == -ENOTSUP) { + TC_PRINT("NOTE: cannot configure pin as disconnected; trying as input\n"); + rc = gpio_pin_configure(dev_out, PIN_OUT, GPIO_INPUT); + } + zassert_equal(rc, 0, + "output disconnect failed"); + + /* Test output high */ + rc = gpio_pin_configure(dev_out, PIN_OUT, GPIO_OUTPUT_HIGH); + zassert_equal(rc, 0, + "pin config output high failed"); + + k_busy_wait(PULL_DELAY_US); + + rc = gpio_port_get_raw(dev_in, &v1); + zassert_equal(rc, 0, + "get raw high failed"); + if (raw_in() != true) { + TC_PRINT("FATAL output pin not wired to input pin? (out high => in low)\n"); + while (true) { + k_sleep(K_FOREVER); + } + } + zassert_not_equal(v1 & BIT(PIN_IN), 0, + "out high does not read low"); + + TC_PRINT("OUT %d to IN %d linkage works\n", PIN_OUT, PIN_IN); + return TC_PASS; +} + +/* gpio_port_set_bits_raw() + * gpio_port_clear_bits_raw() + * gpio_port_set_masked_raw() + * gpio_port_toggle_bits() + */ +static int bits_physical(void) +{ + int rc; + + TC_PRINT("- %s\n", __func__); + + /* port_set_bits_raw */ + rc = gpio_port_set_bits_raw(dev_out, BIT(PIN_OUT)); + zassert_equal(rc, 0, + "port set raw out failed"); + zassert_equal(raw_in(), true, + "raw set mismatch"); + + /* port_clear_bits_raw */ + rc = gpio_port_clear_bits_raw(dev_out, BIT(PIN_OUT)); + zassert_equal(rc, 0, + "port clear raw out failed"); + zassert_equal(raw_in(), false, + "raw clear mismatch"); + + /* set after clear changes */ + rc = gpio_port_set_bits_raw(dev_out, BIT(PIN_OUT)); + zassert_equal(rc, 0, + "port set raw out failed"); + zassert_equal(raw_in(), true, + "raw set mismatch"); + + /* raw_out() after set works */ + raw_out(false); + zassert_equal(raw_in(), false, + "raw_out() false mismatch"); + + /* raw_out() set after raw_out() clear works */ + raw_out(true); + zassert_equal(raw_in(), true, + "raw_out() true mismatch"); + + rc = gpio_port_set_masked_raw(dev_out, BIT(PIN_OUT), 0); + zassert_equal(rc, 0, + "set_masked_raw low failed"); + zassert_equal(raw_in(), false, + "set_masked_raw low mismatch"); + + rc = gpio_port_set_masked_raw(dev_out, BIT(PIN_OUT), ALL_BITS); + zassert_equal(rc, 0, + "set_masked_raw high failed"); + zassert_equal(raw_in(), true, + "set_masked_raw high mismatch"); + + rc = gpio_port_set_clr_bits_raw(dev_out, 0, BIT(PIN_OUT)); + zassert_equal(rc, 0, + "clear out failed"); + zassert_equal(raw_in(), false, + "clear out mismatch"); + + rc = gpio_port_set_clr_bits_raw(dev_out, BIT(PIN_OUT), 0); + zassert_equal(rc, 0, + "set out failed"); + zassert_equal(raw_in(), true, + "set out mismatch"); + + /* Conditionally verify that behavior with __ASSERT disabled + * is to set the bit. + */ + if (false) { + /* preserve set */ + rc = gpio_port_set_clr_bits_raw(dev_out, BIT(PIN_OUT), BIT(PIN_OUT)); + zassert_equal(rc, 0, + "s/c dup set failed"); + zassert_equal(raw_in(), true, + "s/c dup set mismatch"); + + /* do set */ + raw_out(false); + rc = gpio_port_set_clr_bits_raw(dev_out, BIT(PIN_OUT), BIT(PIN_OUT)); + zassert_equal(rc, 0, + "s/c dup2 set failed"); + zassert_equal(raw_in(), true, + "s/c dup2 set mismatch"); + } + + rc = gpio_port_toggle_bits(dev_out, BIT(PIN_OUT)); + zassert_equal(rc, 0, + "toggle_bits high-to-low failed"); + zassert_equal(raw_in(), false, + "toggle_bits high-to-low mismatch"); + + rc = gpio_port_toggle_bits(dev_out, BIT(PIN_OUT)); + zassert_equal(rc, 0, + "toggle_bits low-to-high failed"); + zassert_equal(raw_in(), true, + "toggle_bits low-to-high mismatch"); + + return TC_PASS; +} + +/* gpio_pin_get_raw() + * gpio_pin_set_raw() + */ +static int pin_physical(void) +{ + int rc; + + TC_PRINT("- %s\n", __func__); + + raw_out(true); + zassert_equal(gpio_pin_get_raw(dev_in, PIN_IN), raw_in(), + "pin_get_raw high failed"); + + raw_out(false); + zassert_equal(gpio_pin_get_raw(dev_in, PIN_IN), raw_in(), + "pin_get_raw low failed"); + + rc = gpio_pin_set_raw(dev_out, PIN_OUT, 32); + zassert_equal(rc, 0, + "pin_set_raw high failed"); + zassert_equal(raw_in(), true, + "pin_set_raw high failed"); + + rc = gpio_pin_set_raw(dev_out, PIN_OUT, 0); + zassert_equal(rc, 0, + "pin_set_raw low failed"); + zassert_equal(raw_in(), false, + "pin_set_raw low failed"); + + rc = gpio_pin_toggle(dev_out, PIN_OUT); + zassert_equal(rc, 0, + "pin_toggle low-to-high failed"); + zassert_equal(raw_in(), true, + "pin_toggle low-to-high mismatch"); + + rc = gpio_pin_toggle(dev_out, PIN_OUT); + zassert_equal(rc, 0, + "pin_toggle high-to-low failed"); + zassert_equal(raw_in(), false, + "pin_toggle high-to-low mismatch"); + + return TC_PASS; +} + +/* Verify configure output level is independent of active level, and + * raw output is independent of active level. + */ +static int check_raw_output_levels(void) +{ + int rc; + + TC_PRINT("- %s\n", __func__); + + rc = gpio_pin_configure(dev_out, PIN_OUT, + GPIO_ACTIVE_HIGH | GPIO_OUTPUT_LOW); + zassert_equal(rc, 0, + "active high output low failed"); + zassert_equal(raw_in(), false, + "active high output low raw mismatch"); + raw_out(true); + zassert_equal(raw_in(), true, + "set high mismatch"); + + rc = gpio_pin_configure(dev_out, PIN_OUT, + GPIO_ACTIVE_HIGH | GPIO_OUTPUT_HIGH); + zassert_equal(rc, 0, + "active high output high failed"); + zassert_equal(raw_in(), true, + "active high output high raw mismatch"); + raw_out(false); + zassert_equal(raw_in(), false, + "set low mismatch"); + + rc = gpio_pin_configure(dev_out, PIN_OUT, + GPIO_ACTIVE_LOW | GPIO_OUTPUT_LOW); + zassert_equal(rc, 0, + "active low output low failed"); + zassert_equal(raw_in(), false, + "active low output low raw mismatch"); + raw_out(true); + zassert_equal(raw_in(), true, + "set high mismatch"); + + rc = gpio_pin_configure(dev_out, PIN_OUT, + GPIO_ACTIVE_LOW | GPIO_OUTPUT_HIGH); + zassert_equal(rc, 0, + "active low output high failed"); + zassert_equal(raw_in(), true, + "active low output high raw mismatch"); + raw_out(false); + zassert_equal(raw_in(), false, + "set low mismatch"); + + return TC_PASS; +} + +/* Verify configure output level is dependent on active level, and + * logic output is dependent on active level. + */ +static int check_logic_output_levels(void) +{ + int rc; + + TC_PRINT("- %s\n", __func__); + + rc = gpio_pin_configure(dev_out, PIN_OUT, + GPIO_ACTIVE_HIGH | GPIO_OUTPUT_INACTIVE); + zassert_equal(rc, 0, + "active true output false failed: %d", rc); + zassert_equal(raw_in(), false, + "active true output false logic mismatch"); + logic_out(true); + zassert_equal(raw_in(), true, + "set true mismatch"); + + rc = gpio_pin_configure(dev_out, PIN_OUT, + GPIO_ACTIVE_HIGH | GPIO_OUTPUT_ACTIVE); + zassert_equal(rc, 0, + "active true output true failed"); + zassert_equal(raw_in(), true, + "active true output true logic mismatch"); + logic_out(false); + zassert_equal(raw_in(), false, + "set false mismatch"); + + rc = gpio_pin_configure(dev_out, PIN_OUT, + GPIO_ACTIVE_LOW | GPIO_OUTPUT_ACTIVE); + zassert_equal(rc, 0, + "active low output true failed"); + + zassert_equal(raw_in(), false, + "active low output true raw mismatch"); + logic_out(false); + zassert_equal(raw_in(), true, + "set false mismatch"); + + rc = gpio_pin_configure(dev_out, PIN_OUT, + GPIO_ACTIVE_LOW | GPIO_OUTPUT_INACTIVE); + zassert_equal(rc, 0, + "active low output false failed"); + zassert_equal(raw_in(), true, + "active low output false logic mismatch"); + logic_out(true); + zassert_equal(raw_in(), false, + "set true mismatch"); + + return TC_PASS; +} + +/* gpio_port_set_bits() + * gpio_port_clear_bits() + * gpio_port_set_masked() + * gpio_port_toggle_bits() + */ +static int bits_logical(void) +{ + int rc; + + TC_PRINT("- %s\n", __func__); + + rc = gpio_pin_configure(dev_out, PIN_OUT, + GPIO_OUTPUT_HIGH | GPIO_ACTIVE_LOW); + zassert_equal(rc, 0, + "output configure failed"); + zassert_equal(raw_in(), true, + "raw out high mismatch"); + + /* port_set_bits */ + rc = gpio_port_set_bits(dev_out, BIT(PIN_OUT)); + zassert_equal(rc, 0, + "port set raw out failed"); + zassert_equal(raw_in(), false, + "raw low set mismatch"); + + /* port_clear_bits */ + rc = gpio_port_clear_bits(dev_out, BIT(PIN_OUT)); + zassert_equal(rc, 0, + "port clear raw out failed"); + zassert_equal(raw_in(), true, + "raw low clear mismatch"); + + /* set after clear changes */ + rc = gpio_port_set_bits_raw(dev_out, BIT(PIN_OUT)); + zassert_equal(rc, 0, + "port set raw out failed"); + zassert_equal(raw_in(), true, + "raw set mismatch"); + + /* Conditionally verify that behavior with __ASSERT disabled + * is to set the bit. + */ + if (false) { + /* preserve set */ + rc = gpio_port_set_clr_bits(dev_out, BIT(PIN_OUT), BIT(PIN_OUT)); + zassert_equal(rc, 0, + "s/c set toggle failed"); + zassert_equal(raw_in(), false, + "s/c set toggle mismatch"); + + /* force set */ + raw_out(true); + rc = gpio_port_set_clr_bits(dev_out, BIT(PIN_OUT), BIT(PIN_OUT)); + zassert_equal(rc, 0, + "s/c dup set failed"); + zassert_equal(raw_in(), false, + "s/c dup set mismatch"); + } + + rc = gpio_port_toggle_bits(dev_out, BIT(PIN_OUT)); + zassert_equal(rc, 0, + "toggle_bits active-to-inactive failed"); + zassert_equal(raw_in(), false, + "toggle_bits active-to-inactive mismatch"); + + rc = gpio_port_toggle_bits(dev_out, BIT(PIN_OUT)); + zassert_equal(rc, 0, + "toggle_bits inactive-to-active failed"); + zassert_equal(raw_in(), true, + "toggle_bits inactive-to-active mismatch"); + + rc = gpio_pin_toggle(dev_out, PIN_OUT); + zassert_equal(rc, 0, + "pin_toggle low-to-high failed"); + zassert_equal(raw_in(), false, + "pin_toggle low-to-high mismatch"); + + return TC_PASS; +} + +ZTEST(egpio_port, test_egpio_port) +{ + zassert_equal(setup(), TC_PASS, + "device setup failed"); + zassert_equal(bits_physical(), TC_PASS, + "bits_physical failed"); + zassert_equal(pin_physical(), TC_PASS, + "pin_physical failed"); + zassert_equal(check_raw_output_levels(), TC_PASS, + "check_raw_output_levels failed"); + zassert_equal(check_logic_output_levels(), TC_PASS, + "check_logic_output_levels failed"); + zassert_equal(bits_logical(), TC_PASS, + "bits_logical failed"); +} + +/* Test GPIO port configuration */ +ZTEST_SUITE(egpio_port, NULL, NULL, NULL, NULL, NULL); diff --git a/tests/drivers/gpio/egpio_basic_api/sysbuild.conf b/tests/drivers/gpio/egpio_basic_api/sysbuild.conf new file mode 100644 index 000000000000..e580c9c26c79 --- /dev/null +++ b/tests/drivers/gpio/egpio_basic_api/sysbuild.conf @@ -0,0 +1,3 @@ +SB_CONFIG_PARTITION_MANAGER=n +SB_CONFIG_SDP=y +SB_CONFIG_EGPIO_FLPR_APPLICATION=y diff --git a/tests/drivers/gpio/egpio_basic_api/testcase.yaml b/tests/drivers/gpio/egpio_basic_api/testcase.yaml new file mode 100644 index 000000000000..5fd4c7ae7ec3 --- /dev/null +++ b/tests/drivers/gpio/egpio_basic_api/testcase.yaml @@ -0,0 +1,28 @@ +common: + tags: + - drivers + - gpio + - ci_tests_drivers_egpio + depends_on: gpio + harness: ztest + harness_config: + fixture: gpio_loopback + +tests: + drivers.egpio.loopback_icmsg: + min_flash: 64 + platform_allow: + - nrf54l15dk/nrf54l15/cpuapp + integration_platforms: + - nrf54l15dk/nrf54l15/cpuapp + sysbuild: true + extra_args: SB_CONFIG_EGPIO_BACKEND_ICMSG=y + + drivers.egpio.loopback_mbox: + min_flash: 64 + platform_allow: + - nrf54l15dk/nrf54l15/cpuapp + integration_platforms: + - nrf54l15dk/nrf54l15/cpuapp + sysbuild: true + extra_args: SB_CONFIG_EGPIO_BACKEND_MBOX=y diff --git a/tests/lib/date_time/CMakeLists.txt b/tests/lib/date_time/CMakeLists.txt index c41241cc6798..7f9377d22085 100644 --- a/tests/lib/date_time/CMakeLists.txt +++ b/tests/lib/date_time/CMakeLists.txt @@ -14,7 +14,8 @@ test_runner_generate(src/main.c) cmock_handle(${ZEPHYR_NRFXLIB_MODULE_DIR}/nrf_modem/include/nrf_modem_at.h FUNC_EXCLUDE ".*nrf_modem_at_scanf" - FUNC_EXCLUDE ".*nrf_modem_at_printf") + FUNC_EXCLUDE ".*nrf_modem_at_printf" + WORD_EXCLUDE "__nrf_modem_(printf|scanf)_like\(.*\)") cmock_handle(${ZEPHYR_BASE}/include/zephyr/net/sntp.h) cmock_handle(${ZEPHYR_BASE}/include/zephyr/net/socket.h) diff --git a/tests/lib/date_time/prj.conf b/tests/lib/date_time/prj.conf index 6753a689cb5e..7b3f8b41c672 100644 --- a/tests/lib/date_time/prj.conf +++ b/tests/lib/date_time/prj.conf @@ -14,6 +14,11 @@ CONFIG_MOCK_NRF_MODEM_AT=y CONFIG_LTE_LINK_CONTROL=y CONFIG_POSIX_API=y +CONFIG_DATE_TIME_UPDATE_INTERVAL_SECONDS=3 +CONFIG_DATE_TIME_TOO_OLD_SECONDS=1 +CONFIG_DATE_TIME_RETRY_COUNT=2 +CONFIG_DATE_TIME_RETRY_INTERVAL_SECONDS=1 + # Enable logs if you want to explore them CONFIG_LOG=n CONFIG_DATE_TIME_LOG_LEVEL_DBG=n diff --git a/tests/lib/date_time/src/main.c b/tests/lib/date_time/src/main.c index 1d271c6252da..5bdd5c3e97ee 100644 --- a/tests/lib/date_time/src/main.c +++ b/tests/lib/date_time/src/main.c @@ -9,6 +9,8 @@ #include #include #include +#include +#include #include #include #include @@ -16,17 +18,15 @@ #include #include "cmock_nrf_modem_at.h" +#include "cmock_socket.h" +#include "cmock_sntp.h" -#define TEST_EVENT_MAX_COUNT 10 - -struct test_date_time_cb { - enum date_time_evt_type type; -}; - -struct test_date_time_cb test_date_time_cb_data[TEST_EVENT_MAX_COUNT] = {0}; +/* NOTE: These tests run for few tens of seconds because we are waiting for the + * date-time update and retry intervals. + */ -static int date_time_cb_count_occurred; -static int date_time_cb_count_expected; +#define TEST_EVENT_MAX_COUNT 10 +#define TEST_CB_WAIT_TIME (CONFIG_DATE_TIME_UPDATE_INTERVAL_SECONDS * 1000 + 1000) static void date_time_callback(const struct date_time_evt *evt); @@ -40,15 +40,80 @@ extern void at_monitor_dispatch(const char *at_notif); */ extern void date_time_modem_on_cfun(int mode, void *ctx); -K_SEM_DEFINE(date_time_callback_sem, 0, 1); +struct test_date_time_cb { + enum date_time_evt_type type; + int64_t uptime_start; + int64_t uptime_current; + int64_t time_expected; +}; + +static struct test_date_time_cb test_date_time_cb_data[TEST_EVENT_MAX_COUNT] = {0}; + +static int date_time_cb_count_occurred; +static int date_time_cb_count_expected; + +static K_SEM_DEFINE(date_time_callback_sem, 0, 1); + +static char at_notif[128]; + +/** Fri Aug 07 2020 15:11:30 UTC. */ +static struct tm date_time_global = { + .tm_year = 120, + .tm_mon = 7, + .tm_mday = 7, + .tm_hour = 15, + .tm_min = 11, + .tm_sec = 30 +}; +/** UNIX timestamp equivalent to tm structure date_time_global. */ +static int64_t date_time_global_unix = 1596813090000; + +#if defined(CONFIG_DATE_TIME_NTP) +static struct sockaddr ai_addr_uio_ntp = { + .sa_family = AF_INET, + .data = "100.101.102.103" +}; + +static struct zsock_addrinfo res_data_uio_ntp = { + .ai_addr = &ai_addr_uio_ntp, + .ai_addrlen = sizeof(struct sockaddr), +}; + +static struct zsock_addrinfo *res_uio_ntp = &res_data_uio_ntp; + +static struct sockaddr ai_addr_google_ntp = { + .sa_family = AF_INET, + .data = "1.2.3.4" +}; + +static struct zsock_addrinfo res_data_google_ntp = { + .ai_addr = &ai_addr_google_ntp, + .ai_addrlen = sizeof(struct sockaddr), +}; + +static struct zsock_addrinfo *res_google_ntp = &res_data_google_ntp; + +static struct zsock_addrinfo hints = { + .ai_flags = AI_NUMERICSERV, + .ai_family = AF_UNSPEC /* Allow both IPv4 and IPv6 addresses */ +}; + +static struct sntp_time sntp_time_value = { + .seconds = 42900180919421 +}; +#endif void setUp(void) { mock_nrf_modem_at_Init(); + memset(test_date_time_cb_data, 0, sizeof(test_date_time_cb_data)); + date_time_cb_count_occurred = 0; date_time_cb_count_expected = 0; + test_date_time_cb_data[0].uptime_start = k_uptime_get(); + date_time_register_handler(date_time_callback); } @@ -67,12 +132,22 @@ static void date_time_callback(const struct date_time_evt *evt) TEST_ASSERT_MESSAGE(date_time_cb_count_occurred < date_time_cb_count_expected, "date-time event callback called more times than expected"); + TEST_ASSERT_MESSAGE(date_time_cb_count_occurred < TEST_EVENT_MAX_COUNT, + "date-time event callback called more times than TEST_EVENT_MAX_COUNT"); + TEST_ASSERT_EQUAL(test_date_time_cb_data[date_time_cb_count_occurred].type, evt->type); + /* Check time when callback occurred compared to expected time since the test case start */ + TEST_ASSERT_INT64_WITHIN( + 100, + test_date_time_cb_data[date_time_cb_count_occurred].time_expected, + k_uptime_get() - test_date_time_cb_data[0].uptime_start); + date_time_cb_count_occurred++; k_sem_give(&date_time_callback_sem); } +/** Reset to: Fri Aug 07 2020 15:11:30 UTC. */ static void reset_to_valid_time(struct tm *time) { time->tm_year = 120; @@ -83,104 +158,81 @@ static void reset_to_valid_time(struct tm *time) time->tm_sec = 30; } -void test_date_time_invalid_input(void) +void test_date_time_set_invalid_input_fail(void) { int ret; struct tm date_time_dummy; reset_to_valid_time(&date_time_dummy); - /** Invalid year. */ + /** Invalid year */ date_time_dummy.tm_year = 2020; - ret = date_time_set(&date_time_dummy); TEST_ASSERT_EQUAL(-EINVAL, ret); date_time_dummy.tm_year = 114; - ret = date_time_set(&date_time_dummy); TEST_ASSERT_EQUAL(-EINVAL, ret); reset_to_valid_time(&date_time_dummy); - /**********************************************************************/ - - /** Invalid month. */ + /** Invalid month */ date_time_dummy.tm_mon = 12; - ret = date_time_set(&date_time_dummy); TEST_ASSERT_EQUAL(-EINVAL, ret); date_time_dummy.tm_mon = -1; - ret = date_time_set(&date_time_dummy); TEST_ASSERT_EQUAL(-EINVAL, ret); reset_to_valid_time(&date_time_dummy); - /**********************************************************************/ - - /** Invalid day. */ + /** Invalid day */ date_time_dummy.tm_mday = 0; - ret = date_time_set(&date_time_dummy); TEST_ASSERT_EQUAL(-EINVAL, ret); date_time_dummy.tm_mday = 32; - ret = date_time_set(&date_time_dummy); TEST_ASSERT_EQUAL(-EINVAL, ret); reset_to_valid_time(&date_time_dummy); - /**********************************************************************/ - - /** Invalid hour. */ + /** Invalid hour */ date_time_dummy.tm_hour = -1; - ret = date_time_set(&date_time_dummy); TEST_ASSERT_EQUAL(-EINVAL, ret); date_time_dummy.tm_hour = 24; - ret = date_time_set(&date_time_dummy); TEST_ASSERT_EQUAL(-EINVAL, ret); reset_to_valid_time(&date_time_dummy); - /**********************************************************************/ - /** Invalid minutes. */ date_time_dummy.tm_min = -1; - ret = date_time_set(&date_time_dummy); TEST_ASSERT_EQUAL(-EINVAL, ret); date_time_dummy.tm_min = 60; - ret = date_time_set(&date_time_dummy); TEST_ASSERT_EQUAL(-EINVAL, ret); reset_to_valid_time(&date_time_dummy); - /**********************************************************************/ - - /** Invalid seconds. */ + /** Invalid seconds */ date_time_dummy.tm_sec = -1; - ret = date_time_set(&date_time_dummy); TEST_ASSERT_EQUAL(-EINVAL, ret); date_time_dummy.tm_sec = 62; - ret = date_time_set(&date_time_dummy); TEST_ASSERT_EQUAL(-EINVAL, ret); reset_to_valid_time(&date_time_dummy); - } -void test_date_time_null_input(void) +void test_date_time_null_input_fail(void) { int ret; @@ -200,7 +252,7 @@ void test_date_time_null_input(void) TEST_ASSERT_EQUAL(-EINVAL, ret); } -void test_date_time_premature_request(void) +void test_date_time_no_valid_time_fail(void) { int ret; int64_t ts_unix_ms = 0; @@ -209,47 +261,40 @@ void test_date_time_premature_request(void) TEST_ASSERT_EQUAL(-ENODATA, ret); TEST_ASSERT_EQUAL(0, ts_unix_ms); - ret = date_time_uptime_to_unix_time_ms(&ts_unix_ms); + ret = date_time_now_local(&ts_unix_ms); TEST_ASSERT_EQUAL(-ENODATA, ret); TEST_ASSERT_EQUAL(0, ts_unix_ms); + ret = date_time_uptime_to_unix_time_ms(&ts_unix_ms); + TEST_ASSERT_EQUAL(-ENODATA, ret); + TEST_ASSERT_EQUAL(0, ts_unix_ms); } -void test_date_time_already_converted(void) +void test_date_time_uptime_to_unix_time_ms_already_converted(void) { + int ret; + /* Wait to get uptime non-zero for date_time_uptime_to_unix_time_ms() call */ k_sleep(K_MSEC(10)); date_time_register_handler(NULL); date_time_clear(); - int ret; - - date_time_register_handler(NULL); - - struct tm date_time_dummy = { - .tm_year = 120, - .tm_mon = 7, - .tm_mday = 7, - .tm_hour = 15, - .tm_min = 11, - .tm_sec = 30 - }; +#if defined(CONFIG_DATE_TIME_MODEM) __mock_nrf_modem_at_printf_ExpectAndReturn("AT+CCLK=\"20/08/07,15:11:30+99\"", 0); - - ret = date_time_set(&date_time_dummy); +#endif + ret = date_time_set(&date_time_global); TEST_ASSERT_EQUAL(0, ret); /** Fri Aug 07 2020 15:11:30 UTC. */ - int64_t ts_unix_ms = 1596813090000; - int64_t ts_unix_ms_prev = 1596813090000; + int64_t ts_unix_ms = date_time_global_unix; ret = date_time_uptime_to_unix_time_ms(&ts_unix_ms); TEST_ASSERT_EQUAL(-EINVAL, ret); - TEST_ASSERT_EQUAL(ts_unix_ms_prev, ts_unix_ms); + TEST_ASSERT_EQUAL(date_time_global_unix, ts_unix_ms); } -void test_date_time_negative_uptime(void) +void test_date_time_uptime_to_unix_time_ms_negative_fail(void) { int ret; @@ -259,7 +304,7 @@ void test_date_time_negative_uptime(void) TEST_ASSERT_EQUAL(-EINVAL, ret); } -void test_date_time_clear(void) +void test_date_time_timestamp_clear(void) { int ret; @@ -275,38 +320,27 @@ void test_date_time_clear(void) TEST_ASSERT_EQUAL(0, ts_unix_ms); } -void test_date_time_conversion(void) +void test_date_time_uptime_to_unix_time_ms(void) { - date_time_register_handler(NULL); - date_time_clear(); - int ret; - struct tm date_time_dummy = { - .tm_year = 120, - .tm_mon = 7, - .tm_mday = 7, - .tm_hour = 15, - .tm_min = 11, - .tm_sec = 30 - }; - - /** UNIX timestamp equivalent to tm structure date_time_dummy. */ - /** Fri Aug 07 2020 15:11:30 UTC. */ - int64_t date_time_utc_unix = 1596813090000; - int64_t date_time_utc_unix_origin = k_uptime_get(); + int64_t date_time_global_unix_origin = k_uptime_get(); int64_t uptime = k_uptime_get(); int64_t ts_unix_ms = 0; int64_t ts_expect = 0; - __mock_nrf_modem_at_printf_ExpectAndReturn("AT+CCLK=\"20/08/07,15:11:30+99\"", 0); + date_time_register_handler(NULL); + date_time_clear(); - ret = date_time_set(&date_time_dummy); +#if defined(CONFIG_DATE_TIME_MODEM) + __mock_nrf_modem_at_printf_ExpectAndReturn("AT+CCLK=\"20/08/07,15:11:30+99\"", 0); +#endif + ret = date_time_set(&date_time_global); TEST_ASSERT_EQUAL(0, ret); ret = date_time_now(&ts_unix_ms); TEST_ASSERT_EQUAL(0, ret); - ts_expect = date_time_utc_unix - date_time_utc_unix_origin + k_uptime_get(); + ts_expect = date_time_global_unix - date_time_global_unix_origin + k_uptime_get(); /* We cannot compare exact conversions given by the date time library due to the fact that * the comparing values are based on k_uptime_get(). Use range instead and compare agains an @@ -324,7 +358,7 @@ void test_date_time_conversion(void) ret = date_time_uptime_to_unix_time_ms(&uptime); TEST_ASSERT_EQUAL(0, ret); - ts_expect = date_time_utc_unix - date_time_utc_unix_origin; + ts_expect = date_time_global_unix - date_time_global_unix_origin; TEST_ASSERT_INT64_WITHIN(100, ts_expect, uptime); @@ -333,7 +367,7 @@ void test_date_time_conversion(void) ret = date_time_uptime_to_unix_time_ms(&uptime); TEST_ASSERT_EQUAL(0, ret); - ts_expect = date_time_utc_unix - date_time_utc_unix_origin + k_uptime_get(); + ts_expect = date_time_global_unix - date_time_global_unix_origin + k_uptime_get(); TEST_ASSERT_INT64_WITHIN(100, ts_expect, uptime); @@ -344,40 +378,663 @@ void test_date_time_conversion(void) ret = date_time_uptime_to_unix_time_ms(&uptime); TEST_ASSERT_EQUAL(0, ret); - ts_expect = date_time_utc_unix - date_time_utc_unix_origin + k_uptime_get(); + ts_expect = date_time_global_unix - date_time_global_unix_origin + k_uptime_get(); TEST_ASSERT_INT64_WITHIN(100, ts_expect, uptime); } -void test_date_time_validity(void) +void test_date_time_is_valid(void) { + int ret; + int64_t ts_unix_ms = 0; + /* Wait to get uptime non-zero for last date_time_is_valid() call */ k_sleep(K_MSEC(10)); date_time_register_handler(NULL); date_time_clear(); - int ret; - struct tm date_time_dummy = { - .tm_year = 120, - .tm_mon = 7, - .tm_mday = 7, - .tm_hour = 15, - .tm_min = 11, - .tm_sec = 30 - }; - ret = date_time_is_valid(); TEST_ASSERT_EQUAL(false, ret); + /* Local time not valid here because there is no valid time */ + ret = date_time_is_valid_local(); + TEST_ASSERT_EQUAL(false, ret); + +#if defined(CONFIG_DATE_TIME_MODEM) __mock_nrf_modem_at_printf_ExpectAndReturn("AT+CCLK=\"20/08/07,15:11:30+99\"", 0); +#endif + ret = date_time_set(&date_time_global); + TEST_ASSERT_EQUAL(0, ret); - /** UNIX timestamp equavivalent to tm structure date_time_dummy. */ - /** Fri Aug 07 2020 15:11:30 UTC. */ - ret = date_time_set(&date_time_dummy); + ret = date_time_is_valid(); + TEST_ASSERT_EQUAL(true, ret); + + /* Local time still not valid here because timezone is not set with date_time_set() + * but it requires modem time so that's checked elsewhere. + */ + ret = date_time_is_valid_local(); + TEST_ASSERT_EQUAL(false, ret); + + ret = date_time_now(&ts_unix_ms); TEST_ASSERT_EQUAL(0, ret); + TEST_ASSERT_INT64_WITHIN(100, date_time_global_unix, ts_unix_ms); + + ts_unix_ms = 0; + ret = date_time_now_local(&ts_unix_ms); + TEST_ASSERT_EQUAL(-EAGAIN, ret); + TEST_ASSERT_EQUAL(0, ts_unix_ms); +} + +void test_date_time_xtime_subscribe_fail(void) +{ +#if !defined(CONFIG_DATE_TIME_MODEM) + TEST_IGNORE(); +#endif + /* %XTIME subscription not sent with wrong functional mode */ + date_time_modem_on_cfun(LTE_LC_FUNC_MODE_OFFLINE, NULL); + k_sleep(K_MSEC(1)); + + /* %XTIME subscription fails */ + __mock_nrf_modem_at_printf_ExpectAndReturn("AT%XTIME=1", -ENOMEM); + date_time_modem_on_cfun(LTE_LC_FUNC_MODE_NORMAL, NULL); + k_sleep(K_MSEC(1)); +} + +/** + * Test initial auto update 1 second from the boot. + * Using modem or NTP time depending on the configuration. + * NTP is used if both are configured because modem time is used in that case only + * if XTIME notification has been received, which is not the case here. + * + * Note: This test must be before any %XTIME notification tests because it will set + * modem_valid_network_time and we cannot revert it back to 'false' anymore. + */ +void test_date_time_initial_auto_update_at_1s_from_boot(void) +{ +#if !defined(CONFIG_DATE_TIME_MODEM) && !defined(CONFIG_DATE_TIME_NTP) + TEST_IGNORE(); +#endif + date_time_cb_count_expected = 1; +#if defined(CONFIG_DATE_TIME_NTP) + test_date_time_cb_data[0].type = DATE_TIME_OBTAINED_NTP; +#else /* CONFIG_DATE_TIME_MODEM */ + test_date_time_cb_data[0].type = DATE_TIME_OBTAINED_MODEM; +#endif + test_date_time_cb_data[0].time_expected = 1000; + date_time_clear(); + +#if defined(CONFIG_DATE_TIME_MODEM) + __mock_nrf_modem_at_printf_ExpectAndReturn("AT%XTIME=1", 0); + date_time_modem_on_cfun(LTE_LC_FUNC_MODE_NORMAL, NULL); + + k_sleep(K_MSEC(1)); +#endif + +#if defined(CONFIG_DATE_TIME_NTP) + __mock_nrf_modem_at_scanf_ExpectAndReturn("AT+CEREG?", "+CEREG: %*u,%hu,%*[^,],\"%x\",", 1); + __mock_nrf_modem_at_scanf_ReturnVarg_uint16(LTE_LC_NW_REG_REGISTERED_HOME); + + __cmock_zsock_getaddrinfo_ExpectAndReturn("ntp.uio.no", "123", &hints, NULL, 0); + __cmock_zsock_getaddrinfo_IgnoreArg_res(); + __cmock_zsock_getaddrinfo_ReturnThruPtr_res(&res_uio_ntp); + + __cmock_sntp_init_ExpectAndReturn(NULL, &ai_addr_uio_ntp, sizeof(struct sockaddr), 0); + __cmock_sntp_init_IgnoreArg_ctx(); + + __cmock_sntp_query_ExpectAndReturn(NULL, 5000, NULL, 0); + __cmock_sntp_query_IgnoreArg_ctx(); + __cmock_sntp_query_IgnoreArg_time(); + __cmock_sntp_query_ReturnThruPtr_time(&sntp_time_value); + + __cmock_zsock_freeaddrinfo_ExpectAnyArgs(); + __cmock_sntp_close_ExpectAnyArgs(); +#else /* CONFIG_DATE_TIME_MODEM */ + __mock_nrf_modem_at_scanf_ExpectAndReturn("AT+CCLK?", "+CCLK: \"%u/%u/%u,%u:%u:%u%d", 7); + __mock_nrf_modem_at_scanf_ReturnVarg_uint32(24); + __mock_nrf_modem_at_scanf_ReturnVarg_uint32(1); + __mock_nrf_modem_at_scanf_ReturnVarg_uint32(30); + __mock_nrf_modem_at_scanf_ReturnVarg_uint32(20); + __mock_nrf_modem_at_scanf_ReturnVarg_uint32(40); + __mock_nrf_modem_at_scanf_ReturnVarg_uint32(52); + __mock_nrf_modem_at_scanf_ReturnVarg_uint32(12); +#endif + +#if defined(CONFIG_DATE_TIME_MODEM) && defined(CONFIG_DATE_TIME_NTP) + /* Setting modem time fails */ + __mock_nrf_modem_at_printf_ExpectAndReturn("AT+CCLK=\"22/08/13,18:03:41+99\"", -ENOMEM); +#endif + strcpy(at_notif, "+CEREG: 1,\"002F\",\"0012BEEF\",7,,,\"00000101\",\"00010011\"\r\n"); + at_monitor_dispatch(at_notif); + + k_sem_take(&date_time_callback_sem, K_MSEC(TEST_CB_WAIT_TIME)); +} + +/** Test initial auto update from modem. */ +void test_date_time_initial_auto_update_xtime_notif(void) +{ +#if !defined(CONFIG_DATE_TIME_MODEM) + TEST_IGNORE(); +#endif + int ret; + + date_time_cb_count_expected = 1; + test_date_time_cb_data[0].type = DATE_TIME_OBTAINED_MODEM; + + date_time_clear(); + + ret = date_time_is_valid(); + TEST_ASSERT_EQUAL(false, ret); + + ret = date_time_is_valid_local(); + TEST_ASSERT_EQUAL(false, ret); + + __mock_nrf_modem_at_printf_ExpectAndReturn("AT%XTIME=1", 0); + date_time_modem_on_cfun(LTE_LC_FUNC_MODE_ACTIVATE_LTE, NULL); + + k_sleep(K_MSEC(1)); + + /* Negative timezone. */ + strcpy(at_notif, "%XTIME: \"0A\",\"4290018091940A\",\"01\"\r\n"); + at_monitor_dispatch(at_notif); + + k_sem_take(&date_time_callback_sem, K_MSEC(TEST_CB_WAIT_TIME)); ret = date_time_is_valid(); TEST_ASSERT_EQUAL(true, ret); + + ret = date_time_is_valid_local(); + TEST_ASSERT_EQUAL(true, ret); +} + +/** Test update from modem. */ +void test_date_time_1st_update_modem(void) +{ +#if !defined(CONFIG_DATE_TIME_MODEM) + TEST_IGNORE(); +#endif + date_time_cb_count_expected = 1; + test_date_time_cb_data[0].type = DATE_TIME_OBTAINED_MODEM; + test_date_time_cb_data[0].time_expected = 3000; + + /* Not home or roaming so ignored. */ + strcpy(at_notif, "+CEREG: 2\r\n"); + at_monitor_dispatch(at_notif); + k_sleep(K_MSEC(1)); + + strcpy(at_notif, "+CEREG: 5,\"002F\",\"0012BEEF\",7,,,\"00000101\",\"00010011\"\r\n"); + at_monitor_dispatch(at_notif); + k_sleep(K_MSEC(1)); + + /* %XTIME notification ignored because current time is not too old */ + k_sleep(K_MSEC(300)); + strcpy(at_notif, "%XTIME: ,\"42900180919421\",\"01\"\r\n"); + at_monitor_dispatch(at_notif); + k_sleep(K_MSEC(1)); + + __mock_nrf_modem_at_scanf_ExpectAndReturn("AT+CCLK?", "+CCLK: \"%u/%u/%u,%u:%u:%u%d", 7); + __mock_nrf_modem_at_scanf_ReturnVarg_uint32(24); + __mock_nrf_modem_at_scanf_ReturnVarg_uint32(1); + __mock_nrf_modem_at_scanf_ReturnVarg_uint32(30); + __mock_nrf_modem_at_scanf_ReturnVarg_uint32(20); + __mock_nrf_modem_at_scanf_ReturnVarg_uint32(40); + __mock_nrf_modem_at_scanf_ReturnVarg_uint32(52); + __mock_nrf_modem_at_scanf_ReturnVarg_uint32(12); + + k_sem_take(&date_time_callback_sem, K_MSEC(TEST_CB_WAIT_TIME)); +} + +/* This is after XTIME test because we get timezone there so local time works. */ +void test_date_time_now_local(void) +{ +#if !defined(CONFIG_DATE_TIME_MODEM) + TEST_IGNORE(); +#endif + int ret; + int64_t ts_unix_ms = 0; + + ret = date_time_is_valid_local(); + TEST_ASSERT_EQUAL(true, ret); + + ret = date_time_now_local(&ts_unix_ms); + TEST_ASSERT_EQUAL(0, ret); + + /* TODO: Verify the time */ +} + +/** Test initial auto update from modem. */ +void test_date_time_use_previously_obtained_time(void) +{ + /* Previously found time is available and source is the same */ + date_time_cb_count_expected = 1; +#if defined(CONFIG_DATE_TIME_MODEM) + test_date_time_cb_data[0].type = DATE_TIME_OBTAINED_MODEM; +#elif defined(CONFIG_DATE_TIME_NTP) + test_date_time_cb_data[0].type = DATE_TIME_OBTAINED_NTP; +#else + test_date_time_cb_data[0].type = DATE_TIME_OBTAINED_EXT; +#endif + + date_time_update_async(NULL); + k_sem_take(&date_time_callback_sem, K_MSEC(TEST_CB_WAIT_TIME)); +} + +K_SEM_DEFINE(date_time_callback_custom_sem, 0, 1); + +/** Callback that date_time library will call when an event is received. */ +static void date_time_callback_custom(const struct date_time_evt *evt) +{ + /* Verify that type is previously returned type */ +#if defined(CONFIG_DATE_TIME_MODEM) + TEST_ASSERT_EQUAL(DATE_TIME_OBTAINED_MODEM, evt->type); +#elif defined(CONFIG_DATE_TIME_NTP) + TEST_ASSERT_EQUAL(DATE_TIME_OBTAINED_NTP, evt->type); +#endif + k_sem_give(&date_time_callback_custom_sem); +} + +void test_date_time_update_async_different_handler(void) +{ + /* Normal handler not used in this test case so no callbacks there */ + date_time_cb_count_expected = 0; + + /* Custom date-time callback handler */ + date_time_update_async(date_time_callback_custom); + k_sem_take(&date_time_callback_custom_sem, K_MSEC(TEST_CB_WAIT_TIME)); + + /* No date-time callback handler at all. We cannot really verify that the procedure has + * been executed properly but at least we can check that it doesn't crash or send events. + */ + date_time_register_handler(NULL); + date_time_update_async(NULL); + k_sleep(K_MSEC(1)); +} + +void test_date_time_set_dont_set_modem_time_when_it_exists(void) +{ + int ret; + int64_t ts_unix_ms = 0; + + date_time_cb_count_expected = 1; + test_date_time_cb_data[0].type = DATE_TIME_OBTAINED_EXT; + test_date_time_cb_data[0].time_expected = 0; + + /* Modem has time so check that modem time is not set anymore with "AT+CCLK="*/ + ret = date_time_set(&date_time_global); + TEST_ASSERT_EQUAL(0, ret); + + k_sem_take(&date_time_callback_sem, K_MSEC(TEST_CB_WAIT_TIME)); + + ret = date_time_now(&ts_unix_ms); + TEST_ASSERT_EQUAL(0, ret); + + TEST_ASSERT_INT64_WITHIN(100, date_time_global_unix, ts_unix_ms); +} + +void test_date_time_update_cycle_and_async(void) +{ +#if !defined(CONFIG_DATE_TIME_MODEM) + TEST_IGNORE(); +#endif + date_time_cb_count_expected = 6; + test_date_time_cb_data[0].type = DATE_TIME_OBTAINED_MODEM; + test_date_time_cb_data[0].time_expected = 3000; + test_date_time_cb_data[1].type = DATE_TIME_OBTAINED_MODEM; + test_date_time_cb_data[1].time_expected = 3500; + test_date_time_cb_data[2].type = DATE_TIME_OBTAINED_MODEM; + test_date_time_cb_data[2].time_expected = 5000; + test_date_time_cb_data[3].type = DATE_TIME_OBTAINED_MODEM; + test_date_time_cb_data[3].time_expected = 8000; + test_date_time_cb_data[4].type = DATE_TIME_OBTAINED_MODEM; + test_date_time_cb_data[4].time_expected = 9000; + test_date_time_cb_data[5].type = DATE_TIME_OBTAINED_MODEM; + test_date_time_cb_data[5].time_expected = 11000; + + /* Normal cycle at 3s */ + __mock_nrf_modem_at_scanf_ExpectAndReturn("AT+CCLK?", "+CCLK: \"%u/%u/%u,%u:%u:%u%d", 7); + __mock_nrf_modem_at_scanf_ReturnVarg_uint32(24); + __mock_nrf_modem_at_scanf_ReturnVarg_uint32(1); + __mock_nrf_modem_at_scanf_ReturnVarg_uint32(30); + __mock_nrf_modem_at_scanf_ReturnVarg_uint32(20); + __mock_nrf_modem_at_scanf_ReturnVarg_uint32(40); + __mock_nrf_modem_at_scanf_ReturnVarg_uint32(52); + __mock_nrf_modem_at_scanf_ReturnVarg_uint32(12); + + k_sem_take(&date_time_callback_sem, K_MSEC(TEST_CB_WAIT_TIME)); + + /* Asynchronous update with previous time at 3.5s */ + k_sleep(K_MSEC(500)); + date_time_update_async(NULL); + k_sem_take(&date_time_callback_sem, K_MSEC(TEST_CB_WAIT_TIME)); + + /* Asynchronous update at 5s*/ + __mock_nrf_modem_at_scanf_ExpectAndReturn("AT+CCLK?", "+CCLK: \"%u/%u/%u,%u:%u:%u%d", 6); + __mock_nrf_modem_at_scanf_ReturnVarg_uint32(24); + __mock_nrf_modem_at_scanf_ReturnVarg_uint32(1); + __mock_nrf_modem_at_scanf_ReturnVarg_uint32(30); + __mock_nrf_modem_at_scanf_ReturnVarg_uint32(20); + __mock_nrf_modem_at_scanf_ReturnVarg_uint32(40); + __mock_nrf_modem_at_scanf_ReturnVarg_uint32(52); + + k_sleep(K_MSEC(1500)); + date_time_update_async(NULL); + k_sem_take(&date_time_callback_sem, K_MSEC(TEST_CB_WAIT_TIME)); + + /* Normal cycle at 8s*/ + __mock_nrf_modem_at_scanf_ExpectAndReturn("AT+CCLK?", "+CCLK: \"%u/%u/%u,%u:%u:%u%d", 7); + __mock_nrf_modem_at_scanf_ReturnVarg_uint32(24); + __mock_nrf_modem_at_scanf_ReturnVarg_uint32(1); + __mock_nrf_modem_at_scanf_ReturnVarg_uint32(30); + __mock_nrf_modem_at_scanf_ReturnVarg_uint32(20); + __mock_nrf_modem_at_scanf_ReturnVarg_uint32(40); + __mock_nrf_modem_at_scanf_ReturnVarg_uint32(52); + __mock_nrf_modem_at_scanf_ReturnVarg_uint32(12); + + k_sem_take(&date_time_callback_sem, K_MSEC(TEST_CB_WAIT_TIME)); + + /* Time taken into use from %XTIME notification at 9s */ + k_sleep(K_MSEC(1000)); + strcpy(at_notif, "%XTIME: ,\"42900180919421\",\"01\"\r\n"); + at_monitor_dispatch(at_notif); + + k_sem_take(&date_time_callback_sem, K_MSEC(TEST_CB_WAIT_TIME)); + + /* XTIME doesn't delay normal cycle unlike date_time_update_async */ + + /* Normal cycle at 11s */ + __mock_nrf_modem_at_scanf_ExpectAndReturn("AT+CCLK?", "+CCLK: \"%u/%u/%u,%u:%u:%u%d", 7); + __mock_nrf_modem_at_scanf_ReturnVarg_uint32(24); + __mock_nrf_modem_at_scanf_ReturnVarg_uint32(1); + __mock_nrf_modem_at_scanf_ReturnVarg_uint32(30); + __mock_nrf_modem_at_scanf_ReturnVarg_uint32(20); + __mock_nrf_modem_at_scanf_ReturnVarg_uint32(40); + __mock_nrf_modem_at_scanf_ReturnVarg_uint32(52); + __mock_nrf_modem_at_scanf_ReturnVarg_uint32(12); + + k_sem_take(&date_time_callback_sem, K_MSEC(TEST_CB_WAIT_TIME)); +} + +void test_date_time_update_cycle_with_failing_async(void) +{ +#if !defined(CONFIG_DATE_TIME_MODEM) + TEST_IGNORE(); +#endif + date_time_cb_count_expected = 5; + test_date_time_cb_data[0].type = DATE_TIME_OBTAINED_MODEM; + test_date_time_cb_data[0].time_expected = 3000; + test_date_time_cb_data[1].type = DATE_TIME_NOT_OBTAINED; + test_date_time_cb_data[1].time_expected = 4000; + test_date_time_cb_data[2].type = DATE_TIME_NOT_OBTAINED; + test_date_time_cb_data[2].time_expected = 5000; + test_date_time_cb_data[3].type = DATE_TIME_NOT_OBTAINED; + test_date_time_cb_data[3].time_expected = 6000; + test_date_time_cb_data[4].type = DATE_TIME_OBTAINED_MODEM; + test_date_time_cb_data[4].time_expected = 9000; + + /* Normal cycle at 3s */ + __mock_nrf_modem_at_scanf_ExpectAndReturn("AT+CCLK?", "+CCLK: \"%u/%u/%u,%u:%u:%u%d", 7); + __mock_nrf_modem_at_scanf_ReturnVarg_uint32(24); + __mock_nrf_modem_at_scanf_ReturnVarg_uint32(1); + __mock_nrf_modem_at_scanf_ReturnVarg_uint32(30); + __mock_nrf_modem_at_scanf_ReturnVarg_uint32(20); + __mock_nrf_modem_at_scanf_ReturnVarg_uint32(40); + __mock_nrf_modem_at_scanf_ReturnVarg_uint32(52); + __mock_nrf_modem_at_scanf_ReturnVarg_uint32(12); + + k_sem_take(&date_time_callback_sem, K_MSEC(TEST_CB_WAIT_TIME)); + + /* Failing asynchronous update at 4s */ + k_sleep(K_MSEC(1000)); + + __mock_nrf_modem_at_scanf_ExpectAndReturn( + "AT+CCLK?", "+CCLK: \"%u/%u/%u,%u:%u:%u%d", -ENOMEM); +#if defined(CONFIG_DATE_TIME_NTP) + __mock_nrf_modem_at_scanf_ExpectAndReturn( + "AT+CEREG?", "+CEREG: %*u,%hu,%*[^,],\"%x\",", -ENOMEM); + __mock_nrf_modem_at_scanf_ReturnVarg_uint16(LTE_LC_NW_REG_UNKNOWN); +#endif + date_time_update_async(NULL); + k_sem_take(&date_time_callback_sem, K_MSEC(TEST_CB_WAIT_TIME)); + + /* Failing retry after asynchronous update at 5s */ + __mock_nrf_modem_at_scanf_ExpectAndReturn( + "AT+CCLK?", "+CCLK: \"%u/%u/%u,%u:%u:%u%d", -ENOMEM); +#if defined(CONFIG_DATE_TIME_NTP) + __mock_nrf_modem_at_scanf_ExpectAndReturn( + "AT+CEREG?", "+CEREG: %*u,%hu,%*[^,],\"%x\",", -ENOMEM); + __mock_nrf_modem_at_scanf_ReturnVarg_uint16(LTE_LC_NW_REG_UNKNOWN); +#endif + k_sem_take(&date_time_callback_sem, K_MSEC(TEST_CB_WAIT_TIME)); + + /* Failing retry after asynchronous update at 6s */ + __mock_nrf_modem_at_scanf_ExpectAndReturn( + "AT+CCLK?", "+CCLK: \"%u/%u/%u,%u:%u:%u%d", -ENOMEM); +#if defined(CONFIG_DATE_TIME_NTP) + __mock_nrf_modem_at_scanf_ExpectAndReturn( + "AT+CEREG?", "+CEREG: %*u,%hu,%*[^,],\"%x\",", -ENOMEM); + __mock_nrf_modem_at_scanf_ReturnVarg_uint16(LTE_LC_NW_REG_UNKNOWN); +#endif + k_sem_take(&date_time_callback_sem, K_MSEC(TEST_CB_WAIT_TIME)); + + /* Normal cycle at 6s*/ + __mock_nrf_modem_at_scanf_ExpectAndReturn("AT+CCLK?", "+CCLK: \"%u/%u/%u,%u:%u:%u%d", 7); + __mock_nrf_modem_at_scanf_ReturnVarg_uint32(24); + __mock_nrf_modem_at_scanf_ReturnVarg_uint32(1); + __mock_nrf_modem_at_scanf_ReturnVarg_uint32(30); + __mock_nrf_modem_at_scanf_ReturnVarg_uint32(20); + __mock_nrf_modem_at_scanf_ReturnVarg_uint32(40); + __mock_nrf_modem_at_scanf_ReturnVarg_uint32(52); + __mock_nrf_modem_at_scanf_ReturnVarg_uint32(12); + + k_sem_take(&date_time_callback_sem, K_MSEC(TEST_CB_WAIT_TIME)); +} + +/** Test all retries failing with different NTP failures. */ +void test_date_time_update_all_retry_ntp_fail(void) +{ +#if !defined(CONFIG_DATE_TIME_MODEM) && !defined(CONFIG_DATE_TIME_NTP) + TEST_IGNORE(); +#endif + date_time_cb_count_expected = 3; + test_date_time_cb_data[0].type = DATE_TIME_NOT_OBTAINED; + test_date_time_cb_data[0].time_expected = 3000; + test_date_time_cb_data[1].type = DATE_TIME_NOT_OBTAINED; + test_date_time_cb_data[1].time_expected = 4000; + test_date_time_cb_data[2].type = DATE_TIME_NOT_OBTAINED; + test_date_time_cb_data[2].time_expected = 4500; + + /* 1st date-time update */ +#if defined(CONFIG_DATE_TIME_MODEM) + __mock_nrf_modem_at_scanf_ExpectAndReturn( + "AT+CCLK?", "+CCLK: \"%u/%u/%u,%u:%u:%u%d", -ENOMEM); +#endif +#if defined(CONFIG_DATE_TIME_NTP) + __mock_nrf_modem_at_scanf_ExpectAndReturn("AT+CEREG?", "+CEREG: %*u,%hu,%*[^,],\"%x\",", 1); + __mock_nrf_modem_at_scanf_ReturnVarg_uint16(LTE_LC_NW_REG_REGISTERED_HOME); + + /* NTP fails in NTP query for UIO */ + __cmock_zsock_getaddrinfo_ExpectAndReturn("ntp.uio.no", "123", &hints, NULL, 0); + __cmock_zsock_getaddrinfo_IgnoreArg_res(); + __cmock_zsock_getaddrinfo_ReturnThruPtr_res(&res_uio_ntp); + + __cmock_sntp_init_ExpectAnyArgsAndReturn(0); + __cmock_sntp_query_ExpectAndReturn(NULL, 5000, NULL, -1); + __cmock_sntp_query_IgnoreArg_ctx(); + __cmock_sntp_query_IgnoreArg_time(); + __cmock_sntp_query_ReturnThruPtr_time(&sntp_time_value); + + __cmock_zsock_freeaddrinfo_ExpectAnyArgs(); + __cmock_sntp_close_ExpectAnyArgs(); + + /* NTP fails in DNS query for Google */ + __cmock_zsock_getaddrinfo_ExpectAndReturn("time.google.com", "123", &hints, NULL, -1); + __cmock_zsock_getaddrinfo_IgnoreArg_res(); + __cmock_zsock_getaddrinfo_ReturnThruPtr_res(&res_google_ntp); +#endif + k_sem_take(&date_time_callback_sem, K_MSEC(TEST_CB_WAIT_TIME)); + + /* 1st retry */ +#if defined(CONFIG_DATE_TIME_MODEM) + __mock_nrf_modem_at_scanf_ExpectAndReturn( + "AT+CCLK?", "+CCLK: \"%u/%u/%u,%u:%u:%u%d", -ENOMEM); +#endif +#if defined(CONFIG_DATE_TIME_NTP) + __mock_nrf_modem_at_scanf_ExpectAndReturn("AT+CEREG?", "+CEREG: %*u,%hu,%*[^,],\"%x\",", 1); + __mock_nrf_modem_at_scanf_ReturnVarg_uint16(LTE_LC_NW_REG_REGISTERED_ROAMING); + + /* NTP fails in SNTP init for UIO */ + __cmock_zsock_getaddrinfo_ExpectAndReturn("ntp.uio.no", "123", &hints, NULL, 0); + __cmock_zsock_getaddrinfo_IgnoreArg_res(); + __cmock_zsock_getaddrinfo_ReturnThruPtr_res(&res_uio_ntp); + + __cmock_sntp_init_ExpectAnyArgsAndReturn(-1); + + __cmock_zsock_freeaddrinfo_ExpectAnyArgs(); + __cmock_sntp_close_ExpectAnyArgs(); + + /* NTP fails in NTP query for Google */ + __cmock_zsock_getaddrinfo_ExpectAndReturn("time.google.com", "123", &hints, NULL, 0); + __cmock_zsock_getaddrinfo_IgnoreArg_res(); + __cmock_zsock_getaddrinfo_ReturnThruPtr_res(&res_google_ntp); + + __cmock_sntp_init_ExpectAnyArgsAndReturn(0); + __cmock_sntp_query_ExpectAndReturn(NULL, 5000, NULL, -1); + __cmock_sntp_query_IgnoreArg_ctx(); + __cmock_sntp_query_IgnoreArg_time(); + __cmock_sntp_query_ReturnThruPtr_time(&sntp_time_value); + + __cmock_zsock_freeaddrinfo_ExpectAnyArgs(); + __cmock_sntp_close_ExpectAnyArgs(); +#endif + k_sem_take(&date_time_callback_sem, K_MSEC(TEST_CB_WAIT_TIME)); + + /* 2nd retry with asynchronous update at 4.5s */ +#if defined(CONFIG_DATE_TIME_MODEM) + __mock_nrf_modem_at_scanf_ExpectAndReturn( + "AT+CCLK?", "+CCLK: \"%u/%u/%u,%u:%u:%u%d", -ENOMEM); +#endif +#if defined(CONFIG_DATE_TIME_NTP) + /* NTP not even tried because no connection to LTE network */ + __mock_nrf_modem_at_scanf_ExpectAndReturn("AT+CEREG?", "+CEREG: %*u,%hu,%*[^,],\"%x\",", 1); + __mock_nrf_modem_at_scanf_ReturnVarg_uint16(LTE_LC_NW_REG_REGISTERED_HOME); + + /* NTP fails in NTP query for UIO */ + __cmock_zsock_getaddrinfo_ExpectAndReturn("ntp.uio.no", "123", &hints, NULL, 0); + __cmock_zsock_getaddrinfo_IgnoreArg_res(); + __cmock_zsock_getaddrinfo_ReturnThruPtr_res(&res_uio_ntp); + + __cmock_sntp_init_ExpectAnyArgsAndReturn(0); + __cmock_sntp_query_ExpectAndReturn(NULL, 5000, NULL, -1); + __cmock_sntp_query_IgnoreArg_ctx(); + __cmock_sntp_query_IgnoreArg_time(); + __cmock_sntp_query_ReturnThruPtr_time(&sntp_time_value); + + __cmock_zsock_freeaddrinfo_ExpectAnyArgs(); + __cmock_sntp_close_ExpectAnyArgs(); + + /* NTP fails in NTP query for Google */ + __cmock_zsock_getaddrinfo_ExpectAndReturn("time.google.com", "123", &hints, NULL, 0); + __cmock_zsock_getaddrinfo_IgnoreArg_res(); + __cmock_zsock_getaddrinfo_ReturnThruPtr_res(&res_google_ntp); + + __cmock_sntp_init_ExpectAnyArgsAndReturn(0); + __cmock_sntp_query_ExpectAndReturn(NULL, 5000, NULL, -1); + __cmock_sntp_query_IgnoreArg_ctx(); + __cmock_sntp_query_IgnoreArg_time(); + __cmock_sntp_query_ReturnThruPtr_time(&sntp_time_value); + + __cmock_zsock_freeaddrinfo_ExpectAnyArgs(); + __cmock_sntp_close_ExpectAnyArgs(); +#endif + k_sleep(K_MSEC(500)); + date_time_update_async(NULL); + k_sem_take(&date_time_callback_sem, K_MSEC(TEST_CB_WAIT_TIME)); +} + +/* Test all retries failing due to LTE status checked by NTP procedure. */ +void test_date_time_update_all_retry_ntp_ltestatus_fail(void) +{ +#if !defined(CONFIG_DATE_TIME_MODEM) && !defined(CONFIG_DATE_TIME_NTP) + TEST_IGNORE(); +#endif + date_time_cb_count_expected = 3; + test_date_time_cb_data[0].type = DATE_TIME_NOT_OBTAINED; + test_date_time_cb_data[0].time_expected = 3000; + test_date_time_cb_data[1].type = DATE_TIME_NOT_OBTAINED; + test_date_time_cb_data[1].time_expected = 4000; + test_date_time_cb_data[2].type = DATE_TIME_NOT_OBTAINED; + test_date_time_cb_data[2].time_expected = 5000; + + /* 1st trial */ +#if defined(CONFIG_DATE_TIME_MODEM) + __mock_nrf_modem_at_scanf_ExpectAndReturn( + "AT+CCLK?", "+CCLK: \"%u/%u/%u,%u:%u:%u%d", -ENOMEM); +#endif +#if defined(CONFIG_DATE_TIME_NTP) + __mock_nrf_modem_at_scanf_ExpectAndReturn( + "AT+CEREG?", "+CEREG: %*u,%hu,%*[^,],\"%x\",", -ENOMEM); + __mock_nrf_modem_at_scanf_ReturnVarg_uint16(LTE_LC_NW_REG_UNKNOWN); +#endif + k_sem_take(&date_time_callback_sem, K_MSEC(TEST_CB_WAIT_TIME)); + + /* 1st retry */ +#if defined(CONFIG_DATE_TIME_MODEM) + __mock_nrf_modem_at_scanf_ExpectAndReturn( + "AT+CCLK?", "+CCLK: \"%u/%u/%u,%u:%u:%u%d", -ENOMEM); +#endif +#if defined(CONFIG_DATE_TIME_NTP) + __mock_nrf_modem_at_scanf_ExpectAndReturn("AT+CEREG?", "+CEREG: %*u,%hu,%*[^,],\"%x\",", 1); + __mock_nrf_modem_at_scanf_ReturnVarg_uint16(LTE_LC_NW_REG_UNKNOWN); +#endif + k_sem_take(&date_time_callback_sem, K_MSEC(TEST_CB_WAIT_TIME)); + + /* 2nd retry */ +#if defined(CONFIG_DATE_TIME_MODEM) + __mock_nrf_modem_at_scanf_ExpectAndReturn( + "AT+CCLK?", "+CCLK: \"%u/%u/%u,%u:%u:%u%d", -ENOMEM); +#endif +#if defined(CONFIG_DATE_TIME_NTP) + __mock_nrf_modem_at_scanf_ExpectAndReturn("AT+CEREG?", "+CEREG: %*u,%hu,%*[^,],\"%x\",", 1); + __mock_nrf_modem_at_scanf_ReturnVarg_uint16(LTE_LC_NW_REG_SEARCHING); +#endif + k_sem_take(&date_time_callback_sem, K_MSEC(TEST_CB_WAIT_TIME)); +} + +/* Test that the scheduled updates are not done when modem and NTP time are disabled. */ +void test_date_time_update_cycle_no_ntp_no_modem(void) +{ +#if defined(CONFIG_DATE_TIME_MODEM) || defined(CONFIG_DATE_TIME_NTP) + TEST_IGNORE(); +#endif + date_time_cb_count_expected = 0; + + k_sem_take(&date_time_callback_sem, K_MSEC(TEST_CB_WAIT_TIME)); +} + +/** Test initial auto update from modem. */ +void test_date_time_xtime_notif_fail(void) +{ +#if !defined(CONFIG_DATE_TIME_MODEM) + TEST_IGNORE(); +#endif + /* No comma */ + strcpy(at_notif, "%XTIME: \"42900180919421\" \"01\"\r\n"); + at_monitor_dispatch(at_notif); + k_sleep(K_MSEC(1)); + + /* Too short */ + strcpy(at_notif, "%XTIME: ,\"321\",\"01\"\r\n"); + at_monitor_dispatch(at_notif); + k_sleep(K_MSEC(1)); + + /* Time value contains letters */ + strcpy(at_notif, "%XTIME: ,\"42900180moikka\",\"01\"\r\n"); + at_monitor_dispatch(at_notif); + k_sleep(K_MSEC(1)); + + /* No double quotes for time value */ + strcpy(at_notif, "%XTIME: ,42900180919421,\"01\"\r\n"); + at_monitor_dispatch(at_notif); + k_sleep(K_MSEC(1)); } /* This is needed because AT Monitor library is initialized in SYS_INIT. */ diff --git a/tests/lib/date_time/testcase.yaml b/tests/lib/date_time/testcase.yaml index 4480758f1d72..5d503f5501d5 100644 --- a/tests/lib/date_time/testcase.yaml +++ b/tests/lib/date_time/testcase.yaml @@ -5,3 +5,28 @@ tests: integration_platforms: - native_sim tags: date_time_unity sysbuild ci_tests_lib_date_time_unity + date_time.unit_test.no_modem_time: + sysbuild: true + platform_allow: native_sim + integration_platforms: + - native_sim + extra_configs: + - CONFIG_DATE_TIME_MODEM=n + tags: date_time_unity sysbuild ci_tests_lib_date_time_unity + date_time.unit_test.no_ntp_time: + sysbuild: true + platform_allow: native_sim + integration_platforms: + - native_sim + extra_configs: + - CONFIG_DATE_TIME_NTP=n + tags: date_time_unity sysbuild ci_tests_lib_date_time_unity + date_time.unit_test.no_modem_or_ntp_time: + sysbuild: true + platform_allow: native_sim + integration_platforms: + - native_sim + extra_configs: + - CONFIG_DATE_TIME_MODEM=n + - CONFIG_DATE_TIME_NTP=n + tags: date_time_unity sysbuild ci_tests_lib_date_time_unity diff --git a/tests/lib/hw_unique_key_tfm/create_test_vector.py b/tests/lib/hw_unique_key_tfm/create_test_vector.py index fc84573ba636..a416618205ee 100644 --- a/tests/lib/hw_unique_key_tfm/create_test_vector.py +++ b/tests/lib/hw_unique_key_tfm/create_test_vector.py @@ -15,7 +15,17 @@ # The function tfm_builtin_key_loader_get_builtin_key # uses the owner ID as label when the HUK is being # used for key derivation. -label_owner_id = b"\xff\xff\xff\xff" + +# The owner ID is the caller ID of the ns agent, calculated by +# the function `tz_ns_agent_client_id_translate` in tfm_spm_ns_ctx.c +# via the function `tfm_nspm_get_current_client_id`. +# +# tx_ns_agent_client_id_translate takes DEFAULT_NS_CLIENT_ID (0xFFFFFFFF) +# as input when TFM_NS_MANAGE_NSID is not set, and returns 0xC4000000. +owner_id = 0xc4000000 + +# Convert to little endian +label_owner_id = owner_id.to_bytes(4, byteorder='little') key_nrf53 = [ 0xc5, 0xa8, 0x08, 0xeb, 0xe3, 0x1e, 0xa5, 0xb4, diff --git a/tests/lib/hw_unique_key_tfm/src/main.c b/tests/lib/hw_unique_key_tfm/src/main.c index 40b1881f3983..d4b69e60c0ca 100644 --- a/tests/lib/hw_unique_key_tfm/src/main.c +++ b/tests/lib/hw_unique_key_tfm/src/main.c @@ -17,10 +17,10 @@ static uint8_t test_label[16] = { __ALIGNED(4) static uint8_t expected_key[32] = { - 0xa2, 0x87, 0x3, 0x5f, 0x34, 0xc0, 0x34, 0x63, - 0x7c, 0x9e, 0x45, 0x85, 0xb5, 0xcb, 0x82, 0x7c, - 0x85, 0x7f, 0x1a, 0x22, 0xd6, 0x22, 0xf3, 0xf, - 0x8d, 0x2f, 0xae, 0x7d, 0x3d, 0xd5, 0x5e, 0x5c + 0xa9, 0x4d, 0x17, 0x7f, 0x5b, 0x6a, 0xc4, 0x6e, + 0x64, 0xe1, 0xae, 0xdb, 0x93, 0xee, 0x8a, 0xec, + 0x47, 0x70, 0x9a, 0x40, 0xeb, 0xb2, 0xc2, 0x66, + 0x4f, 0xfe, 0x5b, 0x25, 0x2b, 0x09, 0xd4, 0x75 }; #else __ALIGNED(4) @@ -32,8 +32,8 @@ static uint8_t test_label[19] = { __ALIGNED(4) static uint8_t expected_key[16] = { - 0x4f, 0x2d, 0xf8, 0x86, 0x61, 0xba, 0x8, 0x55, - 0xf3, 0x9d, 0x43, 0xae, 0x96, 0x56, 0xc9, 0x5c + 0x75, 0x70, 0xca, 0xb8, 0x88, 0x6d, 0xcc, 0x91, + 0x9a, 0xfe, 0xfc, 0x34, 0xf1, 0xc1, 0xc5, 0xf5 }; #endif diff --git a/tests/lib/location/CMakeLists.txt b/tests/lib/location/CMakeLists.txt index f1a621a3ce42..add304d2a4ca 100644 --- a/tests/lib/location/CMakeLists.txt +++ b/tests/lib/location/CMakeLists.txt @@ -17,7 +17,8 @@ cmock_handle(${ZEPHYR_NRF_MODULE_DIR}/include/net/rest_client.h) cmock_handle(${ZEPHYR_NRFXLIB_MODULE_DIR}/nrf_modem/include/nrf_modem_gnss.h) cmock_handle(${ZEPHYR_NRFXLIB_MODULE_DIR}/nrf_modem/include/nrf_modem_at.h FUNC_EXCLUDE ".*nrf_modem_at_printf" - FUNC_EXCLUDE ".*nrf_modem_at_scanf") + FUNC_EXCLUDE ".*nrf_modem_at_scanf" + WORD_EXCLUDE "__nrf_modem_(printf|scanf)_like\(.*\)") cmock_handle(${ZEPHYR_NRF_MODULE_DIR}/include/net/nrf_cloud.h FUNC_EXCLUDE ".*nrf_cloud_obj_shadow_update") diff --git a/tests/lib/lte_lc/CMakeLists.txt b/tests/lib/lte_lc/CMakeLists.txt deleted file mode 100644 index 9101bb70b591..000000000000 --- a/tests/lib/lte_lc/CMakeLists.txt +++ /dev/null @@ -1,36 +0,0 @@ -# -# Copyright (c) 2021 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(lte_lc) - -test_runner_generate(src/main.c) - -cmock_handle(${ZEPHYR_NRFXLIB_MODULE_DIR}/nrf_modem/include/nrf_modem_at.h - FUNC_EXCLUDE ".*nrf_modem_at_scanf" - FUNC_EXCLUDE ".*nrf_modem_at_printf") - -FILE(GLOB app_sources src/*.c) -target_sources(app PRIVATE ${app_sources}) - -target_sources(app - PRIVATE - ${ZEPHYR_NRF_MODULE_DIR}/lib/lte_link_control/lte_lc_helpers.c -) - -target_include_directories(app - PRIVATE - ${ZEPHYR_NRF_MODULE_DIR}/lib/lte_link_control/ - ${ZEPHYR_NRF_MODULE_DIR}/include/modem/ -) - -target_compile_options(app - PRIVATE - -DCONFIG_LTE_LINK_CONTROL_LOG_LEVEL=0 - -DCONFIG_LTE_NEIGHBOR_CELLS_MAX=10 -) diff --git a/tests/lib/lte_lc/boards/native_posix.conf b/tests/lib/lte_lc/boards/native_posix.conf deleted file mode 100644 index 92d48b5e27e7..000000000000 --- a/tests/lib/lte_lc/boards/native_posix.conf +++ /dev/null @@ -1,7 +0,0 @@ -# -# Copyright (c) 2021 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -CONFIG_NEWLIB_LIBC=n diff --git a/tests/lib/lte_lc/boards/nrf9160dk_nrf9160.conf b/tests/lib/lte_lc/boards/nrf9160dk_nrf9160.conf deleted file mode 100644 index 8b8d533812eb..000000000000 --- a/tests/lib/lte_lc/boards/nrf9160dk_nrf9160.conf +++ /dev/null @@ -1,7 +0,0 @@ -# -# Copyright (c) 2021 Nordic Semiconductor -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -CONFIG_NEWLIB_LIBC=y diff --git a/tests/lib/lte_lc/boards/nrf9160dk_nrf9160_ns.conf b/tests/lib/lte_lc/boards/nrf9160dk_nrf9160_ns.conf deleted file mode 100644 index 8b8d533812eb..000000000000 --- a/tests/lib/lte_lc/boards/nrf9160dk_nrf9160_ns.conf +++ /dev/null @@ -1,7 +0,0 @@ -# -# Copyright (c) 2021 Nordic Semiconductor -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -CONFIG_NEWLIB_LIBC=y diff --git a/tests/lib/lte_lc/boards/qemu_x86.conf b/tests/lib/lte_lc/boards/qemu_x86.conf deleted file mode 100644 index f52f1ba6864a..000000000000 --- a/tests/lib/lte_lc/boards/qemu_x86.conf +++ /dev/null @@ -1,9 +0,0 @@ -# -# Copyright (c) 2021 Nordic Semiconductor -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -CONFIG_NEWLIB_LIBC=y -CONFIG_FPU=y -CONFIG_SSE=y diff --git a/tests/lib/lte_lc/prj.conf b/tests/lib/lte_lc/prj.conf deleted file mode 100644 index 5a62f6b7ab30..000000000000 --- a/tests/lib/lte_lc/prj.conf +++ /dev/null @@ -1,20 +0,0 @@ -# -# Copyright (c) 2021 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -CONFIG_UNITY=y - -CONFIG_MAIN_STACK_SIZE=2048 - -# Heap is used by the AT command parser -CONFIG_HEAP_MEM_POOL_SIZE=8192 - -# AT command parser library -CONFIG_AT_PARSER=y - -# NewLib C -CONFIG_NEWLIB_LIBC=y - -CONFIG_MOCK_NRF_MODEM_AT=y diff --git a/tests/lib/lte_lc/src/main.c b/tests/lib/lte_lc/src/main.c deleted file mode 100644 index 21cfe81e4eeb..000000000000 --- a/tests/lib/lte_lc/src/main.c +++ /dev/null @@ -1,779 +0,0 @@ -/* - * Copyright (c) 2021 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -#include -#include -#include -#include - -#include "lte_lc_helpers.h" -#include "lte_lc.h" - -/* The unity_main is not declared in any header file. It is only defined in the generated test - * runner because of ncs' unity configuration. It is therefore declared here to avoid a compiler - * warning. - */ -extern int unity_main(void); - -void test_parse_edrx(void) -{ - int err; - struct lte_lc_edrx_cfg cfg; - char edrx_str[5]; - char ptw_str[5]; - char *at_response_none = "+CEDRXP: 0"; - char *at_response_fail = "+CEDRXP: 1,\"1000\",\"0101\",\"1011\""; - char *at_response_ltem = "+CEDRXP: 4,\"1000\",\"0101\",\"1011\""; - char *at_response_ltem_2 = "+CEDRXP: 4,\"1000\",\"0010\",\"1110\""; - char *at_response_nbiot = "+CEDRXP: 5,\"1000\",\"1101\",\"0111\""; - char *at_response_nbiot_2 = "+CEDRXP: 5,\"1000\",\"1101\",\"0101\""; - - err = parse_edrx(at_response_none, &cfg, edrx_str, ptw_str); - TEST_ASSERT_EQUAL(0, err); - TEST_ASSERT_EQUAL(0, cfg.edrx); - TEST_ASSERT_EQUAL(0, cfg.ptw); - TEST_ASSERT_EQUAL(LTE_LC_LTE_MODE_NONE, cfg.mode); - - err = parse_edrx(at_response_fail, &cfg, edrx_str, ptw_str); - TEST_ASSERT_NOT_EQUAL_MESSAGE(0, err, "parse_edrx should have failed"); - - err = parse_edrx(at_response_ltem, &cfg, edrx_str, ptw_str); - TEST_ASSERT_EQUAL(0, err); - TEST_ASSERT_FLOAT_WITHIN(0.1, 81.92, cfg.edrx); - TEST_ASSERT_FLOAT_WITHIN(0.1, 15.36, cfg.ptw); - TEST_ASSERT_EQUAL(LTE_LC_LTE_MODE_LTEM, cfg.mode); - TEST_ASSERT_EQUAL_STRING("0101", edrx_str); - TEST_ASSERT_EQUAL_STRING("1011", ptw_str); - - err = parse_edrx(at_response_ltem_2, &cfg, edrx_str, ptw_str); - TEST_ASSERT_EQUAL(0, err); - TEST_ASSERT_FLOAT_WITHIN(0.1, 20.48, cfg.edrx); - TEST_ASSERT_FLOAT_WITHIN(0.1, 19.2, cfg.ptw); - TEST_ASSERT_EQUAL(LTE_LC_LTE_MODE_LTEM, cfg.mode); - TEST_ASSERT_EQUAL_STRING("0010", edrx_str); - TEST_ASSERT_EQUAL_STRING("1110", ptw_str); - - err = parse_edrx(at_response_nbiot, &cfg, edrx_str, ptw_str); - TEST_ASSERT_EQUAL(0, err); - TEST_ASSERT_FLOAT_WITHIN(0.1, 2621.44, cfg.edrx); - TEST_ASSERT_FLOAT_WITHIN(0.1, 20.48, cfg.ptw); - TEST_ASSERT_EQUAL(LTE_LC_LTE_MODE_NBIOT, cfg.mode); - TEST_ASSERT_EQUAL_STRING("1101", edrx_str); - TEST_ASSERT_EQUAL_STRING("0111", ptw_str); - - err = parse_edrx(at_response_nbiot_2, &cfg, edrx_str, ptw_str); - TEST_ASSERT_EQUAL(0, err); - TEST_ASSERT_FLOAT_WITHIN(0.1, 2621.44, cfg.edrx); - TEST_ASSERT_FLOAT_WITHIN(0.1, 15.36, cfg.ptw); - TEST_ASSERT_EQUAL(LTE_LC_LTE_MODE_NBIOT, cfg.mode); - TEST_ASSERT_EQUAL_STRING("1101", edrx_str); - TEST_ASSERT_EQUAL_STRING("0101", ptw_str); -} - -void test_parse_cereg(void) -{ - int err; - enum lte_lc_nw_reg_status status; - struct lte_lc_cell cell; - enum lte_lc_lte_mode mode; - struct lte_lc_psm_cfg psm_cfg; - char *at_cereg_0 = "+CEREG: 0"; - char *at_cereg_1 = "+CEREG: 1,\"0A0B\",\"01020304\",9,,,\"00100110\",\"01011111\""; - char *at_cereg_1_no_tau_ext = "+CEREG: 1,\"0A0B\",\"01020304\",9,,,\"01001010\""; - char *at_cereg_1_no_tau_ext_no_active_time = "+CEREG: 1,\"0A0B\",\"01020304\",9"; - char *at_cereg_2 = "+CEREG: 2,\"ABBA\",\"DEADBEEF\",7"; - char *at_cereg_2_reject_cause = "+CEREG: 2,\"ABBA\",\"DEADBEEF\",7,0,13"; - char *at_cereg_2_unknown_cause_type = "+CEREG: 2,\"ABBA\",\"DEADBEEF\",7,1,1"; - char *at_cereg_4 = "+CEREG: 4"; - char *at_cereg_5 = "+CEREG: 5,\"0A0B\",\"01020304\",9,,,\"11100000\",\"00011111\""; - char *at_cereg_90 = "+CEREG: 90"; - char *at_cereg_invalid = "+CEREG: 10,,,5,,,,"; - - err = parse_cereg(at_cereg_0, &status, &cell, &mode, &psm_cfg); - TEST_ASSERT_EQUAL(0, err); - TEST_ASSERT_EQUAL(LTE_LC_NW_REG_NOT_REGISTERED, status); - TEST_ASSERT_EQUAL(LTE_LC_CELL_EUTRAN_ID_INVALID, cell.id); - TEST_ASSERT_EQUAL(LTE_LC_CELL_TAC_INVALID, cell.tac); - TEST_ASSERT_EQUAL(LTE_LC_LTE_MODE_NONE, mode); - TEST_ASSERT_EQUAL(-1, psm_cfg.active_time); - TEST_ASSERT_EQUAL(-1, psm_cfg.tau); - - err = parse_cereg(at_cereg_1, &status, &cell, &mode, &psm_cfg); - TEST_ASSERT_EQUAL(0, err); - TEST_ASSERT_EQUAL(LTE_LC_NW_REG_REGISTERED_HOME, status); - TEST_ASSERT_EQUAL(0x01020304, cell.id); - TEST_ASSERT_EQUAL(0x0A0B, cell.tac); - TEST_ASSERT_EQUAL(LTE_LC_LTE_MODE_NBIOT, mode); - TEST_ASSERT_EQUAL(360, psm_cfg.active_time); - TEST_ASSERT_EQUAL(1116000, psm_cfg.tau); - - err = parse_cereg(at_cereg_1_no_tau_ext, &status, &cell, &mode, &psm_cfg); - TEST_ASSERT_EQUAL(0, err); - TEST_ASSERT_EQUAL(LTE_LC_NW_REG_REGISTERED_HOME, status); - TEST_ASSERT_EQUAL(0x01020304, cell.id); - TEST_ASSERT_EQUAL(0x0A0B, cell.tac); - TEST_ASSERT_EQUAL(LTE_LC_LTE_MODE_NBIOT, mode); - TEST_ASSERT_EQUAL(-1, psm_cfg.active_time); - TEST_ASSERT_EQUAL(-1, psm_cfg.tau); - - err = parse_cereg(at_cereg_1_no_tau_ext_no_active_time, &status, &cell, &mode, &psm_cfg); - TEST_ASSERT_EQUAL(0, err); - TEST_ASSERT_EQUAL(LTE_LC_NW_REG_REGISTERED_HOME, status); - TEST_ASSERT_EQUAL(0x01020304, cell.id); - TEST_ASSERT_EQUAL(0x0A0B, cell.tac); - TEST_ASSERT_EQUAL(LTE_LC_LTE_MODE_NBIOT, mode); - TEST_ASSERT_EQUAL(-1, psm_cfg.active_time); - TEST_ASSERT_EQUAL(-1, psm_cfg.tau); - - err = parse_cereg(at_cereg_2, &status, &cell, &mode, &psm_cfg); - TEST_ASSERT_EQUAL(0, err); - TEST_ASSERT_EQUAL(LTE_LC_NW_REG_SEARCHING, status); - TEST_ASSERT_EQUAL(0xDEADBEEF, cell.id); - TEST_ASSERT_EQUAL(0xABBA, cell.tac); - TEST_ASSERT_EQUAL(LTE_LC_LTE_MODE_LTEM, mode); - TEST_ASSERT_EQUAL(-1, psm_cfg.active_time); - TEST_ASSERT_EQUAL(-1, psm_cfg.tau); - - err = parse_cereg(at_cereg_2_reject_cause, &status, &cell, &mode, &psm_cfg); - TEST_ASSERT_EQUAL(0, err); - TEST_ASSERT_EQUAL(LTE_LC_NW_REG_SEARCHING, status); - TEST_ASSERT_EQUAL(0xDEADBEEF, cell.id); - TEST_ASSERT_EQUAL(0xABBA, cell.tac); - TEST_ASSERT_EQUAL(LTE_LC_LTE_MODE_LTEM, mode); - TEST_ASSERT_EQUAL(-1, psm_cfg.active_time); - TEST_ASSERT_EQUAL(-1, psm_cfg.tau); - - err = parse_cereg(at_cereg_2_unknown_cause_type, &status, &cell, &mode, &psm_cfg); - TEST_ASSERT_EQUAL(0, err); - TEST_ASSERT_EQUAL(LTE_LC_NW_REG_SEARCHING, status); - TEST_ASSERT_EQUAL(0xDEADBEEF, cell.id); - TEST_ASSERT_EQUAL(0xABBA, cell.tac); - TEST_ASSERT_EQUAL(LTE_LC_LTE_MODE_LTEM, mode); - TEST_ASSERT_EQUAL(-1, psm_cfg.active_time); - TEST_ASSERT_EQUAL(-1, psm_cfg.tau); - - err = parse_cereg(at_cereg_4, &status, &cell, &mode, &psm_cfg); - TEST_ASSERT_EQUAL(0, err); - TEST_ASSERT_EQUAL(LTE_LC_NW_REG_UNKNOWN, status); - TEST_ASSERT_EQUAL(LTE_LC_CELL_EUTRAN_ID_INVALID, cell.id); - TEST_ASSERT_EQUAL(LTE_LC_CELL_TAC_INVALID, cell.tac); - TEST_ASSERT_EQUAL(LTE_LC_LTE_MODE_NONE, mode); - TEST_ASSERT_EQUAL(-1, psm_cfg.active_time); - TEST_ASSERT_EQUAL(-1, psm_cfg.tau); - - err = parse_cereg(at_cereg_5, &status, &cell, &mode, &psm_cfg); - TEST_ASSERT_EQUAL(0, err); - TEST_ASSERT_EQUAL(LTE_LC_NW_REG_REGISTERED_ROAMING, status); - TEST_ASSERT_EQUAL(0x01020304, cell.id); - TEST_ASSERT_EQUAL(0x0A0B, cell.tac); - TEST_ASSERT_EQUAL(LTE_LC_LTE_MODE_NBIOT, mode); - TEST_ASSERT_EQUAL(-1, psm_cfg.active_time); - TEST_ASSERT_EQUAL(18600, psm_cfg.tau); - - err = parse_cereg(at_cereg_90, &status, &cell, &mode, &psm_cfg); - TEST_ASSERT_EQUAL(0, err); - TEST_ASSERT_EQUAL(LTE_LC_NW_REG_UICC_FAIL, status); - TEST_ASSERT_EQUAL(LTE_LC_CELL_EUTRAN_ID_INVALID, cell.id); - TEST_ASSERT_EQUAL(LTE_LC_CELL_TAC_INVALID, cell.tac); - TEST_ASSERT_EQUAL(LTE_LC_LTE_MODE_NONE, mode); - TEST_ASSERT_EQUAL(-1, psm_cfg.active_time); - TEST_ASSERT_EQUAL(-1, psm_cfg.tau); - - /* The parser does not check registration status or LTE mode values for validity, - * also values not used by the modem are parsed. - */ - err = parse_cereg(at_cereg_invalid, &status, &cell, &mode, &psm_cfg); - TEST_ASSERT_EQUAL(0, err); - TEST_ASSERT_EQUAL(10, status); - TEST_ASSERT_EQUAL(LTE_LC_CELL_EUTRAN_ID_INVALID, cell.id); - TEST_ASSERT_EQUAL(LTE_LC_CELL_TAC_INVALID, cell.tac); - TEST_ASSERT_EQUAL(5, mode); - TEST_ASSERT_EQUAL(-1, psm_cfg.active_time); - TEST_ASSERT_EQUAL(-1, psm_cfg.tau); -} - -void test_parse_xt3412(void) -{ - int err; - uint64_t time; - char *at_response_short = "%XT3412: 360"; - char *at_response_long = "%XT3412: 2147483647"; - char *at_response_t3412_max = "%XT3412: 35712000000"; - char *at_response_t3412_overflow = "%XT3412: 35712000001"; - char *at_response_negative = "%XT3412: -100"; - - err = parse_xt3412(at_response_short, &time); - TEST_ASSERT_EQUAL(0, err); - TEST_ASSERT_EQUAL(360, time); - - err = parse_xt3412(at_response_long, &time); - TEST_ASSERT_EQUAL(0, err); - TEST_ASSERT_EQUAL(2147483647, time); - - err = parse_xt3412(at_response_t3412_max, &time); - TEST_ASSERT_EQUAL(0, err); - TEST_ASSERT_EQUAL(35712000000, time); - - err = parse_xt3412(at_response_t3412_overflow, &time); - TEST_ASSERT_EQUAL(err, -EINVAL); - - err = parse_xt3412(at_response_negative, &time); - TEST_ASSERT_EQUAL(err, -EINVAL); -} - -void test_parse_xmodemsleep(void) -{ - int err; - struct lte_lc_modem_sleep modem_sleep; - char *at_response_0 = "%XMODEMSLEEP: 1,36000"; - char *at_response_1 = "%XMODEMSLEEP: 1,35712000000"; - char *at_response_2 = "%XMODEMSLEEP: 2,100400"; - char *at_response_3 = "%XMODEMSLEEP: 3"; - char *at_response_4 = "%XMODEMSLEEP: 4"; - char *at_response_5 = "%XMODEMSLEEP: 4,0"; - char *at_response_6 = "%XMODEMSLEEP: 7"; - - err = parse_xmodemsleep(at_response_0, &modem_sleep); - TEST_ASSERT_EQUAL(0, err); - TEST_ASSERT_EQUAL(LTE_LC_MODEM_SLEEP_PSM, modem_sleep.type); - TEST_ASSERT_EQUAL(36000, modem_sleep.time); - - err = parse_xmodemsleep(at_response_1, &modem_sleep); - TEST_ASSERT_EQUAL(0, err); - TEST_ASSERT_EQUAL(LTE_LC_MODEM_SLEEP_PSM, modem_sleep.type); - TEST_ASSERT_EQUAL(35712000000, modem_sleep.time); - - err = parse_xmodemsleep(at_response_2, &modem_sleep); - TEST_ASSERT_EQUAL(0, err); - TEST_ASSERT_EQUAL(LTE_LC_MODEM_SLEEP_RF_INACTIVITY, modem_sleep.type); - TEST_ASSERT_EQUAL(100400, modem_sleep.time); - - err = parse_xmodemsleep(at_response_3, &modem_sleep); - TEST_ASSERT_EQUAL(0, err); - TEST_ASSERT_EQUAL(LTE_LC_MODEM_SLEEP_LIMITED_SERVICE, modem_sleep.type); - TEST_ASSERT_EQUAL(-1, modem_sleep.time); - - err = parse_xmodemsleep(at_response_4, &modem_sleep); - TEST_ASSERT_EQUAL(0, err); - TEST_ASSERT_EQUAL(LTE_LC_MODEM_SLEEP_FLIGHT_MODE, modem_sleep.type); - TEST_ASSERT_EQUAL(-1, modem_sleep.time); - - err = parse_xmodemsleep(at_response_5, &modem_sleep); - TEST_ASSERT_EQUAL(0, err); - TEST_ASSERT_EQUAL(LTE_LC_MODEM_SLEEP_FLIGHT_MODE, modem_sleep.type); - TEST_ASSERT_EQUAL(0, modem_sleep.time); - - err = parse_xmodemsleep(at_response_6, &modem_sleep); - TEST_ASSERT_EQUAL(0, err); - TEST_ASSERT_EQUAL(LTE_LC_MODEM_SLEEP_PROPRIETARY_PSM, modem_sleep.type); - TEST_ASSERT_EQUAL(-1, modem_sleep.time); - -} - -void test_parse_rrc_mode(void) -{ - int err; - enum lte_lc_rrc_mode mode; - char *at_response_0 = "+CSCON: 0"; - char *at_response_1 = "+CSCON: 1"; - - err = parse_rrc_mode(at_response_0, &mode, AT_CSCON_RRC_MODE_INDEX); - TEST_ASSERT_EQUAL(0, err); - TEST_ASSERT_EQUAL(LTE_LC_RRC_MODE_IDLE, mode); - - err = parse_rrc_mode(at_response_1, &mode, AT_CSCON_RRC_MODE_INDEX); - TEST_ASSERT_EQUAL(0, err); - TEST_ASSERT_EQUAL(LTE_LC_RRC_MODE_CONNECTED, mode); - -} - -void test_parse_psm(void) -{ - int err; - struct lte_lc_psm_cfg psm_cfg; - struct psm_strings { - char *active_time; - char *tau_ext; - char *tau_legacy; - }; - struct psm_strings psm_disabled_tau_ext = { - .active_time = "11100000", - .tau_ext = "00001000", - .tau_legacy = "11100000", - }; - struct psm_strings psm_disabled_tau_legacy = { - .active_time = "11100000", - .tau_ext = "11100000", - .tau_legacy = "01001010", - }; - struct psm_strings tau_legacy = { - .active_time = "00001000", - .tau_ext = "11100000", - .tau_legacy = "00101010", - }; - struct psm_strings invalid_no_tau = { - .active_time = "00001000", - .tau_ext = "11100000", - .tau_legacy = "11100000", - }; - struct psm_strings invalid_values = { - .active_time = "0001111111", - .tau_ext = "00001", - .tau_legacy = "111", - }; - struct psm_strings valid_values_0 = { - .active_time = "01000001", - .tau_ext = "01000010", - .tau_legacy = "11100000", - }; - struct psm_strings valid_values_1 = { - .active_time = "00100100", - .tau_ext = "00001000", - .tau_legacy = "11100000", - }; - struct psm_strings valid_values_2 = { - .active_time = "00010000", - .tau_ext = "10111011", - .tau_legacy = "11100000", - }; - - err = parse_psm(psm_disabled_tau_ext.active_time, - psm_disabled_tau_ext.tau_ext, - psm_disabled_tau_ext.tau_legacy, - &psm_cfg); - TEST_ASSERT_EQUAL(0, err); - TEST_ASSERT_EQUAL(4800, psm_cfg.tau); - TEST_ASSERT_EQUAL(-1, psm_cfg.active_time); - - memset(&psm_cfg, 0, sizeof(psm_cfg)); - - err = parse_psm(psm_disabled_tau_legacy.active_time, - psm_disabled_tau_legacy.tau_ext, - psm_disabled_tau_legacy.tau_legacy, - &psm_cfg); - TEST_ASSERT_EQUAL(0, err); - TEST_ASSERT_EQUAL(3600, psm_cfg.tau); - TEST_ASSERT_EQUAL(-1, psm_cfg.active_time); - - memset(&psm_cfg, 0, sizeof(psm_cfg)); - - err = parse_psm(tau_legacy.active_time, - tau_legacy.tau_ext, - tau_legacy.tau_legacy, - &psm_cfg); - TEST_ASSERT_EQUAL(0, err); - TEST_ASSERT_EQUAL(600, psm_cfg.tau); - TEST_ASSERT_EQUAL(16, psm_cfg.active_time); - - memset(&psm_cfg, 0, sizeof(psm_cfg)); - - err = parse_psm(invalid_no_tau.active_time, - invalid_no_tau.tau_ext, - invalid_no_tau.tau_legacy, - &psm_cfg); - TEST_ASSERT_EQUAL(-EINVAL, err); - - memset(&psm_cfg, 0, sizeof(psm_cfg)); - - err = parse_psm(invalid_values.active_time, - invalid_values.tau_ext, - invalid_values.tau_legacy, - &psm_cfg); - TEST_ASSERT_EQUAL(-EINVAL, err); - - memset(&psm_cfg, 0, sizeof(psm_cfg)); - - err = parse_psm(valid_values_0.active_time, - valid_values_0.tau_ext, - valid_values_0.tau_legacy, - &psm_cfg); - TEST_ASSERT_EQUAL(0, err); - TEST_ASSERT_EQUAL(72000, psm_cfg.tau); - TEST_ASSERT_EQUAL(360, psm_cfg.active_time); - - memset(&psm_cfg, 0, sizeof(psm_cfg)); - - err = parse_psm(valid_values_1.active_time, - valid_values_1.tau_ext, - valid_values_1.tau_legacy, - &psm_cfg); - TEST_ASSERT_EQUAL(0, err); - TEST_ASSERT_EQUAL(4800, psm_cfg.tau); - TEST_ASSERT_EQUAL(240, psm_cfg.active_time); - - memset(&psm_cfg, 0, sizeof(psm_cfg)); - - err = parse_psm(valid_values_2.active_time, - valid_values_2.tau_ext, - valid_values_2.tau_legacy, - &psm_cfg); - TEST_ASSERT_EQUAL(0, err); - TEST_ASSERT_EQUAL(1620, psm_cfg.tau); - TEST_ASSERT_EQUAL(32, psm_cfg.active_time); -} - -void test_encode_psm(void) -{ - int err; - char tau_ext_str[9] = ""; - char active_time_str[9] = ""; - - err = encode_psm(tau_ext_str, active_time_str, 11400, 60); - TEST_ASSERT_EQUAL(0, err); - TEST_ASSERT_EQUAL_STRING("00010011", tau_ext_str); - TEST_ASSERT_EQUAL_STRING("00011110", active_time_str); - - memset(tau_ext_str, 0, sizeof(tau_ext_str)); - memset(active_time_str, 0, sizeof(active_time_str)); - - /* Test value -1 */ - err = encode_psm(tau_ext_str, active_time_str, -1, -1); - TEST_ASSERT_EQUAL(0, err); - TEST_ASSERT_EQUAL_STRING("", tau_ext_str); - TEST_ASSERT_EQUAL_STRING("", active_time_str); - - memset(tau_ext_str, 0, sizeof(tau_ext_str)); - memset(active_time_str, 0, sizeof(active_time_str)); - - /* Test too big TAU */ - err = encode_psm(tau_ext_str, active_time_str, 35712001, 61); - TEST_ASSERT_EQUAL(-EINVAL, err); - TEST_ASSERT_EQUAL_STRING("", tau_ext_str); - TEST_ASSERT_EQUAL_STRING("00011111", active_time_str); - - memset(tau_ext_str, 0, sizeof(tau_ext_str)); - memset(active_time_str, 0, sizeof(active_time_str)); - - /* Test too big active time */ - err = encode_psm(tau_ext_str, active_time_str, 61, 11161); - TEST_ASSERT_EQUAL(-EINVAL, err); - TEST_ASSERT_EQUAL_STRING("01111111", tau_ext_str); - TEST_ASSERT_EQUAL_STRING("", active_time_str); - - memset(tau_ext_str, 0, sizeof(tau_ext_str)); - memset(active_time_str, 0, sizeof(active_time_str)); - - /* Test value 1 rounding to 2*/ - err = encode_psm(tau_ext_str, active_time_str, 1, 1); - TEST_ASSERT_EQUAL(0, err); - TEST_ASSERT_EQUAL_STRING("01100001", tau_ext_str); - TEST_ASSERT_EQUAL_STRING("00000001", active_time_str); - - memset(tau_ext_str, 0, sizeof(tau_ext_str)); - memset(active_time_str, 0, sizeof(active_time_str)); - - /* Test maximum values */ - err = encode_psm(tau_ext_str, active_time_str, 35712000, 11160); - TEST_ASSERT_EQUAL(0, err); - TEST_ASSERT_EQUAL_STRING("11011111", tau_ext_str); - TEST_ASSERT_EQUAL_STRING("01011111", active_time_str); - - memset(tau_ext_str, 0, sizeof(tau_ext_str)); - memset(active_time_str, 0, sizeof(active_time_str)); - - /****************************************/ - err = encode_psm(tau_ext_str, active_time_str, 123456, 89); - TEST_ASSERT_EQUAL(0, err); - TEST_ASSERT_EQUAL_STRING("01000100", tau_ext_str); - TEST_ASSERT_EQUAL_STRING("00100010", active_time_str); - - memset(tau_ext_str, 0, sizeof(tau_ext_str)); - memset(active_time_str, 0, sizeof(active_time_str)); - - /****************************************/ - err = encode_psm(tau_ext_str, active_time_str, 62, 63); - TEST_ASSERT_EQUAL(0, err); - TEST_ASSERT_EQUAL_STRING("01111111", tau_ext_str); - TEST_ASSERT_EQUAL_STRING("00100010", active_time_str); - - memset(tau_ext_str, 0, sizeof(tau_ext_str)); - memset(active_time_str, 0, sizeof(active_time_str)); -} - -void test_parse_mdmev(void) -{ - int err; - enum lte_lc_modem_evt modem_evt; - const char *light_search = "%MDMEV: SEARCH STATUS 1\r\n"; - const char *search = "%MDMEV: SEARCH STATUS 2\r\n"; - const char *reset = "%MDMEV: RESET LOOP\r\n"; - const char *battery_low = "%MDMEV: ME BATTERY LOW\r\n"; - const char *overheated = "%MDMEV: ME OVERHEATED\r\n"; - const char *status_3 = "%MDMEV: SEARCH STATUS 3\r\n"; - const char *light_search_long = "%MDMEV: SEARCH STATUS 1 and then some\r\n"; - const char *no_imei = "%MDMEV: NO IMEI\r\n"; - const char *ce_level_0 = "%MDMEV: PRACH CE-LEVEL 0\r\n"; - const char *ce_level_1 = "%MDMEV: PRACH CE-LEVEL 1\r\n"; - const char *ce_level_2 = "%MDMEV: PRACH CE-LEVEL 2\r\n"; - const char *ce_level_3 = "%MDMEV: PRACH CE-LEVEL 3\r\n"; - const char *ce_level_invalid = "%MDMEV: PRACH CE-LEVEL 4\r\n"; - const char *ce_level_long = "%MDMEV: PRACH CE-LEVEL 0 and then some\r\n"; - - err = parse_mdmev(light_search, &modem_evt); - TEST_ASSERT_EQUAL(0, err); - TEST_ASSERT_EQUAL(LTE_LC_MODEM_EVT_LIGHT_SEARCH_DONE, modem_evt); - - err = parse_mdmev(search, &modem_evt); - TEST_ASSERT_EQUAL(0, err); - TEST_ASSERT_EQUAL(LTE_LC_MODEM_EVT_SEARCH_DONE, modem_evt); - - err = parse_mdmev(reset, &modem_evt); - TEST_ASSERT_EQUAL(0, err); - TEST_ASSERT_EQUAL(LTE_LC_MODEM_EVT_RESET_LOOP, modem_evt); - - err = parse_mdmev(battery_low, &modem_evt); - TEST_ASSERT_EQUAL(0, err); - TEST_ASSERT_EQUAL(LTE_LC_MODEM_EVT_BATTERY_LOW, modem_evt); - - err = parse_mdmev(overheated, &modem_evt); - TEST_ASSERT_EQUAL(0, err); - TEST_ASSERT_EQUAL(LTE_LC_MODEM_EVT_OVERHEATED, modem_evt); - - err = parse_mdmev(status_3, &modem_evt); - TEST_ASSERT_EQUAL(-ENODATA, err); - - err = parse_mdmev(light_search_long, &modem_evt); - TEST_ASSERT_EQUAL(-ENODATA, err); - - err = parse_mdmev("%MDMEV: ", &modem_evt); - TEST_ASSERT_EQUAL(-ENODATA, err); - - err = parse_mdmev(no_imei, &modem_evt); - TEST_ASSERT_EQUAL(0, err); - TEST_ASSERT_EQUAL(LTE_LC_MODEM_EVT_NO_IMEI, modem_evt); - - err = parse_mdmev(ce_level_0, &modem_evt); - TEST_ASSERT_EQUAL(0, err); - TEST_ASSERT_EQUAL(LTE_LC_MODEM_EVT_CE_LEVEL_0, modem_evt); - - err = parse_mdmev(ce_level_1, &modem_evt); - TEST_ASSERT_EQUAL(0, err); - TEST_ASSERT_EQUAL(LTE_LC_MODEM_EVT_CE_LEVEL_1, modem_evt); - - err = parse_mdmev(ce_level_2, &modem_evt); - TEST_ASSERT_EQUAL(0, err); - TEST_ASSERT_EQUAL(LTE_LC_MODEM_EVT_CE_LEVEL_2, modem_evt); - - err = parse_mdmev(ce_level_3, &modem_evt); - TEST_ASSERT_EQUAL(0, err); - TEST_ASSERT_EQUAL(LTE_LC_MODEM_EVT_CE_LEVEL_3, modem_evt); - - err = parse_mdmev(ce_level_invalid, &modem_evt); - TEST_ASSERT_EQUAL(-ENODATA, err); - - err = parse_mdmev(ce_level_long, &modem_evt); - TEST_ASSERT_EQUAL(-ENODATA, err); -} - -void test_periodic_search_pattern_get(void) -{ - char buf[40] = {0}; - struct lte_lc_periodic_search_pattern pattern_range_1 = { - .type = LTE_LC_PERIODIC_SEARCH_PATTERN_RANGE, - .range = { - .initial_sleep = 60, - .final_sleep = 3600, - .time_to_final_sleep = 300, - .pattern_end_point = 600 - }, - }; - struct lte_lc_periodic_search_pattern pattern_range_2 = { - .type = LTE_LC_PERIODIC_SEARCH_PATTERN_RANGE, - .range = { - .initial_sleep = 60, - .final_sleep = 3600, - .time_to_final_sleep = -1, - .pattern_end_point = 600 - }, - }; - struct lte_lc_periodic_search_pattern pattern_table_1 = { - .type = LTE_LC_PERIODIC_SEARCH_PATTERN_TABLE, - .table = { - .val_1 = 60, - .val_2 = -1, - .val_3 = -1, - .val_4 = -1, - .val_5 = -1, - }, - }; - struct lte_lc_periodic_search_pattern pattern_table_2 = { - .type = LTE_LC_PERIODIC_SEARCH_PATTERN_TABLE, - .table = { - .val_1 = 20, - .val_2 = 80, - .val_3 = -1, - .val_4 = -1, - .val_5 = -1, - }, - }; - struct lte_lc_periodic_search_pattern pattern_table_3 = { - .type = LTE_LC_PERIODIC_SEARCH_PATTERN_TABLE, - .table = { - .val_1 = 10, - .val_2 = 70, - .val_3 = 300, - .val_4 = -1, - .val_5 = -1, - }, - }; - struct lte_lc_periodic_search_pattern pattern_table_4 = { - .type = LTE_LC_PERIODIC_SEARCH_PATTERN_TABLE, - .table = { - .val_1 = 1, - .val_2 = 60, - .val_3 = 120, - .val_4 = 3600, - .val_5 = -1, - }, - }; - struct lte_lc_periodic_search_pattern pattern_table_5 = { - .type = LTE_LC_PERIODIC_SEARCH_PATTERN_TABLE, - .table = { - .val_1 = 2, - .val_2 = 30, - .val_3 = 40, - .val_4 = 900, - .val_5 = 3000, - }, - }; - - TEST_ASSERT_EQUAL_PTR(buf, periodic_search_pattern_get(buf, sizeof(buf), &pattern_range_1)); - TEST_ASSERT_EQUAL_STRING("\"0,60,3600,300,600\"", buf); - - memset(buf, 0, sizeof(buf)); - - TEST_ASSERT_EQUAL_PTR(buf, periodic_search_pattern_get(buf, sizeof(buf), &pattern_range_2)); - TEST_ASSERT_EQUAL_STRING("\"0,60,3600,,600\"", buf); - - memset(buf, 0, sizeof(buf)); - - TEST_ASSERT_EQUAL_PTR(buf, periodic_search_pattern_get(buf, sizeof(buf), &pattern_table_1)); - TEST_ASSERT_EQUAL_STRING("\"1,60\"", buf); - - memset(buf, 0, sizeof(buf)); - - TEST_ASSERT_EQUAL_PTR(buf, periodic_search_pattern_get(buf, sizeof(buf), &pattern_table_2)); - TEST_ASSERT_EQUAL_STRING("\"1,20,80\"", buf); - - memset(buf, 0, sizeof(buf)); - - TEST_ASSERT_EQUAL_PTR(buf, periodic_search_pattern_get(buf, sizeof(buf), &pattern_table_3)); - TEST_ASSERT_EQUAL_STRING("\"1,10,70,300\"", buf); - - memset(buf, 0, sizeof(buf)); - - TEST_ASSERT_EQUAL_PTR(buf, periodic_search_pattern_get(buf, sizeof(buf), &pattern_table_4)); - TEST_ASSERT_EQUAL_STRING("\"1,1,60,120,3600\"", buf); - - memset(buf, 0, sizeof(buf)); - - TEST_ASSERT_EQUAL_PTR(buf, periodic_search_pattern_get(buf, sizeof(buf), &pattern_table_5)); - TEST_ASSERT_EQUAL_STRING("\"1,2,30,40,900,3000\"", buf); -} - -void test_parse_periodic_search_pattern(void) -{ - int err; - struct lte_lc_periodic_search_pattern pattern; - const char *pattern_range_1 = "0,60,3600,300,600"; - const char *pattern_range_2 = "0,60,3600,,600"; - const char *pattern_range_empty = "0"; - const char *pattern_table_1 = "1,10"; - const char *pattern_table_2 = "1,20,30"; - const char *pattern_table_3 = "1,30,40,50"; - const char *pattern_table_4 = "1,40,50,60,70"; - const char *pattern_table_5 = "1,50,60,70,80,90"; - const char *pattern_table_empty = "1"; - - err = parse_periodic_search_pattern(pattern_range_1, &pattern); - TEST_ASSERT_EQUAL(0, err); - TEST_ASSERT_EQUAL(LTE_LC_PERIODIC_SEARCH_PATTERN_RANGE, pattern.type); - TEST_ASSERT_EQUAL(60, pattern.range.initial_sleep); - TEST_ASSERT_EQUAL(3600, pattern.range.final_sleep); - TEST_ASSERT_EQUAL(300, pattern.range.time_to_final_sleep); - TEST_ASSERT_EQUAL(600, pattern.range.pattern_end_point); - - memset(&pattern, 0, sizeof(pattern)); - - err = parse_periodic_search_pattern(pattern_range_2, &pattern); - TEST_ASSERT_EQUAL(0, err); - TEST_ASSERT_EQUAL(LTE_LC_PERIODIC_SEARCH_PATTERN_RANGE, pattern.type); - TEST_ASSERT_EQUAL(60, pattern.range.initial_sleep); - TEST_ASSERT_EQUAL(3600, pattern.range.final_sleep); - TEST_ASSERT_EQUAL(-1, pattern.range.time_to_final_sleep); - TEST_ASSERT_EQUAL(600, pattern.range.pattern_end_point); - - memset(&pattern, 0, sizeof(pattern)); - - err = parse_periodic_search_pattern(pattern_range_empty, &pattern); - TEST_ASSERT_EQUAL(-EBADMSG, err); - - memset(&pattern, 0, sizeof(pattern)); - - err = parse_periodic_search_pattern(pattern_table_1, &pattern); - TEST_ASSERT_EQUAL(0, err); - TEST_ASSERT_EQUAL(LTE_LC_PERIODIC_SEARCH_PATTERN_TABLE, pattern.type); - TEST_ASSERT_EQUAL(10, pattern.table.val_1); - TEST_ASSERT_EQUAL(-1, pattern.table.val_2); - TEST_ASSERT_EQUAL(-1, pattern.table.val_3); - TEST_ASSERT_EQUAL(-1, pattern.table.val_4); - TEST_ASSERT_EQUAL(-1, pattern.table.val_5); - - memset(&pattern, 0, sizeof(pattern)); - - err = parse_periodic_search_pattern(pattern_table_2, &pattern); - TEST_ASSERT_EQUAL(0, err); - TEST_ASSERT_EQUAL(LTE_LC_PERIODIC_SEARCH_PATTERN_TABLE, pattern.type); - TEST_ASSERT_EQUAL(20, pattern.table.val_1); - TEST_ASSERT_EQUAL(30, pattern.table.val_2); - TEST_ASSERT_EQUAL(-1, pattern.table.val_3); - TEST_ASSERT_EQUAL(-1, pattern.table.val_4); - TEST_ASSERT_EQUAL(-1, pattern.table.val_5); - - memset(&pattern, 0, sizeof(pattern)); - - err = parse_periodic_search_pattern(pattern_table_3, &pattern); - TEST_ASSERT_EQUAL(0, err); - TEST_ASSERT_EQUAL(LTE_LC_PERIODIC_SEARCH_PATTERN_TABLE, pattern.type); - TEST_ASSERT_EQUAL(30, pattern.table.val_1); - TEST_ASSERT_EQUAL(40, pattern.table.val_2); - TEST_ASSERT_EQUAL(50, pattern.table.val_3); - TEST_ASSERT_EQUAL(-1, pattern.table.val_4); - TEST_ASSERT_EQUAL(-1, pattern.table.val_5); - - memset(&pattern, 0, sizeof(pattern)); - - err = parse_periodic_search_pattern(pattern_table_4, &pattern); - TEST_ASSERT_EQUAL(0, err); - TEST_ASSERT_EQUAL(LTE_LC_PERIODIC_SEARCH_PATTERN_TABLE, pattern.type); - TEST_ASSERT_EQUAL(40, pattern.table.val_1); - TEST_ASSERT_EQUAL(50, pattern.table.val_2); - TEST_ASSERT_EQUAL(60, pattern.table.val_3); - TEST_ASSERT_EQUAL(70, pattern.table.val_4); - TEST_ASSERT_EQUAL(-1, pattern.table.val_5); - - memset(&pattern, 0, sizeof(pattern)); - - err = parse_periodic_search_pattern(pattern_table_5, &pattern); - TEST_ASSERT_EQUAL(0, err); - TEST_ASSERT_EQUAL(LTE_LC_PERIODIC_SEARCH_PATTERN_TABLE, pattern.type); - TEST_ASSERT_EQUAL(50, pattern.table.val_1); - TEST_ASSERT_EQUAL(60, pattern.table.val_2); - TEST_ASSERT_EQUAL(70, pattern.table.val_3); - TEST_ASSERT_EQUAL(80, pattern.table.val_4); - TEST_ASSERT_EQUAL(90, pattern.table.val_5); - - memset(&pattern, 0, sizeof(pattern)); - - err = parse_periodic_search_pattern(pattern_table_empty, &pattern); - TEST_ASSERT_EQUAL(-EBADMSG, err); -} - -int main(void) -{ - (void)unity_main(); - return 0; -} diff --git a/tests/lib/lte_lc_api/CMakeLists.txt b/tests/lib/lte_lc_api/CMakeLists.txt index 3623d660c199..866c238d80ce 100644 --- a/tests/lib/lte_lc_api/CMakeLists.txt +++ b/tests/lib/lte_lc_api/CMakeLists.txt @@ -14,7 +14,8 @@ test_runner_generate(src/lte_lc_api_test.c) cmock_handle(${ZEPHYR_NRFXLIB_MODULE_DIR}/nrf_modem/include/nrf_modem_at.h FUNC_EXCLUDE ".*nrf_modem_at_scanf" - FUNC_EXCLUDE ".*nrf_modem_at_printf") + FUNC_EXCLUDE ".*nrf_modem_at_printf" + WORD_EXCLUDE "__nrf_modem_(printf|scanf)_like\(.*\)") cmock_handle(${ZEPHYR_NRFXLIB_MODULE_DIR}/nrf_modem/include/nrf_modem.h) diff --git a/tests/lib/lte_lc_api/src/lte_lc_api_test.c b/tests/lib/lte_lc_api/src/lte_lc_api_test.c index 697c64d43f89..dd23dd6241b2 100644 --- a/tests/lib/lte_lc_api/src/lte_lc_api_test.c +++ b/tests/lib/lte_lc_api/src/lte_lc_api_test.c @@ -835,7 +835,7 @@ void test_lte_lc_psm_req_disable_success(void) TEST_ASSERT_EQUAL(EXIT_SUCCESS, ret); } -void test_lte_lc_psm_param_set_seconds_enable_both_set(void) +void test_lte_lc_psm_param_set_seconds_enable_both_set_1(void) { int ret; @@ -848,6 +848,19 @@ void test_lte_lc_psm_param_set_seconds_enable_both_set(void) TEST_ASSERT_EQUAL(EXIT_SUCCESS, ret); } +void test_lte_lc_psm_param_set_seconds_enable_both_set_2(void) +{ + int ret; + + ret = lte_lc_psm_param_set_seconds(123456, 89); + TEST_ASSERT_EQUAL(EXIT_SUCCESS, ret); + + __mock_nrf_modem_at_printf_ExpectAndReturn( + "AT+CPSMS=1,,,\"01000100\",\"00100010\"", EXIT_SUCCESS); + ret = lte_lc_psm_req(true); + TEST_ASSERT_EQUAL(EXIT_SUCCESS, ret); +} + void test_lte_lc_psm_param_set_seconds_enable_both_zero(void) { int ret; @@ -873,11 +886,49 @@ void test_lte_lc_psm_param_set_seconds_enable_both_default(void) TEST_ASSERT_EQUAL(EXIT_SUCCESS, ret); } -void test_lte_lc_psm_param_set_seconds_too_large(void) +void test_lte_lc_psm_param_set_seconds_enable_both_1_rounding_to_2(void) { int ret; - ret = lte_lc_psm_param_set_seconds(1000000000, 1000000000); + ret = lte_lc_psm_param_set_seconds(1, 1); + TEST_ASSERT_EQUAL(EXIT_SUCCESS, ret); + + __mock_nrf_modem_at_printf_ExpectAndReturn( + "AT+CPSMS=1,,,\"01100001\",\"00000001\"", EXIT_SUCCESS); + ret = lte_lc_psm_req(true); + TEST_ASSERT_EQUAL(EXIT_SUCCESS, ret); +} + +void test_lte_lc_psm_param_set_seconds_enable_both_max_values(void) +{ + int ret; + + ret = lte_lc_psm_param_set_seconds(35712000, 11160); + TEST_ASSERT_EQUAL(EXIT_SUCCESS, ret); + + __mock_nrf_modem_at_printf_ExpectAndReturn( + "AT+CPSMS=1,,,\"11011111\",\"01011111\"", EXIT_SUCCESS); + ret = lte_lc_psm_req(true); + TEST_ASSERT_EQUAL(EXIT_SUCCESS, ret); +} + +void test_lte_lc_psm_param_set_seconds_tau_too_big(void) +{ + int ret; + + ret = lte_lc_psm_param_set_seconds(35712001, 61); + TEST_ASSERT_EQUAL(-EINVAL, ret); + + __mock_nrf_modem_at_printf_ExpectAndReturn("AT+CPSMS=1", EXIT_SUCCESS); + ret = lte_lc_psm_req(true); + TEST_ASSERT_EQUAL(EXIT_SUCCESS, ret); +} + +void test_lte_lc_psm_param_set_seconds_active_time_too_big(void) +{ + int ret; + + ret = lte_lc_psm_param_set_seconds(61, 11161); TEST_ASSERT_EQUAL(-EINVAL, ret); __mock_nrf_modem_at_printf_ExpectAndReturn("AT+CPSMS=1", EXIT_SUCCESS); @@ -1302,6 +1353,12 @@ void test_lte_lc_cedrxp_no_params_fail(void) at_monitor_dispatch(at_notif); } +void test_lte_lc_cedrxp_invalid_mode_fail(void) +{ + strcpy(at_notif, "+CEDRXP: 1,\"1000\",\"0101\",\"1011\"\r\n"); + at_monitor_dispatch(at_notif); +} + void test_lte_lc_edrx_get_disabled_success(void) { int ret; @@ -1924,9 +1981,13 @@ void test_lte_lc_cereg_with_xmonitor(void) k_sleep(K_MSEC(1)); } -void test_lte_lc_cereg_with_xmonitor_badmsg(void) +/* Tests: + * - and missing from CEREG + * - AT%XMONITOR failing + */ +void test_lte_lc_cereg_active_time_tau_missing_with_xmonitor_badmsg(void) { - strcpy(at_notif, "+CEREG: 1,\"5678\",\"87654321\",9,,,\"11100000\",\"11100000\"\r\n"); + strcpy(at_notif, "+CEREG: 1,\"5678\",\"87654321\",9,,\r\n"); static const char xmonitor_resp[] = "%XMONITOR: 1,\"Operator\",\"OP\",\"20065\",\"5678\",9,20,\"87654321\"," @@ -1964,9 +2025,13 @@ void test_lte_lc_cereg_with_xmonitor_badmsg(void) k_sleep(K_MSEC(1)); } -void test_lte_lc_cereg_with_xmonitor_fail(void) +/* Tests: + * - missing from CEREG + * - AT%XMONITOR failing + */ +void test_lte_lc_cereg_tau_missing_with_xmonitor_fail(void) { - strcpy(at_notif, "+CEREG: 5,\"5678\",\"87654321\",9,,,\"11100000\",\"11100000\"\r\n"); + strcpy(at_notif, "+CEREG: 5,\"5678\",\"87654321\",9,,,\"11100000\",\r\n"); lte_lc_callback_count_expected = 1; @@ -1985,14 +2050,14 @@ void test_lte_lc_cereg_with_xmonitor_fail(void) k_sleep(K_MSEC(1)); } -void test_lte_lc_cereg_with_xmonitor_tau_ext_not_8_fail(void) +void test_lte_lc_cereg_active_time_not_8_with_xmonitor_tau_ext_not_8_fail(void) { - strcpy(at_notif, "+CEREG: 1,\"5678\",\"87654321\",9,,,\"11100000\",\"111000\"\r\n"); + strcpy(at_notif, "+CEREG: 1,\"5678\",\"87654321\",9,,,\"1110\",\"11100000\"\r\n"); static const char xmonitor_resp[] = "%XMONITOR: 1,\"Operator\",\"OP\",\"20065\",\"5678\",9,20,\"87654321\"," "334,6200,66,44,\"\"," - "\"11100000\",\"001001\",\"01001001\""; + "\"11100000\",\"0010\",\"01001001\""; lte_lc_callback_count_expected = 1; @@ -2013,6 +2078,34 @@ void test_lte_lc_cereg_with_xmonitor_tau_ext_not_8_fail(void) k_sleep(K_MSEC(1)); } +void test_lte_lc_cereg_with_xmonitor_active_time_valid_tau_disabled_fail(void) +{ + strcpy(at_notif, "+CEREG: 5,\"5678\",\"87654321\",9,,,\"00001000\",\"11100000\"\r\n"); + + static const char xmonitor_resp[] = + "%XMONITOR: 1,\"Operator\",\"OP\",\"20065\",\"5678\",9,20,\"87654321\"," + "334,6200,66,44,\"\"," + "\"00001000\",\"11100000\",\"11100000\""; + + lte_lc_callback_count_expected = 1; + + test_event_data[0].type = LTE_LC_EVT_NW_REG_STATUS; + test_event_data[0].nw_reg_status = LTE_LC_NW_REG_REGISTERED_ROAMING; + + /* No LTE_LC_EVT_CELL_UPDATE because same values */ + /* No LTE_LC_EVT_LTE_MODE_UPDATE because same values */ + /* No LTE_LC_EVT_PSM_UPDATE because XMONITOR parsing fails */ + + __cmock_nrf_modem_at_cmd_ExpectAndReturn(NULL, 0, "AT%%XMONITOR", 0); + __cmock_nrf_modem_at_cmd_IgnoreArg_buf(); + __cmock_nrf_modem_at_cmd_IgnoreArg_len(); + __cmock_nrf_modem_at_cmd_ReturnArrayThruPtr_buf( + (char *)xmonitor_resp, sizeof(xmonitor_resp)); + + at_monitor_dispatch(at_notif); + k_sleep(K_MSEC(1)); +} + /* Test the following CEREG syntax: * - Empty: , , , , * - Exists: , @@ -2050,15 +2143,86 @@ void test_lte_lc_cereg_no_tac_but_tau(void) at_monitor_dispatch(at_notif); } +/* Test CEREG reject cause, which is not visible in events but there is only code to log it. */ +void test_lte_lc_cereg_unknown_reject_cause(void) +{ + strcpy(at_notif, "+CEREG: 2,\"ABBA\",\"12345678\",7,0,13\r\n"); + + lte_lc_callback_count_expected = 3; + + test_event_data[0].type = LTE_LC_EVT_NW_REG_STATUS; + test_event_data[0].nw_reg_status = LTE_LC_NW_REG_SEARCHING; + + test_event_data[1].type = LTE_LC_EVT_CELL_UPDATE; + test_event_data[1].cell.mcc = 0; + test_event_data[1].cell.mnc = 0; + test_event_data[1].cell.id = 0x12345678; + test_event_data[1].cell.tac = 0xABBA; + test_event_data[1].cell.earfcn = 0; + test_event_data[1].cell.timing_advance = 0; + test_event_data[1].cell.timing_advance_meas_time = 0; + test_event_data[1].cell.measurement_time = 0; + test_event_data[1].cell.phys_cell_id = 0; + test_event_data[1].cell.rsrp = 0; + test_event_data[1].cell.rsrq = 0; + + /* Because previous test leaves the mode to LTE_LC_LTE_MODE_NONE, + * there is a change to LTE_LC_LTE_MODE_LTEM in this test + */ + test_event_data[2].type = LTE_LC_EVT_LTE_MODE_UPDATE; + test_event_data[2].lte_mode = LTE_LC_LTE_MODE_LTEM; + + at_monitor_dispatch(at_notif); +} + void test_lte_lc_cereg_3_registration_denied(void) { strcpy(at_notif, "+CEREG: 3\r\n"); - lte_lc_callback_count_expected = 1; + lte_lc_callback_count_expected = 3; test_event_data[0].type = LTE_LC_EVT_NW_REG_STATUS; test_event_data[0].nw_reg_status = LTE_LC_NW_REG_REGISTRATION_DENIED; + test_event_data[1].type = LTE_LC_EVT_CELL_UPDATE; + test_event_data[1].cell.id = LTE_LC_CELL_EUTRAN_ID_INVALID; + test_event_data[1].cell.tac = -1; + + test_event_data[2].type = LTE_LC_EVT_LTE_MODE_UPDATE; + test_event_data[2].lte_mode = LTE_LC_LTE_MODE_NONE; + + at_monitor_dispatch(at_notif); +} + +/* Test unknown CEREG reject cause type */ +void test_lte_lc_cereg_unknown_reject_cause_unknown_type(void) +{ + strcpy(at_notif, "+CEREG: 2,\"ABBA\",\"87654321\",7,1,1\r\n"); + + lte_lc_callback_count_expected = 3; + + test_event_data[0].type = LTE_LC_EVT_NW_REG_STATUS; + test_event_data[0].nw_reg_status = LTE_LC_NW_REG_SEARCHING; + + test_event_data[1].type = LTE_LC_EVT_CELL_UPDATE; + test_event_data[1].cell.mcc = 0; + test_event_data[1].cell.mnc = 0; + test_event_data[1].cell.id = 0x87654321; + test_event_data[1].cell.tac = 0xABBA; + test_event_data[1].cell.earfcn = 0; + test_event_data[1].cell.timing_advance = 0; + test_event_data[1].cell.timing_advance_meas_time = 0; + test_event_data[1].cell.measurement_time = 0; + test_event_data[1].cell.phys_cell_id = 0; + test_event_data[1].cell.rsrp = 0; + test_event_data[1].cell.rsrq = 0; + + /* Because previous test leaves the mode to LTE_LC_LTE_MODE_NONE, + * there is a change to LTE_LC_LTE_MODE_LTEM in this test + */ + test_event_data[2].type = LTE_LC_EVT_LTE_MODE_UPDATE; + test_event_data[2].lte_mode = LTE_LC_LTE_MODE_LTEM; + at_monitor_dispatch(at_notif); } @@ -2066,11 +2230,18 @@ void test_lte_lc_cereg_90_uicc_fail(void) { strcpy(at_notif, "+CEREG: 90\r\n"); - lte_lc_callback_count_expected = 1; + lte_lc_callback_count_expected = 3; test_event_data[0].type = LTE_LC_EVT_NW_REG_STATUS; test_event_data[0].nw_reg_status = LTE_LC_NW_REG_UICC_FAIL; + test_event_data[1].type = LTE_LC_EVT_CELL_UPDATE; + test_event_data[1].cell.id = LTE_LC_CELL_EUTRAN_ID_INVALID; + test_event_data[1].cell.tac = -1; + + test_event_data[2].type = LTE_LC_EVT_LTE_MODE_UPDATE; + test_event_data[2].lte_mode = LTE_LC_LTE_MODE_NONE; + at_monitor_dispatch(at_notif); } @@ -2176,6 +2347,10 @@ void test_lte_lc_xt3412(void) strcpy(at_notif, "%XT3412: 1000\r\n"); at_monitor_dispatch(at_notif); + /* TAU with max value */ + strcpy(at_notif, "%XT3412: 35712000000\r\n"); + at_monitor_dispatch(at_notif); + /* Too big TAU pre-warning time */ strcpy(at_notif, "%XT3412: 35712000001\r\n"); at_monitor_dispatch(at_notif); @@ -2183,6 +2358,14 @@ void test_lte_lc_xt3412(void) /* Time not included */ strcpy(at_notif, "%XT3412:\r\n"); at_monitor_dispatch(at_notif); + + /* Negative TAU */ + strcpy(at_notif, "%XT3412: -100\r\n"); + at_monitor_dispatch(at_notif); + + /* TAU not a number */ + strcpy(at_notif, "%XT3412: invalid\r\n"); + at_monitor_dispatch(at_notif); } /* Test failing neighbor cell measurement first to see that the semaphore is given properly */ @@ -3764,6 +3947,12 @@ void test_lte_lc_modem_events_fail(void) strcpy(at_notif, "%MDMEV: PRACH CE-LEVEL 4\r\n"); at_monitor_dispatch(at_notif); + + strcpy(at_notif, "%MDMEV: SEARCH STATUS 1 and then some\r\n"); + at_monitor_dispatch(at_notif); + + strcpy(at_notif, "%MDMEV: PRACH CE-LEVEL 0 and then some\r\n"); + at_monitor_dispatch(at_notif); } void test_lte_lc_periodic_search_request(void) @@ -4061,6 +4250,49 @@ void test_lte_lc_periodic_search_set_patterns4_success(void) TEST_ASSERT_EQUAL(EXIT_SUCCESS, ret); } +void test_lte_lc_periodic_search_set_pattern_table_values_success(void) +{ + int ret; + struct lte_lc_periodic_search_cfg cfg = { 0 }; + + cfg.pattern_count = 4; + cfg.loop = 1; + cfg.return_to_pattern = 3; + cfg.band_optimization = 5; + cfg.patterns[0].type = LTE_LC_PERIODIC_SEARCH_PATTERN_TABLE; + cfg.patterns[0].table.val_1 = 11; + cfg.patterns[0].table.val_2 = -1; + cfg.patterns[0].table.val_3 = -1; + cfg.patterns[0].table.val_4 = -1; + cfg.patterns[0].table.val_5 = -1; + cfg.patterns[1].type = LTE_LC_PERIODIC_SEARCH_PATTERN_TABLE; + cfg.patterns[1].table.val_1 = 21; + cfg.patterns[1].table.val_2 = 22; + cfg.patterns[1].table.val_3 = -1; + cfg.patterns[1].table.val_4 = -1; + cfg.patterns[1].table.val_5 = -1; + cfg.patterns[2].type = LTE_LC_PERIODIC_SEARCH_PATTERN_TABLE; + cfg.patterns[2].table.val_1 = 31; + cfg.patterns[2].table.val_2 = 32; + cfg.patterns[2].table.val_3 = 33; + cfg.patterns[2].table.val_4 = -1; + cfg.patterns[2].table.val_5 = -1; + cfg.patterns[3].type = LTE_LC_PERIODIC_SEARCH_PATTERN_TABLE; + cfg.patterns[3].table.val_1 = 41; + cfg.patterns[3].table.val_2 = 42; + cfg.patterns[3].table.val_3 = 43; + cfg.patterns[3].table.val_4 = 44; + cfg.patterns[3].table.val_5 = -1; + + __mock_nrf_modem_at_printf_ExpectAndReturn( + "AT%PERIODICSEARCHCONF=0,1,3,5,\"1,11\",\"1,21,22\"," + "\"1,31,32,33\",\"1,41,42,43,44\"", + EXIT_SUCCESS); + + ret = lte_lc_periodic_search_set(&cfg); + TEST_ASSERT_EQUAL(EXIT_SUCCESS, ret); +} + void test_lte_lc_periodic_search_set_max_values_fail(void) { int ret; @@ -4293,7 +4525,7 @@ void test_lte_lc_periodic_search_get_pattern3_range_too_few_params_fail(void) TEST_ASSERT_EQUAL(-EBADMSG, ret); } -void test_lte_lc_periodic_search_get_pattern4_fail(void) +void test_lte_lc_periodic_search_get_pattern4_range_empty_fail(void) { int ret; struct lte_lc_periodic_search_cfg cfg; @@ -4308,7 +4540,28 @@ void test_lte_lc_periodic_search_get_pattern4_fail(void) __mock_nrf_modem_at_scanf_ReturnVarg_string("0,60,3600,30,600"); /* pattern_buf */ __mock_nrf_modem_at_scanf_ReturnVarg_string("0,60,3600,30,600"); /* pattern_buf */ __mock_nrf_modem_at_scanf_ReturnVarg_string("0,60,3600,30,600"); /* pattern_buf */ - __mock_nrf_modem_at_scanf_ReturnVarg_string("0,60,3600,,"); /* pattern_buf */ + __mock_nrf_modem_at_scanf_ReturnVarg_string("0"); /* pattern_buf */ + + ret = lte_lc_periodic_search_get(&cfg); + TEST_ASSERT_EQUAL(-EBADMSG, ret); +} + +void test_lte_lc_periodic_search_get_pattern4_table_empty_fail(void) +{ + int ret; + struct lte_lc_periodic_search_cfg cfg; + + __mock_nrf_modem_at_scanf_ExpectAndReturn( + "AT%PERIODICSEARCHCONF=1", + "%%PERIODICSEARCHCONF: %hu,%hu,%hu,\"%40[^\"]\",\"%40[^\"]\",\"%40[^\"]\",\"%40[^\"]\"", + 7); + __mock_nrf_modem_at_scanf_ReturnVarg_uint16(0); /* loop */ + __mock_nrf_modem_at_scanf_ReturnVarg_uint16(0); /* return_to_pattern */ + __mock_nrf_modem_at_scanf_ReturnVarg_uint16(10); /* band_optimization */ + __mock_nrf_modem_at_scanf_ReturnVarg_string("0,60,3600,30,600"); /* pattern_buf */ + __mock_nrf_modem_at_scanf_ReturnVarg_string("0,60,3600,30,600"); /* pattern_buf */ + __mock_nrf_modem_at_scanf_ReturnVarg_string("0,60,3600,30,600"); /* pattern_buf */ + __mock_nrf_modem_at_scanf_ReturnVarg_string("1"); /* pattern_buf */ ret = lte_lc_periodic_search_get(&cfg); TEST_ASSERT_EQUAL(-EBADMSG, ret); @@ -4355,7 +4608,7 @@ void test_lte_lc_periodic_search_get_patterns4_success(void) __mock_nrf_modem_at_scanf_ReturnVarg_string("0,60,3600,,600"); /* pattern_buf */ __mock_nrf_modem_at_scanf_ReturnVarg_string("0,30,1800,20,48"); /* pattern_buf */ __mock_nrf_modem_at_scanf_ReturnVarg_string("1,10,20,30,40,50"); /* pattern_buf */ - __mock_nrf_modem_at_scanf_ReturnVarg_string("1,11,21,31"); /* pattern_buf */ + __mock_nrf_modem_at_scanf_ReturnVarg_string("1,11"); /* pattern_buf */ ret = lte_lc_periodic_search_get(&cfg); TEST_ASSERT_EQUAL(0, cfg.loop); @@ -4379,8 +4632,44 @@ void test_lte_lc_periodic_search_get_patterns4_success(void) TEST_ASSERT_EQUAL(50, cfg.patterns[2].table.val_5); TEST_ASSERT_EQUAL(LTE_LC_PERIODIC_SEARCH_PATTERN_TABLE, cfg.patterns[3].type); TEST_ASSERT_EQUAL(11, cfg.patterns[3].table.val_1); - TEST_ASSERT_EQUAL(21, cfg.patterns[3].table.val_2); - TEST_ASSERT_EQUAL(31, cfg.patterns[3].table.val_3); + TEST_ASSERT_EQUAL(EXIT_SUCCESS, ret); +} + +void test_lte_lc_periodic_search_get_patterns4_table_values_success(void) +{ + int ret; + struct lte_lc_periodic_search_cfg cfg; + + __mock_nrf_modem_at_scanf_ExpectAndReturn( + "AT%PERIODICSEARCHCONF=1", + "%%PERIODICSEARCHCONF: %hu,%hu,%hu,\"%40[^\"]\",\"%40[^\"]\",\"%40[^\"]\",\"%40[^\"]\"", + 7); + __mock_nrf_modem_at_scanf_ReturnVarg_uint16(0); /* loop */ + __mock_nrf_modem_at_scanf_ReturnVarg_uint16(0); /* return_to_pattern */ + __mock_nrf_modem_at_scanf_ReturnVarg_uint16(10); /* band_optimization */ + __mock_nrf_modem_at_scanf_ReturnVarg_string("1,11"); /* pattern_buf */ + __mock_nrf_modem_at_scanf_ReturnVarg_string("1,21,22"); /* pattern_buf */ + __mock_nrf_modem_at_scanf_ReturnVarg_string("1,31,32,33"); /* pattern_buf */ + __mock_nrf_modem_at_scanf_ReturnVarg_string("1,41,42,43,44"); /* pattern_buf */ + + ret = lte_lc_periodic_search_get(&cfg); + TEST_ASSERT_EQUAL(0, cfg.loop); + TEST_ASSERT_EQUAL(0, cfg.return_to_pattern); + TEST_ASSERT_EQUAL(10, cfg.band_optimization); + TEST_ASSERT_EQUAL(LTE_LC_PERIODIC_SEARCH_PATTERN_TABLE, cfg.patterns[2].type); + TEST_ASSERT_EQUAL(11, cfg.patterns[0].table.val_1); + TEST_ASSERT_EQUAL(LTE_LC_PERIODIC_SEARCH_PATTERN_TABLE, cfg.patterns[2].type); + TEST_ASSERT_EQUAL(21, cfg.patterns[1].table.val_1); + TEST_ASSERT_EQUAL(22, cfg.patterns[1].table.val_2); + TEST_ASSERT_EQUAL(LTE_LC_PERIODIC_SEARCH_PATTERN_TABLE, cfg.patterns[2].type); + TEST_ASSERT_EQUAL(31, cfg.patterns[2].table.val_1); + TEST_ASSERT_EQUAL(32, cfg.patterns[2].table.val_2); + TEST_ASSERT_EQUAL(33, cfg.patterns[2].table.val_3); + TEST_ASSERT_EQUAL(LTE_LC_PERIODIC_SEARCH_PATTERN_TABLE, cfg.patterns[3].type); + TEST_ASSERT_EQUAL(41, cfg.patterns[3].table.val_1); + TEST_ASSERT_EQUAL(42, cfg.patterns[3].table.val_2); + TEST_ASSERT_EQUAL(43, cfg.patterns[3].table.val_3); + TEST_ASSERT_EQUAL(44, cfg.patterns[3].table.val_4); TEST_ASSERT_EQUAL(EXIT_SUCCESS, ret); } diff --git a/tests/lib/lte_lc_api/testcase.yaml b/tests/lib/lte_lc_api/testcase.yaml index 9962b8f20c0a..421589b24485 100644 --- a/tests/lib/lte_lc_api/testcase.yaml +++ b/tests/lib/lte_lc_api/testcase.yaml @@ -2,6 +2,6 @@ tests: unity.lte_lc_api_test: sysbuild: true tags: lte_lc_api sysbuild ci_tests_lib_lte_lc - platform_allow: native_posix + platform_allow: native_sim integration_platforms: - - native_posix + - native_sim diff --git a/tests/lib/modem_jwt/CMakeLists.txt b/tests/lib/modem_jwt/CMakeLists.txt index 686c99d830fb..485a10d939bd 100644 --- a/tests/lib/modem_jwt/CMakeLists.txt +++ b/tests/lib/modem_jwt/CMakeLists.txt @@ -14,9 +14,12 @@ test_runner_generate(src/jwt_test.c) target_include_directories(app PRIVATE src) -cmock_handle(../../../../nrfxlib/nrf_modem/include/nrf_modem_at.h) +cmock_handle(${ZEPHYR_NRFXLIB_MODULE_DIR}/nrf_modem/include/nrf_modem_at.h + WORD_EXCLUDE "__nrf_modem_(printf|scanf)_like\(.*\)") # add test file target_sources(app PRIVATE src/jwt_test.c) target_sources(app PRIVATE ../../../lib/modem_jwt/modem_jwt.c) add_definitions(-DCONFIG_MODEM_JWT_MAX_LEN=850) + +target_include_directories(app PRIVATE ${ZEPHYR_NRFXLIB_MODULE_DIR}/nrf_modem/include) diff --git a/tests/lib/nrf_modem_lib/lte_net_if/CMakeLists.txt b/tests/lib/nrf_modem_lib/lte_net_if/CMakeLists.txt index abe03d3d73d5..04581d7b1b80 100644 --- a/tests/lib/nrf_modem_lib/lte_net_if/CMakeLists.txt +++ b/tests/lib/nrf_modem_lib/lte_net_if/CMakeLists.txt @@ -18,7 +18,9 @@ cmock_handle(${ZEPHYR_NRF_MODULE_DIR}/include/modem/lte_lc.h WORD_EXCLUDE "__deprecated") cmock_handle(${ZEPHYR_NRF_MODULE_DIR}/include/modem/nrf_modem_lib.h FUNC_EXCLUDE ".*nrf_modem_lib_shutdown_wait") cmock_handle(${ZEPHYR_NRF_MODULE_DIR}/include/modem/pdn.h) -cmock_handle(${ZEPHYR_NRFXLIB_MODULE_DIR}/nrf_modem/include/nrf_modem_at.h FUNC_EXCLUDE ".*nrf_modem_at_scanf") +cmock_handle(${ZEPHYR_NRFXLIB_MODULE_DIR}/nrf_modem/include/nrf_modem_at.h + FUNC_EXCLUDE ".*nrf_modem_at_scanf" + WORD_EXCLUDE "__nrf_modem_(printf|scanf)_like\(.*\)") cmock_handle(${ZEPHYR_NRFXLIB_MODULE_DIR}/nrf_modem/include/nrf_modem.h) cmock_handle(${ZEPHYR_NRFXLIB_MODULE_DIR}/nrf_modem/include/nrf_socket.h) cmock_handle(${ZEPHYR_NRFXLIB_MODULE_DIR}/nrf_modem/include/nrf_errno.h) @@ -41,6 +43,7 @@ target_sources(app PRIVATE ${ZEPHYR_NRF_MODULE_DIR}/lib/nrf_modem_lib/nrf9x_sock target_include_directories(app PRIVATE ${ZEPHYR_NRF_MODULE_DIR}/lib/nrf_modem_lib/lte_net_if + ${ZEPHYR_NRFXLIB_MODULE_DIR}/nrf_modem/include ${ZEPHYR_BASE}/subsys/net/lib/sockets ) diff --git a/tests/lib/nrf_modem_lib/lte_net_if/testcase.yaml b/tests/lib/nrf_modem_lib/lte_net_if/testcase.yaml index 07322235c7ea..c3fe6e460013 100644 --- a/tests/lib/nrf_modem_lib/lte_net_if/testcase.yaml +++ b/tests/lib/nrf_modem_lib/lte_net_if/testcase.yaml @@ -2,6 +2,7 @@ tests: nrf_modem_lib.lte_net_if: sysbuild: true tags: nrf_modem_lib sysbuild ci_tests_lib_nrf_modem_lib - platform_allow: native_posix + platform_allow: + - native_sim integration_platforms: - - native_posix + - native_sim diff --git a/tests/lib/nrf_modem_lib/nrf9x_sockets/testcase.yaml b/tests/lib/nrf_modem_lib/nrf9x_sockets/testcase.yaml index df99de0d58e0..2a9198862b53 100644 --- a/tests/lib/nrf_modem_lib/nrf9x_sockets/testcase.yaml +++ b/tests/lib/nrf_modem_lib/nrf9x_sockets/testcase.yaml @@ -1,7 +1,8 @@ tests: unity.nrf9x_sockets_test: sysbuild: true - platform_allow: native_posix tags: nrf_modem_lib sysbuild ci_tests_lib_nrf_modem_lib + platform_allow: + - native_sim integration_platforms: - - native_posix + - native_sim diff --git a/tests/lib/nrf_modem_lib/trace_backends/rtt/src/main.c b/tests/lib/nrf_modem_lib/trace_backends/rtt/src/main.c index a7761145cc5f..9960bfd6d71b 100644 --- a/tests/lib/nrf_modem_lib/trace_backends/rtt/src/main.c +++ b/tests/lib/nrf_modem_lib/trace_backends/rtt/src/main.c @@ -40,7 +40,7 @@ static int rtt_allocupbuffer_callback(const char *sName, void *pBuffer, unsigned TEST_ASSERT_EQUAL_CHAR_ARRAY(exp_sName, sName, sizeof(exp_sName)); TEST_ASSERT_NOT_EQUAL(NULL, pBuffer); TEST_ASSERT_EQUAL(BACKEND_RTT_BUF_SIZE, BufferSize); - TEST_ASSERT_EQUAL(SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL, Flags); + TEST_ASSERT_EQUAL(SEGGER_RTT_MODE_NO_BLOCK_TRIM, Flags); return trace_rtt_channel; } diff --git a/tests/lib/sms/CMakeLists.txt b/tests/lib/sms/CMakeLists.txt index 9ea329cee2dd..7a98d84e740f 100644 --- a/tests/lib/sms/CMakeLists.txt +++ b/tests/lib/sms/CMakeLists.txt @@ -14,7 +14,8 @@ test_runner_generate(src/sms_test.c) cmock_handle(${ZEPHYR_NRFXLIB_MODULE_DIR}/nrf_modem/include/nrf_modem_at.h FUNC_EXCLUDE ".*nrf_modem_at_scanf" - FUNC_EXCLUDE ".*nrf_modem_at_printf") + FUNC_EXCLUDE ".*nrf_modem_at_printf" + WORD_EXCLUDE "__nrf_modem_(printf|scanf)_like\(.*\)") # When mocking nrf_modem_at then nrf_modem/include must manually be added # because CONFIG_NRF_MODEM_LINK_BINARY=n diff --git a/tests/lib/sms/src/sms_test.c b/tests/lib/sms/src/sms_test.c index 19ff9246e7a1..3430cb05f98f 100644 --- a/tests/lib/sms/src/sms_test.c +++ b/tests/lib/sms/src/sms_test.c @@ -32,10 +32,15 @@ static void sms_callback(struct sms_data *const data, void *context); */ extern void at_monitor_dispatch(const char *at_notif); -/* lte_lc_on_modem_cfun() is implemented in SMS library and + +#define CFUN_MODE_OFFLINE 0 +#define CFUN_MODE_NORMAL 1 +#define CFUN_MODE_ACTIVATE_LTE 21 + +/* sms_on_cfun() is implemented in SMS library and * we'll call it directly to fake notification of functional modem change */ -extern void lte_lc_on_modem_cfun(int mode, void *ctx); +extern void sms_on_cfun(int mode, void *ctx); /* sms_ack_resp_handler() is implemented in SMS library and * we'll call it directly to fake response to AT+CNMA=1. @@ -330,7 +335,7 @@ void test_sms_lte_lc_cb_reregisteration(void) __mock_nrf_modem_at_printf_ExpectAndReturn("AT+CFUN=4", 0); lte_lc_func_mode_set(LTE_LC_FUNC_MODE_OFFLINE); - lte_lc_on_modem_cfun(LTE_LC_FUNC_MODE_OFFLINE, NULL); + sms_on_cfun(CFUN_MODE_OFFLINE, NULL); __mock_nrf_modem_at_printf_ExpectAndReturn("AT+CEREG=5", 0); __mock_nrf_modem_at_printf_ExpectAndReturn("AT+CSCON=1", 0); @@ -348,7 +353,7 @@ void test_sms_lte_lc_cb_reregisteration(void) #endif lte_lc_func_mode_set(LTE_LC_FUNC_MODE_ACTIVATE_LTE); - lte_lc_on_modem_cfun(LTE_LC_FUNC_MODE_ACTIVATE_LTE, NULL); + sms_on_cfun(CFUN_MODE_ACTIVATE_LTE, NULL); sms_unreg_helper(); } @@ -375,7 +380,7 @@ void test_sms_lte_lc_cb_registration_already_exists(void) __cmock_nrf_modem_at_cmd_ReturnArrayThruPtr_buf(cnmi_reg_ok, sizeof(cnmi_reg_ok)); lte_lc_func_mode_set(LTE_LC_FUNC_MODE_NORMAL); - lte_lc_on_modem_cfun(LTE_LC_FUNC_MODE_NORMAL, NULL); + sms_on_cfun(CFUN_MODE_NORMAL, NULL); sms_unreg_helper(); } @@ -392,7 +397,7 @@ void test_sms_lte_lc_cb_reregisteration_fail(void) __mock_nrf_modem_at_printf_ExpectAndReturn("AT+CFUN=4", 0); lte_lc_func_mode_set(LTE_LC_FUNC_MODE_OFFLINE); - lte_lc_on_modem_cfun(LTE_LC_FUNC_MODE_OFFLINE, NULL); + sms_on_cfun(CFUN_MODE_OFFLINE, NULL); __mock_nrf_modem_at_printf_ExpectAndReturn("AT+CEREG=5", 0); __mock_nrf_modem_at_printf_ExpectAndReturn("AT+CSCON=1", 0); @@ -403,7 +408,7 @@ void test_sms_lte_lc_cb_reregisteration_fail(void) __cmock_nrf_modem_at_cmd_IgnoreArg_len(); lte_lc_func_mode_set(LTE_LC_FUNC_MODE_NORMAL); - lte_lc_on_modem_cfun(LTE_LC_FUNC_MODE_NORMAL, NULL); + sms_on_cfun(CFUN_MODE_NORMAL, NULL); /* Unregister listener. SMS got unregistered already above */ sms_unregister_listener(test_handle); @@ -420,13 +425,13 @@ void test_sms_lte_lc_cb_registeration_not_exists(void) { __mock_nrf_modem_at_printf_ExpectAndReturn("AT+CFUN=4", 0); lte_lc_func_mode_set(LTE_LC_FUNC_MODE_OFFLINE); - lte_lc_on_modem_cfun(LTE_LC_FUNC_MODE_OFFLINE, NULL); + sms_on_cfun(CFUN_MODE_OFFLINE, NULL); __mock_nrf_modem_at_printf_ExpectAndReturn("AT+CEREG=5", 0); __mock_nrf_modem_at_printf_ExpectAndReturn("AT+CSCON=1", 0); __mock_nrf_modem_at_printf_ExpectAndReturn("AT+CFUN=21", 0); lte_lc_func_mode_set(LTE_LC_FUNC_MODE_ACTIVATE_LTE); - lte_lc_on_modem_cfun(LTE_LC_FUNC_MODE_ACTIVATE_LTE, NULL); + sms_on_cfun(CFUN_MODE_ACTIVATE_LTE, NULL); } /********* SMS SEND TEXT TESTS ***********************/ diff --git a/tests/lib/uicc_lwm2m/CMakeLists.txt b/tests/lib/uicc_lwm2m/CMakeLists.txt new file mode 100644 index 000000000000..97ad33f60994 --- /dev/null +++ b/tests/lib/uicc_lwm2m/CMakeLists.txt @@ -0,0 +1,25 @@ +# +# Copyright (c) 2024 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(uicc_lwm2m) + +test_runner_generate(src/main.c) + +FILE(GLOB app_sources src/*.c) +target_sources(app PRIVATE + ${app_sources} + ${ZEPHYR_NRF_MODULE_DIR}/lib/uicc_lwm2m/asn1_decode.c + ${ZEPHYR_NRF_MODULE_DIR}/lib/uicc_lwm2m/pkcs15_decode.c + ${ZEPHYR_NRF_MODULE_DIR}/lib/uicc_lwm2m/uicc_lwm2m.c +) + +zephyr_include_directories( + ${ZEPHYR_NRF_MODULE_DIR}/lib/uicc_lwm2m/include/ + ${ZEPHYR_NRFXLIB_MODULE_DIR}/nrf_modem/include/ +) diff --git a/tests/lib/uicc_lwm2m/prj.conf b/tests/lib/uicc_lwm2m/prj.conf new file mode 100644 index 000000000000..c4750ff9ae70 --- /dev/null +++ b/tests/lib/uicc_lwm2m/prj.conf @@ -0,0 +1,7 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_UNITY=y diff --git a/tests/lib/uicc_lwm2m/src/main.c b/tests/lib/uicc_lwm2m/src/main.c new file mode 100644 index 000000000000..75d5ee1081a0 --- /dev/null +++ b/tests/lib/uicc_lwm2m/src/main.c @@ -0,0 +1,171 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include +#include +#include + +#include "unity.h" + +struct at_csim_cmd_rsp { + char *command; + char *response; +}; + +static struct at_csim_cmd_rsp *at_csim_command; +static int at_csim_command_size; +static int at_csim_command_num; + +static struct at_csim_cmd_rsp at_csim_application_not_found[] = { + /* Open a logical channel 1 */ + { "AT+CSIM=10,\"0070000001\"", "+CSIM: 6,\"019000\"" }, + /* Select PKCS#15 on channel 1 using the default AID */ + { "AT+CSIM=36,\"01A404040CA000000063504B43532D313500\"", "+CSIM: 4,\"6A82\"" }, + /* Close the logical channel */ + { "AT+CSIM=8,\"01708001\"", "+CSIM: 4,\"9000\"" } +}; + +static struct at_csim_cmd_rsp at_csim_bootstrap_not_found[] = { + /* Open a logical channel 1 */ + { "AT+CSIM=10,\"0070000001\"", "+CSIM: 6,\"019000\"" }, + /* Select PKCS#15 on channel 1 using the default AID */ + { "AT+CSIM=36,\"01A404040CA000000063504B43532D313500\"", + "+CSIM: 62,\"621B8202412183025031A5038001718A01058B036F06028002003888009000\"" }, + /* Select EF(ODF) (path 5031) */ + { "AT+CSIM=20,\"01A40804047FFF503100\"", + "+CSIM: 62,\"621B8202412183025031A5038001718A01058B036F06028002003888009000\"" }, + /* Read EF(ODF) */ + { "AT+CSIM=10,\"01B0000080\"", "+CSIM: 42,\"A706300404024407A506300404024404FFFFFF9000\"" }, + /* Select (path 4407) */ + { "AT+CSIM=20,\"01A40804047FFF440700\"", + "+CSIM: 62,\"621B8202412183024407A5038001718A01058B036F0602800200C888009000\"" }, + /* Read record 4407 (empty) */ + { "AT+CSIM=10,\"01B0000080\"", "+CSIM: 42,\"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9000\"" }, + /* Close the logical channel */ + { "AT+CSIM=8,\"01708001\"", "+CSIM: 4,\"9000\"" } +}; + +static struct at_csim_cmd_rsp at_csim_success[] = { + /* Open a logical channel 1 */ + { "AT+CSIM=10,\"0070000001\"", "+CSIM: 6,\"019000\"" }, + /* Select PKCS#15 on channel 1 using the default AID */ + { "AT+CSIM=36,\"01A404040CA000000063504B43532D313500\"", + "+CSIM: 82,\"622582027821840CA000000063504B43532D31358A01058B032F060CC60990014083010183" + "010A9000\"" }, + /* Select EF(ODF) (path 5031) */ + { "AT+CSIM=20,\"01A40804047FFF503100\"", + "+CSIM: 52,\"621682024121830250318A01058B036F06028002002088009000\"" }, + /* Read EF(ODF) */ + { "AT+CSIM=10,\"01B0000080\"", "+CSIM: 20,\"A7063004040264309000\"" }, + /* Select EF(DODF) (path 6430) */ + { "AT+CSIM=20,\"01A40804047FFF643000\"", + "+CSIM: 52,\"621682024121830264308A01058B036F06028002007888009000\"" }, + /* Read EF(DODF) */ + { "AT+CSIM=10,\"01B0000080\"", + "+CSIM: 86,\"A127300030110C0F4C774D324D20426F6F747374726170A110300E06060604672B09013004" + "040264329000\"" }, + /* Select EF(DODF-bootstrap) (path 6432) */ + { "AT+CSIM=20,\"01A40804047FFF643200\"", + "+CSIM: 52,\"621682024121830264308A01058B036F06028002007888009000\"" }, + /* Read EF(DODF-bootstrap) */ + { "AT+CSIM=10,\"01B0000080\"", + "+CSIM: 124,\"00010036000000003108002EC80025636F61703A2F2F6C657368616E2E65636C697073657" + "0726F6A656374732E696F3A35373833C10101C10203FFFF9000\"" }, + /* Close the logical channel */ + { "AT+CSIM=8,\"01708001\"", "+CSIM: 4,\"9000\"" } +}; + +int nrf_modem_at_scanf(const char *cmd, const char *fmt, ...) +{ + va_list args; + int ret; + + /* Check expected command */ + TEST_ASSERT_EQUAL_STRING(at_csim_command[at_csim_command_num].command, cmd); + + /* Check expected format */ + if (at_csim_command_num == at_csim_command_size - 1) { + /* Buffer is smaller on last command (close) */ + TEST_ASSERT_EQUAL_STRING("+CSIM: %d,\"%20s\"", fmt); + } else { + TEST_ASSERT_EQUAL_STRING("+CSIM: %d,\"%260s\"", fmt); + } + + va_start(args, fmt); + ret = vsscanf(at_csim_command[at_csim_command_num].response, fmt, args); + va_end(args); + + at_csim_command_num++; + + return ret; +} + +static uint8_t lwm2m_tlv[] = { + 0x00, 0x01, 0x00, 0x36, 0x00, 0x00, 0x00, 0x00, 0x31, 0x08, 0x00, 0x2e, + 0xc8, 0x00, 0x25, 0x63, 0x6f, 0x61, 0x70, 0x3a, 0x2f, 0x2f, 0x6c, 0x65, + 0x73, 0x68, 0x61, 0x6e, 0x2e, 0x65, 0x63, 0x6c, 0x69, 0x70, 0x73, 0x65, + 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2e, 0x69, 0x6f, 0x3a, + 0x35, 0x37, 0x38, 0x33, 0xc1, 0x01, 0x01, 0xc1, 0x02, 0x03, 0xff, 0xff +}; + +void test_uicc_lwm2m_bootstrap_read_application_not_found(void) +{ + uint8_t buffer[256 + 4 + 1]; /* 256 bytes content + 4 bytes SW + 1 byte NUL */ + + at_csim_command = at_csim_application_not_found; + at_csim_command_size = ARRAY_SIZE(at_csim_application_not_found); + at_csim_command_num = 0; + + int ret = uicc_lwm2m_bootstrap_read(buffer, sizeof(buffer)); + + TEST_ASSERT_EQUAL(-EINVAL, ret); + TEST_ASSERT_EQUAL(at_csim_command_size, at_csim_command_num); +} + +void test_uicc_lwm2m_bootstrap_read_bootstrap_not_found(void) +{ + uint8_t buffer[256 + 4 + 1]; /* 256 bytes content + 4 bytes SW + 1 byte NUL */ + + at_csim_command = at_csim_bootstrap_not_found; + at_csim_command_size = ARRAY_SIZE(at_csim_bootstrap_not_found); + at_csim_command_num = 0; + + int ret = uicc_lwm2m_bootstrap_read(buffer, sizeof(buffer)); + + TEST_ASSERT_EQUAL(-ENOENT, ret); + TEST_ASSERT_EQUAL(at_csim_command_size, at_csim_command_num); +} + +void test_uicc_lwm2m_bootstrap_read_success(void) +{ + uint8_t buffer[256 + 4 + 1]; /* 256 bytes content + 4 bytes SW + 1 byte NUL */ + + at_csim_command = at_csim_success; + at_csim_command_size = ARRAY_SIZE(at_csim_success); + at_csim_command_num = 0; + + int ret = uicc_lwm2m_bootstrap_read(buffer, sizeof(buffer)); + + TEST_ASSERT_EQUAL(sizeof(lwm2m_tlv), ret); + TEST_ASSERT_EQUAL_MEMORY(lwm2m_tlv, buffer, sizeof(lwm2m_tlv)); + TEST_ASSERT_EQUAL(at_csim_command_size, at_csim_command_num); +} + +/* It is required to be added to each test. That is because unity's + * main may return nonzero, while zephyr's main currently must + * return 0 in all cases (other values are reserved). + */ +extern int unity_main(void); + +int main(void) +{ + (void)unity_main(); + + return 0; +} diff --git a/tests/lib/lte_lc/testcase.yaml b/tests/lib/uicc_lwm2m/testcase.yaml similarity index 56% rename from tests/lib/lte_lc/testcase.yaml rename to tests/lib/uicc_lwm2m/testcase.yaml index eb6ff474284c..edd376133169 100644 --- a/tests/lib/lte_lc/testcase.yaml +++ b/tests/lib/uicc_lwm2m/testcase.yaml @@ -1,7 +1,7 @@ tests: - lte_lc.functionality_test: + uicc_lwm2m.unit_test: sysbuild: true + tags: uicc_lwm2m sysbuild ci_tests_lib_uicc_lwm2m platform_allow: native_sim integration_platforms: - native_sim - tags: lte_lc sysbuild ci_tests_lib_lte_lc diff --git a/tests/subsys/bluetooth/fast_pair/crypto/testcase.yaml b/tests/subsys/bluetooth/fast_pair/crypto/testcase.yaml index a1838df94c3a..de276468f64c 100644 --- a/tests/subsys/bluetooth/fast_pair/crypto/testcase.yaml +++ b/tests/subsys/bluetooth/fast_pair/crypto/testcase.yaml @@ -22,12 +22,14 @@ tests: - nrf5340dk/nrf5340/cpuapp - nrf5340dk/nrf5340/cpuapp/ns - nrf54l15dk/nrf54l15/cpuapp + - nrf54l15dk/nrf54l15/cpuapp/ns integration_platforms: - nrf52dk/nrf52832 - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp - nrf5340dk/nrf5340/cpuapp/ns - nrf54l15dk/nrf54l15/cpuapp + - nrf54l15dk/nrf54l15/cpuapp/ns extra_args: FILE_SUFFIX=psa tags: sysbuild bluetooth fast_pair.crypto.tinycrypt: diff --git a/tests/subsys/bluetooth/fast_pair/storage/account_key_storage/src/main.c b/tests/subsys/bluetooth/fast_pair/storage/account_key_storage/src/main.c index 8c07fc67a2e8..7dbf7f36247f 100644 --- a/tests/subsys/bluetooth/fast_pair/storage/account_key_storage/src/main.c +++ b/tests/subsys/bluetooth/fast_pair/storage/account_key_storage/src/main.c @@ -18,6 +18,8 @@ #define ACCOUNT_KEY_MAX_CNT CONFIG_BT_FAST_PAIR_STORAGE_ACCOUNT_KEY_MAX +/* Account Key storage bond management feature is not yet supported by the unit test. */ +BUILD_ASSERT(!IS_ENABLED(CONFIG_BT_FAST_PAIR_STORAGE_AK_BOND)); static void reload_keys_from_storage(void) { @@ -93,7 +95,7 @@ ZTEST(suite_fast_pair_storage_common, test_one_key) struct fp_account_key account_key; cu_generate_account_key(seed, &account_key); - err = fp_storage_ak_save(&account_key); + err = fp_storage_ak_save(&account_key, NULL); zassert_ok(err, "Unexpected error during Account Key save"); struct fp_account_key read_keys[ACCOUNT_KEY_MAX_CNT]; @@ -143,11 +145,11 @@ ZTEST(suite_fast_pair_storage_common, test_duplicate) struct fp_account_key account_key; cu_generate_account_key(seed, &account_key); - err = fp_storage_ak_save(&account_key); + err = fp_storage_ak_save(&account_key, NULL); zassert_ok(err, "Unexpected error during Account Key save"); /* Try to add key duplicate. */ - err = fp_storage_ak_save(&account_key); + err = fp_storage_ak_save(&account_key, NULL); if (!IS_ENABLED(CONFIG_BT_FAST_PAIR_STORAGE_OWNER_ACCOUNT_KEY)) { zassert_ok(err, "Unexpected error during Account Key save"); } else { @@ -310,7 +312,7 @@ ZTEST(suite_fast_pair_storage_common, test_owner_key) ret = fp_storage_ak_is_owner(&account_key); zassert_equal(ret, -ESRCH, "No owner account key should be stored"); - ret = fp_storage_ak_save(&account_key); + ret = fp_storage_ak_save(&account_key, NULL); zassert_ok(ret, "Unexpected error during Account Key save"); ret = fp_storage_ak_is_owner(&account_key); diff --git a/tests/subsys/bluetooth/fast_pair/storage/common/src/common_utils.c b/tests/subsys/bluetooth/fast_pair/storage/common/src/common_utils.c index 07fa13d7177c..526da22ecf7c 100644 --- a/tests/subsys/bluetooth/fast_pair/storage/common/src/common_utils.c +++ b/tests/subsys/bluetooth/fast_pair/storage/common/src/common_utils.c @@ -28,7 +28,7 @@ void cu_account_keys_generate_and_store(uint8_t first_seed, uint8_t gen_count) for (uint8_t i = 0; i < gen_count; i++) { cu_generate_account_key(i + first_seed, &account_key); - err = fp_storage_ak_save(&account_key); + err = fp_storage_ak_save(&account_key, NULL); zassert_ok(err, "Failed to store Account Key"); } } @@ -64,7 +64,7 @@ void cu_account_keys_validate_uninitialized(void) size_t read_cnt = ACCOUNT_KEY_MAX_CNT; cu_generate_account_key(seed, &account_key); - err = fp_storage_ak_save(&account_key); + err = fp_storage_ak_save(&account_key, NULL); zassert_equal(err, -EACCES, "Expected error before initialization"); err = fp_storage_ak_count(); diff --git a/tests/subsys/bluetooth/fast_pair/storage/factory_reset/src/main.c b/tests/subsys/bluetooth/fast_pair/storage/factory_reset/src/main.c index 2cfa53d57113..c9919a5e842e 100644 --- a/tests/subsys/bluetooth/fast_pair/storage/factory_reset/src/main.c +++ b/tests/subsys/bluetooth/fast_pair/storage/factory_reset/src/main.c @@ -60,6 +60,9 @@ static int settings_set_err; static bool storage_reset_pass; +/* Account Key storage bond management feature is not yet supported by the unit test. */ +BUILD_ASSERT(!IS_ENABLED(CONFIG_BT_FAST_PAIR_STORAGE_AK_BOND)); + static int settings_load_stage(size_t len, settings_read_cb read_cb, void *cb_arg) { diff --git a/tests/subsys/dfu/dfu_target/suit/CMakeLists.txt b/tests/subsys/dfu/dfu_target/suit/CMakeLists.txt new file mode 100644 index 000000000000..8d3becb87ed1 --- /dev/null +++ b/tests/subsys/dfu/dfu_target/suit/CMakeLists.txt @@ -0,0 +1,20 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +cmake_minimum_required(VERSION 3.20.0) + +find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) +project(dfu_target_suit_test) +include(${ZEPHYR_NRF_MODULE_DIR}/tests/subsys/suit/cmake/test_template.cmake) + +FILE(GLOB app_sources src/*.c) +target_sources(app PRIVATE ${app_sources}) + +target_include_directories(app + PRIVATE + ${ZEPHYR_NRF_MODULE_DIR}/subsys/dfu/include + "src" + ) diff --git a/tests/subsys/dfu/dfu_target/suit/Kconfig b/tests/subsys/dfu/dfu_target/suit/Kconfig new file mode 100644 index 000000000000..83bb32845eec --- /dev/null +++ b/tests/subsys/dfu/dfu_target/suit/Kconfig @@ -0,0 +1,16 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +menuconfig TESTS_SUIT_DFU_TARGET_SUIT_CACHE_PROCESSING + bool "Run tests for processing of SUIT cache partition by the SUIT DFU target" + imply DFU_TARGET_SUIT_CACHE_PROCESSING + default n + +menuconfig TESTS_SUIT_DFU_TARGET_SUIT_SINGLE_PARTITION + bool "Run tests for processing of the dfu_partition only by the DFU target" + default n + +source "Kconfig.zephyr" diff --git a/tests/subsys/dfu/dfu_target/suit/boards/native_posix.conf b/tests/subsys/dfu/dfu_target/suit/boards/native_posix.conf new file mode 100644 index 000000000000..b6f70968c23f --- /dev/null +++ b/tests/subsys/dfu/dfu_target/suit/boards/native_posix.conf @@ -0,0 +1,11 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_ZCBOR=y +CONFIG_ZCBOR_CANONICAL=y +CONFIG_FLASH_SIMULATOR=y +CONFIG_FLASH_SIMULATOR_DOUBLE_WRITES=y +CONFIG_FLASH=y diff --git a/tests/subsys/dfu/dfu_target/suit/boards/native_posix.overlay b/tests/subsys/dfu/dfu_target/suit/boards/native_posix.overlay new file mode 100644 index 000000000000..575a8733de71 --- /dev/null +++ b/tests/subsys/dfu/dfu_target/suit/boards/native_posix.overlay @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +&flash0 { + partitions { + compatible = "fixed-partitions"; + #address-cells = < 0x1 >; + #size-cells = < 0x1 >; + + dfu_partition: partition@100000 { + reg = < 0x100000 DT_SIZE_K(128) >; + }; + + dfu_cache_partition_1: partition@120000 { + reg = <0x120000 DT_SIZE_K(128)>; + }; + + dfu_cache_partition_2: partition@140000 { + reg = <0x140000 DT_SIZE_K(128)>; + }; + + dfu_cache_partition_3: partition@160000 { + reg = <0x160000 DT_SIZE_K(128)>; + }; + }; +}; + +/ { + sram0: memory@20000000 { + compatible = "mmio-sram"; + reg = <0x20000000 DT_SIZE_K(256)>; + }; +}; diff --git a/tests/subsys/dfu/dfu_target/suit/boards/nrf54h20dk_nrf54h20_cpuapp.conf b/tests/subsys/dfu/dfu_target/suit/boards/nrf54h20dk_nrf54h20_cpuapp.conf new file mode 100644 index 000000000000..e9a2c8ac775f --- /dev/null +++ b/tests/subsys/dfu/dfu_target/suit/boards/nrf54h20dk_nrf54h20_cpuapp.conf @@ -0,0 +1,10 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# Enable logging +CONFIG_LOG=y +CONFIG_LOG_BACKEND_UART=y +CONFIG_LOG_MODE_DEFERRED=y diff --git a/tests/subsys/dfu/dfu_target/suit/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/subsys/dfu/dfu_target/suit/boards/nrf54h20dk_nrf54h20_cpuapp.overlay new file mode 100644 index 000000000000..f244ba4673e9 --- /dev/null +++ b/tests/subsys/dfu/dfu_target/suit/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/ { + chosen { + zephyr,entropy = &psa_rng; + }; + + psa_rng: psa-rng { + compatible = "zephyr,psa-crypto-rng"; + status = "okay"; + }; +}; + +/* Split DFU partition into a smaller one and DFU caches. */ +/delete-node/ &dfu_partition; +/delete-node/ &storage_partition; + +&mram1x { + cpuapp_rw_partitions: cpuapp-rw-partitions { + compatible = "nordic,owned-partitions", "fixed-partitions"; + status = "okay"; + perm-read; + perm-write; + perm-secure; + #address-cells = < 0x1 >; + #size-cells = < 0x1 >; + + dfu_partition: partition@100000 { + reg = < 0x100000 DT_SIZE_K(128) >; + }; + + dfu_cache_partition_1: partition@120000 { + reg = <0x120000 DT_SIZE_K(128)>; + }; + + dfu_cache_partition_2: partition@140000 { + reg = <0x140000 DT_SIZE_K(128)>; + }; + + dfu_cache_partition_3: partition@160000 { + reg = <0x160000 DT_SIZE_K(128)>; + }; + + storage_partition: partition@1df000 { + reg = < 0x1df000 0x6000 >; + }; + }; +}; diff --git a/tests/subsys/dfu/dfu_target/suit/cache_processing.conf b/tests/subsys/dfu/dfu_target/suit/cache_processing.conf new file mode 100644 index 000000000000..146ab0ced2d1 --- /dev/null +++ b/tests/subsys/dfu/dfu_target/suit/cache_processing.conf @@ -0,0 +1,8 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_TESTS_SUIT_DFU_TARGET_SUIT_CACHE_PROCESSING=y +CONFIG_SUIT_DFU_CANDIDATE_PROCESSING_PUSH_TO_CACHE=y diff --git a/tests/subsys/dfu/dfu_target/suit/manifests/manifest_app.yaml b/tests/subsys/dfu/dfu_target/suit/manifests/manifest_app.yaml new file mode 100644 index 000000000000..8762a2d6737c --- /dev/null +++ b/tests/subsys/dfu/dfu_target/suit/manifests/manifest_app.yaml @@ -0,0 +1,63 @@ +SUIT_Envelope_Tagged: + suit-authentication-wrapper: + SuitDigest: + suit-digest-algorithm-id: cose-alg-sha-256 + suit-manifest: + suit-manifest-version: 1 + suit-manifest-sequence-number: 1 + suit-common: + suit-components: + # Place the destination image address after + # the 3rd DFU cache partition defined in the DTS file. + - - MEM + - 0x02 + - 0x0E160000 + - 0x00020000 + suit-shared-sequence: + - suit-directive-override-parameters: + suit-parameter-vendor-identifier: + RFC4122_UUID: nordicsemi.com + suit-parameter-class-identifier: + RFC4122_UUID: + namespace: nordicsemi.com + name: dfu_target_suit_test + suit-parameter-image-digest: + suit-digest-algorithm-id: cose-alg-sha-256 + suit-digest-bytes: + file: file.bin + suit-parameter-image-size: + file: file.bin + - suit-condition-vendor-identifier: + - suit-send-record-success + - suit-send-record-failure + - suit-send-sysinfo-success + - suit-send-sysinfo-failure + - suit-condition-class-identifier: + - suit-send-record-success + - suit-send-record-failure + - suit-send-sysinfo-success + - suit-send-sysinfo-failure + suit-validate: + - suit-condition-image-match: + - suit-send-record-success + - suit-send-record-failure + - suit-send-sysinfo-success + - suit-send-sysinfo-failure + suit-invoke: + - suit-directive-invoke: + - suit-send-record-failure + suit-install: + - suit-directive-override-parameters: + suit-parameter-uri: '#file.bin' + - suit-directive-fetch: + - suit-send-record-failure + - suit-condition-image-match: + - suit-send-record-success + - suit-send-record-failure + - suit-send-sysinfo-success + - suit-send-sysinfo-failure + suit-manifest-component-id: + - INSTLD_MFST + - RFC4122_UUID: + namespace: nordicsemi.com + name: nRF54H20_sample_app diff --git a/tests/subsys/dfu/dfu_target/suit/manifests/manifest_root.yaml b/tests/subsys/dfu/dfu_target/suit/manifests/manifest_root.yaml new file mode 100644 index 000000000000..a64294bd8046 --- /dev/null +++ b/tests/subsys/dfu/dfu_target/suit/manifests/manifest_root.yaml @@ -0,0 +1,122 @@ +SUIT_Envelope_Tagged: + suit-authentication-wrapper: + SuitDigest: + suit-digest-algorithm-id: cose-alg-sha-256 + suit-manifest: + suit-manifest-version: 1 + suit-manifest-sequence-number: 1 + suit-common: + suit-components: + - - CAND_MFST + - 0 + - - INSTLD_MFST + - RFC4122_UUID: + namespace: nordicsemi.com + name: nRF54H20_sample_app + suit-shared-sequence: + - suit-directive-set-component-index: 1 + - suit-directive-override-parameters: + suit-parameter-vendor-identifier: + RFC4122_UUID: nordicsemi.com + suit-parameter-class-identifier: + RFC4122_UUID: + namespace: nordicsemi.com + name: nRF54H20_sample_app + + - suit-directive-set-component-index: [1] + - suit-condition-vendor-identifier: + - suit-send-record-success + - suit-send-record-failure + - suit-send-sysinfo-success + - suit-send-sysinfo-failure + - suit-condition-class-identifier: + - suit-send-record-success + - suit-send-record-failure + - suit-send-sysinfo-success + - suit-send-sysinfo-failure + suit-dependencies: + # Key is the index of suit-components that describe the dependency manifest + "0": {} + "1": {} + + suit-validate: + - suit-directive-set-component-index: [1] + - suit-condition-dependency-integrity: + - suit-send-record-success + - suit-send-record-failure + - suit-send-sysinfo-success + - suit-send-sysinfo-failure + - suit-directive-process-dependency: + - suit-send-record-success + - suit-send-record-failure + - suit-send-sysinfo-success + - suit-send-sysinfo-failure + + suit-invoke: + - suit-directive-set-component-index: [1] + - suit-condition-dependency-integrity: + - suit-send-record-success + - suit-send-record-failure + - suit-send-sysinfo-success + - suit-send-sysinfo-failure + - suit-directive-process-dependency: + - suit-send-record-success + - suit-send-record-failure + - suit-send-sysinfo-success + - suit-send-sysinfo-failure + + suit-install: + - suit-directive-set-component-index: 0 + - suit-directive-override-parameters: + suit-parameter-uri: '#app.suit' + suit-parameter-image-digest: + suit-digest-algorithm-id: cose-alg-sha-256 + suit-digest-bytes: + file: sample.suit + - suit-directive-fetch: + - suit-send-record-failure + - suit-condition-image-match: + - suit-send-record-success + - suit-send-record-failure + - suit-send-sysinfo-success + - suit-send-sysinfo-failure + - suit-condition-dependency-integrity: + - suit-send-record-success + - suit-send-record-failure + - suit-send-sysinfo-success + - suit-send-sysinfo-failure + - suit-directive-process-dependency: + - suit-send-record-success + - suit-send-record-failure + - suit-send-sysinfo-success + - suit-send-sysinfo-failure + - suit-directive-override-parameters: + suit-parameter-uri: '#app.suit' + suit-parameter-image-digest: + suit-digest-algorithm-id: cose-alg-sha-256 + suit-digest-bytes: + file: sample.suit + - suit-directive-fetch: + - suit-send-record-failure + - suit-condition-image-match: + - suit-send-record-success + - suit-send-record-failure + - suit-send-sysinfo-success + - suit-send-sysinfo-failure + - suit-condition-dependency-integrity: + - suit-send-record-success + - suit-send-record-failure + - suit-send-sysinfo-success + - suit-send-sysinfo-failure + - suit-directive-process-dependency: + - suit-send-record-success + - suit-send-record-failure + - suit-send-sysinfo-success + - suit-send-sysinfo-failure + suit-manifest-component-id: + - INSTLD_MFST + - RFC4122_UUID: + namespace: nordicsemi.com + name: nRF54H20_sample_root + suit-integrated-payloads: + '#app.suit': sample.suit diff --git a/tests/subsys/dfu/dfu_target/suit/manifests/manifest_with_payload.yaml b/tests/subsys/dfu/dfu_target/suit/manifests/manifest_with_payload.yaml new file mode 100644 index 000000000000..ebf2a8bf39a9 --- /dev/null +++ b/tests/subsys/dfu/dfu_target/suit/manifests/manifest_with_payload.yaml @@ -0,0 +1,65 @@ +SUIT_Envelope_Tagged: + suit-authentication-wrapper: + SuitDigest: + suit-digest-algorithm-id: cose-alg-sha-256 + suit-manifest: + suit-manifest-version: 1 + suit-manifest-sequence-number: 1 + suit-common: + suit-components: + # Place the destination image address after + # the 3rd DFU cache partition defined in the DTS file. + - - MEM + - 0x02 + - 0x0E160000 + - 0x00020000 + suit-shared-sequence: + - suit-directive-override-parameters: + suit-parameter-vendor-identifier: + RFC4122_UUID: nordicsemi.com + suit-parameter-class-identifier: + RFC4122_UUID: + namespace: nordicsemi.com + name: dfu_target_suit_test + suit-parameter-image-digest: + suit-digest-algorithm-id: cose-alg-sha-256 + suit-digest-bytes: + file: file.bin + suit-parameter-image-size: + file: file.bin + - suit-condition-vendor-identifier: + - suit-send-record-success + - suit-send-record-failure + - suit-send-sysinfo-success + - suit-send-sysinfo-failure + - suit-condition-class-identifier: + - suit-send-record-success + - suit-send-record-failure + - suit-send-sysinfo-success + - suit-send-sysinfo-failure + suit-validate: + - suit-condition-image-match: + - suit-send-record-success + - suit-send-record-failure + - suit-send-sysinfo-success + - suit-send-sysinfo-failure + suit-invoke: + - suit-directive-invoke: + - suit-send-record-failure + suit-install: + - suit-directive-override-parameters: + suit-parameter-uri: '#file.bin' + - suit-directive-fetch: + - suit-send-record-failure + - suit-condition-image-match: + - suit-send-record-success + - suit-send-record-failure + - suit-send-sysinfo-success + - suit-send-sysinfo-failure + suit-manifest-component-id: + - INSTLD_MFST + - RFC4122_UUID: + namespace: nordicsemi.com + name: test_sample_app + suit-integrated-payloads: + '#file.bin': file.bin diff --git a/tests/subsys/dfu/dfu_target/suit/prj.conf b/tests/subsys/dfu/dfu_target/suit/prj.conf new file mode 100644 index 000000000000..8a7984846215 --- /dev/null +++ b/tests/subsys/dfu/dfu_target/suit/prj.conf @@ -0,0 +1,21 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +CONFIG_ZTEST=y + +# Enable suit +CONFIG_SUIT=y +CONFIG_SUIT_DFU=y + +# Enable dfu_target +CONFIG_DFU_TARGET=y +CONFIG_DFU_TARGET_SUIT=y + +# Initialize SUIT DFU by dfu_target since it is the only +# one SUIT DFU implementation in use +CONFIG_DFU_TARGET_SUIT_INITIALIZE_SUIT=y + +# Choose SUIT platform APP +CONFIG_SUIT_PLATFORM_VARIANT_APP=y diff --git a/tests/subsys/dfu/dfu_target/suit/regenerate_manifests.sh b/tests/subsys/dfu/dfu_target/suit/regenerate_manifests.sh new file mode 100755 index 000000000000..2edc89a00993 --- /dev/null +++ b/tests/subsys/dfu/dfu_target/suit/regenerate_manifests.sh @@ -0,0 +1,35 @@ +#!/bin/bash +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# Script to regenerate SUIT manifests for DFU target tests. +# To use this script you must have the following tools installed: +# - suit-generator +# - zcbor +# +# The script will update the following files: +# - dfu_cache_partition_1.c which contains the binary cache as C code +# - manifest.c which contains the signed manifest as C code +# +# Before using this script paste the following files into +# the nrf/tests/subsys/suit/manifest_common directory: +# - file.bin, the testing binary file. + + +cd ../../../suit/manifest_common + +### Generate testing cache file ### +./generate_dfu_cache.sh file.bin + +### Generate Manifests ### +./regenerate.sh ../../dfu/dfu_target/suit/manifests/manifest_root.yaml +./regenerate.sh ../../dfu/dfu_target/suit/manifests/manifest_app.yaml +python3 replace_manifest.py ../../dfu/dfu_target/suit/src/manifest.c sample_signed.suit +./regenerate.sh ../../dfu/dfu_target/suit/manifests/manifest_with_payload.yaml +python3 replace_manifest.py ../../dfu/dfu_target/suit/src/manifest_with_payload.c sample_signed.suit + +### Generate Cache Partition ### +python3 replace_manifest.py ../../dfu/dfu_target/suit/src/dfu_cache_partition.c sample_cache.bin diff --git a/tests/subsys/dfu/dfu_target/suit/single_partition.conf b/tests/subsys/dfu/dfu_target/suit/single_partition.conf new file mode 100644 index 000000000000..e0fd5241fc63 --- /dev/null +++ b/tests/subsys/dfu/dfu_target/suit/single_partition.conf @@ -0,0 +1,8 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_TESTS_SUIT_DFU_TARGET_SUIT_SINGLE_PARTITION=y +CONFIG_SUIT_DFU_CANDIDATE_PROCESSING_MINIMAL=y diff --git a/tests/subsys/dfu/dfu_target/suit/src/common.c b/tests/subsys/dfu/dfu_target/suit/src/common.c new file mode 100644 index 000000000000..144b26a99ae4 --- /dev/null +++ b/tests/subsys/dfu/dfu_target/suit/src/common.c @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include "common.h" + +/* Mocks - ssf services have to be mocked, as real communication with secure domain + * cannot take place in these tests because native_posix target does not have the secure domain + * to communicate with, and nRF54H should not reset the device after calling + * the dfu_target_suit_schedule_update function. + */ +DEFINE_FFF_GLOBALS; + +DEFINE_FAKE_VALUE_FUNC(int, suit_trigger_update, suit_plat_mreg_t *, size_t); + +void reset_fakes(void) +{ + RESET_FAKE(suit_trigger_update); +} + +bool is_partition_empty(void *address, size_t size) +{ + uint8_t *partition_address = (uint8_t *)address; + bool partition_empty = true; + + for (size_t i = 0; i < size; i++) { + if (partition_address[i] != 0xFF) { + partition_empty = false; + break; + } + } + return partition_empty; +} diff --git a/tests/subsys/dfu/dfu_target/suit/src/common.h b/tests/subsys/dfu/dfu_target/suit/src/common.h new file mode 100644 index 000000000000..8534754ca795 --- /dev/null +++ b/tests/subsys/dfu/dfu_target/suit/src/common.h @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef DFU_TARGET_SUIT_TEST_COMMON_H__ +#define DFU_TARGET_SUIT_TEST_COMMON_H__ + +#include +#include + +#include +#include +#include + +#include +#include + +/** + * @brief Reset all mocked functions. + * + */ +void reset_fakes(void); + +/** + * @brief Check whether the partition is empty. + * + * @param address Partition address to check. + * @param size Partition size. + * + * @retval true If the partition is empty. + * @retval false If the partition is not empty. + */ +bool is_partition_empty(void *address, size_t size); + +DECLARE_FAKE_VALUE_FUNC(int, suit_trigger_update, suit_plat_mreg_t *, size_t); + +#endif /* DFU_TARGET_SUIT_TEST_COMMON_H__ */ diff --git a/tests/subsys/dfu/dfu_target/suit/src/dfu_cache_partition.c b/tests/subsys/dfu/dfu_target/suit/src/dfu_cache_partition.c new file mode 100644 index 000000000000..67a6d5e79e5b --- /dev/null +++ b/tests/subsys/dfu/dfu_target/suit/src/dfu_cache_partition.c @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include + +uint8_t dfu_cache_partition[] = { + 0xBF, 0x69, 0x23, 0x66, 0x69, 0x6C, 0x65, 0x2E, 0x62, 0x69, 0x6E, 0x5A, 0x00, 0x00, 0x01, + 0x00, 0xC7, 0x9C, 0xAB, 0x9D, 0xE8, 0x33, 0x7F, 0x30, 0x14, 0xEB, 0xAC, 0x02, 0xAF, 0x26, + 0x01, 0x5E, 0x80, 0x6D, 0x88, 0xA1, 0xDB, 0x11, 0xA7, 0x31, 0xDF, 0xA6, 0xEC, 0xCB, 0x9B, + 0x48, 0x0D, 0xC8, 0x34, 0x40, 0x6D, 0x30, 0x86, 0x7D, 0xE8, 0x1B, 0xEC, 0x3C, 0xF5, 0x40, + 0xD0, 0x48, 0x18, 0x82, 0x11, 0x9D, 0x7C, 0x3F, 0x6C, 0xE5, 0x8F, 0xF1, 0xD3, 0x5D, 0xE1, + 0x51, 0xF7, 0x6A, 0x0F, 0xAF, 0x0B, 0xBD, 0x4C, 0x5F, 0xA5, 0x34, 0x1A, 0x66, 0xDB, 0x22, + 0xEC, 0x63, 0xED, 0x4B, 0xAB, 0xC7, 0xC8, 0xF7, 0x59, 0xD8, 0xD6, 0x9E, 0xEC, 0x71, 0x1B, + 0x24, 0x20, 0xB9, 0xAE, 0xE1, 0x3B, 0xFC, 0xAE, 0xB8, 0x77, 0xAC, 0xA4, 0x57, 0x34, 0x97, + 0x84, 0x4F, 0x58, 0xD5, 0x68, 0x08, 0x6F, 0xE3, 0x9C, 0x7E, 0x1B, 0xD7, 0x38, 0x22, 0x98, + 0x48, 0xF8, 0x7A, 0x67, 0xB2, 0xD9, 0xAC, 0xC5, 0x34, 0xC1, 0x27, 0x82, 0x8E, 0x42, 0x79, + 0x84, 0x21, 0x37, 0x4C, 0x41, 0x4A, 0x0F, 0xE2, 0x7F, 0xA0, 0x6A, 0x19, 0x13, 0x3D, 0x52, + 0x22, 0x7F, 0xD6, 0x2F, 0x71, 0x12, 0x76, 0xAB, 0x25, 0x9C, 0xFC, 0x67, 0x08, 0x03, 0x7C, + 0xDB, 0x18, 0xE6, 0x45, 0xF8, 0x99, 0xC2, 0x9E, 0x2C, 0xE3, 0x9B, 0x25, 0xA9, 0x7B, 0x09, + 0xFF, 0x00, 0x57, 0x26, 0x08, 0x0A, 0x11, 0x42, 0xCF, 0x82, 0xA2, 0x6B, 0x2A, 0x99, 0xF9, + 0x71, 0x9D, 0x14, 0x19, 0x5C, 0x5C, 0x78, 0x31, 0x60, 0x42, 0x4A, 0x18, 0x1F, 0xEC, 0x78, + 0x6A, 0x9A, 0x7C, 0x4F, 0xCF, 0xE8, 0x5A, 0x29, 0x65, 0xCD, 0x01, 0x3B, 0x6D, 0x53, 0xBB, + 0xC6, 0xDB, 0xDA, 0xD5, 0x8F, 0xF7, 0xF4, 0xD9, 0xB9, 0x0A, 0x03, 0x4B, 0xFF, 0x33, 0xAB, + 0x3B, 0xC5, 0xAF, 0xD0, 0xB8, 0x2C, 0x0F, 0x6A, 0xA9, 0x11, 0xB0, 0xE8, 0x57, 0x8C, 0x92, + 0x53, 0x81, 0xFF}; + +const size_t dfu_cache_partition_len = sizeof(dfu_cache_partition); diff --git a/tests/subsys/dfu/dfu_target/suit/src/main_cache_processing.c b/tests/subsys/dfu/dfu_target/suit/src/main_cache_processing.c new file mode 100644 index 000000000000..2c177918c6a6 --- /dev/null +++ b/tests/subsys/dfu/dfu_target/suit/src/main_cache_processing.c @@ -0,0 +1,284 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifdef CONFIG_TESTS_SUIT_DFU_TARGET_SUIT_CACHE_PROCESSING + +#include +#include + +#include "common.h" + +/* The SUIT envelopes are defined inside the respective manfest_*.c files. */ +extern uint8_t manifest[]; +extern const size_t manifest_len; +extern uint8_t dfu_cache_partition[]; +extern const size_t dfu_cache_partition_len; +extern uint8_t manifest_with_payload[]; +extern const size_t manifest_with_payload_len; + +#define TEST_IMAGE_SIZE 1024 +#define TEST_IMAGE_ENVELOPE_NUM 0 +#define TEST_IMAGE_CACHE_1_NUM 2 +#define TEST_IMAGE_CACHE_2_NUM 3 +#define TEST_IMAGE_CACHE_3_NUM 4 + +#define DFU_PARTITION_LABEL dfu_partition +#define DFU_PARTITION_OFFSET FIXED_PARTITION_OFFSET(DFU_PARTITION_LABEL) +#define DFU_PARTITION_ADDRESS suit_plat_mem_nvm_ptr_get(DFU_PARTITION_OFFSET) +#define DFU_PARTITION_SIZE FIXED_PARTITION_SIZE(DFU_PARTITION_LABEL) +#define DFU_PARTITION_DEVICE FIXED_PARTITION_DEVICE(DFU_PARTITION_LABEL) + +#define CACHE_PARTITION_LABEL(N) dfu_cache_partition_##N +#define CACHE_PARTITION_OFFSET(N) FIXED_PARTITION_OFFSET(CACHE_PARTITION_LABEL(N)) +#define CACHE_PARTITION_ADDRESS(N) suit_plat_mem_nvm_ptr_get(CACHE_PARTITION_OFFSET(N)) +#define CACHE_PARTITION_SIZE(N) FIXED_PARTITION_SIZE(CACHE_PARTITION_LABEL(N)) +#define CACHE_PARTITION_DEVICE(N) FIXED_PARTITION_DEVICE(CACHE_PARTITION_LABEL(N)) + +static uint8_t dfu_target_buffer[TEST_IMAGE_SIZE]; + +static void setup_test(void *f) +{ + (void)f; + + reset_fakes(); +} + +ZTEST(dfu_target_suit, test_image_init) +{ + int rc; + + rc = dfu_target_suit_reset(); + zassert_equal(rc, 0, "Unexpected failure: %d", rc); + + zassert_equal(is_partition_empty(DFU_PARTITION_ADDRESS, DFU_PARTITION_SIZE), true, + "Partition should be empty after calling dfu_target_reset"); + zassert_equal(is_partition_empty(CACHE_PARTITION_ADDRESS(1), CACHE_PARTITION_SIZE(1)), true, + "Partition should be empty after calling dfu_target_reset"); + zassert_equal(is_partition_empty(CACHE_PARTITION_ADDRESS(2), CACHE_PARTITION_SIZE(2)), true, + "Partition should be empty after calling dfu_target_reset"); + zassert_equal(is_partition_empty(CACHE_PARTITION_ADDRESS(3), CACHE_PARTITION_SIZE(3)), true, + "Partition should be empty after calling dfu_target_reset"); + + rc = dfu_target_init(DFU_TARGET_IMAGE_TYPE_SUIT, TEST_IMAGE_ENVELOPE_NUM, TEST_IMAGE_SIZE, + NULL); + zassert_equal(rc, -ENODEV, + "dfu_target should fail because the buffer has not been initialized. %d", rc); + + rc = dfu_target_suit_set_buf(dfu_target_buffer, sizeof(dfu_target_buffer)); + zassert_equal(rc, 0, "dfu_target should initialize the data buffer %d", rc); + + rc = dfu_target_init(DFU_TARGET_IMAGE_TYPE_SUIT, TEST_IMAGE_ENVELOPE_NUM, + TEST_IMAGE_SIZE * 1000, NULL); + zassert_equal(rc, -EFBIG, "dfu_target should not allow too big files. %d", rc); + + rc = dfu_target_init(DFU_TARGET_IMAGE_TYPE_SUIT, TEST_IMAGE_ENVELOPE_NUM, TEST_IMAGE_SIZE, + NULL); + zassert_equal(rc, 0, "Unexpected failure: %d", rc); + + rc = dfu_target_init(DFU_TARGET_IMAGE_TYPE_SUIT, TEST_IMAGE_ENVELOPE_NUM, TEST_IMAGE_SIZE, + NULL); + zassert_equal(rc, -EBUSY, + "dfu_target should not initialize the same image twice until the stream is " + "not ended or reset. %d", + rc); + + rc = dfu_target_suit_reset(); + zassert_equal(rc, 0, "Unexpected failure: %d", rc); + + rc = dfu_target_init(DFU_TARGET_IMAGE_TYPE_SUIT, TEST_IMAGE_CACHE_1_NUM, TEST_IMAGE_SIZE, + NULL); + zassert_equal(rc, 0, "Unexpected failure: %d", rc); +} + +ZTEST(dfu_target_suit, test_image_upload) +{ + int rc; + size_t offset = 0; + + rc = dfu_target_suit_reset(); + zassert_equal(rc, 0, "Unexpected failure: %d", rc); + + rc = dfu_target_suit_write(manifest, TEST_IMAGE_SIZE); + zassert_equal(rc, -EFAULT, "Unexpected failure: %d", rc); + + rc = dfu_target_suit_offset_get(&offset); + zassert_equal(rc, 0, "Unexpected failure: %d", rc); + zassert_equal(offset, 0, "DFU target offset should be equal to 0"); + + rc = dfu_target_suit_set_buf(dfu_target_buffer, sizeof(dfu_target_buffer)); + zassert_equal(rc, 0, "Unexpected failure: %d", rc); + + rc = dfu_target_init(DFU_TARGET_IMAGE_TYPE_SUIT, TEST_IMAGE_ENVELOPE_NUM, manifest_len, + NULL); + zassert_equal(rc, 0, "Unexpected failure: %d", rc); + + rc = dfu_target_suit_write(manifest, manifest_len); + zassert_equal(rc, 0, "Unexpected failure: %d", rc); + + rc = dfu_target_suit_offset_get(&offset); + zassert_equal(rc, 0, "DFU target offset get should pass for image 0 %d", rc); + zassert_equal(offset, manifest_len, "DFU target offset should be equal to image size"); + + rc = dfu_target_done(true); + zassert_equal(rc, 0, "Unexpected failure: %d", rc); + + rc = dfu_target_init(DFU_TARGET_IMAGE_TYPE_SUIT, TEST_IMAGE_CACHE_1_NUM, + dfu_cache_partition_len, NULL); + zassert_equal(rc, 0, "Unexpected failure: %d", rc); + + rc = dfu_target_suit_write(dfu_cache_partition, dfu_cache_partition_len); + zassert_equal(rc, 0, "Unexpected failure: %d", rc); + + rc = dfu_target_suit_offset_get(&offset); + zassert_equal(rc, 0, "DFU target offset get should pass for image 0 %d", rc); + zassert_equal(offset, dfu_cache_partition_len, + "DFU target offset should be equal to image size"); + + rc = dfu_target_done(true); + zassert_equal(rc, 0, "Unexpected failure: %d", rc); + + rc = dfu_target_suit_schedule_update(0); + zassert_equal(rc, 0, "Unexpected failure: %d", rc); + + dfu_target_suit_reboot(); + zassert_equal(suit_trigger_update_fake.call_count, 1, + "Incorrect number of suit_dfu_update_start() calls"); + + rc = memcmp((uint8_t *)DFU_PARTITION_ADDRESS, manifest, manifest_len); + zassert_equal(rc, 0, "DFU partition content does not match the manifest %d", rc); + + rc = memcmp((uint8_t *)CACHE_PARTITION_ADDRESS(1), dfu_cache_partition, + dfu_cache_partition_len); + zassert_equal(rc, 0, "DFU cache partition content does not match the file content %d", rc); + + zassert_equal(is_partition_empty(CACHE_PARTITION_ADDRESS(2), CACHE_PARTITION_SIZE(2)), true, + "Partition should be empty after because it was not used"); + zassert_equal(is_partition_empty(CACHE_PARTITION_ADDRESS(3), CACHE_PARTITION_SIZE(3)), true, + "Partition should be empty after because it was not used"); + + rc = dfu_target_suit_reset(); + zassert_equal(rc, 0, "Unexpected failure: %d", rc); + + zassert_equal(is_partition_empty(DFU_PARTITION_ADDRESS, DFU_PARTITION_SIZE), true, + "Partition should be empty after calling dfu_target_reset"); + zassert_equal(is_partition_empty(CACHE_PARTITION_ADDRESS(1), CACHE_PARTITION_SIZE(1)), true, + "Partition should be empty after calling dfu_target_reset"); + zassert_equal(is_partition_empty(CACHE_PARTITION_ADDRESS(2), CACHE_PARTITION_SIZE(2)), true, + "Partition should be empty after calling dfu_target_reset"); + zassert_equal(is_partition_empty(CACHE_PARTITION_ADDRESS(3), CACHE_PARTITION_SIZE(3)), true, + "Partition should be empty after calling dfu_target_reset"); +} + +ZTEST(dfu_target_suit, test_image_multi_cache_upload) +{ + int rc; + size_t offset = 0; + + RESET_FAKE(suit_trigger_update); + + rc = dfu_target_suit_reset(); + zassert_equal(rc, 0, "Unexpected failure: %d", rc); + + rc = dfu_target_suit_set_buf(dfu_target_buffer, sizeof(dfu_target_buffer)); + zassert_equal(rc, 0, "Unexpected failure: %d", rc); + + rc = dfu_target_init(DFU_TARGET_IMAGE_TYPE_SUIT, TEST_IMAGE_ENVELOPE_NUM, manifest_len, + NULL); + zassert_equal(rc, 0, "Unexpected failure: %d", rc); + + rc = dfu_target_suit_write(manifest, manifest_len); + zassert_equal(rc, 0, "Unexpected failure: %d", rc); + + rc = dfu_target_suit_offset_get(&offset); + zassert_equal(rc, 0, "DFU target offset get should pass for image 0 %d", rc); + zassert_equal(offset, manifest_len, "DFU target offset should be equal to image size"); + + rc = dfu_target_done(true); + zassert_equal(rc, 0, "Unexpected failure: %d", rc); + + rc = dfu_target_init(DFU_TARGET_IMAGE_TYPE_SUIT, TEST_IMAGE_CACHE_1_NUM, + dfu_cache_partition_len, NULL); + zassert_equal(rc, 0, "Unexpected failure: %d", rc); + + rc = dfu_target_suit_write(dfu_cache_partition, dfu_cache_partition_len); + zassert_equal(rc, 0, "Unexpected failure: %d", rc); + + rc = dfu_target_suit_offset_get(&offset); + zassert_equal(rc, 0, "Unexpected failure: %d", rc); + zassert_equal(offset, dfu_cache_partition_len, + "DFU target offset should be equal to image size"); + + rc = dfu_target_done(true); + zassert_equal(rc, 0, "Unexpected failure: %d", rc); + + rc = dfu_target_init(DFU_TARGET_IMAGE_TYPE_SUIT, TEST_IMAGE_CACHE_2_NUM, + dfu_cache_partition_len, NULL); + zassert_equal(rc, 0, "Unexpected failure: %d", rc); + + rc = dfu_target_suit_write(dfu_cache_partition, dfu_cache_partition_len); + zassert_equal(rc, 0, "Unexpected failure: %d", rc); + + rc = dfu_target_suit_offset_get(&offset); + zassert_equal(rc, 0, "Unexpected failure: %d", rc); + zassert_equal(offset, dfu_cache_partition_len, + "DFU target offset should be equal to image size"); + + rc = dfu_target_done(true); + zassert_equal(rc, 0, "Unexpected failure: %d", rc); + + rc = dfu_target_init(DFU_TARGET_IMAGE_TYPE_SUIT, TEST_IMAGE_CACHE_3_NUM, + dfu_cache_partition_len, NULL); + zassert_equal(rc, 0, "Unexpected failure: %d", rc); + + rc = dfu_target_suit_write(dfu_cache_partition, dfu_cache_partition_len); + zassert_equal(rc, 0, "Unexpected failure: %d", rc); + + rc = dfu_target_suit_offset_get(&offset); + zassert_equal(rc, 0, "Unexpected failure: %d", rc); + zassert_equal(offset, dfu_cache_partition_len, + "DFU target offset should be equal to image size"); + + rc = dfu_target_done(true); + zassert_equal(rc, 0, "Unexpected failure: %d", rc); + + rc = dfu_target_suit_schedule_update(0); + zassert_equal(rc, 0, "Unexpected failure: %d", rc); + + dfu_target_suit_reboot(); + zassert_equal(suit_trigger_update_fake.call_count, 1, + "Incorrect number of suit_dfu_update_start() calls"); + + rc = memcmp((uint8_t *)DFU_PARTITION_ADDRESS, manifest, manifest_len); + zassert_equal(rc, 0, "DFU partition content does not match the manifest %d", rc); + + rc = memcmp((uint8_t *)CACHE_PARTITION_ADDRESS(1), dfu_cache_partition, + dfu_cache_partition_len); + zassert_equal(rc, 0, "DFU cache partition content does not match the file content %d", rc); + + rc = memcmp((uint8_t *)CACHE_PARTITION_ADDRESS(2), dfu_cache_partition, + dfu_cache_partition_len); + zassert_equal(rc, 0, "DFU cache partition content does not match the file content %d", rc); + + rc = memcmp((uint8_t *)CACHE_PARTITION_ADDRESS(3), dfu_cache_partition, + dfu_cache_partition_len); + zassert_equal(rc, 0, "DFU cache partition content does not match the file content %d", rc); + + rc = dfu_target_suit_reset(); + zassert_equal(rc, 0, "Unexpected failure: %d", rc); + + zassert_equal(is_partition_empty(DFU_PARTITION_ADDRESS, DFU_PARTITION_SIZE), true, + "Partition should be empty after calling dfu_target_reset"); + zassert_equal(is_partition_empty(CACHE_PARTITION_ADDRESS(1), CACHE_PARTITION_SIZE(1)), true, + "Partition should be empty after calling dfu_target_reset"); + zassert_equal(is_partition_empty(CACHE_PARTITION_ADDRESS(2), CACHE_PARTITION_SIZE(2)), true, + "Partition should be empty after calling dfu_target_reset"); + zassert_equal(is_partition_empty(CACHE_PARTITION_ADDRESS(3), CACHE_PARTITION_SIZE(3)), true, + "Partition should be empty after calling dfu_target_reset"); +} + +ZTEST_SUITE(dfu_target_suit, NULL, NULL, setup_test, NULL, NULL); + +#endif /* CONFIG_TESTS_SUIT_DFU_TARGET_SUIT_CACHE_PROCESSING */ diff --git a/tests/subsys/dfu/dfu_target/suit/src/main_single_partition.c b/tests/subsys/dfu/dfu_target/suit/src/main_single_partition.c new file mode 100644 index 000000000000..74f0eab9cf19 --- /dev/null +++ b/tests/subsys/dfu/dfu_target/suit/src/main_single_partition.c @@ -0,0 +1,119 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifdef CONFIG_TESTS_SUIT_DFU_TARGET_SUIT_SINGLE_PARTITION + +#include +#include + +#include "common.h" + +/* The SUIT envelopes are defined inside the respective manfest_*.c files. */ +extern uint8_t manifest_with_payload[]; +extern const size_t manifest_with_payload_len; + +#define TEST_IMAGE_SIZE 1024 +#define TEST_IMAGE_ENVELOPE_NUM 0 +#define TEST_WRONG_IMAGE_CACHE_0 1 +#define TEST_WRONG_IMAGE_CACHE_1 2 + +#define DFU_PARTITION_LABEL dfu_partition +#define DFU_PARTITION_OFFSET FIXED_PARTITION_OFFSET(DFU_PARTITION_LABEL) +#define DFU_PARTITION_ADDRESS suit_plat_mem_nvm_ptr_get(DFU_PARTITION_OFFSET) +#define DFU_PARTITION_SIZE FIXED_PARTITION_SIZE(DFU_PARTITION_LABEL) +#define DFU_PARTITION_DEVICE FIXED_PARTITION_DEVICE(DFU_PARTITION_LABEL) + +static uint8_t dfu_target_buffer[TEST_IMAGE_SIZE]; + +static void setup_test(void *f) +{ + (void)f; + + reset_fakes(); +} + +ZTEST(dfu_target_suit, test_image_init) +{ + int rc; + + rc = dfu_target_suit_reset(); + zassert_equal(rc, 0, "Unexpected failure: %d", rc); + zassert_equal(is_partition_empty(DFU_PARTITION_ADDRESS, DFU_PARTITION_SIZE), true, + "Partition should be empty after calling dfu_target_reset"); + + rc = dfu_target_init(DFU_TARGET_IMAGE_TYPE_SUIT, TEST_IMAGE_ENVELOPE_NUM, TEST_IMAGE_SIZE, + NULL); + zassert_equal(rc, -ENODEV, + "dfu_target should fail because the buffer has not been initialized. %d", rc); + + rc = dfu_target_suit_set_buf(dfu_target_buffer, sizeof(dfu_target_buffer)); + zassert_equal(rc, 0, "dfu_target should initialize the data buffer %d", rc); + + rc = dfu_target_init(DFU_TARGET_IMAGE_TYPE_SUIT, TEST_IMAGE_ENVELOPE_NUM, TEST_IMAGE_SIZE, + NULL); + zassert_equal(rc, 0, "Unexpected failure: %d", rc); + + rc = dfu_target_init(DFU_TARGET_IMAGE_TYPE_SUIT, TEST_WRONG_IMAGE_CACHE_0, TEST_IMAGE_SIZE, + NULL); + zassert_equal(rc, -ENOTSUP, + "dfu_target should fail because CACHE PROCESSING is not enabled: %d", rc); + + rc = dfu_target_init(DFU_TARGET_IMAGE_TYPE_SUIT, TEST_WRONG_IMAGE_CACHE_1, TEST_IMAGE_SIZE, + NULL); + zassert_equal(rc, -ENOTSUP, + "dfu_target should fail because CACHE PROCESSING is not enabled: %d", rc); +} + +ZTEST(dfu_target_suit, test_upload) +{ + int rc; + size_t offset = 0; + + rc = dfu_target_suit_reset(); + zassert_equal(rc, 0, "Unexpected failure: %d", rc); + + rc = dfu_target_suit_set_buf(dfu_target_buffer, sizeof(dfu_target_buffer)); + zassert_equal(rc, 0, "dfu_target should initialize the data buffer %d", rc); + + rc = dfu_target_init(DFU_TARGET_IMAGE_TYPE_SUIT, TEST_IMAGE_ENVELOPE_NUM, + TEST_IMAGE_SIZE * 1000, NULL); + zassert_equal(rc, -EFBIG, "dfu_target should not allow too big files. %d", rc); + + rc = dfu_target_init(DFU_TARGET_IMAGE_TYPE_SUIT, TEST_IMAGE_ENVELOPE_NUM, TEST_IMAGE_SIZE, + NULL); + zassert_equal(rc, 0, "Unexpected failure: %d", rc); + + rc = dfu_target_suit_write(manifest_with_payload, manifest_with_payload_len); + zassert_equal(rc, 0, "Unexpected failure: %d", rc); + + rc = dfu_target_suit_offset_get(&offset); + zassert_equal(rc, 0, "DFU target offset get should pass for image 0 %d", rc); + zassert_equal(offset, manifest_with_payload_len, + "DFU target offset should be equal to image size"); + + rc = dfu_target_done(true); + zassert_equal(rc, 0, "Unexpected failure: %d", rc); + + rc = dfu_target_suit_schedule_update(0); + zassert_equal(rc, 0, "Unexpected failure: %d", rc); + + dfu_target_suit_reboot(); + zassert_equal(suit_trigger_update_fake.call_count, 1, + "Incorrect number of suit_trigger_update() calls"); + + rc = memcmp((uint8_t *)DFU_PARTITION_ADDRESS, manifest_with_payload, + manifest_with_payload_len); + zassert_equal(rc, 0, "DFU partition content does not match the manifest %d", rc); + + rc = dfu_target_suit_reset(); + zassert_equal(rc, 0, "Unexpected failure: %d", rc); + zassert_equal(is_partition_empty(DFU_PARTITION_ADDRESS, DFU_PARTITION_SIZE), true, + "Partition should be empty after calling dfu_target_reset"); +} + +ZTEST_SUITE(dfu_target_suit, NULL, NULL, setup_test, NULL, NULL); + +#endif /* CONFIG_TESTS_SUIT_DFU_TARGET_SUIT_SINGLE_PARTITION */ diff --git a/tests/subsys/dfu/dfu_target/suit/src/manifest.c b/tests/subsys/dfu/dfu_target/suit/src/manifest.c new file mode 100644 index 000000000000..f7f82f35ee04 --- /dev/null +++ b/tests/subsys/dfu/dfu_target/suit/src/manifest.c @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include + +uint8_t manifest[] = { + 0xD8, 0x6B, 0xA3, 0x02, 0x58, 0x7A, 0x82, 0x58, 0x24, 0x82, 0x2F, 0x58, 0x20, 0xAB, 0xE7, + 0x1D, 0x6F, 0x8D, 0x4A, 0xD9, 0x4F, 0x84, 0xBC, 0x0A, 0xFB, 0x29, 0x61, 0x72, 0x74, 0xE6, + 0xB4, 0xF6, 0xE9, 0x81, 0x1C, 0xA6, 0xB9, 0x1A, 0xF3, 0x22, 0x40, 0x47, 0x28, 0x30, 0x6F, + 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x7F, 0xFF, 0xFF, 0xE0, + 0xA0, 0xF6, 0x58, 0x40, 0x41, 0xB2, 0xE4, 0xFD, 0xC8, 0xA9, 0x4C, 0x4F, 0x1B, 0x23, 0xC6, + 0x0B, 0xAB, 0x3D, 0x99, 0x56, 0x4D, 0x84, 0x4E, 0x69, 0x82, 0xB1, 0x60, 0x42, 0x63, 0x63, + 0xC8, 0x5E, 0xF4, 0x6C, 0x6D, 0xDC, 0x32, 0x6E, 0x08, 0xA3, 0x83, 0x7C, 0x4A, 0xDE, 0x1D, + 0x07, 0xCA, 0xAC, 0x3D, 0x3C, 0xCD, 0xE7, 0xA7, 0x9B, 0xB4, 0xD1, 0xCD, 0x3D, 0x1C, 0x8F, + 0xD3, 0x4D, 0xC6, 0x3B, 0x65, 0x07, 0xCB, 0xA2, 0x03, 0x58, 0xB6, 0xA7, 0x01, 0x01, 0x02, + 0x01, 0x03, 0x58, 0x70, 0xA2, 0x02, 0x81, 0x84, 0x44, 0x63, 0x4D, 0x45, 0x4D, 0x41, 0x02, + 0x45, 0x1A, 0x0E, 0x16, 0x00, 0x00, 0x45, 0x1A, 0x00, 0x02, 0x00, 0x00, 0x04, 0x58, 0x56, + 0x86, 0x14, 0xA4, 0x01, 0x50, 0x76, 0x17, 0xDA, 0xA5, 0x71, 0xFD, 0x5A, 0x85, 0x8F, 0x94, + 0xE2, 0x8D, 0x73, 0x5C, 0xE9, 0xF4, 0x02, 0x50, 0xBA, 0x6C, 0x70, 0x4B, 0x1F, 0xD9, 0x5F, + 0x78, 0x91, 0x35, 0xBF, 0x04, 0xD9, 0xA4, 0xED, 0x31, 0x03, 0x58, 0x24, 0x82, 0x2F, 0x58, + 0x20, 0x5F, 0xC3, 0x54, 0xBF, 0x8E, 0x8C, 0x50, 0xFB, 0x4F, 0xBC, 0x2C, 0xFA, 0xEB, 0x04, + 0x53, 0x41, 0xC9, 0x80, 0x6D, 0xEA, 0xBD, 0xCB, 0x41, 0x54, 0xFB, 0x79, 0xCC, 0xA4, 0xF0, + 0xC9, 0x8C, 0x12, 0x0E, 0x19, 0x01, 0x00, 0x01, 0x0F, 0x02, 0x0F, 0x07, 0x43, 0x82, 0x03, + 0x0F, 0x09, 0x43, 0x82, 0x17, 0x02, 0x11, 0x52, 0x86, 0x14, 0xA1, 0x15, 0x69, 0x23, 0x66, + 0x69, 0x6C, 0x65, 0x2E, 0x62, 0x69, 0x6E, 0x15, 0x02, 0x03, 0x0F, 0x05, 0x82, 0x4C, 0x6B, + 0x49, 0x4E, 0x53, 0x54, 0x4C, 0x44, 0x5F, 0x4D, 0x46, 0x53, 0x54, 0x50, 0x5B, 0x46, 0x9F, + 0xD1, 0x90, 0xEE, 0x53, 0x9C, 0xA3, 0x18, 0x68, 0x1B, 0x03, 0x69, 0x5E, 0x36, 0x69, 0x23, + 0x66, 0x69, 0x6C, 0x65, 0x2E, 0x62, 0x69, 0x6E, 0x59, 0x01, 0x00, 0xC7, 0x9C, 0xAB, 0x9D, + 0xE8, 0x33, 0x7F, 0x30, 0x14, 0xEB, 0xAC, 0x02, 0xAF, 0x26, 0x01, 0x5E, 0x80, 0x6D, 0x88, + 0xA1, 0xDB, 0x11, 0xA7, 0x31, 0xDF, 0xA6, 0xEC, 0xCB, 0x9B, 0x48, 0x0D, 0xC8, 0x34, 0x40, + 0x6D, 0x30, 0x86, 0x7D, 0xE8, 0x1B, 0xEC, 0x3C, 0xF5, 0x40, 0xD0, 0x48, 0x18, 0x82, 0x11, + 0x9D, 0x7C, 0x3F, 0x6C, 0xE5, 0x8F, 0xF1, 0xD3, 0x5D, 0xE1, 0x51, 0xF7, 0x6A, 0x0F, 0xAF, + 0x0B, 0xBD, 0x4C, 0x5F, 0xA5, 0x34, 0x1A, 0x66, 0xDB, 0x22, 0xEC, 0x63, 0xED, 0x4B, 0xAB, + 0xC7, 0xC8, 0xF7, 0x59, 0xD8, 0xD6, 0x9E, 0xEC, 0x71, 0x1B, 0x24, 0x20, 0xB9, 0xAE, 0xE1, + 0x3B, 0xFC, 0xAE, 0xB8, 0x77, 0xAC, 0xA4, 0x57, 0x34, 0x97, 0x84, 0x4F, 0x58, 0xD5, 0x68, + 0x08, 0x6F, 0xE3, 0x9C, 0x7E, 0x1B, 0xD7, 0x38, 0x22, 0x98, 0x48, 0xF8, 0x7A, 0x67, 0xB2, + 0xD9, 0xAC, 0xC5, 0x34, 0xC1, 0x27, 0x82, 0x8E, 0x42, 0x79, 0x84, 0x21, 0x37, 0x4C, 0x41, + 0x4A, 0x0F, 0xE2, 0x7F, 0xA0, 0x6A, 0x19, 0x13, 0x3D, 0x52, 0x22, 0x7F, 0xD6, 0x2F, 0x71, + 0x12, 0x76, 0xAB, 0x25, 0x9C, 0xFC, 0x67, 0x08, 0x03, 0x7C, 0xDB, 0x18, 0xE6, 0x45, 0xF8, + 0x99, 0xC2, 0x9E, 0x2C, 0xE3, 0x9B, 0x25, 0xA9, 0x7B, 0x09, 0xFF, 0x00, 0x57, 0x26, 0x08, + 0x0A, 0x11, 0x42, 0xCF, 0x82, 0xA2, 0x6B, 0x2A, 0x99, 0xF9, 0x71, 0x9D, 0x14, 0x19, 0x5C, + 0x5C, 0x78, 0x31, 0x60, 0x42, 0x4A, 0x18, 0x1F, 0xEC, 0x78, 0x6A, 0x9A, 0x7C, 0x4F, 0xCF, + 0xE8, 0x5A, 0x29, 0x65, 0xCD, 0x01, 0x3B, 0x6D, 0x53, 0xBB, 0xC6, 0xDB, 0xDA, 0xD5, 0x8F, + 0xF7, 0xF4, 0xD9, 0xB9, 0x0A, 0x03, 0x4B, 0xFF, 0x33, 0xAB, 0x3B, 0xC5, 0xAF, 0xD0, 0xB8, + 0x2C, 0x0F, 0x6A, 0xA9, 0x11, 0xB0, 0xE8, 0x57, 0x8C, 0x92, 0x53, 0x81}; + +const size_t manifest_len = sizeof(manifest); diff --git a/tests/subsys/dfu/dfu_target/suit/src/manifest_with_payload.c b/tests/subsys/dfu/dfu_target/suit/src/manifest_with_payload.c new file mode 100644 index 000000000000..1f78915c639c --- /dev/null +++ b/tests/subsys/dfu/dfu_target/suit/src/manifest_with_payload.c @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include + +uint8_t manifest_with_payload[] = { + 0xD8, 0x6B, 0xA3, 0x02, 0x58, 0x7A, 0x82, 0x58, 0x24, 0x82, 0x2F, 0x58, 0x20, 0xAB, 0xE7, + 0x1D, 0x6F, 0x8D, 0x4A, 0xD9, 0x4F, 0x84, 0xBC, 0x0A, 0xFB, 0x29, 0x61, 0x72, 0x74, 0xE6, + 0xB4, 0xF6, 0xE9, 0x81, 0x1C, 0xA6, 0xB9, 0x1A, 0xF3, 0x22, 0x40, 0x47, 0x28, 0x30, 0x6F, + 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x7F, 0xFF, 0xFF, 0xE0, + 0xA0, 0xF6, 0x58, 0x40, 0xB5, 0x24, 0x9B, 0xB6, 0xF1, 0xE1, 0x4D, 0xEA, 0xE5, 0x1D, 0xF1, + 0x2D, 0xE4, 0x21, 0x88, 0xB9, 0x27, 0x8E, 0xEF, 0xCB, 0x35, 0xF4, 0xD9, 0x55, 0xDB, 0x71, + 0xB8, 0xEB, 0x51, 0xB3, 0xDC, 0x64, 0xF0, 0xBC, 0x72, 0xEC, 0xD0, 0x45, 0xCE, 0xC0, 0x9D, + 0x83, 0x34, 0xB9, 0x92, 0x4A, 0x82, 0xD8, 0x42, 0xFA, 0xFF, 0xC4, 0x1D, 0xD1, 0x82, 0xEF, + 0x89, 0x06, 0x70, 0x70, 0xAA, 0xFF, 0x43, 0x0F, 0x03, 0x58, 0xB6, 0xA7, 0x01, 0x01, 0x02, + 0x01, 0x03, 0x58, 0x70, 0xA2, 0x02, 0x81, 0x84, 0x44, 0x63, 0x4D, 0x45, 0x4D, 0x41, 0x02, + 0x45, 0x1A, 0x0E, 0x16, 0x00, 0x00, 0x45, 0x1A, 0x00, 0x02, 0x00, 0x00, 0x04, 0x58, 0x56, + 0x86, 0x14, 0xA4, 0x01, 0x50, 0x76, 0x17, 0xDA, 0xA5, 0x71, 0xFD, 0x5A, 0x85, 0x8F, 0x94, + 0xE2, 0x8D, 0x73, 0x5C, 0xE9, 0xF4, 0x02, 0x50, 0xBA, 0x6C, 0x70, 0x4B, 0x1F, 0xD9, 0x5F, + 0x78, 0x91, 0x35, 0xBF, 0x04, 0xD9, 0xA4, 0xED, 0x31, 0x03, 0x58, 0x24, 0x82, 0x2F, 0x58, + 0x20, 0x5F, 0xC3, 0x54, 0xBF, 0x8E, 0x8C, 0x50, 0xFB, 0x4F, 0xBC, 0x2C, 0xFA, 0xEB, 0x04, + 0x53, 0x41, 0xC9, 0x80, 0x6D, 0xEA, 0xBD, 0xCB, 0x41, 0x54, 0xFB, 0x79, 0xCC, 0xA4, 0xF0, + 0xC9, 0x8C, 0x12, 0x0E, 0x19, 0x01, 0x00, 0x01, 0x0F, 0x02, 0x0F, 0x07, 0x43, 0x82, 0x03, + 0x0F, 0x09, 0x43, 0x82, 0x17, 0x02, 0x11, 0x52, 0x86, 0x14, 0xA1, 0x15, 0x69, 0x23, 0x66, + 0x69, 0x6C, 0x65, 0x2E, 0x62, 0x69, 0x6E, 0x15, 0x02, 0x03, 0x0F, 0x05, 0x82, 0x4C, 0x6B, + 0x49, 0x4E, 0x53, 0x54, 0x4C, 0x44, 0x5F, 0x4D, 0x46, 0x53, 0x54, 0x50, 0x5B, 0x46, 0x9F, + 0xD1, 0x90, 0xEE, 0x53, 0x9C, 0xA3, 0x18, 0x68, 0x1B, 0x03, 0x69, 0x5E, 0x36, 0x69, 0x23, + 0x66, 0x69, 0x6C, 0x65, 0x2E, 0x62, 0x69, 0x6E, 0x59, 0x01, 0x00, 0xC7, 0x9C, 0xAB, 0x9D, + 0xE8, 0x33, 0x7F, 0x30, 0x14, 0xEB, 0xAC, 0x02, 0xAF, 0x26, 0x01, 0x5E, 0x80, 0x6D, 0x88, + 0xA1, 0xDB, 0x11, 0xA7, 0x31, 0xDF, 0xA6, 0xEC, 0xCB, 0x9B, 0x48, 0x0D, 0xC8, 0x34, 0x40, + 0x6D, 0x30, 0x86, 0x7D, 0xE8, 0x1B, 0xEC, 0x3C, 0xF5, 0x40, 0xD0, 0x48, 0x18, 0x82, 0x11, + 0x9D, 0x7C, 0x3F, 0x6C, 0xE5, 0x8F, 0xF1, 0xD3, 0x5D, 0xE1, 0x51, 0xF7, 0x6A, 0x0F, 0xAF, + 0x0B, 0xBD, 0x4C, 0x5F, 0xA5, 0x34, 0x1A, 0x66, 0xDB, 0x22, 0xEC, 0x63, 0xED, 0x4B, 0xAB, + 0xC7, 0xC8, 0xF7, 0x59, 0xD8, 0xD6, 0x9E, 0xEC, 0x71, 0x1B, 0x24, 0x20, 0xB9, 0xAE, 0xE1, + 0x3B, 0xFC, 0xAE, 0xB8, 0x77, 0xAC, 0xA4, 0x57, 0x34, 0x97, 0x84, 0x4F, 0x58, 0xD5, 0x68, + 0x08, 0x6F, 0xE3, 0x9C, 0x7E, 0x1B, 0xD7, 0x38, 0x22, 0x98, 0x48, 0xF8, 0x7A, 0x67, 0xB2, + 0xD9, 0xAC, 0xC5, 0x34, 0xC1, 0x27, 0x82, 0x8E, 0x42, 0x79, 0x84, 0x21, 0x37, 0x4C, 0x41, + 0x4A, 0x0F, 0xE2, 0x7F, 0xA0, 0x6A, 0x19, 0x13, 0x3D, 0x52, 0x22, 0x7F, 0xD6, 0x2F, 0x71, + 0x12, 0x76, 0xAB, 0x25, 0x9C, 0xFC, 0x67, 0x08, 0x03, 0x7C, 0xDB, 0x18, 0xE6, 0x45, 0xF8, + 0x99, 0xC2, 0x9E, 0x2C, 0xE3, 0x9B, 0x25, 0xA9, 0x7B, 0x09, 0xFF, 0x00, 0x57, 0x26, 0x08, + 0x0A, 0x11, 0x42, 0xCF, 0x82, 0xA2, 0x6B, 0x2A, 0x99, 0xF9, 0x71, 0x9D, 0x14, 0x19, 0x5C, + 0x5C, 0x78, 0x31, 0x60, 0x42, 0x4A, 0x18, 0x1F, 0xEC, 0x78, 0x6A, 0x9A, 0x7C, 0x4F, 0xCF, + 0xE8, 0x5A, 0x29, 0x65, 0xCD, 0x01, 0x3B, 0x6D, 0x53, 0xBB, 0xC6, 0xDB, 0xDA, 0xD5, 0x8F, + 0xF7, 0xF4, 0xD9, 0xB9, 0x0A, 0x03, 0x4B, 0xFF, 0x33, 0xAB, 0x3B, 0xC5, 0xAF, 0xD0, 0xB8, + 0x2C, 0x0F, 0x6A, 0xA9, 0x11, 0xB0, 0xE8, 0x57, 0x8C, 0x92, 0x53, 0x81}; + +const size_t manifest_with_payload_len = sizeof(manifest_with_payload); diff --git a/tests/subsys/dfu/dfu_target/suit/testcase.yaml b/tests/subsys/dfu/dfu_target/suit/testcase.yaml new file mode 100644 index 000000000000..3ad1fa1285bd --- /dev/null +++ b/tests/subsys/dfu/dfu_target/suit/testcase.yaml @@ -0,0 +1,17 @@ +tests: + dfu.dfu_target.suit.single_partition: + sysbuild: true + platform_allow: nrf54h20dk/nrf54h20/cpuapp native_posix + integration_platforms: + - nrf54h20dk/nrf54h20/cpuapp + - native_posix + extra_args: OVERLAY_CONFIG=single_partition.conf + tags: dfu sysbuild ci_tests_subsys_dfu + dfu.dfu_target.suit.cache_processing: + sysbuild: true + platform_allow: nrf54h20dk/nrf54h20/cpuapp native_posix + integration_platforms: + - nrf54h20dk/nrf54h20/cpuapp + - native_posix + extra_args: OVERLAY_CONFIG=cache_processing.conf + tags: dfu sysbuild ci_tests_subsys_dfu diff --git a/tests/subsys/event_manager_proxy/prj_icmsg.conf b/tests/subsys/event_manager_proxy/prj_icmsg.conf index 67232207bd01..568b82d89fc3 100644 --- a/tests/subsys/event_manager_proxy/prj_icmsg.conf +++ b/tests/subsys/event_manager_proxy/prj_icmsg.conf @@ -17,6 +17,7 @@ CONFIG_HEAP_MEM_POOL_SIZE=2048 CONFIG_IPC_SERVICE=y CONFIG_MBOX=y +CONFIG_PBUF_RX_READ_BUF_SIZE=512 CONFIG_EVENT_MANAGER_PROXY_SEND_RETRIES=100 diff --git a/tests/subsys/event_manager_proxy/remote/prj_icmsg.conf b/tests/subsys/event_manager_proxy/remote/prj_icmsg.conf index 8503b85ea235..f9cc13627105 100644 --- a/tests/subsys/event_manager_proxy/remote/prj_icmsg.conf +++ b/tests/subsys/event_manager_proxy/remote/prj_icmsg.conf @@ -21,6 +21,7 @@ CONFIG_PRINTK=y CONFIG_IPC_SERVICE=y CONFIG_MBOX=y +CONFIG_PBUF_RX_READ_BUF_SIZE=512 CONFIG_EVENT_MANAGER_PROXY_SEND_RETRIES=100 diff --git a/tests/subsys/mpsl/pm/CMakeLists.txt b/tests/subsys/mpsl/pm/CMakeLists.txt index 58163f186b89..3820538a402b 100644 --- a/tests/subsys/mpsl/pm/CMakeLists.txt +++ b/tests/subsys/mpsl/pm/CMakeLists.txt @@ -13,6 +13,7 @@ project(pm_test) test_runner_generate(pm_test.c) # Create mocks for pm module. +cmock_handle(${CMAKE_CURRENT_SOURCE_DIR}/kernel_minimal_mock.h) cmock_handle(${ZEPHYR_BASE}/include/zephyr/pm/policy.h) cmock_handle(${ZEPHYR_NRFXLIB_MODULE_DIR}/mpsl/include/mpsl_pm.h) cmock_handle(${ZEPHYR_NRFXLIB_MODULE_DIR}/mpsl/include/mpsl_pm_config.h) @@ -29,7 +30,7 @@ target_include_directories(app PRIVATE src) # Preinclude file to the UUT to redefine mpsl_work_schedule(). set_property(SOURCE ${ZEPHYR_NRF_MODULE_DIR}/subsys/mpsl/pm/mpsl_pm_utils.c - PROPERTY COMPILE_FLAGS "-include mocks/mpsl_work.h") + PROPERTY COMPILE_FLAGS "-include mocks/kernel_minimal_mock.h -include mocks/mpsl_work.h") # Options that cannot be passed through Kconfig fragments. target_compile_options(app PRIVATE diff --git a/tests/subsys/mpsl/pm/kernel_minimal_mock.h b/tests/subsys/mpsl/pm/kernel_minimal_mock.h new file mode 100644 index 000000000000..9377de21d5ae --- /dev/null +++ b/tests/subsys/mpsl/pm/kernel_minimal_mock.h @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ +#ifndef ZEPHYR_INCLUDE_KERNEL_H_ +#define ZEPHYR_INCLUDE_KERNEL_H_ +/* CMock chokes on zephyr/kernel.h, so we define the minimum required to build + * mpsl_pm and tests, then let CMock generate mocks from this file instead. + */ +#include +struct k_work { +}; +typedef struct k_timeout { + uint64_t value; +} k_timeout_t; +struct k_work_delayable { + void *handler; +}; +#define Z_WORK_DELAYABLE_INITIALIZER(work_handler) {work_handler} +#define K_WORK_DELAYABLE_DEFINE(work, work_handler) \ + struct k_work_delayable work = Z_WORK_DELAYABLE_INITIALIZER(work_handler) +k_timeout_t K_USEC(uint64_t d); +int64_t k_uptime_get(void); +#endif diff --git a/tests/subsys/mpsl/pm/pm_test.c b/tests/subsys/mpsl/pm/pm_test.c index c0e81dfb73db..0c9339abc522 100644 --- a/tests/subsys/mpsl/pm/pm_test.c +++ b/tests/subsys/mpsl/pm/pm_test.c @@ -14,15 +14,13 @@ #include "cmock_mpsl_pm.h" #include "cmock_mpsl_pm_config.h" #include "cmock_mpsl_work.h" +#include "cmock_kernel_minimal_mock.h" #include -#include - #define PM_MAX_LATENCY_HCI_COMMANDS_US 499999 #define TIME_TO_REGISTER_EVENT_IN_ZEPHYR_US 1000 -#define RETRY_TIME_MAX_US (UINT32_MAX - TIME_TO_REGISTER_EVENT_IN_ZEPHYR_US) /* Mock implementation for mpsl_work_q*/ struct k_work_q mpsl_work_q; @@ -55,6 +53,7 @@ typedef struct { uint64_t event_time_us; latency_func_t latency_func; uint64_t latency_us; + int64_t curr_time_ms; } test_vector_t; void run_test(test_vector_t *p_test_vectors, int num_test_vctr) @@ -79,10 +78,12 @@ void run_test(test_vector_t *p_test_vectors, int num_test_vctr) switch (v.event_func) { case EVENT_FUNC_REGISTER: + __cmock_k_uptime_get_ExpectAndReturn(v.curr_time_ms); __cmock_pm_policy_event_register_Expect(0, v.event_time_us); __cmock_pm_policy_event_register_IgnoreArg_evt(); break; case EVENT_FUNC_UPDATE: + __cmock_k_uptime_get_ExpectAndReturn(v.curr_time_ms); __cmock_pm_policy_event_update_Expect(0, v.event_time_us); __cmock_pm_policy_event_update_IgnoreArg_evt(); break; @@ -90,7 +91,11 @@ void run_test(test_vector_t *p_test_vectors, int num_test_vctr) __cmock_pm_policy_event_unregister_ExpectAnyArgs(); break; case EVENT_FUNC_DELAY_SCHEDULING: - __cmock_mpsl_work_schedule_Expect(0, K_USEC(v.event_time_us)); + __cmock_k_uptime_get_ExpectAndReturn(v.curr_time_ms); + __cmock_K_USEC_ExpectAndReturn( + v.event_time_us, (k_timeout_t){v.event_time_us + 100}); + __cmock_mpsl_work_schedule_Expect( + 0, (k_timeout_t){v.event_time_us + 100}); __cmock_mpsl_work_schedule_IgnoreArg_dwork(); break; case EVENT_FUNC_NONE: @@ -118,7 +123,7 @@ void test_init_only(void) test_vector_t test_vectors[] = { {true, false, {0, MPSL_PM_EVENT_STATE_NO_EVENTS_LEFT, 0}, EVENT_FUNC_NONE, 0, - LATENCY_FUNC_REGISTER, PM_MAX_LATENCY_HCI_COMMANDS_US}, + LATENCY_FUNC_REGISTER, PM_MAX_LATENCY_HCI_COMMANDS_US, 0}, }; run_test(&test_vectors[0], ARRAY_SIZE(test_vectors)); } @@ -129,10 +134,10 @@ void test_no_events(void) /* Init then no events*/ {true, false, {0, MPSL_PM_EVENT_STATE_NO_EVENTS_LEFT, 0}, EVENT_FUNC_NONE, 0, - LATENCY_FUNC_REGISTER, PM_MAX_LATENCY_HCI_COMMANDS_US}, + LATENCY_FUNC_REGISTER, PM_MAX_LATENCY_HCI_COMMANDS_US, 0}, {false, false, {0, MPSL_PM_EVENT_STATE_NO_EVENTS_LEFT, 0}, EVENT_FUNC_NONE, 0, - LATENCY_FUNC_NONE, 0}, + LATENCY_FUNC_NONE, 0, 0}, }; run_test(&test_vectors[0], ARRAY_SIZE(test_vectors)); } @@ -143,11 +148,11 @@ void test_high_prio_changed_params(void) /* Init. */ {true, false, {0, MPSL_PM_EVENT_STATE_NO_EVENTS_LEFT, 0}, EVENT_FUNC_NONE, 0, - LATENCY_FUNC_REGISTER, PM_MAX_LATENCY_HCI_COMMANDS_US}, + LATENCY_FUNC_REGISTER, PM_MAX_LATENCY_HCI_COMMANDS_US, 0}, /* Pretend high prio changed parameters while we read them. */ {false, false, {10000, MPSL_PM_EVENT_STATE_BEFORE_EVENT, 1}, EVENT_FUNC_NONE, 0, - LATENCY_FUNC_NONE, 0}, + LATENCY_FUNC_NONE, 0, 0}, }; run_test(&test_vectors[0], ARRAY_SIZE(test_vectors)); } @@ -158,19 +163,19 @@ void test_latency_request(void) /* Init. */ {true, false, {0, MPSL_PM_EVENT_STATE_NO_EVENTS_LEFT, 0}, EVENT_FUNC_NONE, 0, - LATENCY_FUNC_REGISTER, PM_MAX_LATENCY_HCI_COMMANDS_US}, + LATENCY_FUNC_REGISTER, PM_MAX_LATENCY_HCI_COMMANDS_US, 0}, /* Check low-latency is set. */ {false, true, {0, MPSL_PM_EVENT_STATE_NO_EVENTS_LEFT, 1}, EVENT_FUNC_NONE, 0, - LATENCY_FUNC_NONE, 0}, + LATENCY_FUNC_NONE, 0, 0}, /* Set zero-latency. */ {false, true, {0, MPSL_PM_EVENT_STATE_IN_EVENT, 2}, EVENT_FUNC_NONE, 0, - LATENCY_FUNC_UPDATE, 0}, + LATENCY_FUNC_UPDATE, 0, 0}, /* Set low-latency. */ {false, true, {0, MPSL_PM_EVENT_STATE_NO_EVENTS_LEFT, 3}, EVENT_FUNC_NONE, 0, - LATENCY_FUNC_UPDATE, PM_MAX_LATENCY_HCI_COMMANDS_US}, + LATENCY_FUNC_UPDATE, PM_MAX_LATENCY_HCI_COMMANDS_US, 0}, }; run_test(&test_vectors[0], ARRAY_SIZE(test_vectors)); } @@ -181,15 +186,15 @@ void test_register_and_derigster_event(void) /* Init. */ {true, false, {0, MPSL_PM_EVENT_STATE_NO_EVENTS_LEFT, 0}, EVENT_FUNC_NONE, 0, - LATENCY_FUNC_REGISTER, PM_MAX_LATENCY_HCI_COMMANDS_US}, + LATENCY_FUNC_REGISTER, PM_MAX_LATENCY_HCI_COMMANDS_US, 0}, /* Register event. */ {false, true, {10000, MPSL_PM_EVENT_STATE_BEFORE_EVENT, 1}, EVENT_FUNC_REGISTER, 10000, - LATENCY_FUNC_NONE, 0}, + LATENCY_FUNC_NONE, 0, 0}, /* Deregister event. */ {false, true, {0, MPSL_PM_EVENT_STATE_NO_EVENTS_LEFT, 2}, EVENT_FUNC_UNREGISTER, 0, - LATENCY_FUNC_NONE, 0}, + LATENCY_FUNC_NONE, 0, 0}, }; run_test(&test_vectors[0], ARRAY_SIZE(test_vectors)); } @@ -200,19 +205,19 @@ void test_register_enter_and_derigster_event(void) /* Init. */ {true, false, {0, MPSL_PM_EVENT_STATE_NO_EVENTS_LEFT, 0}, EVENT_FUNC_NONE, 0, - LATENCY_FUNC_REGISTER, PM_MAX_LATENCY_HCI_COMMANDS_US}, + LATENCY_FUNC_REGISTER, PM_MAX_LATENCY_HCI_COMMANDS_US, 0}, /* Register event. */ {false, true, {10000, MPSL_PM_EVENT_STATE_BEFORE_EVENT, 1}, EVENT_FUNC_REGISTER, 10000, - LATENCY_FUNC_NONE, 0}, + LATENCY_FUNC_NONE, 0, 0}, /* Pretend to be in event */ {false, true, {0, MPSL_PM_EVENT_STATE_IN_EVENT, 2}, EVENT_FUNC_NONE, 0, - LATENCY_FUNC_UPDATE, 0}, + LATENCY_FUNC_UPDATE, 0, 0}, /* Deregister event. */ {false, true, {0, MPSL_PM_EVENT_STATE_NO_EVENTS_LEFT, 3}, EVENT_FUNC_UNREGISTER, 0, - LATENCY_FUNC_UPDATE, PM_MAX_LATENCY_HCI_COMMANDS_US}, + LATENCY_FUNC_UPDATE, PM_MAX_LATENCY_HCI_COMMANDS_US, 0}, }; run_test(&test_vectors[0], ARRAY_SIZE(test_vectors)); } @@ -223,23 +228,23 @@ void test_register_update_enter_and_deregister_event(void) /* Init. */ {true, false, {0, MPSL_PM_EVENT_STATE_NO_EVENTS_LEFT, 0}, EVENT_FUNC_NONE, 0, - LATENCY_FUNC_REGISTER, PM_MAX_LATENCY_HCI_COMMANDS_US}, + LATENCY_FUNC_REGISTER, PM_MAX_LATENCY_HCI_COMMANDS_US, 0}, /* Register event. */ {false, true, {10000, MPSL_PM_EVENT_STATE_BEFORE_EVENT, 1}, EVENT_FUNC_REGISTER, 10000, - LATENCY_FUNC_NONE, 0}, + LATENCY_FUNC_NONE, 0, 0}, /* Update event. */ {false, true, {15000, MPSL_PM_EVENT_STATE_BEFORE_EVENT, 2}, EVENT_FUNC_UPDATE, 15000, - LATENCY_FUNC_NONE, 0}, + LATENCY_FUNC_NONE, 0, 0}, /* Pretend to be in event */ {false, true, {0, MPSL_PM_EVENT_STATE_IN_EVENT, 3}, EVENT_FUNC_NONE, 0, - LATENCY_FUNC_UPDATE, 0}, + LATENCY_FUNC_UPDATE, 0, 0}, /* Deregister event. */ {false, true, {0, MPSL_PM_EVENT_STATE_NO_EVENTS_LEFT, 4}, EVENT_FUNC_UNREGISTER, 0, - LATENCY_FUNC_UPDATE, PM_MAX_LATENCY_HCI_COMMANDS_US}, + LATENCY_FUNC_UPDATE, PM_MAX_LATENCY_HCI_COMMANDS_US, 0}, }; run_test(&test_vectors[0], ARRAY_SIZE(test_vectors)); } @@ -250,54 +255,52 @@ void test_register_enter_and_update_event(void) /* Init. */ {true, false, {0, MPSL_PM_EVENT_STATE_NO_EVENTS_LEFT, 0}, EVENT_FUNC_NONE, 0, - LATENCY_FUNC_REGISTER, PM_MAX_LATENCY_HCI_COMMANDS_US}, + LATENCY_FUNC_REGISTER, PM_MAX_LATENCY_HCI_COMMANDS_US, 0}, /* Register event. */ {false, true, {10000, MPSL_PM_EVENT_STATE_BEFORE_EVENT, 1}, EVENT_FUNC_REGISTER, 10000, - LATENCY_FUNC_NONE, 0}, + LATENCY_FUNC_NONE, 0, 0}, /* Pretend to be in event */ {false, true, {0, MPSL_PM_EVENT_STATE_IN_EVENT, 2}, EVENT_FUNC_NONE, 0, - LATENCY_FUNC_UPDATE, 0}, + LATENCY_FUNC_UPDATE, 0, 0}, /* Update event (before we get the state no events left). */ {false, true, {15000, MPSL_PM_EVENT_STATE_BEFORE_EVENT, 3}, EVENT_FUNC_UPDATE, 15000, - LATENCY_FUNC_UPDATE, PM_MAX_LATENCY_HCI_COMMANDS_US}, + LATENCY_FUNC_UPDATE, PM_MAX_LATENCY_HCI_COMMANDS_US, 0}, }; run_test(&test_vectors[0], ARRAY_SIZE(test_vectors)); } void test_event_delayed_work(void) { - uint64_t retry_evt_time = (uint64_t)UINT32_MAX + (uint64_t)UINT32_MAX + 5000; + uint64_t event_time_us = (uint64_t)UINT32_MAX + 50000; + /* Make sure time until event will be more than UINT32_MAX cycles away. */ + TEST_ASSERT_GREATER_THAN_INT64(UINT32_MAX, k_us_to_cyc_floor64(event_time_us)); + test_vector_t test_vectors[] = { /* Init. */ {true, false, {0, MPSL_PM_EVENT_STATE_NO_EVENTS_LEFT, 0}, EVENT_FUNC_NONE, 0, LATENCY_FUNC_REGISTER, PM_MAX_LATENCY_HCI_COMMANDS_US}, - /* Pretend we call workqueue delayed. */ - {false, true, {retry_evt_time, MPSL_PM_EVENT_STATE_BEFORE_EVENT, 1}, - EVENT_FUNC_DELAY_SCHEDULING, RETRY_TIME_MAX_US, - LATENCY_FUNC_NONE, 0}, - /* Pretend we call workqueue delayed. */ - {false, true, {retry_evt_time - RETRY_TIME_MAX_US, - MPSL_PM_EVENT_STATE_BEFORE_EVENT, 2}, - EVENT_FUNC_DELAY_SCHEDULING, RETRY_TIME_MAX_US, - LATENCY_FUNC_NONE, 0}, - /* Register event. */ - {false, true, {retry_evt_time - RETRY_TIME_MAX_US - RETRY_TIME_MAX_US, - MPSL_PM_EVENT_STATE_BEFORE_EVENT, 3}, - EVENT_FUNC_REGISTER, retry_evt_time - RETRY_TIME_MAX_US - - RETRY_TIME_MAX_US, - LATENCY_FUNC_NONE, 0}, + /* Event time after 32 bit cycles have wrapped, so schedule retry. */ + {false, true, {event_time_us, MPSL_PM_EVENT_STATE_BEFORE_EVENT, 1}, + EVENT_FUNC_DELAY_SCHEDULING, event_time_us - 1000, + LATENCY_FUNC_NONE, 0, 0}, + /* Time has progressed until cycles will no longer wrap, + * so register latency normally. + */ + {false, true, {event_time_us, MPSL_PM_EVENT_STATE_BEFORE_EVENT, 2}, + EVENT_FUNC_REGISTER, event_time_us, + LATENCY_FUNC_NONE, 0, 100}, /* Pretend to be in event */ - {false, true, {0, MPSL_PM_EVENT_STATE_IN_EVENT, 4}, + {false, true, {0, MPSL_PM_EVENT_STATE_IN_EVENT, 3}, EVENT_FUNC_NONE, 0, - LATENCY_FUNC_UPDATE, 0}, + LATENCY_FUNC_UPDATE, 0, 0}, /* Deregister event. */ - {false, true, {0, MPSL_PM_EVENT_STATE_NO_EVENTS_LEFT, 5}, + {false, true, {0, MPSL_PM_EVENT_STATE_NO_EVENTS_LEFT, 4}, EVENT_FUNC_UNREGISTER, 0, - LATENCY_FUNC_UPDATE, PM_MAX_LATENCY_HCI_COMMANDS_US}, + LATENCY_FUNC_UPDATE, PM_MAX_LATENCY_HCI_COMMANDS_US, 0}, }; run_test(&test_vectors[0], ARRAY_SIZE(test_vectors)); } diff --git a/tests/subsys/nrf_compress/decompression/mcuboot_update/CMakeLists.txt b/tests/subsys/nrf_compress/decompression/mcuboot_update/CMakeLists.txt new file mode 100644 index 000000000000..5f04e0534b8b --- /dev/null +++ b/tests/subsys/nrf_compress/decompression/mcuboot_update/CMakeLists.txt @@ -0,0 +1,14 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +cmake_minimum_required(VERSION 3.20.0) + +find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) +project(mcuboot_update) + +target_sources(app PRIVATE src/main.c) + +zephyr_link_libraries(MCUBOOT_BOOTUTIL) diff --git a/tests/subsys/nrf_compress/decompression/mcuboot_update/Kconfig b/tests/subsys/nrf_compress/decompression/mcuboot_update/Kconfig new file mode 100644 index 000000000000..96903f993de4 --- /dev/null +++ b/tests/subsys/nrf_compress/decompression/mcuboot_update/Kconfig @@ -0,0 +1,14 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +config UPDATE_SLOT_NUMBER + int "Image update number" + range 0 3 + default 0 + help + Should be set to the image containing the firmware to mark for upgrade + +source "Kconfig.zephyr" diff --git a/tests/subsys/nrf_compress/decompression/mcuboot_update/app.overlay b/tests/subsys/nrf_compress/decompression/mcuboot_update/app.overlay new file mode 100644 index 000000000000..fcc2e240fd9e --- /dev/null +++ b/tests/subsys/nrf_compress/decompression/mcuboot_update/app.overlay @@ -0,0 +1,5 @@ +/ { + chosen { + nordic,pm-ext-flash = &mx25r64; + }; +}; diff --git a/tests/subsys/nrf_compress/decompression/mcuboot_update/compressed_app/CMakeLists.txt b/tests/subsys/nrf_compress/decompression/mcuboot_update/compressed_app/CMakeLists.txt new file mode 100644 index 000000000000..815648839be3 --- /dev/null +++ b/tests/subsys/nrf_compress/decompression/mcuboot_update/compressed_app/CMakeLists.txt @@ -0,0 +1,12 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +cmake_minimum_required(VERSION 3.20.0) + +find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) +project(smp_svr) + +target_sources(app PRIVATE src/main.c) diff --git a/tests/subsys/nrf_compress/decompression/mcuboot_update/compressed_app/prj.conf b/tests/subsys/nrf_compress/decompression/mcuboot_update/compressed_app/prj.conf new file mode 100644 index 000000000000..66a29df8fe48 --- /dev/null +++ b/tests/subsys/nrf_compress/decompression/mcuboot_update/compressed_app/prj.conf @@ -0,0 +1,7 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_LOG=y diff --git a/tests/subsys/nrf_compress/decompression/mcuboot_update/compressed_app/src/main.c b/tests/subsys/nrf_compress/decompression/mcuboot_update/compressed_app/src/main.c new file mode 100644 index 000000000000..3f1e858a0f50 --- /dev/null +++ b/tests/subsys/nrf_compress/decompression/mcuboot_update/compressed_app/src/main.c @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include + +LOG_MODULE_REGISTER(compressed_app, LOG_LEVEL_DBG); + +int main(void) +{ + LOG_INF("Compressed image running"); + + return 0; +} diff --git a/tests/subsys/nrf_compress/decompression/mcuboot_update/modified_signing.cmake b/tests/subsys/nrf_compress/decompression/mcuboot_update/modified_signing.cmake new file mode 100644 index 000000000000..5360a5baad19 --- /dev/null +++ b/tests/subsys/nrf_compress/decompression/mcuboot_update/modified_signing.cmake @@ -0,0 +1,17 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +set(CONFIG_MCUBOOT_COMPRESSED_IMAGE_SUPPORT_ENABLED y) +set(ncs_compress_test_compress_hex y) +include(${ZEPHYR_NRF_MODULE_DIR}/cmake/sysbuild/image_signing.cmake) +set(output ${ZEPHYR_BINARY_DIR}/${KERNEL_NAME}.moved.signed.hex) +set(BYPRODUCT_KERNEL_SIGNED_HEX_NAME "${output}" + CACHE FILEPATH "Signed kernel hex file" FORCE + ) +set_property(GLOBAL APPEND PROPERTY extra_post_build_commands COMMAND + ${CMAKE_OBJCOPY} -I ihex -O ihex --change-addresses 0x92000 + ${ZEPHYR_BINARY_DIR}/${KERNEL_NAME}.signed.hex ${output}) +set_property(GLOBAL APPEND PROPERTY extra_post_build_byproducts ${output}) diff --git a/tests/subsys/nrf_compress/decompression/mcuboot_update/pm_static_nrf52840dk_nrf52840.yml b/tests/subsys/nrf_compress/decompression/mcuboot_update/pm_static_nrf52840dk_nrf52840.yml new file mode 100644 index 000000000000..4ed838ca157c --- /dev/null +++ b/tests/subsys/nrf_compress/decompression/mcuboot_update/pm_static_nrf52840dk_nrf52840.yml @@ -0,0 +1,60 @@ +app: + address: 0x10200 + end_address: 0xa2000 + region: flash_primary + size: 0x91e00 +EMPTY_1: + address: 0x0 + end_address: 0x10200 + device: MX25R64 + region: external_flash + size: 0x10200 +compressed_app: + address: 0x10200 + end_address: 0xa2000 + device: MX25R64 + region: external_flash + size: 0x91e00 +EMPTY_2: + address: 0xa2000 + end_address: 0x800000 + device: MX25R64 + region: external_flash + size: 0x75e000 +mcuboot: + address: 0x0 + end_address: 0x10000 + region: flash_primary + size: 0x10000 +mcuboot_pad: + address: 0x10000 + end_address: 0x10200 + region: flash_primary + size: 0x200 +mcuboot_primary: + address: 0x10000 + end_address: 0xa2000 + orig_span: &id001 + - mcuboot_pad + - app + region: flash_primary + size: 0x92000 + span: *id001 +mcuboot_primary_app: + address: 0x10200 + end_address: 0xa2000 + orig_span: &id002 + - app + region: flash_primary + size: 0x91e00 + span: *id002 +mcuboot_secondary: + address: 0xa2000 + end_address: 0xf0000 + region: flash_primary + size: 0x4e000 +settings_storage: + address: 0xf0000 + end_address: 0x100000 + region: flash_primary + size: 0x10000 diff --git a/tests/subsys/nrf_compress/decompression/mcuboot_update/pm_static_nrf5340dk_nrf5340_cpuapp.yml b/tests/subsys/nrf_compress/decompression/mcuboot_update/pm_static_nrf5340dk_nrf5340_cpuapp.yml new file mode 100644 index 000000000000..6e8197cc8abd --- /dev/null +++ b/tests/subsys/nrf_compress/decompression/mcuboot_update/pm_static_nrf5340dk_nrf5340_cpuapp.yml @@ -0,0 +1,78 @@ +app: + address: 0x10200 + end_address: 0xa2000 + region: flash_primary + size: 0x91e00 +EMPTY_1: + address: 0x0 + end_address: 0x10200 + device: MX25R64 + region: external_flash + size: 0x10200 +compressed_app: + address: 0x10200 + end_address: 0xa2000 + device: MX25R64 + region: external_flash + size: 0x91e00 +EMPTY_2: + address: 0xa2000 + end_address: 0x800000 + device: MX25R64 + region: external_flash + size: 0x75e000 +mcuboot: + address: 0x0 + end_address: 0x10000 + region: flash_primary + size: 0x10000 +mcuboot_pad: + address: 0x10000 + end_address: 0x10200 + region: flash_primary + size: 0x200 +mcuboot_primary: + address: 0x10000 + end_address: 0xa2000 + orig_span: &id001 + - mcuboot_pad + - app + region: flash_primary + size: 0x92000 + span: *id001 +mcuboot_primary_app: + address: 0x10200 + end_address: 0xa2000 + orig_span: &id002 + - app + region: flash_primary + size: 0x91e00 + span: *id002 +mcuboot_secondary: + address: 0xa2000 + end_address: 0xf0000 + region: flash_primary + size: 0x4e000 +otp: + address: 0xff8100 + end_address: 0xff83fc + region: otp + size: 0x2fc +rpmsg_nrf53_sram: + address: 0x20070000 + end_address: 0x20080000 + placement: + before: + - end + region: sram_primary + size: 0x10000 +settings_storage: + address: 0xf0000 + end_address: 0x100000 + region: flash_primary + size: 0x10000 +sram_primary: + address: 0x20000000 + end_address: 0x20070000 + region: sram_primary + size: 0x70000 diff --git a/tests/subsys/nrf_compress/decompression/mcuboot_update/pm_static_nrf54l15dk_nrf54l15_cpuapp.yml b/tests/subsys/nrf_compress/decompression/mcuboot_update/pm_static_nrf54l15dk_nrf54l15_cpuapp.yml new file mode 100644 index 000000000000..29091d59e17f --- /dev/null +++ b/tests/subsys/nrf_compress/decompression/mcuboot_update/pm_static_nrf54l15dk_nrf54l15_cpuapp.yml @@ -0,0 +1,65 @@ +app: + address: 0x10800 + end_address: 0xa2000 + region: flash_primary + size: 0x91800 +EMPTY_1: + address: 0x0 + end_address: 0x10800 + device: MX25R64 + region: external_flash + size: 0x10800 +compressed_app: + address: 0x10800 + end_address: 0xa2000 + device: MX25R64 + region: external_flash + size: 0x91800 +EMPTY_2: + address: 0xa2000 + end_address: 0x800000 + device: MX25R64 + region: external_flash + size: 0x75e000 +EMPTY_3: + address: 0x100000 + end_address: 0x165000 + region: flash_primary + size: 0x65000 +mcuboot: + address: 0x0 + end_address: 0x10000 + region: flash_primary + size: 0x10000 +mcuboot_pad: + address: 0x10000 + end_address: 0x10800 + region: flash_primary + size: 0x800 +mcuboot_primary: + address: 0x10000 + end_address: 0xa2000 + orig_span: &id001 + - mcuboot_pad + - app + region: flash_primary + size: 0x92000 + span: *id001 +mcuboot_primary_app: + address: 0x10800 + end_address: 0xa2000 + orig_span: &id002 + - app + region: flash_primary + size: 0x91800 + span: *id002 +mcuboot_secondary: + address: 0xa2000 + end_address: 0xf0000 + region: flash_primary + size: 0x4e000 +settings_storage: + address: 0xf0000 + end_address: 0x100000 + region: flash_primary + size: 0x10000 diff --git a/tests/subsys/nrf_compress/decompression/mcuboot_update/prj.conf b/tests/subsys/nrf_compress/decompression/mcuboot_update/prj.conf new file mode 100644 index 000000000000..8205e1bb6fd5 --- /dev/null +++ b/tests/subsys/nrf_compress/decompression/mcuboot_update/prj.conf @@ -0,0 +1,22 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# Enable MCUmgr and dependencies. +CONFIG_STREAM_FLASH=y +CONFIG_FLASH_MAP=y + +# Enable flash operations. +CONFIG_FLASH=y + +# Enable most core commands. +CONFIG_FLASH=y +CONFIG_IMG_MANAGER=y + +# Enable logging +CONFIG_LOG=y +CONFIG_MCUBOOT_UTIL_LOG_LEVEL_WRN=y + +CONFIG_REBOOT=y diff --git a/tests/subsys/nrf_compress/decompression/mcuboot_update/src/main.c b/tests/subsys/nrf_compress/decompression/mcuboot_update/src/main.c new file mode 100644 index 000000000000..ef0a992d1e2a --- /dev/null +++ b/tests/subsys/nrf_compress/decompression/mcuboot_update/src/main.c @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include +#include +#include +#include + +#include + +LOG_MODULE_REGISTER(mcuboot_update, LOG_LEVEL_DBG); + +#define UPDATE_SLOT_NUMBER CONFIG_UPDATE_SLOT_NUMBER + +#if CONFIG_UPDATE_SLOT_NUMBER == 0 +#define UPDATE_SLOT_ID PM_MCUBOOT_SECONDARY_ID +#else +#define UPDATE_SLOT_ID PM_MCUBOOT_SECONDARY_ ## CONFIG_UPDATE_SLOT_NUMBER ## _ID +#endif + +int main(void) +{ + int rc; + struct image_header header; + const struct flash_area *fa; + + rc = flash_area_open(UPDATE_SLOT_ID, &fa); + + if (rc) { + LOG_ERR("Flash area open failed"); + + return 0; + } + + rc = flash_area_read(fa, 0, &header, sizeof(header)); + + flash_area_close(fa); + + if (rc) { + LOG_ERR("Flash area read failed"); + + return 0; + } + + header.ih_magic = sys_le32_to_cpu(header.ih_magic); + header.ih_hdr_size = sys_le16_to_cpu(header.ih_hdr_size); + header.ih_flags = sys_le32_to_cpu(header.ih_flags); + + if (header.ih_magic != IMAGE_MAGIC) { + LOG_ERR("Invalid header"); + + return 0; + } + + if ((header.ih_flags & IMAGE_F_COMPRESSED_LZMA2) == 0) { + LOG_ERR("Invalid image flags"); + + return 0; + } + + rc = boot_request_upgrade_multi(UPDATE_SLOT_NUMBER, true); + + if (rc) { + LOG_ERR("Update of image %d failed: %d", UPDATE_SLOT_NUMBER, rc); + k_sleep(K_SECONDS(1)); + + return 0; + } + + sys_reboot(SYS_REBOOT_COLD); + + return 0; +} diff --git a/tests/subsys/nrf_compress/decompression/mcuboot_update/sysbuild.cmake b/tests/subsys/nrf_compress/decompression/mcuboot_update/sysbuild.cmake new file mode 100644 index 000000000000..8f5c5427a8a8 --- /dev/null +++ b/tests/subsys/nrf_compress/decompression/mcuboot_update/sysbuild.cmake @@ -0,0 +1,18 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +ExternalZephyrProject_Add( + APPLICATION compressed_app + SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/compressed_app +) + +set_config_bool(compressed_app CONFIG_BOOTLOADER_MCUBOOT "${SB_CONFIG_BOOTLOADER_MCUBOOT}") +set_config_string(compressed_app CONFIG_MCUBOOT_SIGNATURE_KEY_FILE + "${SB_CONFIG_BOOT_SIGNATURE_KEY_FILE}" +) +set_config_bool(compressed_app CONFIG_MCUBOOT_BOOTLOADER_MODE_OVERWRITE_ONLY y) +set(compressed_app_SIGNING_SCRIPT "${CMAKE_CURRENT_LIST_DIR}/modified_signing.cmake" CACHE INTERNAL "MCUboot signing script" FORCE) +set_config_bool(compressed_app CONFIG_MCUBOOT_COMPRESSED_IMAGE_SUPPORT_ENABLED y) diff --git a/tests/subsys/nrf_compress/decompression/mcuboot_update/sysbuild.conf b/tests/subsys/nrf_compress/decompression/mcuboot_update/sysbuild.conf new file mode 100644 index 000000000000..e2cb5bfe879d --- /dev/null +++ b/tests/subsys/nrf_compress/decompression/mcuboot_update/sysbuild.conf @@ -0,0 +1,11 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +SB_CONFIG_BOOTLOADER_MCUBOOT=y +SB_CONFIG_MCUBOOT_MODE_OVERWRITE_ONLY=y +SB_CONFIG_MCUBOOT_UPDATEABLE_IMAGES=1 +SB_CONFIG_MCUBOOT_COMPRESSED_IMAGE_SUPPORT=y +SB_CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY=y diff --git a/tests/subsys/nrf_compress/decompression/mcuboot_update/sysbuild/mcuboot/app.overlay b/tests/subsys/nrf_compress/decompression/mcuboot_update/sysbuild/mcuboot/app.overlay new file mode 100644 index 000000000000..a9c88d6227f3 --- /dev/null +++ b/tests/subsys/nrf_compress/decompression/mcuboot_update/sysbuild/mcuboot/app.overlay @@ -0,0 +1,6 @@ +/ { + chosen { + zephyr,code-partition = &boot_partition; + nordic,pm-ext-flash = &mx25r64; + }; +}; diff --git a/tests/subsys/nrf_compress/decompression/mcuboot_update/sysbuild/mcuboot/boards/nrf52840dk_nrf52840.conf b/tests/subsys/nrf_compress/decompression/mcuboot_update/sysbuild/mcuboot/boards/nrf52840dk_nrf52840.conf new file mode 100644 index 000000000000..7b9508f1d6f9 --- /dev/null +++ b/tests/subsys/nrf_compress/decompression/mcuboot_update/sysbuild/mcuboot/boards/nrf52840dk_nrf52840.conf @@ -0,0 +1,8 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# Ensure that the qspi driver is enabled by default +CONFIG_NORDIC_QSPI_NOR=y diff --git a/tests/subsys/nrf_compress/decompression/mcuboot_update/sysbuild/mcuboot/boards/nrf54l15dk_nrf54l15_cpuapp.conf b/tests/subsys/nrf_compress/decompression/mcuboot_update/sysbuild/mcuboot/boards/nrf54l15dk_nrf54l15_cpuapp.conf new file mode 100644 index 000000000000..ef36c45d402c --- /dev/null +++ b/tests/subsys/nrf_compress/decompression/mcuboot_update/sysbuild/mcuboot/boards/nrf54l15dk_nrf54l15_cpuapp.conf @@ -0,0 +1,13 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# Ensure that the SPI NOR driver is enabled by default +CONFIG_SPI_NOR=n + +# TODO: below are not yet supported and need fixing +CONFIG_FPROTECT=n + +CONFIG_BOOT_WATCHDOG_FEED=n diff --git a/tests/subsys/nrf_compress/decompression/mcuboot_update/sysbuild/mcuboot/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/tests/subsys/nrf_compress/decompression/mcuboot_update/sysbuild/mcuboot/boards/nrf54l15dk_nrf54l15_cpuapp.overlay new file mode 100644 index 000000000000..f19ab2ad78e0 --- /dev/null +++ b/tests/subsys/nrf_compress/decompression/mcuboot_update/sysbuild/mcuboot/boards/nrf54l15dk_nrf54l15_cpuapp.overlay @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/ { + chosen { + nordic,pm-ext-flash = &mx25r64; + zephyr,code-partition = &boot_partition; + }; +}; + +// restore full SRAM space - by default some parts are dedicated to FLRP +&cpuapp_sram { + reg = <0x20000000 DT_SIZE_K(256)>; + ranges = <0x0 0x20000000 0x40000>; +}; diff --git a/tests/subsys/nrf_compress/decompression/mcuboot_update/sysbuild/mcuboot/prj.conf b/tests/subsys/nrf_compress/decompression/mcuboot_update/sysbuild/mcuboot/prj.conf new file mode 100644 index 000000000000..b6cb428120d0 --- /dev/null +++ b/tests/subsys/nrf_compress/decompression/mcuboot_update/sysbuild/mcuboot/prj.conf @@ -0,0 +1,44 @@ +CONFIG_PM=n + +CONFIG_MAIN_STACK_SIZE=10240 +CONFIG_MBEDTLS_CFG_FILE="mcuboot-mbedtls-cfg.h" + +CONFIG_BOOT_SWAP_SAVE_ENCTLV=n +CONFIG_BOOT_ENCRYPT_IMAGE=n + +CONFIG_BOOT_UPGRADE_ONLY=n +CONFIG_BOOT_BOOTSTRAP=n + +### mbedTLS has its own heap +# CONFIG_HEAP_MEM_POOL_SIZE is not set + +### We never want Zephyr's copy of tinycrypt. If tinycrypt is needed, +### MCUboot has its own copy in tree. +# CONFIG_TINYCRYPT is not set +# CONFIG_TINYCRYPT_ECC_DSA is not set +# CONFIG_TINYCRYPT_SHA256 is not set + +CONFIG_FLASH=y +CONFIG_FPROTECT=y + +### Various Zephyr boards enable features that we don't want. +# CONFIG_BT is not set +# CONFIG_BT_CTLR is not set +# CONFIG_I2C is not set + +CONFIG_LOG=y +CONFIG_LOG_MODE_MINIMAL=y # former CONFIG_MODE_MINIMAL +### Ensure Zephyr logging changes don't use more resources +CONFIG_LOG_DEFAULT_LEVEL=0 +### Use info log level by default +CONFIG_MCUBOOT_LOG_LEVEL_INF=y +### Decrease footprint by ~4 KB in comparison to CBPRINTF_COMPLETE=y +CONFIG_CBPRINTF_NANO=y +### Use the minimal C library to reduce flash usage +CONFIG_MINIMAL_LIBC=y +CONFIG_NRF_RTC_TIMER_USER_CHAN_COUNT=0 + +# NCS boot banner +CONFIG_NCS_APPLICATION_BOOT_BANNER_STRING="MCUboot" +CONFIG_BOOT_MAX_IMG_SECTORS=512 +CONFIG_MULTITHREADING=y diff --git a/tests/subsys/nrf_compress/decompression/mcuboot_update/testcase.yaml b/tests/subsys/nrf_compress/decompression/mcuboot_update/testcase.yaml new file mode 100644 index 000000000000..4f189bb7335d --- /dev/null +++ b/tests/subsys/nrf_compress/decompression/mcuboot_update/testcase.yaml @@ -0,0 +1,31 @@ +common: + sysbuild: true + tags: sysbuild +tests: + nrf_compress.decompression.mcuboot_update: + platform_allow: + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf54l15dk/nrf54l15/cpuapp + integration_platforms: + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf54l15dk/nrf54l15/cpuapp + harness: console + harness_config: + type: multi_line + ordered: true + regex: + - "Starting bootloader" + - "Image index: 0, Swap type: none" + - "Bootloader chainload address offset:" + - "Jumping to the first image slot" + - "Starting bootloader" + - "Image index: 0, Swap type: perm" + - "Image 0 upgrade secondary slot -> primary slot" + - "Erasing the primary slot" + - "Image 0 copying the secondary slot to the primary slot" + - "Bootloader chainload address offset:" + - "Jumping to the first image slot" + - "Booting nRF Connect SDK" + - "Compressed image running" diff --git a/tests/subsys/suit/check_image_match/boards/native_posix.conf b/tests/subsys/suit/check_image_match/boards/native_posix.conf new file mode 100644 index 000000000000..70a0fa912cb2 --- /dev/null +++ b/tests/subsys/suit/check_image_match/boards/native_posix.conf @@ -0,0 +1,8 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_FLASH_SIMULATOR=y +CONFIG_FLASH_SIMULATOR_DOUBLE_WRITES=y diff --git a/tests/subsys/suit/check_image_match/boards/native_posix.overlay b/tests/subsys/suit/check_image_match/boards/native_posix.overlay new file mode 100644 index 000000000000..eb746aed69d2 --- /dev/null +++ b/tests/subsys/suit/check_image_match/boards/native_posix.overlay @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +&flash0 { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + /* Use the last 40KB of NVM as suit storage. */ + suit_storage: partition@f6000 { + reg = <0xf6000 DT_SIZE_K(40)>; + }; + }; +}; + +/ { + sram0: memory@20000000 { + compatible = "mmio-sram"; + reg = <0x20000000 DT_SIZE_K(256)>; + }; +}; diff --git a/tests/subsys/suit/check_image_match/boards/native_posix_64.conf b/tests/subsys/suit/check_image_match/boards/native_posix_64.conf new file mode 100644 index 000000000000..70a0fa912cb2 --- /dev/null +++ b/tests/subsys/suit/check_image_match/boards/native_posix_64.conf @@ -0,0 +1,8 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_FLASH_SIMULATOR=y +CONFIG_FLASH_SIMULATOR_DOUBLE_WRITES=y diff --git a/tests/subsys/suit/check_image_match/boards/native_posix_64.overlay b/tests/subsys/suit/check_image_match/boards/native_posix_64.overlay new file mode 100644 index 000000000000..eb746aed69d2 --- /dev/null +++ b/tests/subsys/suit/check_image_match/boards/native_posix_64.overlay @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +&flash0 { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + /* Use the last 40KB of NVM as suit storage. */ + suit_storage: partition@f6000 { + reg = <0xf6000 DT_SIZE_K(40)>; + }; + }; +}; + +/ { + sram0: memory@20000000 { + compatible = "mmio-sram"; + reg = <0x20000000 DT_SIZE_K(256)>; + }; +}; diff --git a/tests/subsys/suit/check_image_match/boards/nrf52840dk_nrf52840.overlay b/tests/subsys/suit/check_image_match/boards/nrf52840dk_nrf52840.overlay new file mode 100644 index 000000000000..78def845a473 --- /dev/null +++ b/tests/subsys/suit/check_image_match/boards/nrf52840dk_nrf52840.overlay @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +&flash0 { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + /* Use the last 40KB of NVM as suit storage. */ + suit_storage: partition@f6000 { + reg = <0xf6000 DT_SIZE_K(40)>; + }; + }; +}; diff --git a/tests/subsys/suit/check_image_match/prj.conf b/tests/subsys/suit/check_image_match/prj.conf index f38ed5f7964c..edc43bef5cb1 100644 --- a/tests/subsys/suit/check_image_match/prj.conf +++ b/tests/subsys/suit/check_image_match/prj.conf @@ -5,6 +5,7 @@ # CONFIG_ZTEST=y +CONFIG_FLASH=y CONFIG_SUIT=y CONFIG_SUIT_PROCESSOR=y @@ -32,6 +33,7 @@ CONFIG_SUIT_LOG_LEVEL_DBG=y CONFIG_SUIT_PLAT_CHECK_COMPONENT_COMPATIBILITY=y CONFIG_SUIT_AUTHENTICATE=y +CONFIG_SUIT_STORAGE=y CONFIG_SUIT_MCI=y CONFIG_SUIT_METADATA=y CONFIG_SUIT_EXECUTION_MODE=y diff --git a/tests/subsys/suit/common/mci_test/mci_test.c b/tests/subsys/suit/common/mci_test/mci_test.c index 3c60f504c1f5..bb0fb1c9fd26 100644 --- a/tests/subsys/suit/common/mci_test/mci_test.c +++ b/tests/subsys/suit/common/mci_test/mci_test.c @@ -233,17 +233,20 @@ int suit_mci_signing_key_id_validate(const suit_manifest_class_id_t *class_id, u return SUIT_PLAT_ERR_INVAL; } - if (key_id == 0) - { - return SUIT_PLAT_SUCCESS; - } - const manifest_config_t *manifest_config = find_manifest_config(class_id); if (NULL == manifest_config) { return MCI_ERR_MANIFESTCLASSID; } +#ifdef CONFIG_ZTEST +#if defined(CONFIG_MBEDTLS) || defined(CONFIG_NRF_SECURITY) + if (PSA_KEY_ID_VENDOR_MIN == key_id) { + return SUIT_PLAT_SUCCESS; + } +#endif /* CONFIG_MBEDTLS || CONFIG_NRF_SECURITY*/ +#endif /* CONFIG_ZTEST */ + if ((manifest_config->signing_key_bits & manifest_config->signing_key_mask) != (key_id & manifest_config->signing_key_mask)) { return MCI_ERR_WRONGKEYID; @@ -252,6 +255,29 @@ int suit_mci_signing_key_id_validate(const suit_manifest_class_id_t *class_id, u return SUIT_PLAT_SUCCESS; } +#ifdef CONFIG_ZTEST +int suit_mci_signing_key_id_get(const suit_manifest_class_id_t *class_id, uint32_t *key_id) +{ + if ((NULL == class_id) || (NULL == key_id)) { + return SUIT_PLAT_ERR_INVAL; + } + + const manifest_config_t *manifest_config = find_manifest_config(class_id); + + if (NULL == manifest_config) { + return MCI_ERR_MANIFESTCLASSID; + } + +#if defined(CONFIG_MBEDTLS) || defined(CONFIG_NRF_SECURITY) + if (PSA_KEY_ID_VENDOR_MIN == *key_id) { + *key_id = manifest_config->signing_key_bits; + } +#endif /* CONFIG_MBEDTLS || CONFIG_NRF_SECURITY*/ + + return SUIT_PLAT_SUCCESS; +} +#endif /* CONFIG_ZTEST */ + int suit_mci_processor_start_rights_validate(const suit_manifest_class_id_t *class_id, int processor_id) { diff --git a/tests/subsys/suit/envelope_decoder/prj.conf b/tests/subsys/suit/envelope_decoder/prj.conf index d5916a09f8b7..0dcdd865c9c0 100644 --- a/tests/subsys/suit/envelope_decoder/prj.conf +++ b/tests/subsys/suit/envelope_decoder/prj.conf @@ -38,6 +38,8 @@ CONFIG_SUIT_STREAM_SOURCE_CACHE=y CONFIG_SUIT_UTILS=y CONFIG_SUIT_MEMPTR_STORAGE=y +CONFIG_PSA_WANT_ALG_ECDSA=y + CONFIG_ZCBOR=y CONFIG_ZCBOR_CANONICAL=y diff --git a/tests/subsys/suit/fetch_integrated_payload_flash/prj.conf b/tests/subsys/suit/fetch_integrated_payload_flash/prj.conf index 6075a5bd01ae..280228b0faa9 100644 --- a/tests/subsys/suit/fetch_integrated_payload_flash/prj.conf +++ b/tests/subsys/suit/fetch_integrated_payload_flash/prj.conf @@ -8,6 +8,7 @@ CONFIG_ZTEST=y CONFIG_SUIT=y CONFIG_SUIT_CRYPTO=y +CONFIG_PSA_WANT_ALG_ECDSA=y CONFIG_SUIT_PROCESSOR=y CONFIG_SUIT_PLATFORM=y CONFIG_SUIT_LOG_LEVEL_DBG=y diff --git a/tests/subsys/suit/fetch_integrated_payload_flash/src/manifest_52.c b/tests/subsys/suit/fetch_integrated_payload_flash/src/manifest_52.c index 0c4aba744b2b..2c398d6685d2 100644 --- a/tests/subsys/suit/fetch_integrated_payload_flash/src/manifest_52.c +++ b/tests/subsys/suit/fetch_integrated_payload_flash/src/manifest_52.c @@ -18,12 +18,12 @@ uint8_t manifest_buf[] = { 0xD8, 0x6B, 0xA4, 0x02, 0x58, 0x7A, 0x82, 0x58, 0x24, 0x82, 0x2F, 0x58, 0x20, 0x21, 0x79, 0x6D, 0xE9, 0x61, 0x0F, 0x6F, 0xF9, 0xA6, 0xC7, 0x43, 0x69, 0x5F, 0xF1, 0x5A, 0x4B, 0x37, 0x14, 0x3E, 0x7D, 0xD7, 0x2E, 0xBF, 0x8C, 0x34, 0x67, 0x33, 0xB8, 0x21, 0x72, 0xAF, 0x7E, - 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x7F, 0xFF, 0xFF, 0xE0, - 0xA0, 0xF6, 0x58, 0x40, 0x98, 0x4A, 0x75, 0x3D, 0xF2, 0xE3, 0x8E, 0xE6, 0x81, 0x63, 0xBD, - 0x18, 0xA0, 0xBB, 0x64, 0x5A, 0x4E, 0x00, 0x03, 0xDE, 0x93, 0x17, 0x43, 0xAD, 0x98, 0x79, - 0xF1, 0x47, 0xB8, 0x32, 0xB4, 0xC0, 0x6F, 0x8F, 0xAF, 0xE5, 0x81, 0xF2, 0xE3, 0x6B, 0xEC, - 0x0A, 0x80, 0x59, 0x94, 0xF7, 0x0E, 0xAA, 0x57, 0x8A, 0xDE, 0x84, 0x03, 0xBC, 0x69, 0x23, - 0x56, 0x60, 0xEF, 0x49, 0x2F, 0xAA, 0x8C, 0x7E, 0x03, 0x58, 0xFD, 0xA8, 0x01, 0x01, 0x02, + 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x40, 0x00, 0x00, 0x00, + 0xA0, 0xF6, 0x58, 0x40, 0xD4, 0x80, 0xAE, 0xC9, 0x57, 0x17, 0x8D, 0xB0, 0x41, 0x36, 0xDF, + 0x95, 0x85, 0x8E, 0x40, 0x3D, 0xE1, 0xB5, 0x34, 0xEA, 0x14, 0xDA, 0xBB, 0xC4, 0x8E, 0x8D, + 0xED, 0x45, 0x08, 0xBD, 0x1A, 0xC4, 0x9E, 0xD6, 0x2C, 0xD1, 0x17, 0xFB, 0x81, 0x22, 0xBB, + 0xA2, 0xA5, 0xD2, 0xC7, 0x7A, 0x75, 0x8C, 0xA5, 0xE3, 0xA8, 0x59, 0x7D, 0x99, 0xA3, 0xF6, + 0xF1, 0x76, 0x8C, 0xAB, 0x6E, 0x23, 0xCF, 0x75, 0x03, 0x58, 0xFD, 0xA8, 0x01, 0x01, 0x02, 0x01, 0x03, 0x58, 0x81, 0xA2, 0x02, 0x82, 0x84, 0x44, 0x63, 0x4D, 0x45, 0x4D, 0x41, 0x00, 0x45, 0x1A, 0x00, 0x08, 0x00, 0x00, 0x43, 0x19, 0x10, 0x00, 0x82, 0x49, 0x68, 0x43, 0x41, 0x4E, 0x44, 0x5F, 0x49, 0x4D, 0x47, 0x41, 0x00, 0x04, 0x58, 0x5C, 0x8C, 0x0C, 0x00, 0x14, diff --git a/tests/subsys/suit/fetch_integrated_payload_flash/src/manifest_54.c b/tests/subsys/suit/fetch_integrated_payload_flash/src/manifest_54.c index 8b7c8b55d11d..f1a6405ef17d 100644 --- a/tests/subsys/suit/fetch_integrated_payload_flash/src/manifest_54.c +++ b/tests/subsys/suit/fetch_integrated_payload_flash/src/manifest_54.c @@ -18,12 +18,12 @@ uint8_t manifest_buf[] = { 0xD8, 0x6B, 0xA4, 0x02, 0x58, 0x7A, 0x82, 0x58, 0x24, 0x82, 0x2F, 0x58, 0x20, 0x6D, 0xD8, 0xC6, 0xEB, 0x81, 0xF3, 0x8D, 0x83, 0x7C, 0x25, 0x9F, 0xA8, 0xF9, 0xA8, 0x4E, 0x63, 0x4A, 0xAB, 0x0D, 0x71, 0xAE, 0x01, 0xF1, 0x71, 0xB4, 0xD4, 0x46, 0x70, 0x03, 0x30, 0xA3, 0xF2, - 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x7F, 0xFF, 0xFF, 0xE0, - 0xA0, 0xF6, 0x58, 0x40, 0x39, 0x53, 0xA2, 0x47, 0xF0, 0x85, 0x25, 0x21, 0x6F, 0x98, 0x97, - 0x90, 0x6A, 0x05, 0x17, 0x61, 0xF4, 0x0D, 0x00, 0xAB, 0xF1, 0xD1, 0xE7, 0xE7, 0x65, 0x8A, - 0xB9, 0xB5, 0xDD, 0x20, 0x36, 0x95, 0x94, 0x75, 0xE0, 0x2B, 0x9B, 0x2E, 0x3C, 0xF4, 0xFB, - 0x85, 0x46, 0x8F, 0xA5, 0xF9, 0x05, 0x3F, 0xAA, 0x7B, 0x28, 0xFD, 0x6A, 0xBF, 0x77, 0x3D, - 0x04, 0x5B, 0x26, 0xFA, 0x22, 0x69, 0x60, 0xFE, 0x03, 0x58, 0xFF, 0xA8, 0x01, 0x01, 0x02, + 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x40, 0x00, 0x00, 0x00, + 0xA0, 0xF6, 0x58, 0x40, 0x35, 0xD5, 0xC3, 0x2C, 0x0E, 0x05, 0x4F, 0x64, 0x34, 0x84, 0x67, + 0x1E, 0xB4, 0x8E, 0x93, 0x0B, 0x3A, 0x7C, 0xB4, 0xE9, 0x9A, 0x7F, 0x1D, 0x9A, 0xAB, 0xFE, + 0x03, 0xEC, 0x96, 0xEA, 0x1F, 0x91, 0xDB, 0xCE, 0xAD, 0x32, 0x15, 0x40, 0x32, 0xFB, 0x6B, + 0x8E, 0x58, 0xC5, 0xB1, 0x2E, 0x7A, 0x95, 0x0B, 0xD5, 0xC5, 0x04, 0xA8, 0xE9, 0x3E, 0x80, + 0x00, 0x7D, 0x74, 0x01, 0x4F, 0x09, 0x23, 0x57, 0x03, 0x58, 0xFF, 0xA8, 0x01, 0x01, 0x02, 0x01, 0x03, 0x58, 0x83, 0xA2, 0x02, 0x82, 0x84, 0x44, 0x63, 0x4D, 0x45, 0x4D, 0x41, 0x00, 0x45, 0x1A, 0x0E, 0x0A, 0xA0, 0x00, 0x45, 0x1A, 0x00, 0x07, 0xF8, 0x00, 0x82, 0x49, 0x68, 0x43, 0x41, 0x4E, 0x44, 0x5F, 0x49, 0x4D, 0x47, 0x41, 0x00, 0x04, 0x58, 0x5C, 0x8C, 0x0C, diff --git a/tests/subsys/suit/manifest_common/generate_dfu_cache.sh b/tests/subsys/suit/manifest_common/generate_dfu_cache.sh new file mode 100755 index 000000000000..e5facb5ac083 --- /dev/null +++ b/tests/subsys/suit/manifest_common/generate_dfu_cache.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +SUIT_GENERATOR_DIR="../../../../../modules/lib/suit-generator" +if [ -z "$1" ] + then + echo "generate_dfu_cache.sh: path to bin file required" + exit -1 +fi + +### DFU cache generation ### +echo "Generating DFU cache for $1 input file ..." +suit-generator cache_create --input "#file.bin,file.bin" --output-file sample_cache.bin diff --git a/tests/subsys/suit/manifest_common/regenerate.sh b/tests/subsys/suit/manifest_common/regenerate.sh index d740a582d432..2bef1a16924c 100755 --- a/tests/subsys/suit/manifest_common/regenerate.sh +++ b/tests/subsys/suit/manifest_common/regenerate.sh @@ -29,6 +29,22 @@ if [ ! -f key_private.pem ]; then generated_files+=("\tprivate key:\t\t$PWD/key_private.pem") generated_files+=("\tpublic key:\t\t$PWD/key_public.pem") fi + + # 0x4000AA00: Path(__file__).parent / "key_private_OEM_ROOT_GEN1.pem", + # 0x40022100: Path(__file__).parent / "key_private_APPLICATION_GEN1.pem", + # 0x40032100: Path(__file__).parent / "key_private_RADIO_GEN1.pem", +if [ ! -f key_private_OEM_ROOT_GEN1.pem ]; then + cp key_private.pem key_private_OEM_ROOT_GEN1.pem +fi + +if [ ! -f key_private_APPLICATION_GEN1.pem ]; then + cp key_private.pem key_private_APPLICATION_GEN1.pem +fi + +if [ ! -f key_private_RADIO_GEN1.pem ]; then + cp key_private.pem key_private_RADIO_GEN1.pem +fi + if [ ! -f key_public.c ]; then echo "Generating public key as C source file..." suit-generator convert --input-file key_private.pem --output-file key_public.c diff --git a/tests/subsys/suit/orchestrator/manifest/src/manifest_different_key.c b/tests/subsys/suit/orchestrator/manifest/src/manifest_different_key.c index 0ba93982feb5..919a981d13b2 100644 --- a/tests/subsys/suit/orchestrator/manifest/src/manifest_different_key.c +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_different_key.c @@ -17,12 +17,12 @@ uint8_t manifest_different_key_buf[] = { 0xD8, 0x6B, 0xA4, 0x02, 0x58, 0x7A, 0x82, 0x58, 0x24, 0x82, 0x2F, 0x58, 0x20, 0x37, 0x68, 0xD5, 0xA0, 0xFC, 0x61, 0x7C, 0x98, 0x15, 0x1C, 0x86, 0xD9, 0xBE, 0xA6, 0x26, 0x2F, 0x20, 0xCB, 0x02, 0x23, 0x20, 0x0C, 0x24, 0x05, 0x2A, 0x6D, 0x71, 0x1D, 0x39, 0x42, 0xEB, 0x6C, - 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x7F, 0xFF, 0xFF, 0xE0, - 0xA0, 0xF6, 0x58, 0x40, 0x9B, 0xFA, 0xF8, 0xDB, 0x34, 0x77, 0xBD, 0x62, 0x99, 0xEE, 0x5E, - 0xA7, 0xE3, 0x41, 0xF4, 0x14, 0xE0, 0x24, 0x16, 0x29, 0xDD, 0x9E, 0x61, 0x25, 0xA3, 0x8A, - 0xD8, 0x5B, 0xFE, 0xC7, 0x52, 0xCB, 0x39, 0x86, 0xAF, 0xDE, 0x93, 0x5F, 0xD7, 0xF4, 0x88, - 0x23, 0xE8, 0xA3, 0x4B, 0xDF, 0x45, 0x38, 0x82, 0xD7, 0xDA, 0x17, 0xB8, 0x9C, 0x53, 0x61, - 0x75, 0x19, 0x21, 0x24, 0x13, 0x30, 0xE1, 0x68, 0x03, 0x58, 0xD9, 0xA8, 0x01, 0x01, 0x02, + 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x40, 0x00, 0x00, 0x00, + 0xA0, 0xF6, 0x58, 0x40, 0x95, 0x8C, 0xDB, 0x95, 0x98, 0x19, 0x93, 0xCD, 0xCA, 0xFF, 0x5A, + 0xAC, 0xBD, 0xCC, 0x4B, 0x48, 0xE5, 0x60, 0x58, 0x90, 0x23, 0x99, 0x76, 0x48, 0x66, 0x3B, + 0xEC, 0xFB, 0x88, 0xE0, 0x4E, 0x73, 0x5A, 0xD2, 0x1D, 0x25, 0x51, 0xDB, 0x0F, 0xE5, 0xAA, + 0x39, 0x5A, 0xDA, 0x66, 0xD3, 0x16, 0x7A, 0x5B, 0x81, 0x59, 0xA5, 0x18, 0xB0, 0x2D, 0x88, + 0x18, 0x0D, 0xF4, 0x04, 0x92, 0xBA, 0x9A, 0xA5, 0x03, 0x58, 0xD9, 0xA8, 0x01, 0x01, 0x02, 0x01, 0x03, 0x58, 0x6E, 0xA2, 0x02, 0x81, 0x84, 0x44, 0x63, 0x4D, 0x45, 0x4D, 0x41, 0x00, 0x45, 0x1A, 0x00, 0x08, 0x00, 0x00, 0x43, 0x19, 0x10, 0x00, 0x04, 0x58, 0x56, 0x86, 0x14, 0xA4, 0x01, 0x50, 0x76, 0x17, 0xDA, 0xA5, 0x71, 0xFD, 0x5A, 0x85, 0x8F, 0x94, 0xE2, 0x8D, diff --git a/tests/subsys/suit/orchestrator/manifest/src/manifest_different_key_54.c b/tests/subsys/suit/orchestrator/manifest/src/manifest_different_key_54.c index f4031461667a..80c51e5a4f7c 100644 --- a/tests/subsys/suit/orchestrator/manifest/src/manifest_different_key_54.c +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_different_key_54.c @@ -17,12 +17,12 @@ uint8_t manifest_different_key_buf[] = { 0xD8, 0x6B, 0xA4, 0x02, 0x58, 0x7A, 0x82, 0x58, 0x24, 0x82, 0x2F, 0x58, 0x20, 0xF0, 0x38, 0xEC, 0x9B, 0xFC, 0x84, 0x81, 0xC7, 0xF5, 0x1D, 0x3F, 0x0B, 0x93, 0x1A, 0x25, 0xDB, 0xEF, 0xBB, 0x23, 0xE7, 0x36, 0x85, 0xF7, 0xD5, 0x1F, 0xF7, 0xCF, 0x73, 0x4F, 0x4E, 0xB6, 0xE8, - 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x7F, 0xFF, 0xFF, 0xE0, - 0xA0, 0xF6, 0x58, 0x40, 0xD0, 0x85, 0xCF, 0xC7, 0x0F, 0x6D, 0x75, 0x6B, 0xE1, 0x3F, 0x79, - 0xF0, 0x93, 0x06, 0x87, 0x39, 0x0D, 0xD0, 0x65, 0xF0, 0x75, 0x33, 0x1B, 0x18, 0xCB, 0x90, - 0x3D, 0x61, 0xB2, 0x9D, 0xEE, 0x6F, 0xF8, 0x77, 0xD2, 0x09, 0x80, 0x0A, 0xD9, 0xC5, 0x01, - 0xA8, 0xF2, 0x69, 0x81, 0xF7, 0xB2, 0x8D, 0xAA, 0x26, 0x14, 0xF2, 0xBA, 0x0E, 0xA0, 0xB7, - 0x50, 0x86, 0xE4, 0xC2, 0xEE, 0xF6, 0xA0, 0xF9, 0x03, 0x58, 0xD9, 0xA8, 0x01, 0x01, 0x02, + 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x40, 0x00, 0x00, 0x00, + 0xA0, 0xF6, 0x58, 0x40, 0x1E, 0xD4, 0xBB, 0xEA, 0x09, 0x31, 0x0D, 0xA0, 0xFE, 0x31, 0xC5, + 0xF1, 0xEE, 0xEA, 0x57, 0x03, 0x87, 0x26, 0xFA, 0xE7, 0xB1, 0xB1, 0xA7, 0x89, 0x3F, 0x76, + 0x8D, 0xDB, 0x08, 0x37, 0xE8, 0x86, 0x25, 0x2C, 0x2B, 0xE2, 0x05, 0x05, 0xA5, 0x20, 0xFE, + 0x92, 0xBB, 0x6C, 0x70, 0x0D, 0x5E, 0xE6, 0x39, 0x15, 0xFB, 0xC4, 0x4D, 0x01, 0xD2, 0x44, + 0x3E, 0x1A, 0x5C, 0x4F, 0xF9, 0x98, 0xD7, 0xBF, 0x03, 0x58, 0xD9, 0xA8, 0x01, 0x01, 0x02, 0x01, 0x03, 0x58, 0x6E, 0xA2, 0x02, 0x81, 0x84, 0x44, 0x63, 0x4D, 0x45, 0x4D, 0x41, 0x00, 0x45, 0x1A, 0x0E, 0x0A, 0xA0, 0x00, 0x43, 0x19, 0x10, 0x00, 0x04, 0x58, 0x56, 0x86, 0x14, 0xA4, 0x01, 0x50, 0x76, 0x17, 0xDA, 0xA5, 0x71, 0xFD, 0x5A, 0x85, 0x8F, 0x94, 0xE2, 0x8D, diff --git a/tests/subsys/suit/orchestrator/manifest/src/manifest_manipulated.c b/tests/subsys/suit/orchestrator/manifest/src/manifest_manipulated.c index d9a20a08f2dc..ac9b5532b114 100644 --- a/tests/subsys/suit/orchestrator/manifest/src/manifest_manipulated.c +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_manipulated.c @@ -17,12 +17,12 @@ uint8_t manifest_manipulated_buf[] = { 0xD8, 0x6B, 0xA4, 0x02, 0x58, 0x7A, 0x82, 0x58, 0x24, 0x82, 0x2F, 0xFF, 0x20, 0x47, 0xF3, 0xFF, 0x8B, 0xE4, 0x4F, 0xA5, 0x2E, 0xD2, 0x10, 0x82, 0xAB, 0xCE, 0x12, 0x8E, 0x70, 0x12, 0x0B, 0x28, 0xCF, 0x63, 0x9B, 0x8D, 0xFC, 0xF5, 0xEA, 0xF4, 0x56, 0xDA, 0xA9, 0x4A, 0xB1, - 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x7F, 0xFF, 0xFF, 0xE0, - 0xA0, 0xF6, 0x58, 0x40, 0x31, 0x16, 0x4B, 0x95, 0x09, 0x43, 0xC8, 0xB9, 0x51, 0xA2, 0x7F, - 0x52, 0x4B, 0xE1, 0x2B, 0x26, 0xAD, 0x42, 0xE3, 0x84, 0xA1, 0x32, 0x4B, 0xFC, 0x47, 0x0B, - 0x04, 0x0E, 0x94, 0x9D, 0x04, 0x17, 0x15, 0x0F, 0x24, 0x69, 0x55, 0x52, 0xBB, 0x10, 0x35, - 0x54, 0x4E, 0x2A, 0xCB, 0xAC, 0x93, 0xF7, 0x35, 0x61, 0x91, 0x32, 0x3D, 0xF9, 0xD9, 0x0E, - 0x37, 0x9A, 0x9C, 0xC4, 0xAB, 0xE6, 0x36, 0x31, 0x03, 0x59, 0x01, 0x07, 0xA8, 0x01, 0x01, + 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x40, 0x00, 0x00, 0x00, + 0xA0, 0xF6, 0x58, 0x40, 0x14, 0xAA, 0x46, 0x79, 0x66, 0xC6, 0x34, 0xD1, 0x29, 0x08, 0x69, + 0x74, 0x57, 0x4A, 0x92, 0xBD, 0x90, 0xB7, 0x3B, 0x32, 0xE1, 0x70, 0x72, 0xFC, 0xBB, 0x48, + 0x81, 0xE0, 0x28, 0x17, 0x5B, 0x28, 0x6B, 0xD2, 0xF9, 0xC1, 0x37, 0x8C, 0x50, 0x49, 0x04, + 0x35, 0x15, 0xE2, 0x25, 0x83, 0x5A, 0xB8, 0x41, 0x2A, 0xBE, 0x14, 0xA2, 0x5F, 0xA2, 0xB6, + 0xA6, 0x52, 0x0A, 0xFB, 0x26, 0x55, 0x53, 0x13, 0x03, 0x59, 0x01, 0x07, 0xA8, 0x01, 0x01, 0x02, 0x01, 0x03, 0x58, 0x66, 0xA3, 0x02, 0x82, 0x82, 0x4A, 0x69, 0x43, 0x41, 0x4E, 0x44, 0x5F, 0x4D, 0x46, 0x53, 0x54, 0x41, 0x00, 0x82, 0x4C, 0x6B, 0x49, 0x4E, 0x53, 0x54, 0x4C, 0x44, 0x5F, 0x4D, 0x46, 0x53, 0x54, 0x50, 0x5B, 0x46, 0x9F, 0xD1, 0x90, 0xEE, 0x53, 0x9C, @@ -53,12 +53,12 @@ uint8_t manifest_manipulated_buf[] = { 0x82, 0x58, 0x24, 0x82, 0x2F, 0x58, 0x20, 0x37, 0x68, 0xD5, 0xA0, 0xFC, 0x61, 0x7C, 0x98, 0x15, 0x1C, 0x86, 0xD9, 0xBE, 0xA6, 0x26, 0x2F, 0x20, 0xCB, 0x02, 0x23, 0x20, 0x0C, 0x24, 0x05, 0x2A, 0x6D, 0x71, 0x1D, 0x39, 0x42, 0xEB, 0x6C, 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, - 0x01, 0x26, 0x04, 0x45, 0x1A, 0x7F, 0xFF, 0xFF, 0xE0, 0xA0, 0xF6, 0x58, 0x40, 0x82, 0xB6, - 0x6C, 0xCB, 0x64, 0x76, 0xBC, 0x07, 0xCD, 0x69, 0xA8, 0xBE, 0x63, 0xA1, 0x57, 0x7D, 0x75, - 0xC3, 0x54, 0x8F, 0xFE, 0x8C, 0x45, 0xA3, 0x9F, 0x9C, 0x01, 0x27, 0x6B, 0xFE, 0xE4, 0x69, - 0x06, 0xF4, 0x82, 0xCF, 0x88, 0x18, 0x01, 0xD6, 0x3E, 0x0D, 0x70, 0xC7, 0x15, 0x4E, 0xBB, - 0xE7, 0x4B, 0x39, 0x8A, 0x31, 0x69, 0xB2, 0x88, 0x94, 0x6D, 0x42, 0xB3, 0x0E, 0x79, 0xDD, - 0x77, 0x56, 0x03, 0x58, 0xD9, 0xA8, 0x01, 0x01, 0x02, 0x01, 0x03, 0x58, 0x6E, 0xA2, 0x02, + 0x01, 0x26, 0x04, 0x45, 0x1A, 0x40, 0x00, 0x00, 0x00, 0xA0, 0xF6, 0x58, 0x40, 0x0F, 0xA6, + 0x5F, 0x27, 0x46, 0xAD, 0x92, 0xAB, 0xEC, 0xAF, 0xB3, 0x97, 0x7F, 0x25, 0x69, 0x12, 0x76, + 0x2A, 0x4A, 0x03, 0xBA, 0xF8, 0xFC, 0xE3, 0x92, 0x66, 0x3F, 0xDD, 0x4A, 0xCC, 0x05, 0xCC, + 0x11, 0xD9, 0xB9, 0xCA, 0x65, 0x82, 0x03, 0xF9, 0xC5, 0x12, 0xC5, 0xB0, 0x84, 0x1C, 0xD7, + 0x73, 0x5E, 0xEB, 0x72, 0x4B, 0x58, 0x48, 0x8A, 0xF8, 0xFD, 0x6C, 0xD4, 0x71, 0xED, 0xE7, + 0xDE, 0xFA, 0x03, 0x58, 0xD9, 0xA8, 0x01, 0x01, 0x02, 0x01, 0x03, 0x58, 0x6E, 0xA2, 0x02, 0x81, 0x84, 0x44, 0x63, 0x4D, 0x45, 0x4D, 0x41, 0x00, 0x45, 0x1A, 0x00, 0x08, 0x00, 0x00, 0x43, 0x19, 0x10, 0x00, 0x04, 0x58, 0x56, 0x86, 0x14, 0xA4, 0x01, 0x50, 0x76, 0x17, 0xDA, 0xA5, 0x71, 0xFD, 0x5A, 0x85, 0x8F, 0x94, 0xE2, 0x8D, 0x73, 0x5C, 0xE9, 0xF4, 0x02, 0x50, diff --git a/tests/subsys/suit/orchestrator/manifest/src/manifest_manipulated_54.c b/tests/subsys/suit/orchestrator/manifest/src/manifest_manipulated_54.c index 7dc72e667162..2b97bb45e3e9 100644 --- a/tests/subsys/suit/orchestrator/manifest/src/manifest_manipulated_54.c +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_manipulated_54.c @@ -17,12 +17,12 @@ uint8_t manifest_manipulated_buf[] = { 0xD8, 0x6B, 0xA4, 0x02, 0x58, 0x7A, 0x82, 0x58, 0x24, 0x82, 0x2F, 0xFF, 0x20, 0x26, 0x81, 0xF4, 0x06, 0x5A, 0x18, 0xD1, 0xDF, 0x38, 0x8D, 0x2B, 0x9C, 0xDE, 0x5E, 0x76, 0xD9, 0xB1, 0x05, 0x31, 0x1B, 0x66, 0xD4, 0x84, 0xB2, 0x4C, 0x36, 0x59, 0x25, 0xA4, 0xCF, 0xF9, 0xDB, - 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x7F, 0xFF, 0xFF, 0xE0, - 0xA0, 0xF6, 0x58, 0x40, 0xA2, 0x60, 0x05, 0xEF, 0x40, 0x37, 0x37, 0x41, 0xAD, 0x90, 0xCC, - 0x50, 0xCF, 0xA6, 0xA0, 0x61, 0x19, 0x61, 0xC7, 0xD6, 0xB1, 0xFF, 0xC0, 0xB0, 0x80, 0xD4, - 0x56, 0xB4, 0x3D, 0xD6, 0xE4, 0x43, 0xBD, 0xDA, 0x3D, 0x35, 0x2B, 0x13, 0x2A, 0x1A, 0x67, - 0x21, 0x76, 0xBD, 0x56, 0x09, 0x14, 0x26, 0x63, 0xA0, 0x93, 0x72, 0xA1, 0x8A, 0xA5, 0x9F, - 0x08, 0xDA, 0x81, 0x0C, 0x4D, 0xC1, 0x7A, 0xDC, 0x03, 0x59, 0x01, 0x07, 0xA8, 0x01, 0x01, + 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x40, 0x00, 0x00, 0x00, + 0xA0, 0xF6, 0x58, 0x40, 0x49, 0x49, 0xDA, 0x6A, 0x72, 0xCC, 0x6E, 0xB5, 0x43, 0x3B, 0x8F, + 0xCD, 0x83, 0x51, 0x37, 0x68, 0xCF, 0xF9, 0x0E, 0xE8, 0xFD, 0xBA, 0x00, 0xE6, 0x9E, 0x7A, + 0xAD, 0x32, 0xC5, 0x7D, 0x46, 0x5E, 0x48, 0x19, 0xCC, 0x4B, 0xF9, 0xA9, 0xB9, 0x7C, 0x0E, + 0x74, 0xAF, 0xFE, 0x42, 0x9E, 0x7F, 0x81, 0x44, 0x00, 0x80, 0x9B, 0x4E, 0x41, 0x90, 0x1F, + 0x8A, 0x29, 0x8C, 0xB9, 0x7F, 0x9D, 0x75, 0x80, 0x03, 0x59, 0x01, 0x07, 0xA8, 0x01, 0x01, 0x02, 0x01, 0x03, 0x58, 0x66, 0xA3, 0x02, 0x82, 0x82, 0x4A, 0x69, 0x43, 0x41, 0x4E, 0x44, 0x5F, 0x4D, 0x46, 0x53, 0x54, 0x41, 0x00, 0x82, 0x4C, 0x6B, 0x49, 0x4E, 0x53, 0x54, 0x4C, 0x44, 0x5F, 0x4D, 0x46, 0x53, 0x54, 0x50, 0x5B, 0x46, 0x9F, 0xD1, 0x90, 0xEE, 0x53, 0x9C, @@ -53,12 +53,12 @@ uint8_t manifest_manipulated_buf[] = { 0x82, 0x58, 0x24, 0x82, 0x2F, 0x58, 0x20, 0xF0, 0x38, 0xEC, 0x9B, 0xFC, 0x84, 0x81, 0xC7, 0xF5, 0x1D, 0x3F, 0x0B, 0x93, 0x1A, 0x25, 0xDB, 0xEF, 0xBB, 0x23, 0xE7, 0x36, 0x85, 0xF7, 0xD5, 0x1F, 0xF7, 0xCF, 0x73, 0x4F, 0x4E, 0xB6, 0xE8, 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, - 0x01, 0x26, 0x04, 0x45, 0x1A, 0x7F, 0xFF, 0xFF, 0xE0, 0xA0, 0xF6, 0x58, 0x40, 0x07, 0x47, - 0x11, 0x79, 0xA7, 0xCF, 0x62, 0x73, 0xE3, 0x29, 0xBA, 0x59, 0xF4, 0x59, 0x7E, 0x7A, 0x66, - 0x0E, 0x2C, 0x67, 0x4A, 0x9C, 0x5B, 0x6D, 0x63, 0x9A, 0x8F, 0x12, 0x90, 0xF0, 0x0F, 0x2C, - 0x96, 0x87, 0x1E, 0xCE, 0x21, 0xDA, 0xE6, 0x9C, 0x66, 0x7D, 0x6C, 0x41, 0xF5, 0x23, 0x44, - 0xE6, 0x46, 0x66, 0x13, 0x58, 0x93, 0x1E, 0xDC, 0x93, 0x69, 0xE7, 0xC2, 0xC1, 0xB7, 0x98, - 0x58, 0x82, 0x03, 0x58, 0xD9, 0xA8, 0x01, 0x01, 0x02, 0x01, 0x03, 0x58, 0x6E, 0xA2, 0x02, + 0x01, 0x26, 0x04, 0x45, 0x1A, 0x40, 0x00, 0x00, 0x00, 0xA0, 0xF6, 0x58, 0x40, 0x1A, 0x35, + 0xA3, 0x4E, 0x7F, 0x13, 0x22, 0xE5, 0x55, 0x79, 0x37, 0xAE, 0xE7, 0x85, 0xE1, 0x1A, 0xAD, + 0x20, 0xD7, 0xAB, 0x89, 0x8C, 0x85, 0x77, 0x10, 0xD0, 0xA2, 0xF5, 0x9A, 0x01, 0x7C, 0x38, + 0x9B, 0x8F, 0x8C, 0x3E, 0x58, 0x9B, 0x0C, 0x28, 0x8B, 0x0E, 0x32, 0xB3, 0x15, 0xAB, 0x49, + 0x98, 0x08, 0x85, 0x8F, 0xA2, 0x11, 0x0B, 0xFA, 0x97, 0x0D, 0x6E, 0x6E, 0x09, 0x2A, 0xF7, + 0x8F, 0x5E, 0x03, 0x58, 0xD9, 0xA8, 0x01, 0x01, 0x02, 0x01, 0x03, 0x58, 0x6E, 0xA2, 0x02, 0x81, 0x84, 0x44, 0x63, 0x4D, 0x45, 0x4D, 0x41, 0x00, 0x45, 0x1A, 0x0E, 0x0A, 0xA0, 0x00, 0x43, 0x19, 0x10, 0x00, 0x04, 0x58, 0x56, 0x86, 0x14, 0xA4, 0x01, 0x50, 0x76, 0x17, 0xDA, 0xA5, 0x71, 0xFD, 0x5A, 0x85, 0x8F, 0x94, 0xE2, 0x8D, 0x73, 0x5C, 0xE9, 0xF4, 0x02, 0x50, diff --git a/tests/subsys/suit/orchestrator/manifest/src/manifest_recovery.c b/tests/subsys/suit/orchestrator/manifest/src/manifest_recovery.c index 07ca7492aee6..079975ddfd30 100644 --- a/tests/subsys/suit/orchestrator/manifest/src/manifest_recovery.c +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_recovery.c @@ -15,12 +15,12 @@ uint8_t manifest_valid_recovery_buf[] = { 0xD8, 0x6B, 0xA4, 0x02, 0x58, 0x7A, 0x82, 0x58, 0x24, 0x82, 0x2F, 0x58, 0x20, 0x8C, 0xA4, 0x8B, 0xBB, 0xD9, 0xA9, 0x13, 0xCE, 0x57, 0x4C, 0x60, 0xB9, 0x0D, 0xAB, 0x3E, 0x7F, 0x25, 0x7C, 0x68, 0xAA, 0x17, 0xF1, 0x8C, 0x59, 0x3C, 0xBD, 0x07, 0x46, 0x51, 0x8F, 0xAD, 0xC2, - 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x7F, 0xFF, 0xFF, 0xE0, - 0xA0, 0xF6, 0x58, 0x40, 0xA1, 0x2E, 0xD4, 0x8A, 0xB6, 0x92, 0x25, 0x3B, 0x00, 0x3A, 0xF4, - 0xAB, 0x18, 0xF9, 0x5B, 0x51, 0x9E, 0x59, 0xB9, 0xC9, 0xCE, 0xDE, 0xAC, 0x49, 0x3F, 0x34, - 0x71, 0xE9, 0xFE, 0xEE, 0x0C, 0x65, 0xF9, 0xC4, 0x7A, 0xFA, 0x32, 0xF9, 0xBE, 0xDD, 0xCE, - 0x90, 0x3A, 0xC1, 0x6C, 0x4A, 0x96, 0xFF, 0x70, 0x12, 0x7A, 0xDB, 0xD1, 0xEA, 0x84, 0x27, - 0xB7, 0xD6, 0x96, 0x3F, 0xF4, 0xCF, 0x93, 0x84, 0x03, 0x59, 0x01, 0x32, 0xAA, 0x01, 0x01, + 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x40, 0x00, 0x00, 0x00, + 0xA0, 0xF6, 0x58, 0x40, 0x09, 0x97, 0x80, 0x84, 0xCE, 0x95, 0x83, 0x92, 0xEF, 0xC1, 0x3C, + 0x91, 0xB6, 0xC8, 0x67, 0xA3, 0x30, 0x91, 0x84, 0x5F, 0x8B, 0x69, 0xE6, 0x32, 0x60, 0x4A, + 0x64, 0xF7, 0x32, 0x87, 0x74, 0x19, 0x79, 0xBC, 0xBC, 0x6A, 0x6E, 0x78, 0x42, 0x5B, 0x54, + 0x12, 0xF9, 0xE2, 0xD5, 0x2C, 0xD8, 0x79, 0x09, 0x6A, 0xF5, 0xC7, 0x3F, 0x99, 0xBA, 0xB0, + 0x25, 0x69, 0xA3, 0xD3, 0x12, 0x85, 0x34, 0x43, 0x03, 0x59, 0x01, 0x32, 0xAA, 0x01, 0x01, 0x02, 0x01, 0x03, 0x58, 0x7D, 0xA2, 0x02, 0x82, 0x82, 0x49, 0x68, 0x43, 0x41, 0x4E, 0x44, 0x5F, 0x49, 0x4D, 0x47, 0x41, 0x00, 0x84, 0x44, 0x63, 0x4D, 0x45, 0x4D, 0x41, 0x00, 0x45, 0x1A, 0x00, 0x08, 0x10, 0x00, 0x43, 0x19, 0x10, 0x00, 0x04, 0x58, 0x58, 0x88, 0x0C, 0x01, diff --git a/tests/subsys/suit/orchestrator/manifest/src/manifest_recovery_54.c b/tests/subsys/suit/orchestrator/manifest/src/manifest_recovery_54.c index 7a4c7fa8cdb1..84569a1d6dbf 100644 --- a/tests/subsys/suit/orchestrator/manifest/src/manifest_recovery_54.c +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_recovery_54.c @@ -15,12 +15,12 @@ uint8_t manifest_valid_recovery_buf[] = { 0xD8, 0x6B, 0xA4, 0x02, 0x58, 0x7A, 0x82, 0x58, 0x24, 0x82, 0x2F, 0x58, 0x20, 0x3B, 0x10, 0x96, 0x69, 0xB6, 0xD0, 0xAA, 0x67, 0xB4, 0xC3, 0x33, 0x15, 0xFD, 0x03, 0x25, 0xC7, 0x6D, 0xFA, 0x33, 0x1D, 0x92, 0x2A, 0x94, 0x2E, 0x28, 0x43, 0xE1, 0xD5, 0x6C, 0x9B, 0x85, 0x49, - 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x7F, 0xFF, 0xFF, 0xE0, - 0xA0, 0xF6, 0x58, 0x40, 0x4D, 0xC3, 0x00, 0xF9, 0x2E, 0xB9, 0x5D, 0x3E, 0x5E, 0xF5, 0xFB, - 0x08, 0x2D, 0x80, 0x2E, 0x6E, 0x16, 0xB9, 0x0E, 0xA8, 0xDF, 0x4E, 0x7B, 0x91, 0xAE, 0xD6, - 0x67, 0x24, 0xF9, 0x4D, 0xE6, 0x5B, 0xA7, 0xE5, 0x2E, 0x77, 0x6B, 0x50, 0x06, 0xB6, 0xB8, - 0xB3, 0x65, 0xA5, 0x72, 0x9A, 0x29, 0x80, 0x28, 0xDA, 0x02, 0xF8, 0x5E, 0x32, 0xC5, 0x70, - 0xC4, 0x75, 0xB2, 0xE0, 0xC5, 0xE2, 0x49, 0xF4, 0x03, 0x59, 0x01, 0x32, 0xAA, 0x01, 0x01, + 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x40, 0x00, 0x00, 0x00, + 0xA0, 0xF6, 0x58, 0x40, 0xF2, 0xEA, 0x24, 0x3A, 0xA6, 0xC1, 0xAC, 0xD2, 0xDC, 0xDE, 0xB8, + 0xC3, 0xFA, 0xF5, 0xF8, 0xB4, 0x2E, 0x80, 0x0A, 0x07, 0x61, 0xFC, 0x4E, 0x17, 0xD4, 0x9F, + 0xED, 0x9A, 0x76, 0x1A, 0x91, 0x31, 0xEB, 0x36, 0x5A, 0xD0, 0x7E, 0xD9, 0x1E, 0xB9, 0x33, + 0x8E, 0x8D, 0x61, 0x2D, 0x08, 0x1E, 0x62, 0x05, 0xB3, 0xFB, 0x16, 0x93, 0xC6, 0x6F, 0x39, + 0x36, 0x99, 0x11, 0x6D, 0x70, 0x11, 0xAD, 0x32, 0x03, 0x59, 0x01, 0x32, 0xAA, 0x01, 0x01, 0x02, 0x01, 0x03, 0x58, 0x7D, 0xA2, 0x02, 0x82, 0x82, 0x49, 0x68, 0x43, 0x41, 0x4E, 0x44, 0x5F, 0x49, 0x4D, 0x47, 0x41, 0x00, 0x84, 0x44, 0x63, 0x4D, 0x45, 0x4D, 0x41, 0x00, 0x45, 0x1A, 0x0E, 0x0A, 0xB0, 0x00, 0x43, 0x19, 0x10, 0x00, 0x04, 0x58, 0x58, 0x88, 0x0C, 0x01, diff --git a/tests/subsys/suit/orchestrator/manifest/src/manifest_recovery_manipulated.c b/tests/subsys/suit/orchestrator/manifest/src/manifest_recovery_manipulated.c index cee042885da4..21191d5589ad 100644 --- a/tests/subsys/suit/orchestrator/manifest/src/manifest_recovery_manipulated.c +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_recovery_manipulated.c @@ -13,16 +13,16 @@ * @details The manipulation is done on byte of index 11, from value 0x58 to 0xFF * */ -const uint8_t manifest_manipulated_recovery_buf[] = { +uint8_t manifest_manipulated_recovery_buf[] = { 0xD8, 0x6B, 0xA4, 0x02, 0x58, 0x7A, 0x82, 0x58, 0x24, 0x82, 0x2F, 0xFF, 0x20, 0x8C, 0xA4, 0x8B, 0xBB, 0xD9, 0xA9, 0x13, 0xCE, 0x57, 0x4C, 0x60, 0xB9, 0x0D, 0xAB, 0x3E, 0x7F, 0x25, 0x7C, 0x68, 0xAA, 0x17, 0xF1, 0x8C, 0x59, 0x3C, 0xBD, 0x07, 0x46, 0x51, 0x8F, 0xAD, 0xC2, - 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x7F, 0xFF, 0xFF, 0xE0, - 0xA0, 0xF6, 0x58, 0x40, 0xA1, 0x2E, 0xD4, 0x8A, 0xB6, 0x92, 0x25, 0x3B, 0x00, 0x3A, 0xF4, - 0xAB, 0x18, 0xF9, 0x5B, 0x51, 0x9E, 0x59, 0xB9, 0xC9, 0xCE, 0xDE, 0xAC, 0x49, 0x3F, 0x34, - 0x71, 0xE9, 0xFE, 0xEE, 0x0C, 0x65, 0xF9, 0xC4, 0x7A, 0xFA, 0x32, 0xF9, 0xBE, 0xDD, 0xCE, - 0x90, 0x3A, 0xC1, 0x6C, 0x4A, 0x96, 0xFF, 0x70, 0x12, 0x7A, 0xDB, 0xD1, 0xEA, 0x84, 0x27, - 0xB7, 0xD6, 0x96, 0x3F, 0xF4, 0xCF, 0x93, 0x84, 0x03, 0x59, 0x01, 0x32, 0xAA, 0x01, 0x01, + 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x40, 0x00, 0x00, 0x00, + 0xA0, 0xF6, 0x58, 0x40, 0x09, 0x97, 0x80, 0x84, 0xCE, 0x95, 0x83, 0x92, 0xEF, 0xC1, 0x3C, + 0x91, 0xB6, 0xC8, 0x67, 0xA3, 0x30, 0x91, 0x84, 0x5F, 0x8B, 0x69, 0xE6, 0x32, 0x60, 0x4A, + 0x64, 0xF7, 0x32, 0x87, 0x74, 0x19, 0x79, 0xBC, 0xBC, 0x6A, 0x6E, 0x78, 0x42, 0x5B, 0x54, + 0x12, 0xF9, 0xE2, 0xD5, 0x2C, 0xD8, 0x79, 0x09, 0x6A, 0xF5, 0xC7, 0x3F, 0x99, 0xBA, 0xB0, + 0x25, 0x69, 0xA3, 0xD3, 0x12, 0x85, 0x34, 0x43, 0x03, 0x59, 0x01, 0x32, 0xAA, 0x01, 0x01, 0x02, 0x01, 0x03, 0x58, 0x7D, 0xA2, 0x02, 0x82, 0x82, 0x49, 0x68, 0x43, 0x41, 0x4E, 0x44, 0x5F, 0x49, 0x4D, 0x47, 0x41, 0x00, 0x84, 0x44, 0x63, 0x4D, 0x45, 0x4D, 0x41, 0x00, 0x45, 0x1A, 0x00, 0x08, 0x10, 0x00, 0x43, 0x19, 0x10, 0x00, 0x04, 0x58, 0x58, 0x88, 0x0C, 0x01, @@ -73,6 +73,6 @@ const uint8_t manifest_manipulated_recovery_buf[] = { 0x0A, 0x03, 0x4B, 0xFF, 0x33, 0xAB, 0x3B, 0xC5, 0xAF, 0xD0, 0xB8, 0x2C, 0x0F, 0x6A, 0xA9, 0x11, 0xB0, 0xE8, 0x57, 0x8C, 0x92, 0x53, 0x81}; -const size_t manifest_manipulated_recovery_len = sizeof(manifest_manipulated_recovery_buf); +size_t manifest_manipulated_recovery_len = sizeof(manifest_manipulated_recovery_buf); #endif /* CONFIG_SOC_NRF52840 || CONFIG_BOARD_NATIVE_POSIX */ diff --git a/tests/subsys/suit/orchestrator/manifest/src/manifest_recovery_manipulated_54.c b/tests/subsys/suit/orchestrator/manifest/src/manifest_recovery_manipulated_54.c index 0c6b50d4b0c0..9e68a1d44894 100644 --- a/tests/subsys/suit/orchestrator/manifest/src/manifest_recovery_manipulated_54.c +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_recovery_manipulated_54.c @@ -13,16 +13,16 @@ * @details The manipulation is done on byte of index 11, from value 0x58 to 0xFF * */ -const uint8_t manifest_manipulated_recovery_buf[] = { +uint8_t manifest_manipulated_recovery_buf[] = { 0xD8, 0x6B, 0xA4, 0x02, 0x58, 0x7A, 0x82, 0x58, 0x24, 0x82, 0x2F, 0xFF, 0x20, 0x3B, 0x10, 0x96, 0x69, 0xB6, 0xD0, 0xAA, 0x67, 0xB4, 0xC3, 0x33, 0x15, 0xFD, 0x03, 0x25, 0xC7, 0x6D, 0xFA, 0x33, 0x1D, 0x92, 0x2A, 0x94, 0x2E, 0x28, 0x43, 0xE1, 0xD5, 0x6C, 0x9B, 0x85, 0x49, - 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x7F, 0xFF, 0xFF, 0xE0, - 0xA0, 0xF6, 0x58, 0x40, 0x4D, 0xC3, 0x00, 0xF9, 0x2E, 0xB9, 0x5D, 0x3E, 0x5E, 0xF5, 0xFB, - 0x08, 0x2D, 0x80, 0x2E, 0x6E, 0x16, 0xB9, 0x0E, 0xA8, 0xDF, 0x4E, 0x7B, 0x91, 0xAE, 0xD6, - 0x67, 0x24, 0xF9, 0x4D, 0xE6, 0x5B, 0xA7, 0xE5, 0x2E, 0x77, 0x6B, 0x50, 0x06, 0xB6, 0xB8, - 0xB3, 0x65, 0xA5, 0x72, 0x9A, 0x29, 0x80, 0x28, 0xDA, 0x02, 0xF8, 0x5E, 0x32, 0xC5, 0x70, - 0xC4, 0x75, 0xB2, 0xE0, 0xC5, 0xE2, 0x49, 0xF4, 0x03, 0x59, 0x01, 0x32, 0xAA, 0x01, 0x01, + 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x40, 0x00, 0x00, 0x00, + 0xA0, 0xF6, 0x58, 0x40, 0xF2, 0xEA, 0x24, 0x3A, 0xA6, 0xC1, 0xAC, 0xD2, 0xDC, 0xDE, 0xB8, + 0xC3, 0xFA, 0xF5, 0xF8, 0xB4, 0x2E, 0x80, 0x0A, 0x07, 0x61, 0xFC, 0x4E, 0x17, 0xD4, 0x9F, + 0xED, 0x9A, 0x76, 0x1A, 0x91, 0x31, 0xEB, 0x36, 0x5A, 0xD0, 0x7E, 0xD9, 0x1E, 0xB9, 0x33, + 0x8E, 0x8D, 0x61, 0x2D, 0x08, 0x1E, 0x62, 0x05, 0xB3, 0xFB, 0x16, 0x93, 0xC6, 0x6F, 0x39, + 0x36, 0x99, 0x11, 0x6D, 0x70, 0x11, 0xAD, 0x32, 0x03, 0x59, 0x01, 0x32, 0xAA, 0x01, 0x01, 0x02, 0x01, 0x03, 0x58, 0x7D, 0xA2, 0x02, 0x82, 0x82, 0x49, 0x68, 0x43, 0x41, 0x4E, 0x44, 0x5F, 0x49, 0x4D, 0x47, 0x41, 0x00, 0x84, 0x44, 0x63, 0x4D, 0x45, 0x4D, 0x41, 0x00, 0x45, 0x1A, 0x0E, 0x0A, 0xB0, 0x00, 0x43, 0x19, 0x10, 0x00, 0x04, 0x58, 0x58, 0x88, 0x0C, 0x01, @@ -73,6 +73,6 @@ const uint8_t manifest_manipulated_recovery_buf[] = { 0x0A, 0x03, 0x4B, 0xFF, 0x33, 0xAB, 0x3B, 0xC5, 0xAF, 0xD0, 0xB8, 0x2C, 0x0F, 0x6A, 0xA9, 0x11, 0xB0, 0xE8, 0x57, 0x8C, 0x92, 0x53, 0x81}; -const size_t manifest_manipulated_recovery_len = sizeof(manifest_manipulated_recovery_buf); +size_t manifest_manipulated_recovery_len = sizeof(manifest_manipulated_recovery_buf); #endif /* CONFIG_SOC_SERIES_NRF54HX */ diff --git a/tests/subsys/suit/orchestrator/manifest/src/manifest_recovery_no_validate.c b/tests/subsys/suit/orchestrator/manifest/src/manifest_recovery_no_validate.c index 3793e4f97852..5646dc7182dd 100644 --- a/tests/subsys/suit/orchestrator/manifest/src/manifest_recovery_no_validate.c +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_recovery_no_validate.c @@ -14,12 +14,12 @@ const uint8_t manifest_recovery_no_validate_buf[] = { 0xD8, 0x6B, 0xA2, 0x02, 0x58, 0x7A, 0x82, 0x58, 0x24, 0x82, 0x2F, 0x58, 0x20, 0xD4, 0x31, 0x66, 0x54, 0x78, 0xE9, 0xD2, 0xA3, 0x06, 0x0E, 0xBC, 0x8F, 0x63, 0x36, 0x0B, 0x85, 0x74, 0x34, 0x6B, 0xB9, 0xD9, 0x7A, 0xF7, 0x9E, 0x74, 0xB1, 0xB0, 0x51, 0x2A, 0xBC, 0xAB, 0xBF, - 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x7F, 0xFF, 0xFF, 0xE0, - 0xA0, 0xF6, 0x58, 0x40, 0x42, 0xBC, 0xC1, 0x28, 0x47, 0xC4, 0xF9, 0x2A, 0xF0, 0xE7, 0x33, - 0x6C, 0x38, 0x87, 0x60, 0x47, 0x75, 0x8C, 0x09, 0xAC, 0x96, 0x35, 0x25, 0x61, 0xDA, 0x67, - 0xE5, 0x3B, 0xD9, 0xDF, 0x37, 0xE4, 0x7A, 0xF0, 0x49, 0xC1, 0x9B, 0x82, 0x27, 0x7E, 0x0B, - 0x69, 0x88, 0xBC, 0x83, 0xFB, 0x38, 0xE8, 0xDD, 0x29, 0x10, 0x22, 0x99, 0x56, 0x12, 0xFB, - 0xA1, 0xB6, 0x47, 0xE9, 0x06, 0x7C, 0xB8, 0xE8, 0x03, 0x58, 0x6C, 0xA5, 0x01, 0x01, 0x02, + 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x40, 0x00, 0x00, 0x00, + 0xA0, 0xF6, 0x58, 0x40, 0x33, 0x80, 0xB6, 0x7B, 0x22, 0xCF, 0x38, 0xE4, 0x71, 0xBC, 0x24, + 0x2A, 0xEC, 0xE0, 0xA0, 0x13, 0xA8, 0xEA, 0x75, 0x0C, 0x04, 0xAB, 0x03, 0xDB, 0xCA, 0x85, + 0x8E, 0xDD, 0xB9, 0xBA, 0x64, 0xED, 0x1F, 0x5E, 0x79, 0x0A, 0xF9, 0x37, 0xA1, 0xBE, 0x84, + 0x9A, 0xEE, 0x79, 0x94, 0x9F, 0x51, 0x45, 0x51, 0x5A, 0xBE, 0x7D, 0x43, 0xDA, 0x4B, 0xF9, + 0xA4, 0x1D, 0xE0, 0x33, 0x3B, 0x1B, 0xD4, 0x21, 0x03, 0x58, 0x6C, 0xA5, 0x01, 0x01, 0x02, 0x01, 0x03, 0x58, 0x3F, 0xA3, 0x02, 0x81, 0x82, 0x4A, 0x69, 0x43, 0x41, 0x4E, 0x44, 0x5F, 0x4D, 0x46, 0x53, 0x54, 0x41, 0x00, 0x04, 0x58, 0x27, 0x82, 0x14, 0xA2, 0x01, 0x50, 0x76, 0x17, 0xDA, 0xA5, 0x71, 0xFD, 0x5A, 0x85, 0x8F, 0x94, 0xE2, 0x8D, 0x73, 0x5C, 0xE9, 0xF4, diff --git a/tests/subsys/suit/orchestrator/manifest/src/manifest_recovery_validate_fail.c b/tests/subsys/suit/orchestrator/manifest/src/manifest_recovery_validate_fail.c index dca44019067a..9a6c44ff94ef 100644 --- a/tests/subsys/suit/orchestrator/manifest/src/manifest_recovery_validate_fail.c +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_recovery_validate_fail.c @@ -14,12 +14,12 @@ const uint8_t manifest_recovery_validate_fail_buf[] = { 0xD8, 0x6B, 0xA2, 0x02, 0x58, 0x7A, 0x82, 0x58, 0x24, 0x82, 0x2F, 0x58, 0x20, 0x41, 0x50, 0xC4, 0x6D, 0xE7, 0x03, 0x13, 0xF8, 0xAE, 0x84, 0x4B, 0x66, 0xAF, 0x5E, 0x56, 0x55, 0x55, 0x5F, 0x86, 0xB4, 0x5D, 0x11, 0xA9, 0x6F, 0x02, 0x4B, 0xED, 0x44, 0x81, 0xE7, 0xDC, 0x0C, - 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x7F, 0xFF, 0xFF, 0xE0, - 0xA0, 0xF6, 0x58, 0x40, 0x2A, 0x15, 0xFC, 0xA0, 0x41, 0xA7, 0x57, 0x0A, 0x2D, 0xF2, 0xC9, - 0xAE, 0x85, 0xA3, 0x10, 0x7A, 0xA2, 0x60, 0x7C, 0x1A, 0x8E, 0x82, 0x8E, 0x32, 0x93, 0x42, - 0x52, 0x7C, 0x6E, 0xE4, 0x43, 0x97, 0x27, 0x1F, 0x8F, 0xCB, 0x4A, 0xC8, 0xC3, 0x2F, 0x1A, - 0x85, 0xE9, 0x6F, 0x9D, 0xF3, 0x86, 0xFF, 0x86, 0xD2, 0x7C, 0x59, 0x12, 0x86, 0x8B, 0x1C, - 0xB4, 0x16, 0x61, 0xE3, 0xFC, 0xF3, 0xC5, 0xBE, 0x03, 0x58, 0x87, 0xA6, 0x01, 0x01, 0x02, + 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x40, 0x00, 0x00, 0x00, + 0xA0, 0xF6, 0x58, 0x40, 0x40, 0xFC, 0x02, 0x1C, 0xD1, 0x5F, 0x1D, 0x26, 0x8D, 0x35, 0x37, + 0xE0, 0xB3, 0xF8, 0xBC, 0xEB, 0x40, 0xA2, 0xE2, 0xB2, 0xCE, 0x24, 0xD7, 0x06, 0xC6, 0x40, + 0x1D, 0x6C, 0xB5, 0xE0, 0x25, 0x47, 0x29, 0xD5, 0x2D, 0xEC, 0x1E, 0xCE, 0x0E, 0x5B, 0x48, + 0x0D, 0xDE, 0xE2, 0x14, 0x03, 0xA8, 0xAE, 0x42, 0x4D, 0xA1, 0xD7, 0x63, 0x6A, 0x9D, 0x1A, + 0xCE, 0x75, 0x95, 0x90, 0xDA, 0xA4, 0xF9, 0x49, 0x03, 0x58, 0x87, 0xA6, 0x01, 0x01, 0x02, 0x01, 0x03, 0x58, 0x52, 0xA3, 0x02, 0x81, 0x82, 0x4A, 0x69, 0x43, 0x41, 0x4E, 0x44, 0x5F, 0x4D, 0x46, 0x53, 0x54, 0x41, 0x00, 0x04, 0x58, 0x3A, 0x82, 0x14, 0xA3, 0x01, 0x50, 0x76, 0x17, 0xDA, 0xA5, 0x71, 0xFD, 0x5A, 0x85, 0x8F, 0x94, 0xE2, 0x8D, 0x73, 0x5C, 0xE9, 0xF4, diff --git a/tests/subsys/suit/orchestrator/manifest/src/manifest_recovery_validate_load_fail.c b/tests/subsys/suit/orchestrator/manifest/src/manifest_recovery_validate_load_fail.c index d85de0246005..4a12c3a996d6 100644 --- a/tests/subsys/suit/orchestrator/manifest/src/manifest_recovery_validate_load_fail.c +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_recovery_validate_load_fail.c @@ -14,12 +14,12 @@ const uint8_t manifest_recovery_validate_load_fail_buf[] = { 0xD8, 0x6B, 0xA2, 0x02, 0x58, 0x7A, 0x82, 0x58, 0x24, 0x82, 0x2F, 0x58, 0x20, 0x7D, 0xEA, 0x06, 0x98, 0xF5, 0x82, 0x3F, 0x65, 0xBD, 0xC2, 0x18, 0xB5, 0x36, 0xCB, 0x30, 0xCB, 0xDA, 0x55, 0x00, 0xD9, 0x5C, 0x34, 0xBB, 0xD5, 0x53, 0x4C, 0x7F, 0x84, 0x37, 0x1D, 0xD8, 0xCD, - 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x7F, 0xFF, 0xFF, 0xE0, - 0xA0, 0xF6, 0x58, 0x40, 0x28, 0x4F, 0xBC, 0x35, 0x27, 0x5E, 0xF1, 0xE6, 0x47, 0xB8, 0xC3, - 0x35, 0x89, 0xAE, 0x2A, 0xE7, 0x9F, 0x8F, 0x67, 0x7B, 0x72, 0xA9, 0xDB, 0x4B, 0x18, 0x5F, - 0x25, 0x64, 0x32, 0x5D, 0x97, 0xD7, 0x69, 0xAC, 0xA3, 0x95, 0x06, 0x53, 0x8B, 0x4A, 0xF6, - 0x77, 0xDB, 0x3F, 0x7A, 0xAC, 0x5E, 0x28, 0xEF, 0xD2, 0xF8, 0x8F, 0x7C, 0x83, 0xF9, 0xB0, - 0x7B, 0x97, 0x47, 0xEC, 0x26, 0x9A, 0x22, 0xF7, 0x03, 0x58, 0x8C, 0xA7, 0x01, 0x01, 0x02, + 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x40, 0x00, 0x00, 0x00, + 0xA0, 0xF6, 0x58, 0x40, 0xDC, 0xF7, 0x5B, 0xF6, 0xD6, 0x9D, 0xB3, 0x4A, 0x59, 0xBD, 0x7C, + 0x33, 0xA0, 0x02, 0x07, 0x1C, 0xE6, 0x77, 0x3A, 0xE4, 0x33, 0x48, 0x28, 0x73, 0xF9, 0xE3, + 0x81, 0x27, 0x03, 0xE2, 0x66, 0xB0, 0xC0, 0x7A, 0xE2, 0x34, 0x60, 0x09, 0xE5, 0x50, 0xF5, + 0x64, 0x55, 0xC4, 0x9A, 0x53, 0xA3, 0x87, 0x31, 0xCF, 0x66, 0x15, 0x57, 0xDC, 0xE4, 0x2A, + 0x7E, 0xB1, 0x40, 0xEA, 0x74, 0xA0, 0x91, 0x43, 0x03, 0x58, 0x8C, 0xA7, 0x01, 0x01, 0x02, 0x01, 0x03, 0x58, 0x52, 0xA3, 0x02, 0x81, 0x82, 0x4A, 0x69, 0x43, 0x41, 0x4E, 0x44, 0x5F, 0x4D, 0x46, 0x53, 0x54, 0x41, 0x00, 0x04, 0x58, 0x3A, 0x82, 0x14, 0xA3, 0x01, 0x50, 0x76, 0x17, 0xDA, 0xA5, 0x71, 0xFD, 0x5A, 0x85, 0x8F, 0x94, 0xE2, 0x8D, 0x73, 0x5C, 0xE9, 0xF4, diff --git a/tests/subsys/suit/orchestrator/manifest/src/manifest_recovery_validate_load_invoke.c b/tests/subsys/suit/orchestrator/manifest/src/manifest_recovery_validate_load_invoke.c index a4522265d31d..86948d760a11 100644 --- a/tests/subsys/suit/orchestrator/manifest/src/manifest_recovery_validate_load_invoke.c +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_recovery_validate_load_invoke.c @@ -14,12 +14,12 @@ const uint8_t manifest_recovery_validate_load_invoke_buf[] = { 0xD8, 0x6B, 0xA2, 0x02, 0x58, 0x7A, 0x82, 0x58, 0x24, 0x82, 0x2F, 0x58, 0x20, 0x01, 0x91, 0xDA, 0x1A, 0x63, 0xEB, 0x7C, 0x1A, 0x32, 0x6B, 0xA4, 0xCE, 0x48, 0xDF, 0xAE, 0x51, 0x3F, 0x86, 0x8C, 0xE4, 0xFE, 0xA8, 0x99, 0xE5, 0x82, 0xE3, 0xB9, 0xBB, 0x8E, 0xE1, 0x49, 0x13, - 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x7F, 0xFF, 0xFF, 0xE0, - 0xA0, 0xF6, 0x58, 0x40, 0x0D, 0x3E, 0xC9, 0x58, 0xDB, 0xF2, 0x67, 0x19, 0x98, 0x2D, 0x35, - 0x34, 0xC2, 0xD6, 0x1C, 0x80, 0x2F, 0x2B, 0xBB, 0x66, 0xE3, 0x3C, 0xCD, 0xED, 0x85, 0x4B, - 0xD2, 0x18, 0xB0, 0x95, 0x2A, 0x94, 0x39, 0x9B, 0xCD, 0x7A, 0x6E, 0x34, 0x90, 0x28, 0xDE, - 0x36, 0x7F, 0x2A, 0x7A, 0xDA, 0x37, 0x83, 0x69, 0x57, 0x84, 0x21, 0x2D, 0x5C, 0x13, 0xB8, - 0xBF, 0x8F, 0x06, 0x01, 0x49, 0x87, 0x7F, 0x08, 0x03, 0x58, 0x76, 0xA7, 0x01, 0x01, 0x02, + 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x40, 0x00, 0x00, 0x00, + 0xA0, 0xF6, 0x58, 0x40, 0xC1, 0x6A, 0x22, 0xBC, 0x91, 0xDA, 0x46, 0xD4, 0x35, 0x61, 0xA9, + 0x18, 0x67, 0x3D, 0xC1, 0xFB, 0xB8, 0x47, 0x78, 0x65, 0x49, 0x9E, 0xF3, 0x70, 0x7D, 0xC6, + 0xE4, 0xEF, 0xAD, 0xF8, 0x38, 0x55, 0x79, 0xE9, 0xF0, 0x91, 0x8F, 0xC9, 0xFB, 0xCE, 0x06, + 0x7D, 0xF1, 0xAF, 0xE5, 0xE0, 0xCA, 0x4E, 0x49, 0x9B, 0xFF, 0xDC, 0xF5, 0x1E, 0xD6, 0xC2, + 0x09, 0xB1, 0x60, 0x40, 0x78, 0x86, 0x3F, 0xE7, 0x03, 0x58, 0x76, 0xA7, 0x01, 0x01, 0x02, 0x01, 0x03, 0x58, 0x3F, 0xA3, 0x02, 0x81, 0x82, 0x4A, 0x69, 0x43, 0x41, 0x4E, 0x44, 0x5F, 0x4D, 0x46, 0x53, 0x54, 0x41, 0x00, 0x04, 0x58, 0x27, 0x82, 0x14, 0xA2, 0x01, 0x50, 0x76, 0x17, 0xDA, 0xA5, 0x71, 0xFD, 0x5A, 0x85, 0x8F, 0x94, 0xE2, 0x8D, 0x73, 0x5C, 0xE9, 0xF4, diff --git a/tests/subsys/suit/orchestrator/manifest/src/manifest_recovery_validate_load_invoke_fail.c b/tests/subsys/suit/orchestrator/manifest/src/manifest_recovery_validate_load_invoke_fail.c index df1c1bc05efa..b32f9429d0be 100644 --- a/tests/subsys/suit/orchestrator/manifest/src/manifest_recovery_validate_load_invoke_fail.c +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_recovery_validate_load_invoke_fail.c @@ -14,12 +14,12 @@ const uint8_t manifest_recovery_validate_load_invoke_fail_buf[] = { 0xD8, 0x6B, 0xA2, 0x02, 0x58, 0x7A, 0x82, 0x58, 0x24, 0x82, 0x2F, 0x58, 0x20, 0x7F, 0x0E, 0x3C, 0x56, 0x16, 0xFE, 0xCC, 0xA7, 0xF3, 0xFB, 0x8A, 0x4A, 0xFE, 0x22, 0x45, 0xB8, 0xE1, 0x69, 0x08, 0x7C, 0x75, 0x50, 0xFC, 0x5D, 0x1A, 0xF5, 0x3D, 0x00, 0x86, 0x5D, 0x9A, 0x28, - 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x7F, 0xFF, 0xFF, 0xE0, - 0xA0, 0xF6, 0x58, 0x40, 0x54, 0xA3, 0xDA, 0x65, 0x13, 0xAA, 0xE5, 0x1D, 0x98, 0x0E, 0xE6, - 0x5B, 0x26, 0xFA, 0x81, 0xD0, 0xC9, 0x2E, 0x62, 0x7C, 0x81, 0x66, 0xB1, 0x40, 0xC5, 0xDF, - 0x45, 0xED, 0x96, 0x53, 0x36, 0xC8, 0x23, 0x0E, 0xCB, 0xE1, 0x89, 0xD5, 0x6B, 0x0F, 0x9A, - 0x56, 0x4F, 0x40, 0x7A, 0xA0, 0x28, 0xB6, 0xBA, 0xCE, 0x43, 0x64, 0x9C, 0x0D, 0x6B, 0x60, - 0x69, 0x60, 0x92, 0x93, 0x4A, 0xE4, 0x29, 0xA7, 0x03, 0x58, 0x8C, 0xA7, 0x01, 0x01, 0x02, + 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x40, 0x00, 0x00, 0x00, + 0xA0, 0xF6, 0x58, 0x40, 0x6F, 0x8C, 0x91, 0x6C, 0xF7, 0x3D, 0x68, 0x2F, 0x47, 0xE6, 0xA3, + 0xCA, 0x0C, 0xF4, 0x11, 0x54, 0x8D, 0xED, 0x46, 0xFA, 0xC9, 0xC2, 0x5A, 0x8A, 0x0D, 0x53, + 0x3B, 0x51, 0xA0, 0xB0, 0xB8, 0xB4, 0x38, 0xE2, 0xAD, 0x5F, 0x33, 0xE2, 0xE4, 0x85, 0xD7, + 0x0D, 0xE9, 0x72, 0xBE, 0x51, 0x67, 0x2F, 0xDE, 0xDF, 0x0E, 0xDC, 0x23, 0x6E, 0xB3, 0xA5, + 0x31, 0x05, 0xAB, 0x28, 0x19, 0x1D, 0x3F, 0xFF, 0x03, 0x58, 0x8C, 0xA7, 0x01, 0x01, 0x02, 0x01, 0x03, 0x58, 0x52, 0xA3, 0x02, 0x81, 0x82, 0x4A, 0x69, 0x43, 0x41, 0x4E, 0x44, 0x5F, 0x4D, 0x46, 0x53, 0x54, 0x41, 0x00, 0x04, 0x58, 0x3A, 0x82, 0x14, 0xA3, 0x01, 0x50, 0x76, 0x17, 0xDA, 0xA5, 0x71, 0xFD, 0x5A, 0x85, 0x8F, 0x94, 0xE2, 0x8D, 0x73, 0x5C, 0xE9, 0xF4, diff --git a/tests/subsys/suit/orchestrator/manifest/src/manifest_recovery_validate_load_no_invoke.c b/tests/subsys/suit/orchestrator/manifest/src/manifest_recovery_validate_load_no_invoke.c index c8f3028b2468..d0fd080db0a2 100644 --- a/tests/subsys/suit/orchestrator/manifest/src/manifest_recovery_validate_load_no_invoke.c +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_recovery_validate_load_no_invoke.c @@ -14,12 +14,12 @@ const uint8_t manifest_recovery_validate_load_no_invoke_buf[] = { 0xD8, 0x6B, 0xA2, 0x02, 0x58, 0x7A, 0x82, 0x58, 0x24, 0x82, 0x2F, 0x58, 0x20, 0x86, 0x3C, 0xD7, 0x87, 0x4A, 0xEE, 0xBE, 0x78, 0xA7, 0x57, 0x7C, 0xAE, 0xCB, 0xBA, 0x7D, 0x5E, 0x3D, 0xB1, 0xAC, 0x8B, 0x36, 0xD8, 0xB1, 0x79, 0xAA, 0xD4, 0xEA, 0xB2, 0xEA, 0x66, 0xA7, 0x74, - 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x7F, 0xFF, 0xFF, 0xE0, - 0xA0, 0xF6, 0x58, 0x40, 0xC5, 0x41, 0xAA, 0x3F, 0x82, 0x8C, 0xB2, 0xE8, 0x71, 0x2B, 0xD6, - 0x19, 0xEA, 0xC7, 0x7D, 0xB4, 0xC6, 0xAD, 0x7B, 0x06, 0xE6, 0x0F, 0x51, 0xDB, 0x4F, 0x6B, - 0x56, 0x7E, 0x3B, 0x66, 0xB2, 0xD4, 0xA6, 0x72, 0xBA, 0x84, 0x01, 0xF5, 0xC5, 0x96, 0xC6, - 0xA7, 0xE8, 0x08, 0x85, 0xD4, 0xB9, 0xD9, 0xD7, 0xF7, 0x97, 0xC4, 0x94, 0x24, 0xA6, 0x92, - 0xA9, 0x54, 0xB1, 0xD1, 0x34, 0x5D, 0x96, 0x72, 0x03, 0x58, 0x71, 0xA6, 0x01, 0x01, 0x02, + 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x40, 0x00, 0x00, 0x00, + 0xA0, 0xF6, 0x58, 0x40, 0x29, 0xB9, 0x06, 0xB0, 0xC0, 0x19, 0xB2, 0x8D, 0x6D, 0x24, 0xB4, + 0xF1, 0x80, 0x4D, 0x56, 0xA8, 0x00, 0xC3, 0x62, 0x6C, 0xBA, 0x30, 0x11, 0xF7, 0x89, 0xC5, + 0xC9, 0xB8, 0x69, 0x7F, 0x61, 0x8C, 0x1C, 0xA2, 0xA2, 0xE9, 0xE1, 0xC2, 0xF8, 0xE5, 0x3F, + 0xF6, 0x1B, 0x8F, 0x8E, 0xB3, 0xED, 0x72, 0x0B, 0x1E, 0x00, 0x41, 0x64, 0x8A, 0x0F, 0x32, + 0xD9, 0xED, 0xD6, 0x9B, 0xCA, 0x94, 0xCC, 0xD4, 0x03, 0x58, 0x71, 0xA6, 0x01, 0x01, 0x02, 0x01, 0x03, 0x58, 0x3F, 0xA3, 0x02, 0x81, 0x82, 0x4A, 0x69, 0x43, 0x41, 0x4E, 0x44, 0x5F, 0x4D, 0x46, 0x53, 0x54, 0x41, 0x00, 0x04, 0x58, 0x27, 0x82, 0x14, 0xA2, 0x01, 0x50, 0x76, 0x17, 0xDA, 0xA5, 0x71, 0xFD, 0x5A, 0x85, 0x8F, 0x94, 0xE2, 0x8D, 0x73, 0x5C, 0xE9, 0xF4, diff --git a/tests/subsys/suit/orchestrator/manifest/src/manifest_root_candidate_verification_fail.c b/tests/subsys/suit/orchestrator/manifest/src/manifest_root_candidate_verification_fail.c index 0f08c734f196..2d1188c901ff 100644 --- a/tests/subsys/suit/orchestrator/manifest/src/manifest_root_candidate_verification_fail.c +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_root_candidate_verification_fail.c @@ -14,12 +14,12 @@ uint8_t manifest_root_candidate_verification_fail_buf[] = { 0xD8, 0x6B, 0xA2, 0x02, 0x58, 0x7A, 0x82, 0x58, 0x24, 0x82, 0x2F, 0x58, 0x20, 0x58, 0x26, 0xB9, 0xAE, 0xED, 0x51, 0xDE, 0x3C, 0x7C, 0x47, 0xE5, 0x7C, 0xA6, 0xB4, 0x51, 0x82, 0x44, 0x54, 0xB9, 0x3B, 0x79, 0xF5, 0xBA, 0xE8, 0x70, 0x34, 0x82, 0xCE, 0xFA, 0x6C, 0xF6, 0x45, - 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x7F, 0xFF, 0xFF, 0xE0, - 0xA0, 0xF6, 0x58, 0x40, 0x5B, 0x59, 0xEA, 0xD1, 0xCC, 0x13, 0xB0, 0x3E, 0x10, 0x52, 0x4F, - 0xC9, 0xC8, 0x60, 0x8F, 0xCA, 0xAC, 0x58, 0x52, 0xF3, 0x78, 0xF1, 0xF7, 0x10, 0xBE, 0x9A, - 0x9A, 0xA0, 0x45, 0xDF, 0x71, 0xB1, 0x90, 0xC5, 0x0A, 0x6A, 0xAD, 0x4F, 0x1C, 0xBA, 0xCB, - 0x09, 0x2E, 0x97, 0x95, 0xC7, 0x44, 0xF0, 0xA4, 0x93, 0x44, 0x6C, 0x37, 0xB3, 0xFE, 0x3C, - 0xA1, 0x37, 0x89, 0xCD, 0x82, 0x88, 0x38, 0xFF, 0x03, 0x58, 0x87, 0xA6, 0x01, 0x01, 0x02, + 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x40, 0x00, 0x00, 0x00, + 0xA0, 0xF6, 0x58, 0x40, 0x5B, 0x14, 0xD8, 0x95, 0x71, 0x09, 0x46, 0xA9, 0x86, 0x6F, 0xAB, + 0xB3, 0x88, 0xA6, 0xD0, 0x59, 0x3F, 0xB1, 0x32, 0xAA, 0x58, 0x5F, 0x2F, 0xB4, 0x16, 0x1F, + 0x55, 0xC0, 0x78, 0x04, 0x8A, 0x88, 0x53, 0xD9, 0xE8, 0xC7, 0xCB, 0x87, 0x04, 0x1C, 0x1B, + 0x46, 0x4D, 0x65, 0x15, 0x70, 0xE8, 0xF1, 0xCF, 0x93, 0x3C, 0x8B, 0x93, 0x0C, 0x20, 0x4C, + 0x65, 0xBE, 0x8D, 0x2F, 0x49, 0xFB, 0x5C, 0xAD, 0x03, 0x58, 0x87, 0xA6, 0x01, 0x01, 0x02, 0x01, 0x03, 0x58, 0x52, 0xA3, 0x02, 0x81, 0x82, 0x4A, 0x69, 0x43, 0x41, 0x4E, 0x44, 0x5F, 0x4D, 0x46, 0x53, 0x54, 0x41, 0x00, 0x04, 0x58, 0x3A, 0x82, 0x14, 0xA3, 0x01, 0x50, 0x76, 0x17, 0xDA, 0xA5, 0x71, 0xFD, 0x5A, 0x85, 0x8F, 0x94, 0xE2, 0x8D, 0x73, 0x5C, 0xE9, 0xF4, diff --git a/tests/subsys/suit/orchestrator/manifest/src/manifest_root_candidate_verification_install.c b/tests/subsys/suit/orchestrator/manifest/src/manifest_root_candidate_verification_install.c index c67df67facf4..6789935088e7 100644 --- a/tests/subsys/suit/orchestrator/manifest/src/manifest_root_candidate_verification_install.c +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_root_candidate_verification_install.c @@ -14,12 +14,12 @@ uint8_t manifest_root_candidate_verification_install_buf[] = { 0xD8, 0x6B, 0xA2, 0x02, 0x58, 0x7A, 0x82, 0x58, 0x24, 0x82, 0x2F, 0x58, 0x20, 0x1A, 0x58, 0x25, 0xFD, 0x2F, 0x9E, 0xED, 0x27, 0x52, 0x24, 0x7C, 0x01, 0x65, 0xB3, 0xD5, 0x4B, 0x48, 0xAE, 0xED, 0xDE, 0x9E, 0x4D, 0x7A, 0xEC, 0xB4, 0xC6, 0xD6, 0x35, 0x8E, 0xEF, 0x98, 0x42, - 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x7F, 0xFF, 0xFF, 0xE0, - 0xA0, 0xF6, 0x58, 0x40, 0xD8, 0xF1, 0xE3, 0x8D, 0x19, 0x74, 0xD6, 0xDE, 0xD3, 0xE4, 0x5A, - 0xC2, 0x27, 0xDE, 0x84, 0x3B, 0xE0, 0x7D, 0xF9, 0xC5, 0x58, 0x5A, 0x4F, 0xE6, 0xB4, 0xC4, - 0xC8, 0x74, 0x3C, 0xB6, 0x9D, 0xD6, 0xB7, 0x0E, 0x8B, 0xE6, 0x99, 0xC1, 0x3C, 0x55, 0xE0, - 0xF6, 0xBE, 0x5A, 0x4B, 0x8C, 0x19, 0xA4, 0xFA, 0x82, 0xDA, 0x15, 0x5F, 0x09, 0xD2, 0x14, - 0x27, 0x75, 0xD2, 0xCC, 0xD5, 0x34, 0xF2, 0x9F, 0x03, 0x58, 0x84, 0xA6, 0x01, 0x01, 0x02, + 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x40, 0x00, 0x00, 0x00, + 0xA0, 0xF6, 0x58, 0x40, 0xED, 0x9C, 0x73, 0xC0, 0xF9, 0xD3, 0x01, 0x0B, 0x10, 0x34, 0x4E, + 0x69, 0xB5, 0x35, 0xAC, 0xC1, 0x7D, 0x3A, 0x55, 0xD5, 0xD1, 0xBB, 0x1C, 0xFD, 0x69, 0xA4, + 0x10, 0xB1, 0x86, 0xE4, 0xDE, 0xB7, 0xFD, 0x16, 0xBD, 0xED, 0x33, 0xC5, 0xA4, 0x6E, 0xB5, + 0xC2, 0xAF, 0xEF, 0x80, 0xE9, 0x28, 0x46, 0x6A, 0xE9, 0x31, 0xD0, 0xDA, 0x6C, 0x31, 0x26, + 0x3D, 0x81, 0xBD, 0xEA, 0xF3, 0x9C, 0xAB, 0xCF, 0x03, 0x58, 0x84, 0xA6, 0x01, 0x01, 0x02, 0x01, 0x03, 0x58, 0x52, 0xA3, 0x02, 0x81, 0x82, 0x4A, 0x69, 0x43, 0x41, 0x4E, 0x44, 0x5F, 0x4D, 0x46, 0x53, 0x54, 0x41, 0x00, 0x04, 0x58, 0x3A, 0x82, 0x14, 0xA3, 0x01, 0x50, 0x76, 0x17, 0xDA, 0xA5, 0x71, 0xFD, 0x5A, 0x85, 0x8F, 0x94, 0xE2, 0x8D, 0x73, 0x5C, 0xE9, 0xF4, diff --git a/tests/subsys/suit/orchestrator/manifest/src/manifest_root_candidate_verification_install_fail.c b/tests/subsys/suit/orchestrator/manifest/src/manifest_root_candidate_verification_install_fail.c index c4ecfd2a16e8..085d22d01b17 100644 --- a/tests/subsys/suit/orchestrator/manifest/src/manifest_root_candidate_verification_install_fail.c +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_root_candidate_verification_install_fail.c @@ -14,12 +14,12 @@ uint8_t manifest_root_candidate_verification_install_fail_buf[] = { 0xD8, 0x6B, 0xA2, 0x02, 0x58, 0x7A, 0x82, 0x58, 0x24, 0x82, 0x2F, 0x58, 0x20, 0xBF, 0x29, 0x13, 0x70, 0x6A, 0x6F, 0xCF, 0xEB, 0x34, 0x00, 0x46, 0xE4, 0xE3, 0xAB, 0x0C, 0x63, 0xBE, 0x4B, 0x5F, 0x91, 0xDA, 0x44, 0xBD, 0xB4, 0x34, 0x23, 0xD3, 0x6F, 0x60, 0x10, 0x0C, 0x15, - 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x7F, 0xFF, 0xFF, 0xE0, - 0xA0, 0xF6, 0x58, 0x40, 0x68, 0x7C, 0x8F, 0x79, 0x43, 0x28, 0x99, 0x95, 0xCF, 0x43, 0x39, - 0x21, 0xD5, 0xC6, 0xA3, 0x5D, 0x90, 0xF2, 0x8F, 0x1C, 0x6A, 0xD4, 0x3F, 0x08, 0x43, 0xEF, - 0x39, 0x4B, 0x03, 0x50, 0xCD, 0x9F, 0x23, 0xEF, 0x3E, 0x06, 0xAE, 0xE9, 0xB3, 0x18, 0x9D, - 0x3E, 0x39, 0x36, 0x8E, 0xC5, 0xD6, 0x70, 0xA8, 0x57, 0xAB, 0xE2, 0x31, 0x70, 0x25, 0xE9, - 0xB9, 0xC4, 0x10, 0x4B, 0x8D, 0xC7, 0x99, 0xA4, 0x03, 0x58, 0x87, 0xA6, 0x01, 0x01, 0x02, + 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x40, 0x00, 0x00, 0x00, + 0xA0, 0xF6, 0x58, 0x40, 0x91, 0xCB, 0x7C, 0x86, 0x77, 0xE3, 0x50, 0xDE, 0x8F, 0x1E, 0x10, + 0x2C, 0xAF, 0xB3, 0xC3, 0xA2, 0xB3, 0x4F, 0x43, 0x5E, 0x61, 0x2C, 0xD8, 0xC7, 0x5E, 0xEA, + 0xD2, 0x8F, 0x6C, 0x39, 0xB8, 0xF2, 0xFB, 0x28, 0x21, 0xDB, 0x3A, 0xC6, 0x91, 0x0A, 0xE6, + 0xCB, 0xBB, 0x21, 0xFB, 0x00, 0xE1, 0x06, 0x40, 0xDA, 0x76, 0x25, 0x27, 0x14, 0x05, 0x81, + 0x3E, 0x7D, 0x53, 0xD7, 0xA8, 0x2B, 0xC4, 0x4B, 0x03, 0x58, 0x87, 0xA6, 0x01, 0x01, 0x02, 0x01, 0x03, 0x58, 0x52, 0xA3, 0x02, 0x81, 0x82, 0x4A, 0x69, 0x43, 0x41, 0x4E, 0x44, 0x5F, 0x4D, 0x46, 0x53, 0x54, 0x41, 0x00, 0x04, 0x58, 0x3A, 0x82, 0x14, 0xA3, 0x01, 0x50, 0x76, 0x17, 0xDA, 0xA5, 0x71, 0xFD, 0x5A, 0x85, 0x8F, 0x94, 0xE2, 0x8D, 0x73, 0x5C, 0xE9, 0xF4, diff --git a/tests/subsys/suit/orchestrator/manifest/src/manifest_root_candidate_verification_no_install.c b/tests/subsys/suit/orchestrator/manifest/src/manifest_root_candidate_verification_no_install.c index 1c301c9e16d1..f82555e7b3e8 100644 --- a/tests/subsys/suit/orchestrator/manifest/src/manifest_root_candidate_verification_no_install.c +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_root_candidate_verification_no_install.c @@ -14,12 +14,12 @@ uint8_t manifest_root_candidate_verification_no_install_buf[] = { 0xD8, 0x6B, 0xA2, 0x02, 0x58, 0x7A, 0x82, 0x58, 0x24, 0x82, 0x2F, 0x58, 0x20, 0x95, 0x00, 0xE8, 0x75, 0x5C, 0x21, 0x5A, 0x97, 0x76, 0x64, 0xA7, 0xB9, 0x9B, 0x43, 0x3E, 0x5A, 0x9F, 0x43, 0x8F, 0x9B, 0x04, 0x3E, 0x71, 0xA5, 0x93, 0x16, 0x0E, 0x0A, 0x60, 0x6E, 0xFD, 0xDC, - 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x7F, 0xFF, 0xFF, 0xE0, - 0xA0, 0xF6, 0x58, 0x40, 0x63, 0x12, 0xBC, 0x4E, 0x79, 0xF1, 0x3A, 0x79, 0x8A, 0x82, 0x1D, - 0xFA, 0x67, 0x9B, 0xB6, 0xF8, 0x4B, 0xBF, 0x9E, 0x88, 0xAC, 0x32, 0xAD, 0x79, 0x53, 0x96, - 0x3D, 0xE8, 0x00, 0x4A, 0xDB, 0x5A, 0x76, 0x6A, 0xF1, 0xBD, 0xAD, 0xAE, 0xD7, 0x99, 0x42, - 0xAC, 0x2C, 0x62, 0x8B, 0xBE, 0x71, 0xA6, 0x6F, 0xD9, 0xE2, 0x4D, 0xE1, 0x26, 0x9E, 0x42, - 0x66, 0x5B, 0xFD, 0x5C, 0x89, 0x2A, 0x91, 0xC2, 0x03, 0x58, 0x7F, 0xA5, 0x01, 0x01, 0x02, + 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x40, 0x00, 0x00, 0x00, + 0xA0, 0xF6, 0x58, 0x40, 0x8A, 0xB4, 0xA2, 0xD6, 0x54, 0x3C, 0x08, 0x64, 0x24, 0xE3, 0x2F, + 0xFC, 0xFD, 0xDC, 0xD0, 0xC8, 0x07, 0x5E, 0xC3, 0x73, 0xB5, 0x6B, 0x2A, 0x9D, 0x6A, 0x7C, + 0x1E, 0x8E, 0x54, 0xF7, 0x60, 0x35, 0xED, 0xFE, 0x61, 0x94, 0xE3, 0x1C, 0x41, 0xE0, 0xAD, + 0x8D, 0x85, 0xB6, 0x6E, 0x1C, 0x98, 0x02, 0xA1, 0x5C, 0x35, 0x66, 0x2A, 0x7C, 0x66, 0x29, + 0xA7, 0x81, 0x54, 0x7B, 0x50, 0x37, 0xD8, 0x76, 0x03, 0x58, 0x7F, 0xA5, 0x01, 0x01, 0x02, 0x01, 0x03, 0x58, 0x52, 0xA3, 0x02, 0x81, 0x82, 0x4A, 0x69, 0x43, 0x41, 0x4E, 0x44, 0x5F, 0x4D, 0x46, 0x53, 0x54, 0x41, 0x00, 0x04, 0x58, 0x3A, 0x82, 0x14, 0xA3, 0x01, 0x50, 0x76, 0x17, 0xDA, 0xA5, 0x71, 0xFD, 0x5A, 0x85, 0x8F, 0x94, 0xE2, 0x8D, 0x73, 0x5C, 0xE9, 0xF4, diff --git a/tests/subsys/suit/orchestrator/manifest/src/manifest_root_no_validate.c b/tests/subsys/suit/orchestrator/manifest/src/manifest_root_no_validate.c index 1cfd46568201..041c18ae33f7 100644 --- a/tests/subsys/suit/orchestrator/manifest/src/manifest_root_no_validate.c +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_root_no_validate.c @@ -14,12 +14,12 @@ const uint8_t manifest_root_no_validate_buf[] = { 0xD8, 0x6B, 0xA2, 0x02, 0x58, 0x7A, 0x82, 0x58, 0x24, 0x82, 0x2F, 0x58, 0x20, 0x6A, 0x4D, 0xE0, 0xB9, 0x92, 0xDA, 0x50, 0xB6, 0x75, 0x2A, 0xCA, 0x6A, 0x5F, 0xF6, 0x53, 0xB8, 0xD1, 0xFB, 0x09, 0xF0, 0x25, 0x57, 0x04, 0xD8, 0xCF, 0x63, 0xBA, 0xD6, 0x48, 0x59, 0x2F, 0x4F, - 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x7F, 0xFF, 0xFF, 0xE0, - 0xA0, 0xF6, 0x58, 0x40, 0xDF, 0xCE, 0x3B, 0xA5, 0x63, 0xAF, 0xDC, 0x4C, 0x8B, 0x5F, 0x59, - 0x09, 0x6B, 0x21, 0x7C, 0x5D, 0x2E, 0xE3, 0x6D, 0xBF, 0xC3, 0x80, 0x95, 0xF4, 0x00, 0xCD, - 0x08, 0xB3, 0x97, 0xE6, 0x93, 0x6C, 0x67, 0xA5, 0xA8, 0xCC, 0x0E, 0x95, 0xE6, 0x46, 0x9E, - 0xFF, 0xA6, 0xF2, 0xDD, 0x06, 0x3F, 0xAA, 0x3E, 0x85, 0xF7, 0x63, 0xA8, 0x3B, 0xD2, 0xB8, - 0x4B, 0x6F, 0x56, 0xEA, 0x26, 0xFD, 0x26, 0x07, 0x03, 0x58, 0x6C, 0xA5, 0x01, 0x01, 0x02, + 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x40, 0x00, 0x00, 0x00, + 0xA0, 0xF6, 0x58, 0x40, 0x1D, 0xD5, 0x3B, 0x4A, 0xDE, 0x01, 0xEE, 0xA2, 0x2D, 0x09, 0xB9, + 0x24, 0x4C, 0x3C, 0x17, 0x97, 0x6A, 0xAD, 0x91, 0x09, 0x05, 0xB2, 0x0E, 0x45, 0x42, 0x0C, + 0x00, 0x42, 0x70, 0x1B, 0xB4, 0x50, 0xBF, 0x71, 0x2D, 0xD0, 0xFF, 0xE4, 0xE9, 0xD1, 0x4C, + 0x33, 0x49, 0xD9, 0x40, 0xE4, 0x4D, 0x4A, 0xAD, 0xCB, 0xE4, 0x41, 0xA2, 0xBC, 0x4F, 0x9E, + 0xB3, 0xE5, 0x49, 0xF0, 0x26, 0x59, 0x8A, 0x57, 0x03, 0x58, 0x6C, 0xA5, 0x01, 0x01, 0x02, 0x01, 0x03, 0x58, 0x3F, 0xA3, 0x02, 0x81, 0x82, 0x4A, 0x69, 0x43, 0x41, 0x4E, 0x44, 0x5F, 0x4D, 0x46, 0x53, 0x54, 0x41, 0x00, 0x04, 0x58, 0x27, 0x82, 0x14, 0xA2, 0x01, 0x50, 0x76, 0x17, 0xDA, 0xA5, 0x71, 0xFD, 0x5A, 0x85, 0x8F, 0x94, 0xE2, 0x8D, 0x73, 0x5C, 0xE9, 0xF4, diff --git a/tests/subsys/suit/orchestrator/manifest/src/manifest_root_unsupported_command.c b/tests/subsys/suit/orchestrator/manifest/src/manifest_root_unsupported_command.c index f01c6ee324d1..7255255056d7 100644 --- a/tests/subsys/suit/orchestrator/manifest/src/manifest_root_unsupported_command.c +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_root_unsupported_command.c @@ -14,12 +14,12 @@ uint8_t manifest_root_unsupported_command_buf[] = { 0xD8, 0x6B, 0xA2, 0x02, 0x58, 0x7A, 0x82, 0x58, 0x24, 0x82, 0x2F, 0x58, 0x20, 0x99, 0xC8, 0x96, 0x7E, 0x44, 0x28, 0xB7, 0x54, 0x60, 0xF9, 0x95, 0x93, 0x6A, 0xEE, 0x8B, 0xBD, 0x8F, 0xE5, 0xB4, 0x87, 0xF2, 0xB4, 0x02, 0xC9, 0x77, 0x88, 0xC8, 0x91, 0xB0, 0xB4, 0x16, 0xCB, - 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x7F, 0xFF, 0xFF, 0xE0, - 0xA0, 0xF6, 0x58, 0x40, 0xEE, 0x69, 0xE7, 0xB5, 0xE6, 0x30, 0x68, 0x8E, 0x48, 0x0E, 0x35, - 0x13, 0x21, 0x94, 0x8E, 0x6D, 0x5A, 0x08, 0xEC, 0x36, 0x31, 0x15, 0x96, 0x6A, 0x48, 0x32, - 0xE2, 0x6D, 0x84, 0x0C, 0x16, 0x33, 0x81, 0xB9, 0x93, 0x9F, 0xB2, 0x34, 0x24, 0x27, 0x44, - 0x12, 0xF7, 0xE0, 0xB4, 0x04, 0x6B, 0x44, 0xFD, 0x21, 0xF6, 0x6E, 0xD9, 0x66, 0xD0, 0x66, - 0x6E, 0xD4, 0xD4, 0xE4, 0x5B, 0x00, 0x36, 0x33, 0x03, 0x58, 0x6E, 0xA5, 0x01, 0x01, 0x02, + 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x40, 0x00, 0x00, 0x00, + 0xA0, 0xF6, 0x58, 0x40, 0xB4, 0x02, 0x66, 0x0F, 0xED, 0x3A, 0xD5, 0x9B, 0xB5, 0x08, 0x9D, + 0xFA, 0x72, 0xB0, 0x97, 0x04, 0x04, 0x78, 0xFB, 0x08, 0x9C, 0x91, 0xBD, 0xC9, 0xCF, 0x14, + 0xB4, 0xE3, 0x7F, 0x5D, 0x48, 0xB6, 0x7C, 0x51, 0xE1, 0xA5, 0x5A, 0x0A, 0x7A, 0x90, 0x2D, + 0x6C, 0x5A, 0xC5, 0x41, 0x9B, 0x60, 0x42, 0xE6, 0x62, 0xC1, 0xD6, 0x47, 0x31, 0xA9, 0x07, + 0x13, 0x9E, 0x13, 0x4C, 0x4D, 0x21, 0x4B, 0x5E, 0x03, 0x58, 0x6E, 0xA5, 0x01, 0x01, 0x02, 0x01, 0x03, 0x58, 0x3F, 0xA3, 0x02, 0x81, 0x82, 0x4A, 0x69, 0x43, 0x41, 0x4E, 0x44, 0x5F, 0x4D, 0x46, 0x53, 0x54, 0x41, 0x00, 0x04, 0x58, 0x27, 0x82, 0x14, 0xA2, 0x01, 0x50, 0x76, 0x17, 0xDA, 0xA5, 0x71, 0xFD, 0x5A, 0x85, 0x8F, 0x94, 0xE2, 0x8D, 0x73, 0x5C, 0xE9, 0xF4, diff --git a/tests/subsys/suit/orchestrator/manifest/src/manifest_root_validate_fail.c b/tests/subsys/suit/orchestrator/manifest/src/manifest_root_validate_fail.c index df9e3031bc38..cf2d3d214f58 100644 --- a/tests/subsys/suit/orchestrator/manifest/src/manifest_root_validate_fail.c +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_root_validate_fail.c @@ -14,12 +14,12 @@ const uint8_t manifest_root_validate_fail_buf[] = { 0xD8, 0x6B, 0xA2, 0x02, 0x58, 0x7A, 0x82, 0x58, 0x24, 0x82, 0x2F, 0x58, 0x20, 0x8D, 0x1E, 0x66, 0xE8, 0x32, 0x13, 0x16, 0x4E, 0x57, 0x8A, 0x32, 0x3F, 0x2A, 0x25, 0xA8, 0x83, 0x7E, 0x0F, 0x08, 0x9C, 0xAC, 0x15, 0x90, 0x2A, 0x22, 0x2F, 0x49, 0x31, 0x5A, 0xD5, 0xEE, 0x85, - 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x7F, 0xFF, 0xFF, 0xE0, - 0xA0, 0xF6, 0x58, 0x40, 0x4F, 0x46, 0x80, 0x76, 0x4F, 0x78, 0xA7, 0x12, 0x23, 0x9B, 0x3C, - 0xA6, 0xAD, 0x3E, 0x26, 0xCF, 0xB6, 0x3C, 0xBE, 0x02, 0x3E, 0x3D, 0x4A, 0x23, 0x3F, 0x68, - 0x8F, 0x9A, 0x7B, 0xCD, 0x0D, 0x9A, 0x2D, 0x56, 0xFF, 0xB5, 0x5E, 0xF2, 0x3D, 0x0A, 0x19, - 0x1C, 0x1A, 0xAC, 0x83, 0xA2, 0xB2, 0x2D, 0x68, 0xA9, 0xAB, 0x75, 0x86, 0x1C, 0xB7, 0x11, - 0x45, 0xB2, 0x6B, 0x4E, 0x06, 0x2E, 0x70, 0xEF, 0x03, 0x58, 0x87, 0xA6, 0x01, 0x01, 0x02, + 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x40, 0x00, 0x00, 0x00, + 0xA0, 0xF6, 0x58, 0x40, 0x9E, 0xBD, 0x3F, 0x9E, 0x7B, 0xB7, 0x94, 0xCA, 0x81, 0xBC, 0x20, + 0xE7, 0x1E, 0x35, 0x0F, 0x00, 0x65, 0xFB, 0x2C, 0x87, 0xED, 0xD4, 0xBF, 0xE3, 0xDC, 0x20, + 0xAD, 0xB5, 0xA2, 0x0F, 0x16, 0xEC, 0x1D, 0x62, 0x01, 0xD3, 0x4B, 0xEC, 0x06, 0x94, 0x1A, + 0xF4, 0x0C, 0xEA, 0xFE, 0x92, 0xA6, 0xF7, 0x78, 0x59, 0x14, 0x0B, 0x06, 0xBA, 0x50, 0xDF, + 0x8B, 0xF5, 0x65, 0x52, 0x29, 0x74, 0x34, 0xD8, 0x03, 0x58, 0x87, 0xA6, 0x01, 0x01, 0x02, 0x01, 0x03, 0x58, 0x52, 0xA3, 0x02, 0x81, 0x82, 0x4A, 0x69, 0x43, 0x41, 0x4E, 0x44, 0x5F, 0x4D, 0x46, 0x53, 0x54, 0x41, 0x00, 0x04, 0x58, 0x3A, 0x82, 0x14, 0xA3, 0x01, 0x50, 0x76, 0x17, 0xDA, 0xA5, 0x71, 0xFD, 0x5A, 0x85, 0x8F, 0x94, 0xE2, 0x8D, 0x73, 0x5C, 0xE9, 0xF4, diff --git a/tests/subsys/suit/orchestrator/manifest/src/manifest_root_validate_load_fail.c b/tests/subsys/suit/orchestrator/manifest/src/manifest_root_validate_load_fail.c index 7aba051392a5..d164b2181aef 100644 --- a/tests/subsys/suit/orchestrator/manifest/src/manifest_root_validate_load_fail.c +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_root_validate_load_fail.c @@ -14,12 +14,12 @@ const uint8_t manifest_root_validate_load_fail_buf[] = { 0xD8, 0x6B, 0xA2, 0x02, 0x58, 0x7A, 0x82, 0x58, 0x24, 0x82, 0x2F, 0x58, 0x20, 0xE2, 0x9F, 0x20, 0x0A, 0xA7, 0x4B, 0xD4, 0xAD, 0xCD, 0x76, 0xBD, 0xA9, 0x76, 0xFB, 0xB3, 0xD7, 0x54, 0x46, 0xD2, 0x6A, 0xF7, 0xCE, 0x7D, 0x4F, 0x34, 0x26, 0x43, 0x40, 0x90, 0xAA, 0x39, 0x5B, - 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x7F, 0xFF, 0xFF, 0xE0, - 0xA0, 0xF6, 0x58, 0x40, 0xF4, 0xDB, 0xB6, 0xA8, 0x82, 0xF5, 0xBD, 0x9C, 0x1D, 0xD8, 0xB2, - 0xE3, 0xDB, 0x09, 0x83, 0x5E, 0x59, 0x7F, 0xD2, 0x48, 0xA5, 0x3A, 0xA6, 0x69, 0xD3, 0x0E, - 0x0E, 0x36, 0x7A, 0x50, 0x73, 0x10, 0x3B, 0xEB, 0x80, 0xD2, 0x5E, 0x63, 0xD3, 0x29, 0xE4, - 0xDF, 0xE2, 0xFE, 0xA1, 0x0C, 0x0A, 0x57, 0x36, 0x69, 0xDC, 0x3F, 0xB9, 0xA7, 0xF5, 0x05, - 0x8C, 0x23, 0x2A, 0x20, 0xFC, 0xBB, 0x18, 0x43, 0x03, 0x58, 0x8C, 0xA7, 0x01, 0x01, 0x02, + 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x40, 0x00, 0x00, 0x00, + 0xA0, 0xF6, 0x58, 0x40, 0xE5, 0xED, 0xD6, 0xEA, 0x6B, 0x52, 0x91, 0xE3, 0xB2, 0x41, 0xCA, + 0x5B, 0xE8, 0x69, 0x10, 0x2C, 0x20, 0x16, 0x1B, 0xD5, 0x13, 0x20, 0x57, 0x2A, 0x96, 0xC6, + 0x68, 0x4E, 0x53, 0x12, 0x96, 0xFD, 0x15, 0x6C, 0xF3, 0xBB, 0x09, 0x9F, 0xCE, 0x61, 0xC7, + 0x23, 0x45, 0xF2, 0x13, 0x62, 0x38, 0x8C, 0xA0, 0x19, 0xE5, 0x67, 0x65, 0x66, 0xE4, 0xC8, + 0x73, 0x86, 0x26, 0x1A, 0x8D, 0x72, 0x27, 0xB0, 0x03, 0x58, 0x8C, 0xA7, 0x01, 0x01, 0x02, 0x01, 0x03, 0x58, 0x52, 0xA3, 0x02, 0x81, 0x82, 0x4A, 0x69, 0x43, 0x41, 0x4E, 0x44, 0x5F, 0x4D, 0x46, 0x53, 0x54, 0x41, 0x00, 0x04, 0x58, 0x3A, 0x82, 0x14, 0xA3, 0x01, 0x50, 0x76, 0x17, 0xDA, 0xA5, 0x71, 0xFD, 0x5A, 0x85, 0x8F, 0x94, 0xE2, 0x8D, 0x73, 0x5C, 0xE9, 0xF4, diff --git a/tests/subsys/suit/orchestrator/manifest/src/manifest_root_validate_load_invoke.c b/tests/subsys/suit/orchestrator/manifest/src/manifest_root_validate_load_invoke.c index 0e554c54dcc0..7adb7aa3ee8e 100644 --- a/tests/subsys/suit/orchestrator/manifest/src/manifest_root_validate_load_invoke.c +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_root_validate_load_invoke.c @@ -14,12 +14,12 @@ const uint8_t manifest_root_validate_load_invoke_buf[] = { 0xD8, 0x6B, 0xA2, 0x02, 0x58, 0x7A, 0x82, 0x58, 0x24, 0x82, 0x2F, 0x58, 0x20, 0xAD, 0xD8, 0x6F, 0xE0, 0x24, 0x24, 0x84, 0x6B, 0x35, 0x69, 0x47, 0x27, 0x46, 0xE9, 0x16, 0x8E, 0xCE, 0xF5, 0x89, 0x92, 0x7F, 0x88, 0x92, 0xD8, 0x33, 0x1E, 0x65, 0x41, 0x26, 0x24, 0xE6, 0xAC, - 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x7F, 0xFF, 0xFF, 0xE0, - 0xA0, 0xF6, 0x58, 0x40, 0x89, 0x80, 0xAF, 0xEA, 0xEA, 0xA2, 0x74, 0x66, 0xF3, 0x35, 0x23, - 0x8E, 0xD3, 0xA0, 0x83, 0x9D, 0x63, 0x4B, 0x2B, 0x56, 0x72, 0x68, 0x0A, 0x67, 0x29, 0xBA, - 0xC0, 0xB0, 0xD7, 0x19, 0x0F, 0xBE, 0x8C, 0x93, 0xC2, 0x8E, 0x18, 0x76, 0x80, 0x29, 0x4B, - 0x3B, 0xED, 0xF1, 0x35, 0xAC, 0x7F, 0xFA, 0x8E, 0xED, 0x32, 0xA4, 0xA9, 0x98, 0x55, 0x54, - 0xF1, 0x2B, 0xD9, 0x91, 0xF6, 0x79, 0x54, 0xA3, 0x03, 0x58, 0x76, 0xA7, 0x01, 0x01, 0x02, + 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x40, 0x00, 0x00, 0x00, + 0xA0, 0xF6, 0x58, 0x40, 0x42, 0x87, 0x2D, 0x2F, 0xA6, 0x74, 0x23, 0x27, 0xC6, 0x97, 0x44, + 0xFB, 0xB5, 0x64, 0xBE, 0xFA, 0x04, 0xF3, 0xAB, 0xDE, 0xBD, 0x22, 0xC8, 0x35, 0x59, 0xFB, + 0x35, 0x55, 0xB7, 0x13, 0xE6, 0xE1, 0xA2, 0xEA, 0x3C, 0x6E, 0xEB, 0x82, 0x45, 0xD8, 0x10, + 0xE8, 0xC9, 0x4C, 0x4D, 0x41, 0x7D, 0xD5, 0x9B, 0x7D, 0x7F, 0x90, 0x5B, 0xC8, 0x13, 0x63, + 0x3D, 0x01, 0x13, 0x25, 0x4B, 0x52, 0x49, 0xEC, 0x03, 0x58, 0x76, 0xA7, 0x01, 0x01, 0x02, 0x01, 0x03, 0x58, 0x3F, 0xA3, 0x02, 0x81, 0x82, 0x4A, 0x69, 0x43, 0x41, 0x4E, 0x44, 0x5F, 0x4D, 0x46, 0x53, 0x54, 0x41, 0x00, 0x04, 0x58, 0x27, 0x82, 0x14, 0xA2, 0x01, 0x50, 0x76, 0x17, 0xDA, 0xA5, 0x71, 0xFD, 0x5A, 0x85, 0x8F, 0x94, 0xE2, 0x8D, 0x73, 0x5C, 0xE9, 0xF4, diff --git a/tests/subsys/suit/orchestrator/manifest/src/manifest_root_validate_load_invoke_fail.c b/tests/subsys/suit/orchestrator/manifest/src/manifest_root_validate_load_invoke_fail.c index 4b84fb71691f..1bfa82369d9c 100644 --- a/tests/subsys/suit/orchestrator/manifest/src/manifest_root_validate_load_invoke_fail.c +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_root_validate_load_invoke_fail.c @@ -14,12 +14,12 @@ const uint8_t manifest_root_validate_load_invoke_fail_buf[] = { 0xD8, 0x6B, 0xA2, 0x02, 0x58, 0x7A, 0x82, 0x58, 0x24, 0x82, 0x2F, 0x58, 0x20, 0x47, 0xD1, 0xEE, 0xB3, 0xDD, 0x31, 0x12, 0xD4, 0xA1, 0x9F, 0x94, 0xC7, 0x2A, 0x44, 0xE8, 0xE0, 0x07, 0xD5, 0xFF, 0xE8, 0xBC, 0xA0, 0xBC, 0xF5, 0x47, 0x69, 0x81, 0x73, 0x64, 0xCD, 0x8D, 0x18, - 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x7F, 0xFF, 0xFF, 0xE0, - 0xA0, 0xF6, 0x58, 0x40, 0x7C, 0x6D, 0xC7, 0xDE, 0xE9, 0x93, 0x81, 0x55, 0x05, 0xB8, 0xA5, - 0x80, 0x48, 0x2D, 0x82, 0x0C, 0xAD, 0xB6, 0x69, 0x19, 0x6D, 0x80, 0x1E, 0x43, 0xFD, 0x97, - 0xCA, 0x95, 0x8C, 0xAC, 0x63, 0xE1, 0x46, 0x9F, 0xEE, 0xF9, 0x64, 0x12, 0xFB, 0xC5, 0x91, - 0x00, 0xBB, 0xDD, 0x28, 0xE6, 0xE1, 0x31, 0x20, 0x8D, 0xE8, 0x09, 0x80, 0x86, 0x8B, 0x4F, - 0x41, 0x7F, 0xAC, 0x70, 0xFE, 0xDC, 0x71, 0x5A, 0x03, 0x58, 0x8C, 0xA7, 0x01, 0x01, 0x02, + 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x40, 0x00, 0x00, 0x00, + 0xA0, 0xF6, 0x58, 0x40, 0xC2, 0xCF, 0xA3, 0xFE, 0xCD, 0x94, 0xAF, 0x8F, 0xFE, 0xB6, 0x8F, + 0x7C, 0x85, 0x59, 0xE7, 0xC1, 0xB7, 0x90, 0x6E, 0x5F, 0x70, 0x1C, 0x4B, 0x61, 0x26, 0x07, + 0x05, 0x09, 0xEE, 0x9D, 0x5A, 0xD0, 0xA2, 0x49, 0x89, 0x2E, 0xAD, 0x93, 0x81, 0x69, 0x04, + 0x0F, 0x6E, 0x19, 0xAB, 0x12, 0x20, 0x80, 0xED, 0xEF, 0x92, 0x8F, 0x94, 0xA3, 0x60, 0x17, + 0x4D, 0x49, 0x37, 0xEC, 0xDA, 0x5D, 0xCE, 0x98, 0x03, 0x58, 0x8C, 0xA7, 0x01, 0x01, 0x02, 0x01, 0x03, 0x58, 0x52, 0xA3, 0x02, 0x81, 0x82, 0x4A, 0x69, 0x43, 0x41, 0x4E, 0x44, 0x5F, 0x4D, 0x46, 0x53, 0x54, 0x41, 0x00, 0x04, 0x58, 0x3A, 0x82, 0x14, 0xA3, 0x01, 0x50, 0x76, 0x17, 0xDA, 0xA5, 0x71, 0xFD, 0x5A, 0x85, 0x8F, 0x94, 0xE2, 0x8D, 0x73, 0x5C, 0xE9, 0xF4, diff --git a/tests/subsys/suit/orchestrator/manifest/src/manifest_root_validate_load_no_invoke.c b/tests/subsys/suit/orchestrator/manifest/src/manifest_root_validate_load_no_invoke.c index 8958a39eb9b0..8ceeee5ac9ce 100644 --- a/tests/subsys/suit/orchestrator/manifest/src/manifest_root_validate_load_no_invoke.c +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_root_validate_load_no_invoke.c @@ -14,12 +14,12 @@ const uint8_t manifest_root_validate_load_no_invoke_buf[] = { 0xD8, 0x6B, 0xA2, 0x02, 0x58, 0x7A, 0x82, 0x58, 0x24, 0x82, 0x2F, 0x58, 0x20, 0x19, 0x47, 0xFE, 0xB7, 0xB6, 0x25, 0x40, 0x19, 0x2F, 0x73, 0x72, 0x4B, 0xB1, 0xAC, 0x80, 0x41, 0x4D, 0x29, 0x7D, 0xFD, 0x4B, 0xCF, 0xF8, 0x4B, 0x60, 0x0C, 0x37, 0x1D, 0x1B, 0x29, 0x6A, 0x72, - 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x7F, 0xFF, 0xFF, 0xE0, - 0xA0, 0xF6, 0x58, 0x40, 0xB3, 0x69, 0x6E, 0x6B, 0x29, 0x0D, 0xB4, 0x1A, 0xA0, 0x4D, 0x35, - 0x7D, 0x12, 0xF4, 0x18, 0xB2, 0xCF, 0x20, 0x46, 0x69, 0x09, 0xAF, 0x16, 0x5F, 0x2B, 0x6A, - 0x73, 0xE3, 0x9E, 0x95, 0x56, 0xDC, 0xA5, 0x05, 0x93, 0x5D, 0xD5, 0xFF, 0xD0, 0x4A, 0xA9, - 0x87, 0xB7, 0x1C, 0x8C, 0xDE, 0x26, 0xCF, 0xF1, 0xED, 0x2D, 0x7E, 0x51, 0xCA, 0xF4, 0x43, - 0x36, 0x90, 0x7A, 0xD7, 0x4D, 0x8F, 0xA8, 0xC2, 0x03, 0x58, 0x71, 0xA6, 0x01, 0x01, 0x02, + 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x40, 0x00, 0x00, 0x00, + 0xA0, 0xF6, 0x58, 0x40, 0x88, 0x12, 0x70, 0x86, 0xFF, 0xC8, 0x46, 0x68, 0x58, 0x7A, 0x04, + 0xA9, 0xDD, 0x92, 0x56, 0x41, 0x86, 0xF3, 0x12, 0xA9, 0xD9, 0x79, 0xA1, 0xC9, 0xAD, 0xAC, + 0x25, 0x07, 0x4E, 0x14, 0xAE, 0x93, 0xC8, 0x13, 0x75, 0xA4, 0xE6, 0x83, 0x3E, 0x7D, 0xA4, + 0x2F, 0x08, 0x39, 0x57, 0x9A, 0xFF, 0x23, 0x91, 0x74, 0x5D, 0xE4, 0x2B, 0xAE, 0xC8, 0x52, + 0x20, 0xAD, 0x64, 0xF8, 0x7A, 0x94, 0x98, 0xCA, 0x03, 0x58, 0x71, 0xA6, 0x01, 0x01, 0x02, 0x01, 0x03, 0x58, 0x3F, 0xA3, 0x02, 0x81, 0x82, 0x4A, 0x69, 0x43, 0x41, 0x4E, 0x44, 0x5F, 0x4D, 0x46, 0x53, 0x54, 0x41, 0x00, 0x04, 0x58, 0x27, 0x82, 0x14, 0xA2, 0x01, 0x50, 0x76, 0x17, 0xDA, 0xA5, 0x71, 0xFD, 0x5A, 0x85, 0x8F, 0x94, 0xE2, 0x8D, 0x73, 0x5C, 0xE9, 0xF4, diff --git a/tests/subsys/suit/orchestrator/manifest/src/manifest_unsupported_component.c b/tests/subsys/suit/orchestrator/manifest/src/manifest_unsupported_component.c index bfdbc1ff6bac..2c45bd212754 100644 --- a/tests/subsys/suit/orchestrator/manifest/src/manifest_unsupported_component.c +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_unsupported_component.c @@ -16,12 +16,12 @@ uint8_t manifest_unsupported_component_buf[] = { 0xD8, 0x6B, 0xA4, 0x02, 0x58, 0x7A, 0x82, 0x58, 0x24, 0x82, 0x2F, 0x58, 0x20, 0xBB, 0x0A, 0x39, 0xA9, 0xB1, 0xBE, 0xF7, 0x8B, 0xED, 0x6C, 0x3D, 0xC1, 0x90, 0x47, 0xBA, 0x9D, 0x61, 0x04, 0xF1, 0xF9, 0xF9, 0xB3, 0x2A, 0x7F, 0xA4, 0x7E, 0xE8, 0xD7, 0x29, 0xB9, 0x67, 0x1F, - 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x7F, 0xFF, 0xFF, 0xE0, - 0xA0, 0xF6, 0x58, 0x40, 0x09, 0x0E, 0xE3, 0xAB, 0x60, 0x28, 0xF9, 0x2F, 0x26, 0xC7, 0xF2, - 0x03, 0xEB, 0x87, 0x09, 0xA1, 0x52, 0xBD, 0x19, 0x2A, 0xF3, 0xA3, 0xC8, 0x5C, 0x9D, 0x2A, - 0xF5, 0xFF, 0xD4, 0xC9, 0x8B, 0x7F, 0x4E, 0x90, 0x8F, 0x04, 0xF4, 0x0D, 0x25, 0x73, 0xF8, - 0x1D, 0xF4, 0x7E, 0xD2, 0x24, 0x12, 0xD9, 0xEB, 0x62, 0x93, 0xE0, 0xD8, 0x6A, 0x85, 0x9E, - 0xF6, 0x61, 0xF9, 0x4F, 0x72, 0xFD, 0xCE, 0x6C, 0x03, 0x58, 0xD2, 0xA8, 0x01, 0x01, 0x02, + 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x40, 0x00, 0x00, 0x00, + 0xA0, 0xF6, 0x58, 0x40, 0xD6, 0x2F, 0x8A, 0x1A, 0x23, 0x1E, 0x95, 0x33, 0x64, 0x2C, 0x41, + 0x05, 0x53, 0x67, 0x2B, 0x1C, 0xCD, 0x4A, 0xE4, 0xA2, 0xFA, 0xF3, 0xC2, 0xE9, 0x43, 0xCF, + 0xBE, 0x78, 0x2A, 0x97, 0x2C, 0x52, 0x3D, 0xEC, 0x83, 0x04, 0xB2, 0x4A, 0xFD, 0xD7, 0xAB, + 0x29, 0x21, 0xB5, 0x6F, 0x12, 0xAB, 0xB9, 0x0F, 0x9D, 0x87, 0xF0, 0x76, 0xCC, 0x16, 0xD9, + 0x20, 0x12, 0xD8, 0x36, 0xCE, 0xD5, 0x4F, 0x8E, 0x03, 0x58, 0xD2, 0xA8, 0x01, 0x01, 0x02, 0x01, 0x03, 0x58, 0x67, 0xA2, 0x02, 0x81, 0x84, 0x41, 0x58, 0x41, 0x02, 0x45, 0x1A, 0x00, 0x08, 0x00, 0x00, 0x43, 0x19, 0x01, 0x00, 0x04, 0x58, 0x52, 0x86, 0x14, 0xA3, 0x01, 0x50, 0x76, 0x17, 0xDA, 0xA5, 0x71, 0xFD, 0x5A, 0x85, 0x8F, 0x94, 0xE2, 0x8D, 0x73, 0x5C, 0xE9, diff --git a/tests/subsys/suit/orchestrator/manifest/src/manifest_unsupported_component_54.c b/tests/subsys/suit/orchestrator/manifest/src/manifest_unsupported_component_54.c index 361d4baf424a..8291fc158f0b 100644 --- a/tests/subsys/suit/orchestrator/manifest/src/manifest_unsupported_component_54.c +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_unsupported_component_54.c @@ -16,12 +16,12 @@ uint8_t manifest_unsupported_component_buf[] = { 0xD8, 0x6B, 0xA4, 0x02, 0x58, 0x7A, 0x82, 0x58, 0x24, 0x82, 0x2F, 0x58, 0x20, 0x99, 0x28, 0x30, 0x1C, 0x1F, 0xC0, 0xA3, 0x92, 0xE7, 0x79, 0x02, 0x66, 0xA5, 0x8E, 0x04, 0xFC, 0x14, 0x68, 0x84, 0x89, 0xBA, 0x02, 0x36, 0xB6, 0xCA, 0xEF, 0x07, 0xD8, 0x12, 0x27, 0xA7, 0x35, - 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x7F, 0xFF, 0xFF, 0xE0, - 0xA0, 0xF6, 0x58, 0x40, 0xED, 0x79, 0xC9, 0x52, 0x69, 0xE1, 0x2E, 0xFD, 0xB3, 0xE6, 0x94, - 0x1E, 0x8C, 0x7D, 0xF5, 0xC5, 0x5A, 0x08, 0x98, 0x18, 0xCF, 0xDD, 0xD3, 0x65, 0x7D, 0xB6, - 0xC0, 0xDC, 0x62, 0x3C, 0xED, 0x05, 0x20, 0x4B, 0xD0, 0x39, 0xF8, 0x57, 0x1E, 0x1D, 0x0A, - 0xDC, 0xED, 0x37, 0x82, 0x85, 0x59, 0xC0, 0xCD, 0xD6, 0x5C, 0x95, 0x36, 0x5D, 0x97, 0x05, - 0x6D, 0xD7, 0xCA, 0xFD, 0x41, 0xBD, 0x3A, 0x7D, 0x03, 0x58, 0xD2, 0xA8, 0x01, 0x01, 0x02, + 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x40, 0x00, 0x00, 0x00, + 0xA0, 0xF6, 0x58, 0x40, 0xFE, 0xB0, 0x7A, 0x5E, 0x05, 0x60, 0xA3, 0xC8, 0xA0, 0xB6, 0xED, + 0x29, 0x6D, 0xAF, 0x2F, 0x11, 0xA2, 0x21, 0x4C, 0xBD, 0xA2, 0x2F, 0x9E, 0xDA, 0xA6, 0x38, + 0x89, 0xAC, 0xA2, 0x22, 0xB9, 0xDF, 0xD6, 0x9A, 0x4B, 0x9A, 0x66, 0x7C, 0x51, 0x98, 0xAD, + 0x09, 0x5C, 0x59, 0x26, 0xCC, 0xBF, 0x13, 0x20, 0xCF, 0x7E, 0x25, 0xF1, 0x66, 0x37, 0x05, + 0x27, 0x4F, 0xF8, 0xEE, 0xDE, 0x09, 0x6A, 0x66, 0x03, 0x58, 0xD2, 0xA8, 0x01, 0x01, 0x02, 0x01, 0x03, 0x58, 0x67, 0xA2, 0x02, 0x81, 0x84, 0x41, 0x58, 0x41, 0x00, 0x45, 0x1A, 0x0E, 0x0A, 0xA0, 0x00, 0x43, 0x19, 0x01, 0x00, 0x04, 0x58, 0x52, 0x86, 0x14, 0xA3, 0x01, 0x50, 0x76, 0x17, 0xDA, 0xA5, 0x71, 0xFD, 0x5A, 0x85, 0x8F, 0x94, 0xE2, 0x8D, 0x73, 0x5C, 0xE9, diff --git a/tests/subsys/suit/orchestrator/manifest/src/manifest_valid.c b/tests/subsys/suit/orchestrator/manifest/src/manifest_valid.c index 39e19f1709a0..afdeeafdea79 100644 --- a/tests/subsys/suit/orchestrator/manifest/src/manifest_valid.c +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_valid.c @@ -15,12 +15,12 @@ uint8_t manifest_valid_buf[] = { 0xD8, 0x6B, 0xA4, 0x02, 0x58, 0x7A, 0x82, 0x58, 0x24, 0x82, 0x2F, 0x58, 0x20, 0x47, 0xF3, 0xFF, 0x8B, 0xE4, 0x4F, 0xA5, 0x2E, 0xD2, 0x10, 0x82, 0xAB, 0xCE, 0x12, 0x8E, 0x70, 0x12, 0x0B, 0x28, 0xCF, 0x63, 0x9B, 0x8D, 0xFC, 0xF5, 0xEA, 0xF4, 0x56, 0xDA, 0xA9, 0x4A, 0xB1, - 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x7F, 0xFF, 0xFF, 0xE0, - 0xA0, 0xF6, 0x58, 0x40, 0x31, 0x16, 0x4B, 0x95, 0x09, 0x43, 0xC8, 0xB9, 0x51, 0xA2, 0x7F, - 0x52, 0x4B, 0xE1, 0x2B, 0x26, 0xAD, 0x42, 0xE3, 0x84, 0xA1, 0x32, 0x4B, 0xFC, 0x47, 0x0B, - 0x04, 0x0E, 0x94, 0x9D, 0x04, 0x17, 0x15, 0x0F, 0x24, 0x69, 0x55, 0x52, 0xBB, 0x10, 0x35, - 0x54, 0x4E, 0x2A, 0xCB, 0xAC, 0x93, 0xF7, 0x35, 0x61, 0x91, 0x32, 0x3D, 0xF9, 0xD9, 0x0E, - 0x37, 0x9A, 0x9C, 0xC4, 0xAB, 0xE6, 0x36, 0x31, 0x03, 0x59, 0x01, 0x07, 0xA8, 0x01, 0x01, + 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x40, 0x00, 0x00, 0x00, + 0xA0, 0xF6, 0x58, 0x40, 0x14, 0xAA, 0x46, 0x79, 0x66, 0xC6, 0x34, 0xD1, 0x29, 0x08, 0x69, + 0x74, 0x57, 0x4A, 0x92, 0xBD, 0x90, 0xB7, 0x3B, 0x32, 0xE1, 0x70, 0x72, 0xFC, 0xBB, 0x48, + 0x81, 0xE0, 0x28, 0x17, 0x5B, 0x28, 0x6B, 0xD2, 0xF9, 0xC1, 0x37, 0x8C, 0x50, 0x49, 0x04, + 0x35, 0x15, 0xE2, 0x25, 0x83, 0x5A, 0xB8, 0x41, 0x2A, 0xBE, 0x14, 0xA2, 0x5F, 0xA2, 0xB6, + 0xA6, 0x52, 0x0A, 0xFB, 0x26, 0x55, 0x53, 0x13, 0x03, 0x59, 0x01, 0x07, 0xA8, 0x01, 0x01, 0x02, 0x01, 0x03, 0x58, 0x66, 0xA3, 0x02, 0x82, 0x82, 0x4A, 0x69, 0x43, 0x41, 0x4E, 0x44, 0x5F, 0x4D, 0x46, 0x53, 0x54, 0x41, 0x00, 0x82, 0x4C, 0x6B, 0x49, 0x4E, 0x53, 0x54, 0x4C, 0x44, 0x5F, 0x4D, 0x46, 0x53, 0x54, 0x50, 0x5B, 0x46, 0x9F, 0xD1, 0x90, 0xEE, 0x53, 0x9C, @@ -51,12 +51,12 @@ uint8_t manifest_valid_buf[] = { 0x82, 0x58, 0x24, 0x82, 0x2F, 0x58, 0x20, 0x37, 0x68, 0xD5, 0xA0, 0xFC, 0x61, 0x7C, 0x98, 0x15, 0x1C, 0x86, 0xD9, 0xBE, 0xA6, 0x26, 0x2F, 0x20, 0xCB, 0x02, 0x23, 0x20, 0x0C, 0x24, 0x05, 0x2A, 0x6D, 0x71, 0x1D, 0x39, 0x42, 0xEB, 0x6C, 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, - 0x01, 0x26, 0x04, 0x45, 0x1A, 0x7F, 0xFF, 0xFF, 0xE0, 0xA0, 0xF6, 0x58, 0x40, 0x82, 0xB6, - 0x6C, 0xCB, 0x64, 0x76, 0xBC, 0x07, 0xCD, 0x69, 0xA8, 0xBE, 0x63, 0xA1, 0x57, 0x7D, 0x75, - 0xC3, 0x54, 0x8F, 0xFE, 0x8C, 0x45, 0xA3, 0x9F, 0x9C, 0x01, 0x27, 0x6B, 0xFE, 0xE4, 0x69, - 0x06, 0xF4, 0x82, 0xCF, 0x88, 0x18, 0x01, 0xD6, 0x3E, 0x0D, 0x70, 0xC7, 0x15, 0x4E, 0xBB, - 0xE7, 0x4B, 0x39, 0x8A, 0x31, 0x69, 0xB2, 0x88, 0x94, 0x6D, 0x42, 0xB3, 0x0E, 0x79, 0xDD, - 0x77, 0x56, 0x03, 0x58, 0xD9, 0xA8, 0x01, 0x01, 0x02, 0x01, 0x03, 0x58, 0x6E, 0xA2, 0x02, + 0x01, 0x26, 0x04, 0x45, 0x1A, 0x40, 0x00, 0x00, 0x00, 0xA0, 0xF6, 0x58, 0x40, 0x0F, 0xA6, + 0x5F, 0x27, 0x46, 0xAD, 0x92, 0xAB, 0xEC, 0xAF, 0xB3, 0x97, 0x7F, 0x25, 0x69, 0x12, 0x76, + 0x2A, 0x4A, 0x03, 0xBA, 0xF8, 0xFC, 0xE3, 0x92, 0x66, 0x3F, 0xDD, 0x4A, 0xCC, 0x05, 0xCC, + 0x11, 0xD9, 0xB9, 0xCA, 0x65, 0x82, 0x03, 0xF9, 0xC5, 0x12, 0xC5, 0xB0, 0x84, 0x1C, 0xD7, + 0x73, 0x5E, 0xEB, 0x72, 0x4B, 0x58, 0x48, 0x8A, 0xF8, 0xFD, 0x6C, 0xD4, 0x71, 0xED, 0xE7, + 0xDE, 0xFA, 0x03, 0x58, 0xD9, 0xA8, 0x01, 0x01, 0x02, 0x01, 0x03, 0x58, 0x6E, 0xA2, 0x02, 0x81, 0x84, 0x44, 0x63, 0x4D, 0x45, 0x4D, 0x41, 0x00, 0x45, 0x1A, 0x00, 0x08, 0x00, 0x00, 0x43, 0x19, 0x10, 0x00, 0x04, 0x58, 0x56, 0x86, 0x14, 0xA4, 0x01, 0x50, 0x76, 0x17, 0xDA, 0xA5, 0x71, 0xFD, 0x5A, 0x85, 0x8F, 0x94, 0xE2, 0x8D, 0x73, 0x5C, 0xE9, 0xF4, 0x02, 0x50, diff --git a/tests/subsys/suit/orchestrator/manifest/src/manifest_valid_54.c b/tests/subsys/suit/orchestrator/manifest/src/manifest_valid_54.c index ec0a35be7e17..9070599b58ba 100644 --- a/tests/subsys/suit/orchestrator/manifest/src/manifest_valid_54.c +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_valid_54.c @@ -15,12 +15,12 @@ uint8_t manifest_valid_buf[] = { 0xD8, 0x6B, 0xA4, 0x02, 0x58, 0x7A, 0x82, 0x58, 0x24, 0x82, 0x2F, 0x58, 0x20, 0x26, 0x81, 0xF4, 0x06, 0x5A, 0x18, 0xD1, 0xDF, 0x38, 0x8D, 0x2B, 0x9C, 0xDE, 0x5E, 0x76, 0xD9, 0xB1, 0x05, 0x31, 0x1B, 0x66, 0xD4, 0x84, 0xB2, 0x4C, 0x36, 0x59, 0x25, 0xA4, 0xCF, 0xF9, 0xDB, - 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x7F, 0xFF, 0xFF, 0xE0, - 0xA0, 0xF6, 0x58, 0x40, 0xA2, 0x60, 0x05, 0xEF, 0x40, 0x37, 0x37, 0x41, 0xAD, 0x90, 0xCC, - 0x50, 0xCF, 0xA6, 0xA0, 0x61, 0x19, 0x61, 0xC7, 0xD6, 0xB1, 0xFF, 0xC0, 0xB0, 0x80, 0xD4, - 0x56, 0xB4, 0x3D, 0xD6, 0xE4, 0x43, 0xBD, 0xDA, 0x3D, 0x35, 0x2B, 0x13, 0x2A, 0x1A, 0x67, - 0x21, 0x76, 0xBD, 0x56, 0x09, 0x14, 0x26, 0x63, 0xA0, 0x93, 0x72, 0xA1, 0x8A, 0xA5, 0x9F, - 0x08, 0xDA, 0x81, 0x0C, 0x4D, 0xC1, 0x7A, 0xDC, 0x03, 0x59, 0x01, 0x07, 0xA8, 0x01, 0x01, + 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x40, 0x00, 0x00, 0x00, + 0xA0, 0xF6, 0x58, 0x40, 0x49, 0x49, 0xDA, 0x6A, 0x72, 0xCC, 0x6E, 0xB5, 0x43, 0x3B, 0x8F, + 0xCD, 0x83, 0x51, 0x37, 0x68, 0xCF, 0xF9, 0x0E, 0xE8, 0xFD, 0xBA, 0x00, 0xE6, 0x9E, 0x7A, + 0xAD, 0x32, 0xC5, 0x7D, 0x46, 0x5E, 0x48, 0x19, 0xCC, 0x4B, 0xF9, 0xA9, 0xB9, 0x7C, 0x0E, + 0x74, 0xAF, 0xFE, 0x42, 0x9E, 0x7F, 0x81, 0x44, 0x00, 0x80, 0x9B, 0x4E, 0x41, 0x90, 0x1F, + 0x8A, 0x29, 0x8C, 0xB9, 0x7F, 0x9D, 0x75, 0x80, 0x03, 0x59, 0x01, 0x07, 0xA8, 0x01, 0x01, 0x02, 0x01, 0x03, 0x58, 0x66, 0xA3, 0x02, 0x82, 0x82, 0x4A, 0x69, 0x43, 0x41, 0x4E, 0x44, 0x5F, 0x4D, 0x46, 0x53, 0x54, 0x41, 0x00, 0x82, 0x4C, 0x6B, 0x49, 0x4E, 0x53, 0x54, 0x4C, 0x44, 0x5F, 0x4D, 0x46, 0x53, 0x54, 0x50, 0x5B, 0x46, 0x9F, 0xD1, 0x90, 0xEE, 0x53, 0x9C, @@ -51,12 +51,12 @@ uint8_t manifest_valid_buf[] = { 0x82, 0x58, 0x24, 0x82, 0x2F, 0x58, 0x20, 0xF0, 0x38, 0xEC, 0x9B, 0xFC, 0x84, 0x81, 0xC7, 0xF5, 0x1D, 0x3F, 0x0B, 0x93, 0x1A, 0x25, 0xDB, 0xEF, 0xBB, 0x23, 0xE7, 0x36, 0x85, 0xF7, 0xD5, 0x1F, 0xF7, 0xCF, 0x73, 0x4F, 0x4E, 0xB6, 0xE8, 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, - 0x01, 0x26, 0x04, 0x45, 0x1A, 0x7F, 0xFF, 0xFF, 0xE0, 0xA0, 0xF6, 0x58, 0x40, 0x07, 0x47, - 0x11, 0x79, 0xA7, 0xCF, 0x62, 0x73, 0xE3, 0x29, 0xBA, 0x59, 0xF4, 0x59, 0x7E, 0x7A, 0x66, - 0x0E, 0x2C, 0x67, 0x4A, 0x9C, 0x5B, 0x6D, 0x63, 0x9A, 0x8F, 0x12, 0x90, 0xF0, 0x0F, 0x2C, - 0x96, 0x87, 0x1E, 0xCE, 0x21, 0xDA, 0xE6, 0x9C, 0x66, 0x7D, 0x6C, 0x41, 0xF5, 0x23, 0x44, - 0xE6, 0x46, 0x66, 0x13, 0x58, 0x93, 0x1E, 0xDC, 0x93, 0x69, 0xE7, 0xC2, 0xC1, 0xB7, 0x98, - 0x58, 0x82, 0x03, 0x58, 0xD9, 0xA8, 0x01, 0x01, 0x02, 0x01, 0x03, 0x58, 0x6E, 0xA2, 0x02, + 0x01, 0x26, 0x04, 0x45, 0x1A, 0x40, 0x00, 0x00, 0x00, 0xA0, 0xF6, 0x58, 0x40, 0x1A, 0x35, + 0xA3, 0x4E, 0x7F, 0x13, 0x22, 0xE5, 0x55, 0x79, 0x37, 0xAE, 0xE7, 0x85, 0xE1, 0x1A, 0xAD, + 0x20, 0xD7, 0xAB, 0x89, 0x8C, 0x85, 0x77, 0x10, 0xD0, 0xA2, 0xF5, 0x9A, 0x01, 0x7C, 0x38, + 0x9B, 0x8F, 0x8C, 0x3E, 0x58, 0x9B, 0x0C, 0x28, 0x8B, 0x0E, 0x32, 0xB3, 0x15, 0xAB, 0x49, + 0x98, 0x08, 0x85, 0x8F, 0xA2, 0x11, 0x0B, 0xFA, 0x97, 0x0D, 0x6E, 0x6E, 0x09, 0x2A, 0xF7, + 0x8F, 0x5E, 0x03, 0x58, 0xD9, 0xA8, 0x01, 0x01, 0x02, 0x01, 0x03, 0x58, 0x6E, 0xA2, 0x02, 0x81, 0x84, 0x44, 0x63, 0x4D, 0x45, 0x4D, 0x41, 0x00, 0x45, 0x1A, 0x0E, 0x0A, 0xA0, 0x00, 0x43, 0x19, 0x10, 0x00, 0x04, 0x58, 0x56, 0x86, 0x14, 0xA4, 0x01, 0x50, 0x76, 0x17, 0xDA, 0xA5, 0x71, 0xFD, 0x5A, 0x85, 0x8F, 0x94, 0xE2, 0x8D, 0x73, 0x5C, 0xE9, 0xF4, 0x02, 0x50, diff --git a/tests/subsys/suit/orchestrator/manifest/src/manifest_valid_app.c b/tests/subsys/suit/orchestrator/manifest/src/manifest_valid_app.c index 492cd6911ebd..c40eff3dc644 100644 --- a/tests/subsys/suit/orchestrator/manifest/src/manifest_valid_app.c +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_valid_app.c @@ -15,12 +15,12 @@ uint8_t manifest_valid_app_buf[] = { 0xD8, 0x6B, 0xA4, 0x02, 0x58, 0x7A, 0x82, 0x58, 0x24, 0x82, 0x2F, 0x58, 0x20, 0x37, 0x68, 0xD5, 0xA0, 0xFC, 0x61, 0x7C, 0x98, 0x15, 0x1C, 0x86, 0xD9, 0xBE, 0xA6, 0x26, 0x2F, 0x20, 0xCB, 0x02, 0x23, 0x20, 0x0C, 0x24, 0x05, 0x2A, 0x6D, 0x71, 0x1D, 0x39, 0x42, 0xEB, 0x6C, - 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x7F, 0xFF, 0xFF, 0xE0, - 0xA0, 0xF6, 0x58, 0x40, 0x2F, 0x45, 0xEC, 0x3B, 0x42, 0x1D, 0x76, 0xBF, 0x6D, 0xD6, 0xC7, - 0xF3, 0x38, 0x7B, 0x04, 0xB7, 0x69, 0x16, 0x1A, 0x4C, 0x5D, 0x31, 0xDB, 0x17, 0xB2, 0x7F, - 0x73, 0xAB, 0x14, 0x33, 0xEB, 0x7E, 0x70, 0xB6, 0x03, 0xF5, 0xBB, 0x89, 0xFE, 0x56, 0x3F, - 0xC5, 0xEB, 0x0E, 0x5C, 0x4A, 0x65, 0x20, 0x78, 0xEE, 0x75, 0x02, 0x42, 0x88, 0xFF, 0x7B, - 0x4E, 0x27, 0x18, 0x79, 0x28, 0x0C, 0xE6, 0x2C, 0x03, 0x58, 0xD9, 0xA8, 0x01, 0x01, 0x02, + 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x40, 0x00, 0x00, 0x00, + 0xA0, 0xF6, 0x58, 0x40, 0x0F, 0xA6, 0x5F, 0x27, 0x46, 0xAD, 0x92, 0xAB, 0xEC, 0xAF, 0xB3, + 0x97, 0x7F, 0x25, 0x69, 0x12, 0x76, 0x2A, 0x4A, 0x03, 0xBA, 0xF8, 0xFC, 0xE3, 0x92, 0x66, + 0x3F, 0xDD, 0x4A, 0xCC, 0x05, 0xCC, 0x11, 0xD9, 0xB9, 0xCA, 0x65, 0x82, 0x03, 0xF9, 0xC5, + 0x12, 0xC5, 0xB0, 0x84, 0x1C, 0xD7, 0x73, 0x5E, 0xEB, 0x72, 0x4B, 0x58, 0x48, 0x8A, 0xF8, + 0xFD, 0x6C, 0xD4, 0x71, 0xED, 0xE7, 0xDE, 0xFA, 0x03, 0x58, 0xD9, 0xA8, 0x01, 0x01, 0x02, 0x01, 0x03, 0x58, 0x6E, 0xA2, 0x02, 0x81, 0x84, 0x44, 0x63, 0x4D, 0x45, 0x4D, 0x41, 0x00, 0x45, 0x1A, 0x00, 0x08, 0x00, 0x00, 0x43, 0x19, 0x10, 0x00, 0x04, 0x58, 0x56, 0x86, 0x14, 0xA4, 0x01, 0x50, 0x76, 0x17, 0xDA, 0xA5, 0x71, 0xFD, 0x5A, 0x85, 0x8F, 0x94, 0xE2, 0x8D, diff --git a/tests/subsys/suit/orchestrator/manifest/src/manifest_valid_app_54.c b/tests/subsys/suit/orchestrator/manifest/src/manifest_valid_app_54.c index d175d0adc6e2..16f7a6a81510 100644 --- a/tests/subsys/suit/orchestrator/manifest/src/manifest_valid_app_54.c +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_valid_app_54.c @@ -15,12 +15,12 @@ uint8_t manifest_valid_app_buf[] = { 0xD8, 0x6B, 0xA4, 0x02, 0x58, 0x7A, 0x82, 0x58, 0x24, 0x82, 0x2F, 0x58, 0x20, 0xF0, 0x38, 0xEC, 0x9B, 0xFC, 0x84, 0x81, 0xC7, 0xF5, 0x1D, 0x3F, 0x0B, 0x93, 0x1A, 0x25, 0xDB, 0xEF, 0xBB, 0x23, 0xE7, 0x36, 0x85, 0xF7, 0xD5, 0x1F, 0xF7, 0xCF, 0x73, 0x4F, 0x4E, 0xB6, 0xE8, - 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x7F, 0xFF, 0xFF, 0xE0, - 0xA0, 0xF6, 0x58, 0x40, 0xF7, 0xC1, 0x0A, 0x57, 0x2D, 0x63, 0x45, 0xEE, 0xA2, 0xC6, 0x6A, - 0xD9, 0x14, 0x12, 0x76, 0x27, 0xF4, 0xFE, 0x9A, 0xBF, 0xD0, 0x07, 0xD4, 0x4E, 0x8F, 0xDA, - 0xCA, 0x60, 0x8D, 0x48, 0xB6, 0x15, 0x90, 0x63, 0xB1, 0x28, 0x54, 0xED, 0x33, 0xB8, 0xF2, - 0x8F, 0x2D, 0x48, 0xC9, 0xE7, 0xED, 0x3B, 0xA4, 0x65, 0xC6, 0x57, 0x83, 0x9C, 0x48, 0x82, - 0x66, 0xF4, 0x48, 0x9E, 0x7C, 0x2C, 0xCF, 0x3F, 0x03, 0x58, 0xD9, 0xA8, 0x01, 0x01, 0x02, + 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x40, 0x00, 0x00, 0x00, + 0xA0, 0xF6, 0x58, 0x40, 0x1A, 0x35, 0xA3, 0x4E, 0x7F, 0x13, 0x22, 0xE5, 0x55, 0x79, 0x37, + 0xAE, 0xE7, 0x85, 0xE1, 0x1A, 0xAD, 0x20, 0xD7, 0xAB, 0x89, 0x8C, 0x85, 0x77, 0x10, 0xD0, + 0xA2, 0xF5, 0x9A, 0x01, 0x7C, 0x38, 0x9B, 0x8F, 0x8C, 0x3E, 0x58, 0x9B, 0x0C, 0x28, 0x8B, + 0x0E, 0x32, 0xB3, 0x15, 0xAB, 0x49, 0x98, 0x08, 0x85, 0x8F, 0xA2, 0x11, 0x0B, 0xFA, 0x97, + 0x0D, 0x6E, 0x6E, 0x09, 0x2A, 0xF7, 0x8F, 0x5E, 0x03, 0x58, 0xD9, 0xA8, 0x01, 0x01, 0x02, 0x01, 0x03, 0x58, 0x6E, 0xA2, 0x02, 0x81, 0x84, 0x44, 0x63, 0x4D, 0x45, 0x4D, 0x41, 0x00, 0x45, 0x1A, 0x0E, 0x0A, 0xA0, 0x00, 0x43, 0x19, 0x10, 0x00, 0x04, 0x58, 0x56, 0x86, 0x14, 0xA4, 0x01, 0x50, 0x76, 0x17, 0xDA, 0xA5, 0x71, 0xFD, 0x5A, 0x85, 0x8F, 0x94, 0xE2, 0x8D, diff --git a/tests/subsys/suit/orchestrator/manifest/src/manifest_valid_payload_fetch.c b/tests/subsys/suit/orchestrator/manifest/src/manifest_valid_payload_fetch.c index a8119157ce3d..72cc058f7e00 100644 --- a/tests/subsys/suit/orchestrator/manifest/src/manifest_valid_payload_fetch.c +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_valid_payload_fetch.c @@ -15,12 +15,12 @@ const uint8_t manifest_valid_payload_fetch_buf[] = { 0xD8, 0x6B, 0xA3, 0x02, 0x58, 0x7A, 0x82, 0x58, 0x24, 0x82, 0x2F, 0x58, 0x20, 0xFD, 0xF8, 0x9A, 0x91, 0xAB, 0xF9, 0x01, 0x4B, 0xB1, 0x33, 0x32, 0x49, 0xFC, 0x71, 0xE1, 0x7E, 0x7E, 0xEC, 0x57, 0xDE, 0xD2, 0xBB, 0x1E, 0x2D, 0x30, 0xB5, 0xA9, 0xA0, 0xE0, 0x9A, 0x32, 0x27, - 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x7F, 0xFF, 0xFF, 0xE0, - 0xA0, 0xF6, 0x58, 0x40, 0xD5, 0xB7, 0xBF, 0xC9, 0x72, 0xF8, 0x3E, 0x32, 0x8C, 0x5B, 0x1A, - 0xBB, 0xFF, 0x66, 0x8D, 0x06, 0x7E, 0x04, 0xCE, 0xAF, 0x92, 0xB0, 0xD6, 0x90, 0xDA, 0x3E, - 0x21, 0xF4, 0x6F, 0x9A, 0xB6, 0xDC, 0x54, 0x57, 0x90, 0xED, 0xA8, 0xA1, 0xEE, 0x7D, 0x70, - 0x47, 0x21, 0xD8, 0x9D, 0xBA, 0xDB, 0x73, 0x24, 0xC0, 0x1E, 0x37, 0x08, 0x90, 0x41, 0xE2, - 0x14, 0x68, 0xF3, 0x93, 0x38, 0xE2, 0x03, 0x1F, 0x03, 0x59, 0x01, 0x1A, 0xAA, 0x01, 0x01, + 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x40, 0x00, 0xAA, 0x00, + 0xA0, 0xF6, 0x58, 0x40, 0xD7, 0x8F, 0x47, 0xBA, 0x24, 0xED, 0x01, 0x8E, 0x5A, 0x31, 0x57, + 0x83, 0xB6, 0x2F, 0x55, 0x12, 0x0D, 0x4B, 0x89, 0x0C, 0xF5, 0x72, 0xAB, 0x39, 0xA8, 0x2F, + 0x67, 0x9E, 0x3C, 0x7F, 0xA7, 0x12, 0x44, 0x7D, 0x13, 0xD0, 0x43, 0xDE, 0xC1, 0x1F, 0x9B, + 0xF1, 0x36, 0xB9, 0x06, 0x6A, 0x54, 0xA2, 0x75, 0x35, 0x5C, 0x9D, 0x43, 0x6A, 0xA1, 0xEB, + 0x27, 0xAC, 0xAB, 0xAB, 0x5D, 0xDB, 0x91, 0xE2, 0x03, 0x59, 0x01, 0x1A, 0xAA, 0x01, 0x01, 0x02, 0x01, 0x03, 0x58, 0x78, 0xA3, 0x02, 0x83, 0x82, 0x4A, 0x69, 0x43, 0x41, 0x4E, 0x44, 0x5F, 0x4D, 0x46, 0x53, 0x54, 0x41, 0x00, 0x82, 0x4C, 0x6B, 0x49, 0x4E, 0x53, 0x54, 0x4C, 0x44, 0x5F, 0x4D, 0x46, 0x53, 0x54, 0x50, 0x08, 0xC1, 0xB5, 0x99, 0x55, 0xE8, 0x5F, 0xBC, diff --git a/tests/subsys/suit/orchestrator/manifest/src/manifest_valid_payload_fetch_app.c b/tests/subsys/suit/orchestrator/manifest/src/manifest_valid_payload_fetch_app.c index a8d08ba43007..c22d6a940ca5 100644 --- a/tests/subsys/suit/orchestrator/manifest/src/manifest_valid_payload_fetch_app.c +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_valid_payload_fetch_app.c @@ -15,12 +15,12 @@ const uint8_t manifest_valid_payload_fetch_app_buf[] = { 0xD8, 0x6B, 0xA3, 0x02, 0x58, 0x7A, 0x82, 0x58, 0x24, 0x82, 0x2F, 0x58, 0x20, 0x7D, 0x44, 0xB0, 0xB0, 0xE9, 0x4A, 0x8C, 0xC7, 0x46, 0x98, 0xA5, 0xCB, 0xB9, 0x88, 0x28, 0x12, 0x8A, 0x0C, 0x46, 0x29, 0x77, 0xE5, 0xBD, 0xB2, 0x1F, 0x66, 0x1C, 0x02, 0xC6, 0x41, 0x30, 0xEA, - 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x7F, 0xFF, 0xFF, 0xE0, - 0xA0, 0xF6, 0x58, 0x40, 0x7C, 0x66, 0x55, 0x84, 0xB3, 0x1D, 0x2D, 0xFF, 0x08, 0xBC, 0x7F, - 0x8F, 0xBC, 0xD5, 0x1A, 0x86, 0xF1, 0xA9, 0x1B, 0xCA, 0x16, 0xA7, 0xA0, 0x39, 0xA0, 0x2F, - 0xA6, 0xC2, 0xBB, 0x53, 0xA5, 0xCE, 0x98, 0x76, 0x31, 0xA3, 0xE4, 0x34, 0x88, 0x8F, 0x58, - 0x58, 0xAA, 0x41, 0xCE, 0xB9, 0xB1, 0x38, 0xB1, 0x35, 0x10, 0xF6, 0xF8, 0x93, 0x61, 0xEF, - 0xD7, 0xCA, 0x99, 0x69, 0x83, 0xDF, 0x97, 0xC3, 0x03, 0x59, 0x01, 0x3E, 0xA9, 0x01, 0x01, + 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x40, 0x02, 0x21, 0x00, + 0xA0, 0xF6, 0x58, 0x40, 0x0C, 0x69, 0x83, 0x1F, 0x65, 0xBD, 0xB3, 0xF5, 0x45, 0xF6, 0xD9, + 0x7E, 0xC1, 0x56, 0x62, 0xFD, 0x0F, 0xA7, 0xA8, 0x50, 0x53, 0xBC, 0xD3, 0x63, 0xC4, 0xF9, + 0xD7, 0x01, 0x1C, 0x7A, 0x62, 0x9F, 0x80, 0x71, 0x18, 0x11, 0x9C, 0xDA, 0x29, 0xA9, 0x61, + 0xCC, 0x3B, 0x43, 0x0A, 0x01, 0x2D, 0xC0, 0xF4, 0x22, 0xEA, 0x81, 0x46, 0x50, 0x8E, 0x18, + 0x96, 0xBC, 0x44, 0x59, 0x77, 0x79, 0x2F, 0xA4, 0x03, 0x59, 0x01, 0x3E, 0xA9, 0x01, 0x01, 0x02, 0x01, 0x03, 0x58, 0x7F, 0xA2, 0x02, 0x85, 0x84, 0x44, 0x63, 0x4D, 0x45, 0x4D, 0x41, 0x00, 0x45, 0x1A, 0x00, 0x08, 0x00, 0x00, 0x43, 0x19, 0x10, 0x00, 0x82, 0x49, 0x68, 0x43, 0x41, 0x4E, 0x44, 0x5F, 0x49, 0x4D, 0x47, 0x41, 0x00, 0x82, 0x4B, 0x6A, 0x43, 0x41, 0x43, diff --git a/tests/subsys/suit/orchestrator/manifest/src/manifest_wrong_version.c b/tests/subsys/suit/orchestrator/manifest/src/manifest_wrong_version.c index 0a6ca6ee2166..fb74b04485ae 100644 --- a/tests/subsys/suit/orchestrator/manifest/src/manifest_wrong_version.c +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_wrong_version.c @@ -16,12 +16,12 @@ uint8_t manifest_wrong_version_buf[] = { 0xD8, 0x6B, 0xA4, 0x02, 0x58, 0x7A, 0x82, 0x58, 0x24, 0x82, 0x2F, 0x58, 0x20, 0x85, 0x16, 0x81, 0x4F, 0xA4, 0xB1, 0x0D, 0x08, 0x0F, 0x07, 0x5E, 0x81, 0xC8, 0x52, 0xB4, 0xC5, 0x8A, 0x0A, 0x78, 0x33, 0xD7, 0xBF, 0xD0, 0x07, 0x48, 0xE7, 0xD1, 0x74, 0xAF, 0x68, 0x99, 0xF3, - 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x7F, 0xFF, 0xFF, 0xE0, - 0xA0, 0xF6, 0x58, 0x40, 0x3F, 0x0A, 0x75, 0x0C, 0x06, 0x05, 0x18, 0x96, 0x0B, 0x05, 0x2D, - 0xDF, 0xB5, 0x32, 0x38, 0x4A, 0x6D, 0x01, 0x52, 0x02, 0xDF, 0xDD, 0x96, 0xED, 0xE5, 0x0A, - 0x73, 0xF5, 0xE7, 0x15, 0xB7, 0xFC, 0x69, 0xA3, 0xB8, 0xFE, 0x91, 0x82, 0xAA, 0x97, 0xD0, - 0xF3, 0xDC, 0x45, 0xF5, 0xEA, 0x40, 0x13, 0xB5, 0x8C, 0xB7, 0x7D, 0xA9, 0x18, 0x0B, 0xB1, - 0xCA, 0x57, 0xB3, 0xB2, 0x32, 0x0D, 0x79, 0xB0, 0x03, 0x58, 0xD9, 0xA8, 0x01, 0x02, 0x02, + 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x40, 0x00, 0x00, 0x00, + 0xA0, 0xF6, 0x58, 0x40, 0x4A, 0x49, 0xD6, 0x1F, 0x7B, 0x9B, 0x6B, 0xAE, 0x75, 0xA6, 0x08, + 0xC2, 0x05, 0x93, 0x00, 0xE9, 0x7C, 0x6B, 0xAB, 0x89, 0x8C, 0x11, 0x1B, 0x15, 0xEB, 0x64, + 0xB0, 0x9F, 0x17, 0xD9, 0x3B, 0xB1, 0x7C, 0x30, 0x77, 0x0E, 0x95, 0xD3, 0x1B, 0x87, 0x48, + 0x17, 0xB5, 0xA3, 0x49, 0x77, 0x96, 0x55, 0x22, 0x4F, 0x41, 0xAA, 0x51, 0x8F, 0x22, 0x18, + 0x57, 0x6C, 0xD8, 0x6D, 0xF4, 0x5F, 0x2A, 0xB8, 0x03, 0x58, 0xD9, 0xA8, 0x01, 0x02, 0x02, 0x01, 0x03, 0x58, 0x6E, 0xA2, 0x02, 0x81, 0x84, 0x44, 0x63, 0x4D, 0x45, 0x4D, 0x41, 0x00, 0x45, 0x1A, 0x00, 0x08, 0x00, 0x00, 0x43, 0x19, 0x01, 0x00, 0x04, 0x58, 0x56, 0x86, 0x14, 0xA4, 0x01, 0x50, 0x76, 0x17, 0xDA, 0xA5, 0x71, 0xFD, 0x5A, 0x85, 0x8F, 0x94, 0xE2, 0x8D, diff --git a/tests/subsys/suit/orchestrator/manifest/src/manifest_wrong_version_54.c b/tests/subsys/suit/orchestrator/manifest/src/manifest_wrong_version_54.c index 6d0352f1aac4..74401ca900ad 100644 --- a/tests/subsys/suit/orchestrator/manifest/src/manifest_wrong_version_54.c +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_wrong_version_54.c @@ -16,12 +16,12 @@ uint8_t manifest_wrong_version_buf[] = { 0xD8, 0x6B, 0xA4, 0x02, 0x58, 0x7A, 0x82, 0x58, 0x24, 0x82, 0x2F, 0x58, 0x20, 0x49, 0x63, 0xD4, 0xEE, 0x7C, 0x72, 0x69, 0xC9, 0x1D, 0xED, 0xB0, 0x62, 0x67, 0x7A, 0x46, 0x26, 0xD4, 0xB5, 0xA6, 0xE0, 0xA5, 0x40, 0x79, 0xF8, 0xF0, 0x5B, 0x90, 0x7F, 0x9E, 0x0D, 0x16, 0x0E, - 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x7F, 0xFF, 0xFF, 0xE0, - 0xA0, 0xF6, 0x58, 0x40, 0x0C, 0x87, 0xE8, 0x6A, 0x06, 0x5F, 0x87, 0x35, 0xD3, 0x65, 0x5A, - 0xCF, 0x6B, 0x38, 0x03, 0x22, 0x13, 0x33, 0x6A, 0x60, 0x66, 0xE2, 0x84, 0xB8, 0x44, 0x63, - 0xE9, 0x14, 0xDA, 0x21, 0x6C, 0x77, 0x5C, 0x3F, 0xB2, 0x0B, 0x59, 0xE3, 0x64, 0xFB, 0xAB, - 0xBA, 0x91, 0x07, 0x62, 0xAE, 0x6D, 0x90, 0x00, 0x50, 0x23, 0xED, 0x03, 0xD1, 0x29, 0x48, - 0x3C, 0x3C, 0x02, 0xEE, 0x12, 0x30, 0x6A, 0xDD, 0x03, 0x58, 0xD9, 0xA8, 0x01, 0x02, 0x02, + 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x40, 0x00, 0x00, 0x00, + 0xA0, 0xF6, 0x58, 0x40, 0x50, 0x97, 0x63, 0x8F, 0x93, 0x36, 0x1B, 0x35, 0xD0, 0x3B, 0xA2, + 0xC1, 0x65, 0x77, 0xC5, 0x7C, 0xBA, 0x87, 0x6E, 0xFE, 0x7C, 0xA3, 0x2E, 0x75, 0x9E, 0x7E, + 0xE2, 0x90, 0x72, 0x3E, 0x27, 0xCB, 0x06, 0x55, 0x44, 0xE1, 0x85, 0x95, 0xEB, 0xEE, 0x71, + 0xFE, 0x31, 0xF6, 0xC9, 0x92, 0x8D, 0x5C, 0x5B, 0x11, 0x4C, 0x57, 0x15, 0xC9, 0xA2, 0xD9, + 0x7F, 0xED, 0xA9, 0x59, 0x98, 0x8D, 0x96, 0xA4, 0x03, 0x58, 0xD9, 0xA8, 0x01, 0x02, 0x02, 0x01, 0x03, 0x58, 0x6E, 0xA2, 0x02, 0x81, 0x84, 0x44, 0x63, 0x4D, 0x45, 0x4D, 0x41, 0x00, 0x45, 0x1A, 0x0E, 0x0A, 0xA0, 0x00, 0x43, 0x19, 0x01, 0x00, 0x04, 0x58, 0x56, 0x86, 0x14, 0xA4, 0x01, 0x50, 0x76, 0x17, 0xDA, 0xA5, 0x71, 0xFD, 0x5A, 0x85, 0x8F, 0x94, 0xE2, 0x8D, diff --git a/tests/subsys/suit/orchestrator/manifest/src/manifest_zero_size.c b/tests/subsys/suit/orchestrator/manifest/src/manifest_zero_size.c index 4073dfeeaf56..0c47a196479c 100644 --- a/tests/subsys/suit/orchestrator/manifest/src/manifest_zero_size.c +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_zero_size.c @@ -16,12 +16,12 @@ uint8_t manifest_zero_size_buf[] = { 0xD8, 0x6B, 0xA4, 0x02, 0x58, 0x7A, 0x82, 0x58, 0x24, 0x82, 0x2F, 0x58, 0x20, 0xB1, 0x7D, 0x31, 0xF7, 0x8C, 0x66, 0xD2, 0xBE, 0xB3, 0x43, 0xFE, 0x15, 0xA4, 0x81, 0xFF, 0xFF, 0xC9, 0x13, 0x64, 0xF8, 0x69, 0x9A, 0x4B, 0x21, 0x1F, 0x37, 0xD8, 0x5D, 0x72, 0x26, 0x9A, 0x36, - 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x7F, 0xFF, 0xFF, 0xE0, - 0xA0, 0xF6, 0x58, 0x40, 0x06, 0xC0, 0x0C, 0x47, 0x36, 0x69, 0x59, 0xBB, 0xEC, 0xCB, 0xC1, - 0x5B, 0x4D, 0xD3, 0xD1, 0xB5, 0x65, 0xBD, 0xE4, 0x18, 0xE8, 0xC6, 0x3D, 0xB9, 0x60, 0x2F, - 0xD7, 0x75, 0x1F, 0xD8, 0xC1, 0x66, 0x58, 0x60, 0xEA, 0x1B, 0xF0, 0xB2, 0x53, 0x83, 0xAC, - 0xFA, 0x80, 0x26, 0xA2, 0x35, 0x92, 0x84, 0x03, 0x65, 0xFD, 0x47, 0x9A, 0xCC, 0x51, 0x70, - 0xB0, 0x61, 0x72, 0x00, 0x47, 0x1B, 0x9B, 0xCB, 0x03, 0x58, 0xD7, 0xA8, 0x01, 0x01, 0x02, + 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x40, 0x00, 0x00, 0x00, + 0xA0, 0xF6, 0x58, 0x40, 0x18, 0xB1, 0xC7, 0xA3, 0x27, 0xB2, 0x6F, 0x8D, 0x69, 0x2A, 0xBC, + 0xF8, 0x5E, 0x12, 0x98, 0x3C, 0x2D, 0xC2, 0x58, 0x93, 0x5A, 0x2A, 0xC2, 0xEF, 0xFB, 0xFF, + 0x07, 0xA5, 0x68, 0x69, 0x2A, 0x73, 0x44, 0xC8, 0x3F, 0x65, 0xB9, 0x76, 0xFF, 0x43, 0xCB, + 0xF9, 0x9A, 0x10, 0x7B, 0x16, 0x9E, 0x98, 0x97, 0x30, 0x7D, 0xD5, 0x4A, 0x0D, 0x0B, 0x49, + 0xD1, 0x67, 0x86, 0xFD, 0x28, 0xB9, 0x95, 0x3F, 0x03, 0x58, 0xD7, 0xA8, 0x01, 0x01, 0x02, 0x01, 0x03, 0x58, 0x6C, 0xA2, 0x02, 0x81, 0x84, 0x44, 0x63, 0x4D, 0x45, 0x4D, 0x41, 0x00, 0x45, 0x1A, 0x00, 0x08, 0x00, 0x00, 0x41, 0x00, 0x04, 0x58, 0x56, 0x86, 0x14, 0xA4, 0x01, 0x50, 0x76, 0x17, 0xDA, 0xA5, 0x71, 0xFD, 0x5A, 0x85, 0x8F, 0x94, 0xE2, 0x8D, 0x73, 0x5C, diff --git a/tests/subsys/suit/orchestrator/manifest/src/manifest_zero_size_54.c b/tests/subsys/suit/orchestrator/manifest/src/manifest_zero_size_54.c index 71819709dd56..398cb986eca9 100644 --- a/tests/subsys/suit/orchestrator/manifest/src/manifest_zero_size_54.c +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_zero_size_54.c @@ -16,12 +16,12 @@ uint8_t manifest_zero_size_buf[] = { 0xD8, 0x6B, 0xA4, 0x02, 0x58, 0x7A, 0x82, 0x58, 0x24, 0x82, 0x2F, 0x58, 0x20, 0x5E, 0x1D, 0x7B, 0xE6, 0x31, 0x6B, 0x95, 0x80, 0x28, 0x89, 0x22, 0x31, 0x13, 0x34, 0x92, 0xB2, 0xA8, 0xBA, 0x8D, 0x6C, 0xB6, 0xE3, 0x39, 0x8F, 0x6E, 0x05, 0xBB, 0xBB, 0x69, 0xDF, 0x94, 0x73, - 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x7F, 0xFF, 0xFF, 0xE0, - 0xA0, 0xF6, 0x58, 0x40, 0x8D, 0x0F, 0x26, 0xDF, 0x83, 0x20, 0x61, 0x99, 0x0E, 0x0D, 0x4F, - 0x63, 0x86, 0xD8, 0xF1, 0x88, 0x88, 0xB3, 0xFB, 0x3A, 0x47, 0x1F, 0x7C, 0xE5, 0x68, 0xC9, - 0x64, 0xFE, 0x7A, 0x34, 0x38, 0x1F, 0x85, 0xA8, 0x39, 0x52, 0xDC, 0xDB, 0x72, 0xDB, 0x12, - 0xA1, 0xBD, 0x2A, 0x62, 0xB2, 0xC6, 0x7A, 0xAA, 0x2A, 0x8C, 0xCC, 0x22, 0x96, 0xE2, 0xCA, - 0x22, 0xF1, 0x3E, 0xBA, 0x7B, 0x74, 0xE8, 0xBE, 0x03, 0x58, 0xD7, 0xA8, 0x01, 0x01, 0x02, + 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x40, 0x00, 0x00, 0x00, + 0xA0, 0xF6, 0x58, 0x40, 0x70, 0x37, 0x5B, 0xC6, 0x38, 0xE1, 0xCB, 0x35, 0xAC, 0xF3, 0x99, + 0x32, 0x54, 0x0C, 0x4D, 0x29, 0xBC, 0xAE, 0x0A, 0x8A, 0xC8, 0x1D, 0xBA, 0x11, 0x48, 0xD1, + 0x41, 0xE5, 0xAD, 0xB6, 0xBC, 0xF0, 0xFA, 0x6F, 0x92, 0x0B, 0x46, 0xFC, 0x16, 0x59, 0xBE, + 0x0B, 0xC3, 0x56, 0xA4, 0x84, 0x12, 0x4F, 0x84, 0x01, 0x9A, 0x12, 0xA2, 0x70, 0x92, 0x94, + 0x67, 0x35, 0x92, 0xD1, 0x64, 0x2D, 0xF9, 0x78, 0x03, 0x58, 0xD7, 0xA8, 0x01, 0x01, 0x02, 0x01, 0x03, 0x58, 0x6C, 0xA2, 0x02, 0x81, 0x84, 0x44, 0x63, 0x4D, 0x45, 0x4D, 0x41, 0x00, 0x45, 0x1A, 0x0E, 0x0A, 0xA0, 0x00, 0x41, 0x00, 0x04, 0x58, 0x56, 0x86, 0x14, 0xA4, 0x01, 0x50, 0x76, 0x17, 0xDA, 0xA5, 0x71, 0xFD, 0x5A, 0x85, 0x8F, 0x94, 0xE2, 0x8D, 0x73, 0x5C, diff --git a/tests/subsys/suit/orchestrator/orchestrator_sdfw/prj.conf b/tests/subsys/suit/orchestrator/orchestrator_sdfw/prj.conf index 22f99bb51217..0c5492dad580 100644 --- a/tests/subsys/suit/orchestrator/orchestrator_sdfw/prj.conf +++ b/tests/subsys/suit/orchestrator/orchestrator_sdfw/prj.conf @@ -11,6 +11,7 @@ CONFIG_SUIT=y CONFIG_SUIT_CRYPTO=y CONFIG_SUIT_MCI=y CONFIG_SUIT_MCI_IMPL_CUSTOM=y +CONFIG_PSA_WANT_ALG_ECDSA=y CONFIG_SUIT_VALIDATOR=y CONFIG_SUIT_VALIDATOR_IMPL_CUSTOM=y CONFIG_SUIT_METADATA=y diff --git a/tests/subsys/suit/orchestrator/orchestrator_sdfw/src/test_recovery_boot_mode.c b/tests/subsys/suit/orchestrator/orchestrator_sdfw/src/test_recovery_boot_mode.c index 20579f3168f8..531ec097c4df 100644 --- a/tests/subsys/suit/orchestrator/orchestrator_sdfw/src/test_recovery_boot_mode.c +++ b/tests/subsys/suit/orchestrator/orchestrator_sdfw/src/test_recovery_boot_mode.c @@ -190,7 +190,7 @@ ZTEST(orchestrator_recovery_boot_tests, test_rec_invalid_recovery_envelope) int err = suit_orchestrator_entry(); /* THEN orchestrator fails (hard)... */ - zassert_equal(-EACCES, err, "Orchestrator did not fail"); + zassert_equal(-ENOEXEC, err, "Orchestrator did not fail"); /* ... and the emergency flag is set... */ zassert_equal(SUIT_PLAT_SUCCESS, suit_storage_report_read(0, &buf, &len), "Emergency flag not set"); @@ -256,7 +256,7 @@ ZTEST(orchestrator_recovery_boot_tests, test_rec_seq_no_validate) int err = suit_orchestrator_entry(); /* THEN orchestrator fails (hard)... */ - zassert_equal(-EACCES, err, "Orchestrator did not fail"); + zassert_equal(-EILSEQ, err, "Orchestrator did not fail"); /* ... and the emergency flag is set... */ zassert_equal(SUIT_PLAT_SUCCESS, suit_storage_report_read(0, &buf, &len), "Emergency flag not set"); @@ -289,7 +289,7 @@ ZTEST(orchestrator_recovery_boot_tests, test_rec_seq_validate_fail) int err = suit_orchestrator_entry(); /* THEN orchestrator fails (hard)... */ - zassert_equal(-EACCES, err, "Orchestrator did not fail"); + zassert_equal(-EILSEQ, err, "Orchestrator did not fail"); /* ... and the emergency flag is set... */ zassert_equal(SUIT_PLAT_SUCCESS, suit_storage_report_read(0, &buf, &len), "Emergency flag not set"); @@ -322,7 +322,7 @@ ZTEST(orchestrator_recovery_boot_tests, test_rec_seq_validate_load_fail) int err = suit_orchestrator_entry(); /* THEN orchestrator fails (hard)... */ - zassert_equal(-EACCES, err, "Orchestrator did not fail"); + zassert_equal(-EILSEQ, err, "Orchestrator did not fail"); /* ... and the emergency flag is set... */ zassert_equal(SUIT_PLAT_SUCCESS, suit_storage_report_read(0, &buf, &len), "Emergency flag not set"); @@ -355,7 +355,7 @@ ZTEST(orchestrator_recovery_boot_tests, test_rec_seq_validate_load_no_invoke) int err = suit_orchestrator_entry(); /* THEN orchestrator fails (hard)... */ - zassert_equal(-EACCES, err, "Orchestrator did not fail"); + zassert_equal(-EILSEQ, err, "Orchestrator did not fail"); /* ... and the emergency flag is set... */ zassert_equal(SUIT_PLAT_SUCCESS, suit_storage_report_read(0, &buf, &len), "Emergency flag not set"); @@ -388,7 +388,7 @@ ZTEST(orchestrator_recovery_boot_tests, test_rec_seq_validate_load_invoke_fail) int err = suit_orchestrator_entry(); /* THEN orchestrator fails (hard)... */ - zassert_equal(-EACCES, err, "Orchestrator did not fail"); + zassert_equal(-EILSEQ, err, "Orchestrator did not fail"); /* ... and the emergency flag is set... */ zassert_equal(SUIT_PLAT_SUCCESS, suit_storage_report_read(0, &buf, &len), "Emergency flag not set"); diff --git a/tests/subsys/suit/orchestrator/orchestrator_sdfw/src/test_recovery_update_mode.c b/tests/subsys/suit/orchestrator/orchestrator_sdfw/src/test_recovery_update_mode.c index 2240f2a4d135..6b91dc9370bb 100644 --- a/tests/subsys/suit/orchestrator/orchestrator_sdfw/src/test_recovery_update_mode.c +++ b/tests/subsys/suit/orchestrator/orchestrator_sdfw/src/test_recovery_update_mode.c @@ -237,7 +237,7 @@ ZTEST(orchestrator_recovery_update_tests, test_rec_invalid_exec_mode) int err = suit_orchestrator_entry(); /* THEN orchestrator returns error code... */ - zassert_equal(-EACCES, err, "Unexpected error code"); + zassert_equal(-EMSGSIZE, err, "Unexpected error code"); /* ... and the candidate availability flag remains cleared */ assert_post_recovery_install_state(); } diff --git a/tests/subsys/suit/orchestrator/orchestrator_sdfw/src/test_update_mode.c b/tests/subsys/suit/orchestrator/orchestrator_sdfw/src/test_update_mode.c index acd440b11e2e..dc58f9178eaa 100644 --- a/tests/subsys/suit/orchestrator/orchestrator_sdfw/src/test_update_mode.c +++ b/tests/subsys/suit/orchestrator/orchestrator_sdfw/src/test_update_mode.c @@ -238,7 +238,7 @@ ZTEST(orchestrator_update_tests, test_envelope_size_zero) int err = suit_orchestrator_entry(); /* THEN orchestrator returns error code... */ - zassert_equal(-EACCES, err, "Unexpected error code"); + zassert_equal(-ENOEXEC, err, "Unexpected error code"); /* ... and the candidate availability flag is cleared */ assert_post_install_state(); } @@ -258,7 +258,7 @@ ZTEST(orchestrator_update_tests, test_manipulated_envelope) int err = suit_orchestrator_entry(); /* THEN orchestrator returns error code... */ - zassert_equal(-EACCES, err, "Unexpected error code"); + zassert_equal(-ENOEXEC, err, "Unexpected error code"); /* ... and the candidate availability flag is cleared */ assert_post_install_state(); } @@ -277,7 +277,7 @@ ZTEST(orchestrator_update_tests, test_update_invalid_exec_mode) int err = suit_orchestrator_entry(); /* THEN orchestrator returns error code... */ - zassert_equal(-EACCES, err, "Unexpected error code"); + zassert_equal(-EMSGSIZE, err, "Unexpected error code"); /* ... and the candidate availability flag remains cleared */ assert_post_install_state(); } @@ -302,7 +302,7 @@ ZTEST(orchestrator_update_tests, test_invalid_address_and_size) int err = suit_orchestrator_entry(); /* THEN orchestrator returns error code... */ - zassert_equal(-EFAULT, err, "Unexpected error code"); + zassert_equal(-EMSGSIZE, err, "Unexpected error code"); /* ... and the candidate availability flag is cleared */ assert_post_install_state(); } @@ -327,7 +327,7 @@ ZTEST(orchestrator_update_tests, test_candidate_empty_size) int err = suit_orchestrator_entry(); /* THEN orchestrator returns error code... */ - zassert_equal(-EFAULT, err, "Unexpected error code"); + zassert_equal(-EMSGSIZE, err, "Unexpected error code"); /* ... and the candidate availability flag is cleared */ assert_post_install_state(); } @@ -363,7 +363,7 @@ ZTEST(orchestrator_update_tests, test_candidate_too_many_caches) err = suit_orchestrator_entry(); /* THEN orchestrator returns error code... */ - zassert_equal(-EINVAL, err, "Unexpected error code"); + zassert_equal(-EMSGSIZE, err, "Unexpected error code"); /* ... and the candidate availability flag is cleared */ assert_post_install_state(); } @@ -383,7 +383,7 @@ ZTEST(orchestrator_update_tests, test_unsupported_component) int err = suit_orchestrator_entry(); /* THEN orchestrator returns error code... */ - zassert_equal(-EACCES, err, "Unexpected error code"); + zassert_equal(-ENOEXEC, err, "Unexpected error code"); /* ... and the candidate availability flag is cleared */ assert_post_install_state(); } @@ -403,7 +403,7 @@ ZTEST(orchestrator_update_tests, test_wrong_manifest_version) int err = suit_orchestrator_entry(); /* THEN orchestrator returns error code... */ - zassert_equal(-EACCES, err, "Unexpected error code"); + zassert_equal(-ENOEXEC, err, "Unexpected error code"); /* ... and the candidate availability flag is cleared */ assert_post_install_state(); } @@ -423,7 +423,7 @@ ZTEST(orchestrator_update_tests, test_signed_with_different_key) int err = suit_orchestrator_entry(); /* THEN orchestrator returns error code... */ - zassert_equal(-EACCES, err, "Unexpected error code"); + zassert_equal(-ENOEXEC, err, "Unexpected error code"); /* ... and the candidate availability flag is cleared */ assert_post_install_state(); } @@ -464,7 +464,7 @@ ZTEST(orchestrator_update_tests, test_unsupported_command) int err = suit_orchestrator_entry(); /* THEN orchestrator returns error code... */ - zassert_equal(-EACCES, err, "Unexpected error code"); + zassert_equal(-ENOEXEC, err, "Unexpected error code"); /* ... and the candidate availability flag is cleared */ assert_post_install_state(); } @@ -487,7 +487,7 @@ ZTEST(orchestrator_update_tests, test_seq_cand_varification_fail) int err = suit_orchestrator_entry(); /* THEN orchestrator returns error code... */ - zassert_equal(-EACCES, err, "Unexpected error code"); + zassert_equal(-EILSEQ, err, "Unexpected error code"); /* ... and the candidate availability flag is cleared */ assert_post_install_state(); } @@ -508,7 +508,7 @@ ZTEST(orchestrator_update_tests, test_seq_cand_varification_no_install) int err = suit_orchestrator_entry(); /* THEN orchestrator returns error code... */ - zassert_equal(-EACCES, err, "Unexpected error code"); + zassert_equal(-EILSEQ, err, "Unexpected error code"); /* ... and the candidate availability flag is cleared */ assert_post_install_state(); } @@ -529,7 +529,7 @@ ZTEST(orchestrator_update_tests, test_seq_cand_varification_install_fail) int err = suit_orchestrator_entry(); /* THEN orchestrator returns error code... */ - zassert_equal(-EACCES, err, "Unexpected error code"); + zassert_equal(-EILSEQ, err, "Unexpected error code"); /* ... and the candidate availability flag is cleared */ assert_post_install_state(); } @@ -566,7 +566,7 @@ ZTEST(orchestrator_update_tests, test_seq_cand_varification_install) ZTEST(orchestrator_update_tests, test_invalid_update_candidate_address) { /* GIVEN update candidate with invalid address... */ - setup_update_candidate((uint8_t *) 0x00000FF0, 0x50); + setup_update_candidate((uint8_t *)0x00000FF0, 0x50); /* ... and suit orchestrator is initialized... */ zassert_equal(0, suit_orchestrator_init(), "Orchestrator not initialized"); /* ... and the execution mode is set to install mode */ diff --git a/tests/subsys/suit/storage/src/manifest_app.c b/tests/subsys/suit/storage/src/manifest_app.c index 510ac5439fba..0218c6a15702 100644 --- a/tests/subsys/suit/storage/src/manifest_app.c +++ b/tests/subsys/suit/storage/src/manifest_app.c @@ -19,12 +19,12 @@ uint8_t manifest_app_buf[] = { 0xD8, 0x6B, 0xA4, 0x02, 0x58, 0x7A, 0x82, 0x58, 0x24, 0x82, 0x2F, 0x58, 0x20, 0x4E, 0xDE, 0x20, 0x62, 0xD7, 0x21, 0x32, 0xB2, 0xF4, 0x4C, 0x2C, 0x8B, 0x10, 0x41, 0xB1, 0x76, 0x3C, 0x6E, 0x42, 0x2A, 0x82, 0xE9, 0x95, 0x91, 0x2B, 0x3B, 0x3A, 0x41, 0xC7, 0x96, 0xA3, 0x9B, - 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x7F, 0xFF, 0xFF, 0xE0, - 0xA0, 0xF6, 0x58, 0x40, 0xBB, 0xC7, 0xB2, 0x73, 0x7B, 0x11, 0x19, 0x82, 0x58, 0x0F, 0x3F, - 0x6C, 0x82, 0xCD, 0x96, 0x04, 0x6D, 0xA0, 0xDC, 0x03, 0xC7, 0x51, 0x1B, 0x3F, 0x7D, 0x85, - 0xA7, 0x35, 0x33, 0x56, 0xC6, 0x10, 0xA6, 0x57, 0xCE, 0xA5, 0x13, 0xC4, 0x1C, 0x03, 0xD2, - 0xFC, 0x9D, 0x2B, 0x07, 0x14, 0xAB, 0xF8, 0x0B, 0x7B, 0x25, 0x37, 0x8D, 0x64, 0x3D, 0x89, - 0x8A, 0x4C, 0xE9, 0x12, 0x07, 0xB0, 0xE6, 0x32, 0x03, 0x58, 0xDB, 0xA8, 0x01, 0x01, 0x02, + 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x40, 0x02, 0x21, 0x00, + 0xA0, 0xF6, 0x58, 0x40, 0x39, 0x9A, 0x16, 0x37, 0xEC, 0x61, 0xA4, 0x17, 0x40, 0x22, 0xE7, + 0x0B, 0xA4, 0x9F, 0x37, 0x93, 0xC9, 0x32, 0xD9, 0x6A, 0x16, 0x42, 0x10, 0x2E, 0xB9, 0x59, + 0x62, 0x1C, 0x04, 0x30, 0x5D, 0xB8, 0x8A, 0x86, 0x95, 0xEB, 0x5C, 0xFC, 0x99, 0x9C, 0xE3, + 0x23, 0x00, 0xB3, 0xDB, 0xE7, 0xC0, 0x60, 0x56, 0x72, 0x6D, 0x7C, 0xD0, 0x94, 0x69, 0xB1, + 0x72, 0x64, 0xDD, 0x79, 0x44, 0x05, 0x18, 0xBC, 0x03, 0x58, 0xDB, 0xA8, 0x01, 0x01, 0x02, 0x01, 0x03, 0x58, 0x70, 0xA2, 0x02, 0x81, 0x84, 0x44, 0x63, 0x4D, 0x45, 0x4D, 0x41, 0x02, 0x45, 0x1A, 0x0E, 0x0A, 0xA0, 0x00, 0x45, 0x1A, 0x00, 0x07, 0xF8, 0x00, 0x04, 0x58, 0x56, 0x86, 0x14, 0xA4, 0x01, 0x50, 0x76, 0x17, 0xDA, 0xA5, 0x71, 0xFD, 0x5A, 0x85, 0x8F, 0x94, diff --git a/tests/subsys/suit/storage/src/manifest_app_posix.c b/tests/subsys/suit/storage/src/manifest_app_posix.c index 0bf6df790c4e..ec2574f27b25 100644 --- a/tests/subsys/suit/storage/src/manifest_app_posix.c +++ b/tests/subsys/suit/storage/src/manifest_app_posix.c @@ -19,12 +19,12 @@ uint8_t manifest_app_posix_buf[] = { 0xD8, 0x6B, 0xA4, 0x02, 0x58, 0x7A, 0x82, 0x58, 0x24, 0x82, 0x2F, 0x58, 0x20, 0xDF, 0x79, 0x9F, 0x6C, 0xEB, 0x40, 0x2C, 0x68, 0x1F, 0x1A, 0x36, 0x49, 0x79, 0x88, 0x83, 0xF3, 0x8A, 0x6D, 0xA9, 0x81, 0x08, 0xA1, 0xA8, 0xE3, 0x72, 0xA0, 0xF7, 0x01, 0x27, 0x4C, 0xE9, 0x75, - 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x7F, 0xFF, 0xFF, 0xE0, - 0xA0, 0xF6, 0x58, 0x40, 0x11, 0xFF, 0x09, 0xA1, 0xBB, 0x1E, 0x9F, 0x8E, 0x34, 0x68, 0x94, - 0x0C, 0x62, 0xAB, 0x10, 0x24, 0xE9, 0x53, 0x70, 0x1D, 0x79, 0x5C, 0x9B, 0xA8, 0xA9, 0x80, - 0x99, 0x1A, 0x9A, 0xCC, 0xB7, 0x17, 0x45, 0xB9, 0x0C, 0xA8, 0x1A, 0x7D, 0xA8, 0xD6, 0x2E, - 0x57, 0xBC, 0xAD, 0x12, 0x94, 0xCA, 0x25, 0xA4, 0xA2, 0x2B, 0x6B, 0x20, 0x8C, 0xE7, 0x41, - 0x34, 0xC5, 0x69, 0x64, 0x84, 0xE9, 0x09, 0x13, 0x03, 0x58, 0xD9, 0xA8, 0x01, 0x01, 0x02, + 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x40, 0x00, 0x00, 0x00, + 0xA0, 0xF6, 0x58, 0x40, 0xB6, 0xA9, 0xAB, 0x2B, 0xCA, 0x46, 0xB7, 0xCE, 0x18, 0x3D, 0xF1, + 0x42, 0xA1, 0xFE, 0xFE, 0x8F, 0x92, 0x4E, 0xC4, 0x3F, 0x96, 0xA9, 0x63, 0xFC, 0xD2, 0x1C, + 0xDC, 0x05, 0x07, 0x09, 0x38, 0x3C, 0x8B, 0x4D, 0x73, 0xEC, 0xF8, 0x90, 0x59, 0xCB, 0x4A, + 0x58, 0x61, 0xA6, 0x31, 0x55, 0xE4, 0xD3, 0xCF, 0xF2, 0xAA, 0x20, 0xDD, 0x4D, 0x51, 0x1B, + 0xC6, 0xF4, 0x16, 0x22, 0x65, 0x0E, 0x16, 0x48, 0x03, 0x58, 0xD9, 0xA8, 0x01, 0x01, 0x02, 0x01, 0x03, 0x58, 0x6E, 0xA2, 0x02, 0x81, 0x84, 0x44, 0x63, 0x4D, 0x45, 0x4D, 0x41, 0x00, 0x45, 0x1A, 0x00, 0x08, 0x00, 0x00, 0x43, 0x19, 0x10, 0x00, 0x04, 0x58, 0x56, 0x86, 0x14, 0xA4, 0x01, 0x50, 0x76, 0x17, 0xDA, 0xA5, 0x71, 0xFD, 0x5A, 0x85, 0x8F, 0x94, 0xE2, 0x8D, diff --git a/tests/subsys/suit/storage/src/manifest_app_posix_v2.c b/tests/subsys/suit/storage/src/manifest_app_posix_v2.c index ad3cff2940d1..3ed0fca21abc 100644 --- a/tests/subsys/suit/storage/src/manifest_app_posix_v2.c +++ b/tests/subsys/suit/storage/src/manifest_app_posix_v2.c @@ -19,12 +19,12 @@ uint8_t manifest_app_posix_v2_buf[] = { 0xD8, 0x6B, 0xA4, 0x02, 0x58, 0x7A, 0x82, 0x58, 0x24, 0x82, 0x2F, 0x58, 0x20, 0xF7, 0x1F, 0x7D, 0xC3, 0x77, 0x29, 0xF6, 0x7E, 0x16, 0xF1, 0x1A, 0x6C, 0xA8, 0x3F, 0xC7, 0x20, 0xC7, 0xFC, 0x04, 0xD3, 0xC2, 0x2E, 0x4B, 0xA2, 0xCC, 0x00, 0xA9, 0x02, 0x11, 0x79, 0x8C, 0x96, - 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x7F, 0xFF, 0xFF, 0xE0, - 0xA0, 0xF6, 0x58, 0x40, 0xAE, 0x29, 0x14, 0x44, 0x66, 0x70, 0xF9, 0xAE, 0xFF, 0x6A, 0x85, - 0xF9, 0x2A, 0x4A, 0x9E, 0xFB, 0x4E, 0x4E, 0xED, 0xB5, 0x24, 0x8E, 0x4C, 0x5F, 0x2C, 0x3F, - 0x47, 0xFD, 0x76, 0x68, 0x22, 0xD0, 0x40, 0x47, 0x14, 0x54, 0xF5, 0xA8, 0x26, 0xBA, 0x8D, - 0x71, 0x93, 0x1D, 0xBC, 0x3F, 0x2F, 0xDE, 0x1C, 0x0B, 0xE7, 0x23, 0x4B, 0xAA, 0x10, 0x08, - 0x06, 0x01, 0x4A, 0x3C, 0xD3, 0x35, 0x55, 0xE0, 0x03, 0x58, 0xD9, 0xA8, 0x01, 0x01, 0x02, + 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x40, 0x00, 0x00, 0x00, + 0xA0, 0xF6, 0x58, 0x40, 0xD8, 0xCE, 0x24, 0x64, 0x7B, 0x2E, 0x7B, 0x1D, 0x6C, 0x40, 0x25, + 0x79, 0xEE, 0xB0, 0xFB, 0xFB, 0xD2, 0x1E, 0xED, 0x35, 0x70, 0x8F, 0x20, 0x95, 0x81, 0x09, + 0x21, 0x04, 0xC7, 0xD7, 0xD3, 0x7F, 0xCD, 0xBE, 0x69, 0x31, 0xB9, 0x7D, 0x71, 0xAA, 0x3A, + 0x50, 0x2D, 0xEB, 0x67, 0x78, 0x63, 0x27, 0x36, 0xBF, 0x72, 0xF5, 0x0A, 0x65, 0x11, 0x3C, + 0x70, 0xC0, 0x99, 0xA0, 0xFA, 0x9F, 0x72, 0xA1, 0x03, 0x58, 0xD9, 0xA8, 0x01, 0x01, 0x02, 0x02, 0x03, 0x58, 0x6E, 0xA2, 0x02, 0x81, 0x84, 0x44, 0x63, 0x4D, 0x45, 0x4D, 0x41, 0x00, 0x45, 0x1A, 0x00, 0x08, 0x00, 0x00, 0x43, 0x19, 0x10, 0x00, 0x04, 0x58, 0x56, 0x86, 0x14, 0xA4, 0x01, 0x50, 0x76, 0x17, 0xDA, 0xA5, 0x71, 0xFD, 0x5A, 0x85, 0x8F, 0x94, 0xE2, 0x8D, diff --git a/tests/subsys/suit/storage/src/manifest_rad.c b/tests/subsys/suit/storage/src/manifest_rad.c index 661b72a384b2..47cf8f86a21a 100644 --- a/tests/subsys/suit/storage/src/manifest_rad.c +++ b/tests/subsys/suit/storage/src/manifest_rad.c @@ -19,12 +19,12 @@ uint8_t manifest_rad_buf[] = { 0xD8, 0x6B, 0xA4, 0x02, 0x58, 0x7A, 0x82, 0x58, 0x24, 0x82, 0x2F, 0x58, 0x20, 0x8A, 0x63, 0x1C, 0x5B, 0x6D, 0xE8, 0x37, 0x82, 0xB0, 0x4A, 0xDC, 0x63, 0x26, 0xC0, 0x3D, 0xA9, 0x28, 0x16, 0xE1, 0xA5, 0xB4, 0x2D, 0xB5, 0x7D, 0xA8, 0xA0, 0x3C, 0x19, 0x81, 0x5F, 0x8E, 0xF5, - 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x7F, 0xFF, 0xFF, 0xE0, - 0xA0, 0xF6, 0x58, 0x40, 0x83, 0x96, 0x10, 0x58, 0x03, 0xA9, 0xC8, 0xDA, 0x9E, 0x7D, 0xAD, - 0xD5, 0xF2, 0xBD, 0x16, 0xA6, 0x1C, 0xAC, 0x55, 0x03, 0x1F, 0x6C, 0x80, 0x88, 0xBF, 0x35, - 0x63, 0xF9, 0x8B, 0x9A, 0x0B, 0x49, 0x6D, 0x27, 0x22, 0x9B, 0xA6, 0xA5, 0x4E, 0x88, 0xA1, - 0x80, 0xF6, 0x4D, 0x91, 0x85, 0xB3, 0x3A, 0x0F, 0x65, 0x0D, 0xCC, 0x80, 0xEB, 0x6F, 0xBF, - 0x96, 0xD1, 0xA4, 0x3D, 0x54, 0xFD, 0x21, 0x66, 0x03, 0x58, 0xDB, 0xA8, 0x01, 0x01, 0x02, + 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x40, 0x03, 0x21, 0x00, + 0xA0, 0xF6, 0x58, 0x40, 0x11, 0x6B, 0x0F, 0x84, 0x71, 0x3E, 0xA6, 0xD0, 0xA5, 0x07, 0x12, + 0x81, 0x9A, 0x0C, 0xC6, 0x0B, 0x96, 0x9D, 0x4A, 0x57, 0x5B, 0x23, 0x61, 0xC2, 0x68, 0x8C, + 0x23, 0x2A, 0xB9, 0x95, 0x2D, 0x38, 0x2B, 0x24, 0x56, 0xC6, 0xF4, 0x58, 0xAC, 0xFD, 0x22, + 0xF2, 0x7E, 0x8C, 0x76, 0x16, 0xF7, 0xF8, 0xFB, 0x66, 0xB3, 0xC9, 0x28, 0xB2, 0x17, 0x3C, + 0xA9, 0x25, 0x34, 0x6C, 0xC8, 0xDD, 0xD2, 0xF1, 0x03, 0x58, 0xDB, 0xA8, 0x01, 0x01, 0x02, 0x01, 0x03, 0x58, 0x70, 0xA2, 0x02, 0x81, 0x84, 0x44, 0x63, 0x4D, 0x45, 0x4D, 0x41, 0x03, 0x45, 0x1A, 0x0E, 0x05, 0x40, 0x00, 0x45, 0x1A, 0x00, 0x05, 0x58, 0x00, 0x04, 0x58, 0x56, 0x86, 0x14, 0xA4, 0x01, 0x50, 0x76, 0x17, 0xDA, 0xA5, 0x71, 0xFD, 0x5A, 0x85, 0x8F, 0x94, diff --git a/tests/subsys/suit/storage/src/manifest_root.c b/tests/subsys/suit/storage/src/manifest_root.c index 7cbf143d15f5..96152c2041d6 100644 --- a/tests/subsys/suit/storage/src/manifest_root.c +++ b/tests/subsys/suit/storage/src/manifest_root.c @@ -16,15 +16,15 @@ * @note Please use the manifest_common/regenerate.sh script for regenerating payloads. */ uint8_t manifest_root_buf[] = { - 0xD8, 0x6B, 0xA5, 0x02, 0x58, 0x7A, 0x82, 0x58, 0x24, 0x82, 0x2F, 0x58, 0x20, 0x70, 0x48, - 0xD3, 0x40, 0x31, 0x7C, 0xB9, 0xA7, 0xEC, 0x03, 0xF9, 0x9D, 0x70, 0x2B, 0x71, 0xA9, 0x9D, - 0x27, 0x1D, 0x7B, 0xED, 0xA6, 0x84, 0x91, 0xBF, 0xB5, 0x6A, 0x03, 0x91, 0xAB, 0xEE, 0x42, - 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x7F, 0xFF, 0xFF, 0xE0, - 0xA0, 0xF6, 0x58, 0x40, 0x07, 0x99, 0x39, 0xCB, 0xB1, 0xB2, 0xAE, 0xDF, 0x7D, 0x25, 0xD6, - 0x3B, 0xEA, 0x4B, 0x13, 0x86, 0xEC, 0x5F, 0x31, 0x2B, 0x4D, 0x95, 0xAD, 0x87, 0xCF, 0x7C, - 0x43, 0x00, 0xAA, 0x20, 0xB5, 0x6F, 0xE1, 0x51, 0xDB, 0xFA, 0x43, 0xD2, 0xE3, 0x48, 0x8F, - 0xD2, 0x66, 0xAF, 0x32, 0xC7, 0xA0, 0xFB, 0xDC, 0x1B, 0xBE, 0xB4, 0x8E, 0x76, 0x46, 0x28, - 0x7A, 0x16, 0xEA, 0x99, 0xEA, 0x4D, 0x70, 0xBB, 0x03, 0x59, 0x01, 0x94, 0xA8, 0x01, 0x01, + 0xD8, 0x6B, 0xA5, 0x02, 0x58, 0x7A, 0x82, 0x58, 0x24, 0x82, 0x2F, 0x58, 0x20, 0x0E, 0x18, + 0xC8, 0xF1, 0xC8, 0x26, 0x7D, 0xFC, 0x8F, 0xF8, 0xE6, 0xCE, 0xBF, 0xBF, 0xC1, 0xF9, 0x34, + 0xEB, 0x49, 0x24, 0x78, 0x12, 0x56, 0xE7, 0xE4, 0x3F, 0x52, 0x0E, 0x86, 0xAE, 0xFF, 0x5D, + 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x40, 0x00, 0xAA, 0x00, + 0xA0, 0xF6, 0x58, 0x40, 0x6B, 0x85, 0xAD, 0x50, 0x0E, 0x2B, 0x93, 0xB3, 0x91, 0x0A, 0x46, + 0x7C, 0x3B, 0x11, 0x9A, 0xD4, 0x0E, 0xC6, 0x8A, 0x66, 0x5D, 0x97, 0x2D, 0xE7, 0x77, 0xE2, + 0xAB, 0x3F, 0xFA, 0x3A, 0xC1, 0x74, 0x9E, 0x16, 0x57, 0xE8, 0x56, 0x90, 0x7A, 0x71, 0x4A, + 0x74, 0x65, 0x23, 0xCA, 0xB6, 0x2E, 0x7C, 0x46, 0x7A, 0x54, 0x48, 0xC2, 0x63, 0xEE, 0x3B, + 0xE5, 0x82, 0x2F, 0x20, 0xFB, 0x8D, 0x42, 0x3C, 0x03, 0x59, 0x01, 0x94, 0xA8, 0x01, 0x01, 0x02, 0x01, 0x03, 0x58, 0xB3, 0xA3, 0x02, 0x83, 0x82, 0x4A, 0x69, 0x43, 0x41, 0x4E, 0x44, 0x5F, 0x4D, 0x46, 0x53, 0x54, 0x41, 0x00, 0x82, 0x4C, 0x6B, 0x49, 0x4E, 0x53, 0x54, 0x4C, 0x44, 0x5F, 0x4D, 0x46, 0x53, 0x54, 0x50, 0x81, 0x6A, 0xA0, 0xA0, 0xAF, 0x11, 0x5E, 0xF2, @@ -40,13 +40,13 @@ uint8_t manifest_root_buf[] = { 0x01, 0xA0, 0x02, 0xA0, 0x07, 0x49, 0x86, 0x0C, 0x82, 0x01, 0x02, 0x07, 0x0F, 0x0B, 0x0F, 0x09, 0x49, 0x86, 0x0C, 0x82, 0x01, 0x02, 0x07, 0x0F, 0x0B, 0x0F, 0x11, 0x58, 0x7B, 0x96, 0x0C, 0x00, 0x14, 0xA2, 0x15, 0x69, 0x23, 0x72, 0x61, 0x64, 0x2E, 0x73, 0x75, 0x69, 0x74, - 0x03, 0x58, 0x24, 0x82, 0x2F, 0x58, 0x20, 0x70, 0xB9, 0xD4, 0x31, 0x38, 0x5A, 0xC8, 0xB7, - 0x1C, 0xFF, 0x05, 0xCD, 0xC3, 0xFB, 0x72, 0xB0, 0xC3, 0x03, 0xC9, 0xA4, 0xCD, 0xC6, 0x37, - 0x1C, 0x87, 0x2A, 0xC8, 0x0E, 0x6E, 0xAA, 0x9C, 0x77, 0x15, 0x02, 0x03, 0x0F, 0x07, 0x0F, + 0x03, 0x58, 0x24, 0x82, 0x2F, 0x58, 0x20, 0x64, 0x06, 0x96, 0x7A, 0x2D, 0xBD, 0xB4, 0x50, + 0xCA, 0xE3, 0xCA, 0x10, 0x4C, 0x64, 0x5F, 0xA0, 0x84, 0x69, 0x90, 0x65, 0x69, 0x7B, 0xDD, + 0x31, 0xA9, 0xE8, 0xAC, 0x7A, 0x6F, 0x4C, 0x18, 0x62, 0x15, 0x02, 0x03, 0x0F, 0x07, 0x0F, 0x0B, 0x0F, 0x14, 0xA2, 0x15, 0x69, 0x23, 0x61, 0x70, 0x70, 0x2E, 0x73, 0x75, 0x69, 0x74, - 0x03, 0x58, 0x24, 0x82, 0x2F, 0x58, 0x20, 0xF1, 0x02, 0x85, 0xAA, 0xED, 0x59, 0xD2, 0x35, - 0x97, 0xF0, 0xED, 0xC3, 0xE5, 0x2F, 0x9E, 0x41, 0x62, 0x3C, 0x5C, 0x98, 0xF9, 0xBF, 0x52, - 0x5E, 0x57, 0xC9, 0xBA, 0x5B, 0x98, 0x39, 0x50, 0x35, 0x15, 0x02, 0x03, 0x0F, 0x07, 0x0F, + 0x03, 0x58, 0x24, 0x82, 0x2F, 0x58, 0x20, 0xDA, 0x37, 0x33, 0x37, 0xCB, 0x1E, 0x25, 0xAB, + 0x21, 0xCE, 0x03, 0x04, 0x5F, 0xE0, 0xA4, 0x3D, 0xEF, 0x99, 0xC8, 0x0A, 0xFD, 0xB7, 0xEC, + 0x12, 0x10, 0x71, 0x2B, 0xA0, 0xFA, 0xC9, 0xAE, 0x9D, 0x15, 0x02, 0x03, 0x0F, 0x07, 0x0F, 0x0B, 0x0F, 0x17, 0x82, 0x2F, 0x58, 0x20, 0xB8, 0x36, 0xCD, 0xE4, 0x01, 0x13, 0xBD, 0x77, 0x5D, 0xE0, 0xEC, 0x07, 0xFC, 0x3E, 0xBC, 0x5F, 0x36, 0x8F, 0x8C, 0xA5, 0x05, 0xC2, 0x78, 0x7D, 0x1A, 0xED, 0x46, 0xAB, 0x8F, 0x6B, 0x05, 0x89, 0x05, 0x82, 0x4C, 0x6B, 0x49, 0x4E, @@ -65,12 +65,12 @@ uint8_t manifest_root_buf[] = { 0x82, 0x58, 0x24, 0x82, 0x2F, 0x58, 0x20, 0x8A, 0x63, 0x1C, 0x5B, 0x6D, 0xE8, 0x37, 0x82, 0xB0, 0x4A, 0xDC, 0x63, 0x26, 0xC0, 0x3D, 0xA9, 0x28, 0x16, 0xE1, 0xA5, 0xB4, 0x2D, 0xB5, 0x7D, 0xA8, 0xA0, 0x3C, 0x19, 0x81, 0x5F, 0x8E, 0xF5, 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, - 0x01, 0x26, 0x04, 0x45, 0x1A, 0x7F, 0xFF, 0xFF, 0xE0, 0xA0, 0xF6, 0x58, 0x40, 0xB4, 0xDA, - 0x32, 0x1E, 0x72, 0x20, 0x15, 0x8B, 0xEE, 0xF6, 0x9A, 0x83, 0x02, 0xA4, 0xF5, 0x69, 0xC4, - 0xB9, 0xA0, 0xDA, 0x10, 0x2B, 0xDE, 0x6F, 0x90, 0x31, 0xFD, 0x73, 0xB3, 0x25, 0xB1, 0x77, - 0xE5, 0x22, 0xFF, 0x33, 0x9D, 0x7C, 0x72, 0x40, 0xBF, 0x5C, 0xB6, 0x3C, 0xF5, 0xC1, 0x7D, - 0x78, 0x29, 0x69, 0x6F, 0x1C, 0x7A, 0x44, 0x15, 0xF3, 0x69, 0x4F, 0xB2, 0x58, 0x0A, 0x67, - 0xCE, 0xD3, 0x03, 0x58, 0xDB, 0xA8, 0x01, 0x01, 0x02, 0x01, 0x03, 0x58, 0x70, 0xA2, 0x02, + 0x01, 0x26, 0x04, 0x45, 0x1A, 0x40, 0x03, 0x21, 0x00, 0xA0, 0xF6, 0x58, 0x40, 0x11, 0x6B, + 0x0F, 0x84, 0x71, 0x3E, 0xA6, 0xD0, 0xA5, 0x07, 0x12, 0x81, 0x9A, 0x0C, 0xC6, 0x0B, 0x96, + 0x9D, 0x4A, 0x57, 0x5B, 0x23, 0x61, 0xC2, 0x68, 0x8C, 0x23, 0x2A, 0xB9, 0x95, 0x2D, 0x38, + 0x2B, 0x24, 0x56, 0xC6, 0xF4, 0x58, 0xAC, 0xFD, 0x22, 0xF2, 0x7E, 0x8C, 0x76, 0x16, 0xF7, + 0xF8, 0xFB, 0x66, 0xB3, 0xC9, 0x28, 0xB2, 0x17, 0x3C, 0xA9, 0x25, 0x34, 0x6C, 0xC8, 0xDD, + 0xD2, 0xF1, 0x03, 0x58, 0xDB, 0xA8, 0x01, 0x01, 0x02, 0x01, 0x03, 0x58, 0x70, 0xA2, 0x02, 0x81, 0x84, 0x44, 0x63, 0x4D, 0x45, 0x4D, 0x41, 0x03, 0x45, 0x1A, 0x0E, 0x05, 0x40, 0x00, 0x45, 0x1A, 0x00, 0x05, 0x58, 0x00, 0x04, 0x58, 0x56, 0x86, 0x14, 0xA4, 0x01, 0x50, 0x76, 0x17, 0xDA, 0xA5, 0x71, 0xFD, 0x5A, 0x85, 0x8F, 0x94, 0xE2, 0x8D, 0x73, 0x5C, 0xE9, 0xF4, @@ -117,11 +117,11 @@ uint8_t manifest_root_buf[] = { 0x2F, 0x58, 0x20, 0x4E, 0xDE, 0x20, 0x62, 0xD7, 0x21, 0x32, 0xB2, 0xF4, 0x4C, 0x2C, 0x8B, 0x10, 0x41, 0xB1, 0x76, 0x3C, 0x6E, 0x42, 0x2A, 0x82, 0xE9, 0x95, 0x91, 0x2B, 0x3B, 0x3A, 0x41, 0xC7, 0x96, 0xA3, 0x9B, 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, - 0x1A, 0x7F, 0xFF, 0xFF, 0xE0, 0xA0, 0xF6, 0x58, 0x40, 0xE6, 0x31, 0x54, 0x34, 0xE4, 0xCB, - 0xEC, 0x63, 0xA5, 0x6C, 0x1A, 0x11, 0x64, 0xB9, 0x6C, 0xA7, 0xB1, 0x7B, 0xD9, 0x3A, 0xA2, - 0x3E, 0xA0, 0x89, 0x78, 0x74, 0x92, 0x6E, 0xBA, 0x7E, 0x16, 0x6C, 0xA4, 0x05, 0x21, 0xA3, - 0x82, 0x20, 0x64, 0x58, 0x5B, 0x58, 0x9F, 0x69, 0xB1, 0xAB, 0x06, 0x6C, 0xEA, 0xA3, 0x32, - 0xF1, 0xE6, 0x62, 0xEA, 0xF5, 0xED, 0x94, 0xC3, 0xEA, 0x0C, 0xD3, 0x01, 0x17, 0x03, 0x58, + 0x1A, 0x40, 0x02, 0x21, 0x00, 0xA0, 0xF6, 0x58, 0x40, 0x39, 0x9A, 0x16, 0x37, 0xEC, 0x61, + 0xA4, 0x17, 0x40, 0x22, 0xE7, 0x0B, 0xA4, 0x9F, 0x37, 0x93, 0xC9, 0x32, 0xD9, 0x6A, 0x16, + 0x42, 0x10, 0x2E, 0xB9, 0x59, 0x62, 0x1C, 0x04, 0x30, 0x5D, 0xB8, 0x8A, 0x86, 0x95, 0xEB, + 0x5C, 0xFC, 0x99, 0x9C, 0xE3, 0x23, 0x00, 0xB3, 0xDB, 0xE7, 0xC0, 0x60, 0x56, 0x72, 0x6D, + 0x7C, 0xD0, 0x94, 0x69, 0xB1, 0x72, 0x64, 0xDD, 0x79, 0x44, 0x05, 0x18, 0xBC, 0x03, 0x58, 0xDB, 0xA8, 0x01, 0x01, 0x02, 0x01, 0x03, 0x58, 0x70, 0xA2, 0x02, 0x81, 0x84, 0x44, 0x63, 0x4D, 0x45, 0x4D, 0x41, 0x02, 0x45, 0x1A, 0x0E, 0x0A, 0xA0, 0x00, 0x45, 0x1A, 0x00, 0x07, 0xF8, 0x00, 0x04, 0x58, 0x56, 0x86, 0x14, 0xA4, 0x01, 0x50, 0x76, 0x17, 0xDA, 0xA5, 0x71, diff --git a/tests/subsys/suit/storage/src/manifest_root_posix.c b/tests/subsys/suit/storage/src/manifest_root_posix.c index f5af7391a1f1..315276cad184 100644 --- a/tests/subsys/suit/storage/src/manifest_root_posix.c +++ b/tests/subsys/suit/storage/src/manifest_root_posix.c @@ -16,15 +16,15 @@ * @note Please use the manifest_common/regenerate.sh script for regenerating payloads. */ uint8_t manifest_root_posix_buf[] = { - 0xD8, 0x6B, 0xA4, 0x02, 0x58, 0x7A, 0x82, 0x58, 0x24, 0x82, 0x2F, 0x58, 0x20, 0x21, 0xC7, - 0x4E, 0x83, 0x69, 0xE0, 0x22, 0x1B, 0x94, 0x50, 0xD3, 0x29, 0x08, 0x6A, 0x0A, 0x22, 0xBC, - 0xEC, 0x50, 0x86, 0xE6, 0xBD, 0x7B, 0xDF, 0xC9, 0xA2, 0xAC, 0xF8, 0x69, 0xAF, 0xDE, 0x59, - 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x7F, 0xFF, 0xFF, 0xE0, - 0xA0, 0xF6, 0x58, 0x40, 0xFA, 0x5D, 0x9D, 0x42, 0x57, 0x36, 0x71, 0x7F, 0xC7, 0xA9, 0xAB, - 0x5C, 0xFC, 0x1A, 0xDB, 0x1C, 0x0D, 0x3F, 0xDA, 0x54, 0x17, 0xF5, 0x7E, 0x99, 0x6B, 0x4E, - 0x4F, 0xCE, 0x58, 0xF7, 0x9A, 0x7D, 0xA1, 0x62, 0x5D, 0x83, 0xF1, 0x1F, 0x5C, 0x77, 0x63, - 0xC1, 0x2F, 0xFD, 0xF2, 0x06, 0x78, 0x4E, 0x7D, 0x0B, 0x2C, 0x11, 0x94, 0x00, 0x40, 0xBA, - 0x72, 0xB2, 0xC9, 0xC5, 0x54, 0x31, 0xBE, 0x0E, 0x03, 0x59, 0x01, 0x09, 0xA8, 0x01, 0x01, + 0xD8, 0x6B, 0xA4, 0x02, 0x58, 0x7A, 0x82, 0x58, 0x24, 0x82, 0x2F, 0x58, 0x20, 0xA0, 0xC8, + 0x2A, 0x76, 0xFD, 0xD9, 0xF6, 0x87, 0x6E, 0xA5, 0xF4, 0x46, 0xED, 0x1D, 0x64, 0xCF, 0xBF, + 0xEE, 0x64, 0x3E, 0x2F, 0xCA, 0x4E, 0xBA, 0x98, 0x07, 0x6A, 0xB4, 0xC8, 0xCF, 0x3F, 0xA8, + 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x40, 0x00, 0x00, 0x00, + 0xA0, 0xF6, 0x58, 0x40, 0x88, 0xB0, 0xFD, 0xD3, 0x7D, 0x78, 0x2F, 0xD8, 0x6D, 0x43, 0xCE, + 0x60, 0xD4, 0xBA, 0xB6, 0x3D, 0x07, 0xE3, 0x04, 0xCA, 0x7E, 0x65, 0xA0, 0x2A, 0xA8, 0x65, + 0x93, 0xD6, 0x00, 0x5D, 0xAF, 0x77, 0x33, 0x75, 0xCC, 0x62, 0x13, 0x98, 0xFB, 0xFA, 0xCD, + 0x65, 0x5A, 0x00, 0xE6, 0x63, 0x50, 0x91, 0xB5, 0x70, 0xF6, 0x9E, 0xCE, 0xD3, 0xC2, 0x46, + 0x2C, 0x2A, 0xD8, 0xD3, 0x77, 0x70, 0xD0, 0x1A, 0x03, 0x59, 0x01, 0x09, 0xA8, 0x01, 0x01, 0x02, 0x01, 0x03, 0x58, 0x68, 0xA3, 0x02, 0x82, 0x82, 0x4A, 0x69, 0x43, 0x41, 0x4E, 0x44, 0x5F, 0x4D, 0x46, 0x53, 0x54, 0x41, 0x00, 0x82, 0x4C, 0x6B, 0x49, 0x4E, 0x53, 0x54, 0x4C, 0x44, 0x5F, 0x4D, 0x46, 0x53, 0x54, 0x50, 0x5B, 0x46, 0x9F, 0xD1, 0x90, 0xEE, 0x53, 0x9C, @@ -35,9 +35,9 @@ uint8_t manifest_root_posix_buf[] = { 0x00, 0xA0, 0x01, 0xA0, 0x07, 0x47, 0x86, 0x0C, 0x01, 0x07, 0x0F, 0x0B, 0x0F, 0x09, 0x47, 0x86, 0x0C, 0x01, 0x07, 0x0F, 0x0B, 0x0F, 0x11, 0x58, 0x3F, 0x8C, 0x0C, 0x00, 0x14, 0xA2, 0x15, 0x69, 0x23, 0x61, 0x70, 0x70, 0x2E, 0x73, 0x75, 0x69, 0x74, 0x03, 0x58, 0x24, 0x82, - 0x2F, 0x58, 0x20, 0x5B, 0x78, 0x0A, 0xE6, 0xAD, 0x9E, 0xF0, 0x8B, 0x67, 0xFE, 0xFC, 0xBF, - 0x8D, 0xC6, 0x71, 0x9A, 0x11, 0xD6, 0xD7, 0x2D, 0x0A, 0x89, 0xB0, 0xE8, 0xD9, 0x81, 0x4B, - 0x2D, 0xCE, 0xAA, 0xC3, 0xCE, 0x15, 0x02, 0x03, 0x0F, 0x07, 0x0F, 0x0B, 0x0F, 0x17, 0x82, + 0x2F, 0x58, 0x20, 0x65, 0x3D, 0x93, 0x0A, 0x71, 0x9A, 0x25, 0xF9, 0xBB, 0x5A, 0x92, 0x39, + 0x62, 0x78, 0x10, 0x5D, 0xF4, 0x89, 0x15, 0x05, 0xCD, 0x09, 0x2B, 0xE1, 0x02, 0x3F, 0x3D, + 0xDE, 0x17, 0xC5, 0xA5, 0xB3, 0x15, 0x02, 0x03, 0x0F, 0x07, 0x0F, 0x0B, 0x0F, 0x17, 0x82, 0x2F, 0x58, 0x20, 0x45, 0x5E, 0x9B, 0x02, 0x97, 0xB3, 0xBB, 0xA3, 0xEC, 0x89, 0xBA, 0xD9, 0x6F, 0x09, 0x7C, 0x12, 0xA7, 0x4D, 0x3E, 0xDC, 0x1F, 0xB2, 0x40, 0x3F, 0x4A, 0x36, 0xA5, 0x5C, 0x82, 0x24, 0x9D, 0x84, 0x05, 0x82, 0x4C, 0x6B, 0x49, 0x4E, 0x53, 0x54, 0x4C, 0x44, @@ -55,12 +55,12 @@ uint8_t manifest_root_posix_buf[] = { 0xA4, 0x02, 0x58, 0x7A, 0x82, 0x58, 0x24, 0x82, 0x2F, 0x58, 0x20, 0xDF, 0x79, 0x9F, 0x6C, 0xEB, 0x40, 0x2C, 0x68, 0x1F, 0x1A, 0x36, 0x49, 0x79, 0x88, 0x83, 0xF3, 0x8A, 0x6D, 0xA9, 0x81, 0x08, 0xA1, 0xA8, 0xE3, 0x72, 0xA0, 0xF7, 0x01, 0x27, 0x4C, 0xE9, 0x75, 0x58, 0x51, - 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x7F, 0xFF, 0xFF, 0xE0, 0xA0, 0xF6, - 0x58, 0x40, 0x10, 0x77, 0xC0, 0x12, 0xB9, 0x1B, 0x34, 0xD8, 0x01, 0x6E, 0xD2, 0x75, 0x7F, - 0xA2, 0x86, 0x7C, 0x68, 0x88, 0xCA, 0x41, 0x3D, 0xA2, 0xD0, 0x7F, 0x94, 0xC3, 0x0A, 0xBC, - 0xBE, 0xD7, 0x80, 0x64, 0x94, 0x1A, 0x59, 0x71, 0x6A, 0xBC, 0x8A, 0xD6, 0x89, 0x9D, 0xB7, - 0xD4, 0x17, 0x15, 0xAE, 0xAB, 0x69, 0xC3, 0xB0, 0x6E, 0xF5, 0xF3, 0xD0, 0x89, 0x33, 0xE0, - 0x4C, 0xFC, 0xFD, 0x8C, 0x67, 0xDC, 0x03, 0x58, 0xD9, 0xA8, 0x01, 0x01, 0x02, 0x01, 0x03, + 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x40, 0x00, 0x00, 0x00, 0xA0, 0xF6, + 0x58, 0x40, 0xB6, 0xA9, 0xAB, 0x2B, 0xCA, 0x46, 0xB7, 0xCE, 0x18, 0x3D, 0xF1, 0x42, 0xA1, + 0xFE, 0xFE, 0x8F, 0x92, 0x4E, 0xC4, 0x3F, 0x96, 0xA9, 0x63, 0xFC, 0xD2, 0x1C, 0xDC, 0x05, + 0x07, 0x09, 0x38, 0x3C, 0x8B, 0x4D, 0x73, 0xEC, 0xF8, 0x90, 0x59, 0xCB, 0x4A, 0x58, 0x61, + 0xA6, 0x31, 0x55, 0xE4, 0xD3, 0xCF, 0xF2, 0xAA, 0x20, 0xDD, 0x4D, 0x51, 0x1B, 0xC6, 0xF4, + 0x16, 0x22, 0x65, 0x0E, 0x16, 0x48, 0x03, 0x58, 0xD9, 0xA8, 0x01, 0x01, 0x02, 0x01, 0x03, 0x58, 0x6E, 0xA2, 0x02, 0x81, 0x84, 0x44, 0x63, 0x4D, 0x45, 0x4D, 0x41, 0x00, 0x45, 0x1A, 0x00, 0x08, 0x00, 0x00, 0x43, 0x19, 0x10, 0x00, 0x04, 0x58, 0x56, 0x86, 0x14, 0xA4, 0x01, 0x50, 0x76, 0x17, 0xDA, 0xA5, 0x71, 0xFD, 0x5A, 0x85, 0x8F, 0x94, 0xE2, 0x8D, 0x73, 0x5C, diff --git a/tests/subsys/suit/storage/src/manifest_root_posix_v2.c b/tests/subsys/suit/storage/src/manifest_root_posix_v2.c index 672f3f4aebf2..fff5290b7684 100644 --- a/tests/subsys/suit/storage/src/manifest_root_posix_v2.c +++ b/tests/subsys/suit/storage/src/manifest_root_posix_v2.c @@ -16,15 +16,15 @@ * @note Please use the manifest_common/regenerate.sh script for regenerating payloads. */ uint8_t manifest_root_posix_v2_buf[] = { - 0xD8, 0x6B, 0xA4, 0x02, 0x58, 0x7A, 0x82, 0x58, 0x24, 0x82, 0x2F, 0x58, 0x20, 0x87, 0x48, - 0x71, 0xC3, 0xD0, 0xDD, 0x8A, 0xE4, 0x82, 0xAD, 0x2D, 0x57, 0x6E, 0xD5, 0xC2, 0xB1, 0x46, - 0x7F, 0xF8, 0x2C, 0x3C, 0x8B, 0x1B, 0x0A, 0xC9, 0x7F, 0xF0, 0xF9, 0x24, 0x26, 0xE9, 0xF2, - 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x7F, 0xFF, 0xFF, 0xE0, - 0xA0, 0xF6, 0x58, 0x40, 0x76, 0xBB, 0xFB, 0x2B, 0x8C, 0x65, 0xFC, 0x31, 0xF0, 0x43, 0xFA, - 0xD2, 0x86, 0xFA, 0x24, 0x2F, 0xD3, 0xAD, 0x3E, 0xE5, 0x28, 0x92, 0x46, 0x6F, 0x5D, 0x57, - 0x07, 0x3E, 0x0D, 0xEA, 0xC7, 0x01, 0xBA, 0xB3, 0x74, 0xD9, 0x60, 0x3A, 0xF7, 0x09, 0xCD, - 0xE4, 0x0C, 0x7A, 0x7F, 0x48, 0xA8, 0x8F, 0x5A, 0x87, 0xEE, 0x15, 0x22, 0xA9, 0xA0, 0x8F, - 0x43, 0xEB, 0x1C, 0x18, 0x7A, 0x70, 0x6F, 0xAF, 0x03, 0x59, 0x01, 0x09, 0xA8, 0x01, 0x01, + 0xD8, 0x6B, 0xA4, 0x02, 0x58, 0x7A, 0x82, 0x58, 0x24, 0x82, 0x2F, 0x58, 0x20, 0x92, 0xDC, + 0x23, 0xCF, 0xE0, 0x88, 0xFD, 0xD3, 0x09, 0xC7, 0xAF, 0x16, 0xED, 0x0A, 0xA2, 0xA6, 0x7F, + 0xBD, 0x25, 0xAF, 0x89, 0xAC, 0xF6, 0x71, 0xD3, 0xF9, 0x81, 0xA2, 0x36, 0x82, 0x40, 0x30, + 0x58, 0x51, 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x40, 0x00, 0x00, 0x00, + 0xA0, 0xF6, 0x58, 0x40, 0x59, 0x15, 0x2F, 0xC7, 0x9E, 0xA3, 0xE2, 0x54, 0x12, 0x83, 0xB0, + 0x76, 0x83, 0xF8, 0x7B, 0xA9, 0x96, 0xA8, 0x94, 0xD6, 0x63, 0xFE, 0x92, 0xD1, 0xAA, 0x2D, + 0x93, 0x44, 0x8B, 0xFC, 0x83, 0xD7, 0x79, 0x58, 0xFE, 0x14, 0xCF, 0xB4, 0x6F, 0x78, 0x91, + 0x1D, 0x96, 0xDA, 0x8C, 0x67, 0xA9, 0x8B, 0x98, 0xCF, 0x33, 0x79, 0xCA, 0xCD, 0x66, 0xD6, + 0x13, 0xC7, 0xA2, 0x64, 0xB8, 0x3E, 0x15, 0x78, 0x03, 0x59, 0x01, 0x09, 0xA8, 0x01, 0x01, 0x02, 0x02, 0x03, 0x58, 0x68, 0xA3, 0x02, 0x82, 0x82, 0x4A, 0x69, 0x43, 0x41, 0x4E, 0x44, 0x5F, 0x4D, 0x46, 0x53, 0x54, 0x41, 0x00, 0x82, 0x4C, 0x6B, 0x49, 0x4E, 0x53, 0x54, 0x4C, 0x44, 0x5F, 0x4D, 0x46, 0x53, 0x54, 0x50, 0x5B, 0x46, 0x9F, 0xD1, 0x90, 0xEE, 0x53, 0x9C, @@ -35,9 +35,9 @@ uint8_t manifest_root_posix_v2_buf[] = { 0x00, 0xA0, 0x01, 0xA0, 0x07, 0x47, 0x86, 0x0C, 0x01, 0x07, 0x0F, 0x0B, 0x0F, 0x09, 0x47, 0x86, 0x0C, 0x01, 0x07, 0x0F, 0x0B, 0x0F, 0x11, 0x58, 0x3F, 0x8C, 0x0C, 0x00, 0x14, 0xA2, 0x15, 0x69, 0x23, 0x61, 0x70, 0x70, 0x2E, 0x73, 0x75, 0x69, 0x74, 0x03, 0x58, 0x24, 0x82, - 0x2F, 0x58, 0x20, 0xB1, 0xEF, 0xD1, 0x5B, 0x2E, 0x87, 0xDB, 0xCB, 0xE6, 0x07, 0xC4, 0xB4, - 0xB5, 0xE4, 0x82, 0x37, 0x20, 0x7D, 0xFC, 0x63, 0xA3, 0x5C, 0xB6, 0xA7, 0x9D, 0x71, 0xF3, - 0x93, 0x0C, 0xEF, 0xBC, 0x38, 0x15, 0x02, 0x03, 0x0F, 0x07, 0x0F, 0x0B, 0x0F, 0x17, 0x82, + 0x2F, 0x58, 0x20, 0xCF, 0x3A, 0xD7, 0x0E, 0xF2, 0xEB, 0xCB, 0x5E, 0x33, 0x3D, 0xFE, 0x74, + 0x06, 0x9A, 0x5F, 0xAA, 0xEE, 0x36, 0xE6, 0x2A, 0xF4, 0x22, 0xD5, 0xD4, 0xCB, 0xBB, 0x5B, + 0x8F, 0x2F, 0x14, 0xAE, 0x50, 0x15, 0x02, 0x03, 0x0F, 0x07, 0x0F, 0x0B, 0x0F, 0x17, 0x82, 0x2F, 0x58, 0x20, 0x45, 0x5E, 0x9B, 0x02, 0x97, 0xB3, 0xBB, 0xA3, 0xEC, 0x89, 0xBA, 0xD9, 0x6F, 0x09, 0x7C, 0x12, 0xA7, 0x4D, 0x3E, 0xDC, 0x1F, 0xB2, 0x40, 0x3F, 0x4A, 0x36, 0xA5, 0x5C, 0x82, 0x24, 0x9D, 0x84, 0x05, 0x82, 0x4C, 0x6B, 0x49, 0x4E, 0x53, 0x54, 0x4C, 0x44, @@ -55,12 +55,12 @@ uint8_t manifest_root_posix_v2_buf[] = { 0xA4, 0x02, 0x58, 0x7A, 0x82, 0x58, 0x24, 0x82, 0x2F, 0x58, 0x20, 0xF7, 0x1F, 0x7D, 0xC3, 0x77, 0x29, 0xF6, 0x7E, 0x16, 0xF1, 0x1A, 0x6C, 0xA8, 0x3F, 0xC7, 0x20, 0xC7, 0xFC, 0x04, 0xD3, 0xC2, 0x2E, 0x4B, 0xA2, 0xCC, 0x00, 0xA9, 0x02, 0x11, 0x79, 0x8C, 0x96, 0x58, 0x51, - 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x7F, 0xFF, 0xFF, 0xE0, 0xA0, 0xF6, - 0x58, 0x40, 0xFC, 0xF0, 0xF3, 0x65, 0xAB, 0x4C, 0x23, 0x5A, 0x5E, 0x58, 0x69, 0x8B, 0x23, - 0xB2, 0x57, 0x1E, 0xE8, 0x40, 0xDC, 0x6D, 0xA7, 0x99, 0xD3, 0x2E, 0xB8, 0xE1, 0xBA, 0xCF, - 0x29, 0x8E, 0x90, 0x6B, 0x4C, 0xD8, 0x30, 0x6E, 0x78, 0xD3, 0xFB, 0x31, 0xBC, 0x14, 0x84, - 0x56, 0x16, 0xC3, 0x6A, 0x75, 0xAE, 0x5A, 0xE5, 0x42, 0x35, 0xF2, 0x9C, 0x82, 0x8E, 0x70, - 0x02, 0xE8, 0xDF, 0xDC, 0x1D, 0x1C, 0x03, 0x58, 0xD9, 0xA8, 0x01, 0x01, 0x02, 0x02, 0x03, + 0xD2, 0x84, 0x4A, 0xA2, 0x01, 0x26, 0x04, 0x45, 0x1A, 0x40, 0x00, 0x00, 0x00, 0xA0, 0xF6, + 0x58, 0x40, 0xD8, 0xCE, 0x24, 0x64, 0x7B, 0x2E, 0x7B, 0x1D, 0x6C, 0x40, 0x25, 0x79, 0xEE, + 0xB0, 0xFB, 0xFB, 0xD2, 0x1E, 0xED, 0x35, 0x70, 0x8F, 0x20, 0x95, 0x81, 0x09, 0x21, 0x04, + 0xC7, 0xD7, 0xD3, 0x7F, 0xCD, 0xBE, 0x69, 0x31, 0xB9, 0x7D, 0x71, 0xAA, 0x3A, 0x50, 0x2D, + 0xEB, 0x67, 0x78, 0x63, 0x27, 0x36, 0xBF, 0x72, 0xF5, 0x0A, 0x65, 0x11, 0x3C, 0x70, 0xC0, + 0x99, 0xA0, 0xFA, 0x9F, 0x72, 0xA1, 0x03, 0x58, 0xD9, 0xA8, 0x01, 0x01, 0x02, 0x02, 0x03, 0x58, 0x6E, 0xA2, 0x02, 0x81, 0x84, 0x44, 0x63, 0x4D, 0x45, 0x4D, 0x41, 0x00, 0x45, 0x1A, 0x00, 0x08, 0x00, 0x00, 0x43, 0x19, 0x10, 0x00, 0x04, 0x58, 0x56, 0x86, 0x14, 0xA4, 0x01, 0x50, 0x76, 0x17, 0xDA, 0xA5, 0x71, 0xFD, 0x5A, 0x85, 0x8F, 0x94, 0xE2, 0x8D, 0x73, 0x5C, diff --git a/tests/subsys/suit/unit/mocks/include/mock_suit_mci.h b/tests/subsys/suit/unit/mocks/include/mock_suit_mci.h index fa8bc1c2a2dc..fb8143012220 100644 --- a/tests/subsys/suit/unit/mocks/include/mock_suit_mci.h +++ b/tests/subsys/suit/unit/mocks/include/mock_suit_mci.h @@ -34,6 +34,7 @@ FAKE_VALUE_FUNC(int, suit_mci_independent_update_policy_get, const suit_manifest suit_independent_updateability_policy_t *); FAKE_VALUE_FUNC(int, suit_mci_manifest_class_id_validate, const suit_manifest_class_id_t *); FAKE_VALUE_FUNC(int, suit_mci_signing_key_id_validate, const suit_manifest_class_id_t *, uint32_t); +FAKE_VALUE_FUNC(int, suit_mci_signing_key_id_get, const suit_manifest_class_id_t *, uint32_t *); FAKE_VALUE_FUNC(int, suit_mci_processor_start_rights_validate, const suit_manifest_class_id_t *, int); FAKE_VALUE_FUNC(int, suit_mci_memory_access_rights_validate, const suit_manifest_class_id_t *, @@ -65,6 +66,7 @@ static inline void mock_suit_mci_reset(void) RESET_FAKE(suit_mci_independent_update_policy_get); RESET_FAKE(suit_mci_manifest_class_id_validate); RESET_FAKE(suit_mci_signing_key_id_validate); + RESET_FAKE(suit_mci_signing_key_id_get); RESET_FAKE(suit_mci_processor_start_rights_validate); RESET_FAKE(suit_mci_memory_access_rights_validate); RESET_FAKE(suit_mci_platform_specific_component_rights_validate); diff --git a/tests/subsys/suit/unit/mocks/include/mock_suit_storage.h b/tests/subsys/suit/unit/mocks/include/mock_suit_storage.h index bb97edf2b0cb..334caf806b20 100644 --- a/tests/subsys/suit/unit/mocks/include/mock_suit_storage.h +++ b/tests/subsys/suit/unit/mocks/include/mock_suit_storage.h @@ -23,6 +23,10 @@ FAKE_VALUE_FUNC(int, suit_storage_install_envelope, const suit_manifest_class_id FAKE_VALUE_FUNC(int, suit_storage_update_cand_get, const suit_plat_mreg_t **, size_t *); FAKE_VALUE_FUNC(int, suit_storage_update_cand_set, suit_plat_mreg_t *, size_t); +/* suit_storage_mpi.c */ +FAKE_VALUE_FUNC(int, suit_storage_mpi_role_get, const suit_manifest_class_id_t *, + suit_manifest_role_t *); + static inline void mock_suit_storage_reset(void) { RESET_FAKE(suit_storage_init); @@ -30,6 +34,7 @@ static inline void mock_suit_storage_reset(void) RESET_FAKE(suit_storage_install_envelope); RESET_FAKE(suit_storage_update_cand_get); RESET_FAKE(suit_storage_update_cand_set); + RESET_FAKE(suit_storage_mpi_role_get); } #endif /* MOCK_SUIT_STORAGE_H__ */ diff --git a/tests/subsys/suit/unit/suit_plat_component_compatibility/prj.conf b/tests/subsys/suit/unit/suit_plat_component_compatibility/prj.conf index b9afa4d1aba9..b0fa04b982de 100644 --- a/tests/subsys/suit/unit/suit_plat_component_compatibility/prj.conf +++ b/tests/subsys/suit/unit/suit_plat_component_compatibility/prj.conf @@ -7,5 +7,6 @@ CONFIG_MOCK_SUIT_PROCESSOR=y CONFIG_MOCK_SUIT_MCI=y CONFIG_MOCK_SUIT_METADATA=y +CONFIG_MOCK_SUIT_STORAGE=y CONFIG_MOCK_SUIT_UTILS=y CONFIG_MOCK_SUIT_PLATFORM_INTERNAL=y diff --git a/tests/subsys/suit/unit/suit_plat_component_compatibility/src/main.c b/tests/subsys/suit/unit/suit_plat_component_compatibility/src/main.c index 3c3a907f80e6..18beba2fede3 100644 --- a/tests/subsys/suit/unit/suit_plat_component_compatibility/src/main.c +++ b/tests/subsys/suit/unit/suit_plat_component_compatibility/src/main.c @@ -189,6 +189,19 @@ suit_plat_decode_component_type_cand_mfst_correct_fake_func(struct zcbor_string return SUIT_PLAT_SUCCESS; } +static suit_plat_err_t +suit_plat_decode_component_type_cand_img_correct_fake_func(struct zcbor_string *component_id, + suit_component_type_t *type) +{ + zassert_equal(&valid_component_id, component_id, "Invalid component ID value"); + zassert_not_equal(type, NULL, + "The API must provide a valid type pointer, to decode component ID"); + + *type = SUIT_COMPONENT_TYPE_CAND_IMG; + + return SUIT_PLAT_SUCCESS; +} + static suit_plat_err_t suit_plat_decode_component_type_instld_mfst_correct_fake_func(struct zcbor_string *component_id, suit_component_type_t *type) @@ -202,6 +215,45 @@ suit_plat_decode_component_type_instld_mfst_correct_fake_func(struct zcbor_strin return SUIT_PLAT_SUCCESS; } +static suit_plat_err_t +suit_storage_mpi_role_get_invalid_fake_func(const suit_manifest_class_id_t *class_id, + suit_manifest_role_t *role) +{ + zassert_equal(class_id, &sample_class_id, "Invalid manifest class ID value"); + zassert_not_equal(role, NULL, + "The API must provide a valid type pointer, to get manifest role"); + + *role = SUIT_MANIFEST_UNKNOWN; + + return SUIT_PLAT_ERR_NOT_FOUND; +} + +static suit_plat_err_t +suit_storage_mpi_role_get_app_fake_func(const suit_manifest_class_id_t *class_id, + suit_manifest_role_t *role) +{ + zassert_equal(class_id, &sample_class_id, "Invalid manifest class ID value"); + zassert_not_equal(role, NULL, + "The API must provide a valid type pointer, to get manifest role"); + + *role = SUIT_MANIFEST_APP_LOCAL_1; + + return SUIT_PLAT_SUCCESS; +} + +static suit_plat_err_t +suit_storage_mpi_role_get_root_fake_func(const suit_manifest_class_id_t *class_id, + suit_manifest_role_t *role) +{ + zassert_equal(class_id, &sample_class_id, "Invalid manifest class ID value"); + zassert_not_equal(role, NULL, + "The API must provide a valid type pointer, to get manifest role"); + + *role = SUIT_MANIFEST_APP_ROOT; + + return SUIT_PLAT_SUCCESS; +} + static suit_plat_err_t suit_plat_decode_component_number_invalid_fake_func(struct zcbor_string *component_id, uint32_t *number) @@ -303,6 +355,8 @@ ZTEST(suit_plat_component_compatibility_tests, test_null_manifest_class_id) "Incorrect number of suit_mci_manifest_class_id_validate() calls"); zassert_equal(suit_plat_decode_component_type_fake.call_count, 0, "Incorrect number of suit_plat_decode_component_type() calls"); + zassert_equal(suit_storage_mpi_role_get_fake.call_count, 0, + "Incorrect number of suit_storage_mpi_role_get() calls"); zassert_equal(suit_plat_decode_component_id_fake.call_count, 0, "Incorrect number of suit_plat_decode_component_id() calls"); zassert_equal(suit_mci_processor_start_rights_validate_fake.call_count, 0, @@ -330,6 +384,8 @@ ZTEST(suit_plat_component_compatibility_tests, test_null_component_id) "Incorrect number of suit_mci_manifest_class_id_validate() calls"); zassert_equal(suit_plat_decode_component_type_fake.call_count, 0, "Incorrect number of suit_plat_decode_component_type() calls"); + zassert_equal(suit_storage_mpi_role_get_fake.call_count, 0, + "Incorrect number of suit_storage_mpi_role_get() calls"); zassert_equal(suit_plat_decode_component_id_fake.call_count, 0, "Incorrect number of suit_plat_decode_component_id() calls"); zassert_equal(suit_mci_processor_start_rights_validate_fake.call_count, 0, @@ -362,6 +418,8 @@ ZTEST(suit_plat_component_compatibility_tests, test_invalid_component_id_null_va "Incorrect number of suit_mci_manifest_class_id_validate() calls"); zassert_equal(suit_plat_decode_component_type_fake.call_count, 0, "Incorrect number of suit_plat_decode_component_type() calls"); + zassert_equal(suit_storage_mpi_role_get_fake.call_count, 0, + "Incorrect number of suit_storage_mpi_role_get() calls"); zassert_equal(suit_plat_decode_component_id_fake.call_count, 0, "Incorrect number of suit_plat_decode_component_id() calls"); zassert_equal(suit_mci_processor_start_rights_validate_fake.call_count, 0, @@ -394,6 +452,8 @@ ZTEST(suit_plat_component_compatibility_tests, test_invalid_component_id_0_len) "Incorrect number of suit_mci_manifest_class_id_validate() calls"); zassert_equal(suit_plat_decode_component_type_fake.call_count, 0, "Incorrect number of suit_plat_decode_component_type() calls"); + zassert_equal(suit_storage_mpi_role_get_fake.call_count, 0, + "Incorrect number of suit_storage_mpi_role_get() calls"); zassert_equal(suit_plat_decode_component_id_fake.call_count, 0, "Incorrect number of suit_plat_decode_component_id() calls"); zassert_equal(suit_mci_processor_start_rights_validate_fake.call_count, 0, @@ -424,6 +484,8 @@ ZTEST(suit_plat_component_compatibility_tests, test_invalid_validate_manifest_cl "Incorrect number of suit_mci_manifest_class_id_validate() calls"); zassert_equal(suit_plat_decode_component_type_fake.call_count, 0, "Incorrect number of suit_plat_decode_component_type() calls"); + zassert_equal(suit_storage_mpi_role_get_fake.call_count, 0, + "Incorrect number of suit_storage_mpi_role_get() calls"); zassert_equal(suit_plat_decode_component_id_fake.call_count, 0, "Incorrect number of suit_plat_decode_component_id() calls"); zassert_equal(suit_mci_processor_start_rights_validate_fake.call_count, 0, @@ -456,6 +518,43 @@ ZTEST(suit_plat_component_compatibility_tests, test_invalid_decode_component_typ "Incorrect number of suit_mci_manifest_class_id_validate() calls"); zassert_equal(suit_plat_decode_component_type_fake.call_count, 1, "Incorrect number of suit_plat_decode_component_type() calls"); + zassert_equal(suit_storage_mpi_role_get_fake.call_count, 0, + "Incorrect number of suit_storage_mpi_role_get() calls"); + zassert_equal(suit_plat_decode_component_id_fake.call_count, 0, + "Incorrect number of suit_plat_decode_component_id() calls"); + zassert_equal(suit_mci_processor_start_rights_validate_fake.call_count, 0, + "Incorrect number of suit_mci_processor_start_rights_validate() calls"); + zassert_equal(suit_mci_memory_access_rights_validate_fake.call_count, 0, + "Incorrect number of suit_mci_memory_access_rights_validate() calls"); + zassert_equal(suit_plat_decode_component_number_fake.call_count, 0, + "Incorrect number of suit_plat_decode_component_number() calls"); + zassert_equal( + suit_mci_platform_specific_component_rights_validate_fake.call_count, 0, + "Incorrect number of suit_mci_platform_specific_component_rights_validate() calls"); + zassert_equal(suit_plat_decode_manifest_class_id_fake.call_count, 0, + "Incorrect number of suit_plat_decode_manifest_class_id() calls"); +} + +ZTEST(suit_plat_component_compatibility_tests, test_mem_type_invalid_role) +{ + suit_mci_manifest_class_id_validate_fake.custom_fake = + suit_mci_manifest_class_id_validate_correct_fake_func; + suit_plat_decode_component_type_fake.custom_fake = + suit_plat_decode_component_type_mem_correct_fake_func; + suit_storage_mpi_role_get_fake.custom_fake = suit_storage_mpi_role_get_invalid_fake_func; + + int ret = suit_plat_component_compatibility_check(&sample_class_id, &valid_component_id); + + /* Manifest authentication fails */ + zassert_equal(SUIT_ERR_UNSUPPORTED_COMPONENT_ID, ret, "Authorization should have failed"); + + /* Check expected call counts for fake functions */ + zassert_equal(suit_mci_manifest_class_id_validate_fake.call_count, 1, + "Incorrect number of suit_mci_manifest_class_id_validate() calls"); + zassert_equal(suit_plat_decode_component_type_fake.call_count, 1, + "Incorrect number of suit_plat_decode_component_type() calls"); + zassert_equal(suit_storage_mpi_role_get_fake.call_count, 1, + "Incorrect number of suit_storage_mpi_role_get() calls"); zassert_equal(suit_plat_decode_component_id_fake.call_count, 0, "Incorrect number of suit_plat_decode_component_id() calls"); zassert_equal(suit_mci_processor_start_rights_validate_fake.call_count, 0, @@ -477,6 +576,7 @@ ZTEST(suit_plat_component_compatibility_tests, test_mem_type_invalid_decode_comp suit_mci_manifest_class_id_validate_correct_fake_func; suit_plat_decode_component_type_fake.custom_fake = suit_plat_decode_component_type_mem_correct_fake_func; + suit_storage_mpi_role_get_fake.custom_fake = suit_storage_mpi_role_get_app_fake_func; suit_plat_decode_component_id_fake.custom_fake = suit_plat_decode_component_id_invalid_fake_func; @@ -490,6 +590,8 @@ ZTEST(suit_plat_component_compatibility_tests, test_mem_type_invalid_decode_comp "Incorrect number of suit_mci_manifest_class_id_validate() calls"); zassert_equal(suit_plat_decode_component_type_fake.call_count, 1, "Incorrect number of suit_plat_decode_component_type() calls"); + zassert_equal(suit_storage_mpi_role_get_fake.call_count, 1, + "Incorrect number of suit_storage_mpi_role_get() calls"); zassert_equal(suit_plat_decode_component_id_fake.call_count, 1, "Incorrect number of suit_plat_decode_component_id() calls"); zassert_equal(suit_mci_processor_start_rights_validate_fake.call_count, 0, @@ -511,6 +613,7 @@ ZTEST(suit_plat_component_compatibility_tests, test_mem_type_invalid_processor_s suit_mci_manifest_class_id_validate_correct_fake_func; suit_plat_decode_component_type_fake.custom_fake = suit_plat_decode_component_type_mem_correct_fake_func; + suit_storage_mpi_role_get_fake.custom_fake = suit_storage_mpi_role_get_app_fake_func; suit_plat_decode_component_id_fake.custom_fake = suit_plat_decode_component_id_correct_fake_func; suit_mci_processor_start_rights_validate_fake.custom_fake = @@ -526,6 +629,8 @@ ZTEST(suit_plat_component_compatibility_tests, test_mem_type_invalid_processor_s "Incorrect number of suit_mci_manifest_class_id_validate() calls"); zassert_equal(suit_plat_decode_component_type_fake.call_count, 1, "Incorrect number of suit_plat_decode_component_type() calls"); + zassert_equal(suit_storage_mpi_role_get_fake.call_count, 1, + "Incorrect number of suit_storage_mpi_role_get() calls"); zassert_equal(suit_plat_decode_component_id_fake.call_count, 1, "Incorrect number of suit_plat_decode_component_id() calls"); zassert_equal(suit_mci_processor_start_rights_validate_fake.call_count, 1, @@ -547,6 +652,7 @@ ZTEST(suit_plat_component_compatibility_tests, test_mem_type_invalid_memory_acce suit_mci_manifest_class_id_validate_correct_fake_func; suit_plat_decode_component_type_fake.custom_fake = suit_plat_decode_component_type_mem_correct_fake_func; + suit_storage_mpi_role_get_fake.custom_fake = suit_storage_mpi_role_get_app_fake_func; suit_plat_decode_component_id_fake.custom_fake = suit_plat_decode_component_id_correct_fake_func; suit_mci_processor_start_rights_validate_fake.custom_fake = @@ -564,6 +670,8 @@ ZTEST(suit_plat_component_compatibility_tests, test_mem_type_invalid_memory_acce "Incorrect number of suit_mci_manifest_class_id_validate() calls"); zassert_equal(suit_plat_decode_component_type_fake.call_count, 1, "Incorrect number of suit_plat_decode_component_type() calls"); + zassert_equal(suit_storage_mpi_role_get_fake.call_count, 1, + "Incorrect number of suit_storage_mpi_role_get() calls"); zassert_equal(suit_plat_decode_component_id_fake.call_count, 1, "Incorrect number of suit_plat_decode_component_id() calls"); zassert_equal(suit_mci_processor_start_rights_validate_fake.call_count, 1, @@ -585,6 +693,7 @@ ZTEST(suit_plat_component_compatibility_tests, test_mem_type_OK) suit_mci_manifest_class_id_validate_correct_fake_func; suit_plat_decode_component_type_fake.custom_fake = suit_plat_decode_component_type_mem_correct_fake_func; + suit_storage_mpi_role_get_fake.custom_fake = suit_storage_mpi_role_get_app_fake_func; suit_plat_decode_component_id_fake.custom_fake = suit_plat_decode_component_id_correct_fake_func; suit_mci_processor_start_rights_validate_fake.custom_fake = @@ -602,6 +711,8 @@ ZTEST(suit_plat_component_compatibility_tests, test_mem_type_OK) "Incorrect number of suit_mci_manifest_class_id_validate() calls"); zassert_equal(suit_plat_decode_component_type_fake.call_count, 1, "Incorrect number of suit_plat_decode_component_type() calls"); + zassert_equal(suit_storage_mpi_role_get_fake.call_count, 1, + "Incorrect number of suit_storage_mpi_role_get() calls"); zassert_equal(suit_plat_decode_component_id_fake.call_count, 1, "Incorrect number of suit_plat_decode_component_id() calls"); zassert_equal(suit_mci_processor_start_rights_validate_fake.call_count, 1, @@ -623,6 +734,7 @@ ZTEST(suit_plat_component_compatibility_tests, test_special_type_invalid_decode_ suit_mci_manifest_class_id_validate_correct_fake_func; suit_plat_decode_component_type_fake.custom_fake = suit_plat_decode_component_type_special_correct_fake_func; + suit_storage_mpi_role_get_fake.custom_fake = suit_storage_mpi_role_get_app_fake_func; suit_plat_decode_component_number_fake.custom_fake = suit_plat_decode_component_number_invalid_fake_func; @@ -636,6 +748,8 @@ ZTEST(suit_plat_component_compatibility_tests, test_special_type_invalid_decode_ "Incorrect number of suit_mci_manifest_class_id_validate() calls"); zassert_equal(suit_plat_decode_component_type_fake.call_count, 1, "Incorrect number of suit_plat_decode_component_type() calls"); + zassert_equal(suit_storage_mpi_role_get_fake.call_count, 1, + "Incorrect number of suit_storage_mpi_role_get() calls"); zassert_equal(suit_plat_decode_component_id_fake.call_count, 0, "Incorrect number of suit_plat_decode_component_id() calls"); zassert_equal(suit_mci_processor_start_rights_validate_fake.call_count, 0, @@ -658,6 +772,7 @@ ZTEST(suit_plat_component_compatibility_tests, suit_mci_manifest_class_id_validate_correct_fake_func; suit_plat_decode_component_type_fake.custom_fake = suit_plat_decode_component_type_special_correct_fake_func; + suit_storage_mpi_role_get_fake.custom_fake = suit_storage_mpi_role_get_app_fake_func; suit_plat_decode_component_number_fake.custom_fake = suit_plat_decode_component_number_correct_fake_func; suit_mci_platform_specific_component_rights_validate_fake.custom_fake = @@ -673,6 +788,8 @@ ZTEST(suit_plat_component_compatibility_tests, "Incorrect number of suit_mci_manifest_class_id_validate() calls"); zassert_equal(suit_plat_decode_component_type_fake.call_count, 1, "Incorrect number of suit_plat_decode_component_type() calls"); + zassert_equal(suit_storage_mpi_role_get_fake.call_count, 1, + "Incorrect number of suit_storage_mpi_role_get() calls"); zassert_equal(suit_plat_decode_component_id_fake.call_count, 0, "Incorrect number of suit_plat_decode_component_id() calls"); zassert_equal(suit_mci_processor_start_rights_validate_fake.call_count, 0, @@ -694,6 +811,7 @@ ZTEST(suit_plat_component_compatibility_tests, test_special_type_OK) suit_mci_manifest_class_id_validate_correct_fake_func; suit_plat_decode_component_type_fake.custom_fake = suit_plat_decode_component_type_special_correct_fake_func; + suit_storage_mpi_role_get_fake.custom_fake = suit_storage_mpi_role_get_app_fake_func; suit_plat_decode_component_number_fake.custom_fake = suit_plat_decode_component_number_correct_fake_func; suit_mci_platform_specific_component_rights_validate_fake.custom_fake = @@ -709,6 +827,8 @@ ZTEST(suit_plat_component_compatibility_tests, test_special_type_OK) "Incorrect number of suit_mci_manifest_class_id_validate() calls"); zassert_equal(suit_plat_decode_component_type_fake.call_count, 1, "Incorrect number of suit_plat_decode_component_type() calls"); + zassert_equal(suit_storage_mpi_role_get_fake.call_count, 1, + "Incorrect number of suit_storage_mpi_role_get() calls"); zassert_equal(suit_plat_decode_component_id_fake.call_count, 0, "Incorrect number of suit_plat_decode_component_id() calls"); zassert_equal(suit_mci_processor_start_rights_validate_fake.call_count, 0, @@ -730,6 +850,7 @@ ZTEST(suit_plat_component_compatibility_tests, test_cand_mfst_type_invalid_decod suit_mci_manifest_class_id_validate_correct_fake_func; suit_plat_decode_component_type_fake.custom_fake = suit_plat_decode_component_type_cand_mfst_correct_fake_func; + suit_storage_mpi_role_get_fake.custom_fake = suit_storage_mpi_role_get_app_fake_func; suit_plat_decode_component_number_fake.custom_fake = suit_plat_decode_component_number_invalid_fake_func; @@ -743,6 +864,45 @@ ZTEST(suit_plat_component_compatibility_tests, test_cand_mfst_type_invalid_decod "Incorrect number of suit_mci_manifest_class_id_validate() calls"); zassert_equal(suit_plat_decode_component_type_fake.call_count, 1, "Incorrect number of suit_plat_decode_component_type() calls"); + zassert_equal(suit_storage_mpi_role_get_fake.call_count, 1, + "Incorrect number of suit_storage_mpi_role_get() calls"); + zassert_equal(suit_plat_decode_component_id_fake.call_count, 0, + "Incorrect number of suit_plat_decode_component_id() calls"); + zassert_equal(suit_mci_processor_start_rights_validate_fake.call_count, 0, + "Incorrect number of suit_mci_processor_start_rights_validate() calls"); + zassert_equal(suit_mci_memory_access_rights_validate_fake.call_count, 0, + "Incorrect number of suit_mci_memory_access_rights_validate() calls"); + zassert_equal(suit_plat_decode_component_number_fake.call_count, 1, + "Incorrect number of suit_plat_decode_component_number() calls"); + zassert_equal( + suit_mci_platform_specific_component_rights_validate_fake.call_count, 0, + "Incorrect number of suit_mci_platform_specific_component_rights_validate() calls"); + zassert_equal(suit_plat_decode_manifest_class_id_fake.call_count, 0, + "Incorrect number of suit_plat_decode_manifest_class_id() calls"); +} + +ZTEST(suit_plat_component_compatibility_tests, test_cand_mfst_type_app) +{ + suit_mci_manifest_class_id_validate_fake.custom_fake = + suit_mci_manifest_class_id_validate_correct_fake_func; + suit_plat_decode_component_type_fake.custom_fake = + suit_plat_decode_component_type_cand_mfst_correct_fake_func; + suit_storage_mpi_role_get_fake.custom_fake = suit_storage_mpi_role_get_app_fake_func; + suit_plat_decode_component_number_fake.custom_fake = + suit_plat_decode_component_number_correct_fake_func; + + int ret = suit_plat_component_compatibility_check(&sample_class_id, &valid_component_id); + + /* Manifest authentication fails */ + zassert_equal(SUIT_ERR_UNAUTHORIZED_COMPONENT, ret, "Authorization should have succeeded"); + + /* Check expected call counts for fake functions */ + zassert_equal(suit_mci_manifest_class_id_validate_fake.call_count, 1, + "Incorrect number of suit_mci_manifest_class_id_validate() calls"); + zassert_equal(suit_plat_decode_component_type_fake.call_count, 1, + "Incorrect number of suit_plat_decode_component_type() calls"); + zassert_equal(suit_storage_mpi_role_get_fake.call_count, 1, + "Incorrect number of suit_storage_mpi_role_get() calls"); zassert_equal(suit_plat_decode_component_id_fake.call_count, 0, "Incorrect number of suit_plat_decode_component_id() calls"); zassert_equal(suit_mci_processor_start_rights_validate_fake.call_count, 0, @@ -758,12 +918,124 @@ ZTEST(suit_plat_component_compatibility_tests, test_cand_mfst_type_invalid_decod "Incorrect number of suit_plat_decode_manifest_class_id() calls"); } -ZTEST(suit_plat_component_compatibility_tests, test_cand_mfst_type_OK) +ZTEST(suit_plat_component_compatibility_tests, test_cand_mfst_type_root_OK) { suit_mci_manifest_class_id_validate_fake.custom_fake = suit_mci_manifest_class_id_validate_correct_fake_func; suit_plat_decode_component_type_fake.custom_fake = suit_plat_decode_component_type_cand_mfst_correct_fake_func; + suit_storage_mpi_role_get_fake.custom_fake = suit_storage_mpi_role_get_root_fake_func; + suit_plat_decode_component_number_fake.custom_fake = + suit_plat_decode_component_number_correct_fake_func; + + int ret = suit_plat_component_compatibility_check(&sample_class_id, &valid_component_id); + + /* Manifest authentication succeeds */ + zassert_equal(SUIT_SUCCESS, ret, "Authorization should have succeeded"); + + /* Check expected call counts for fake functions */ + zassert_equal(suit_mci_manifest_class_id_validate_fake.call_count, 1, + "Incorrect number of suit_mci_manifest_class_id_validate() calls"); + zassert_equal(suit_plat_decode_component_type_fake.call_count, 1, + "Incorrect number of suit_plat_decode_component_type() calls"); + zassert_equal(suit_storage_mpi_role_get_fake.call_count, 1, + "Incorrect number of suit_storage_mpi_role_get() calls"); + zassert_equal(suit_plat_decode_component_id_fake.call_count, 0, + "Incorrect number of suit_plat_decode_component_id() calls"); + zassert_equal(suit_mci_processor_start_rights_validate_fake.call_count, 0, + "Incorrect number of suit_mci_processor_start_rights_validate() calls"); + zassert_equal(suit_mci_memory_access_rights_validate_fake.call_count, 0, + "Incorrect number of suit_mci_memory_access_rights_validate() calls"); + zassert_equal(suit_plat_decode_component_number_fake.call_count, 1, + "Incorrect number of suit_plat_decode_component_number() calls"); + zassert_equal( + suit_mci_platform_specific_component_rights_validate_fake.call_count, 0, + "Incorrect number of suit_mci_platform_specific_component_rights_validate() calls"); + zassert_equal(suit_plat_decode_manifest_class_id_fake.call_count, 0, + "Incorrect number of suit_plat_decode_manifest_class_id() calls"); +} + +ZTEST(suit_plat_component_compatibility_tests, test_cand_img_type_invalid_decode_component_number) +{ + suit_mci_manifest_class_id_validate_fake.custom_fake = + suit_mci_manifest_class_id_validate_correct_fake_func; + suit_plat_decode_component_type_fake.custom_fake = + suit_plat_decode_component_type_cand_img_correct_fake_func; + suit_storage_mpi_role_get_fake.custom_fake = suit_storage_mpi_role_get_app_fake_func; + suit_plat_decode_component_number_fake.custom_fake = + suit_plat_decode_component_number_invalid_fake_func; + + int ret = suit_plat_component_compatibility_check(&sample_class_id, &valid_component_id); + + /* Manifest authentication fails */ + zassert_equal(SUIT_ERR_UNSUPPORTED_COMPONENT_ID, ret, "Authorization should have failed"); + + /* Check expected call counts for fake functions */ + zassert_equal(suit_mci_manifest_class_id_validate_fake.call_count, 1, + "Incorrect number of suit_mci_manifest_class_id_validate() calls"); + zassert_equal(suit_plat_decode_component_type_fake.call_count, 1, + "Incorrect number of suit_plat_decode_component_type() calls"); + zassert_equal(suit_storage_mpi_role_get_fake.call_count, 1, + "Incorrect number of suit_storage_mpi_role_get() calls"); + zassert_equal(suit_plat_decode_component_id_fake.call_count, 0, + "Incorrect number of suit_plat_decode_component_id() calls"); + zassert_equal(suit_mci_processor_start_rights_validate_fake.call_count, 0, + "Incorrect number of suit_mci_processor_start_rights_validate() calls"); + zassert_equal(suit_mci_memory_access_rights_validate_fake.call_count, 0, + "Incorrect number of suit_mci_memory_access_rights_validate() calls"); + zassert_equal(suit_plat_decode_component_number_fake.call_count, 1, + "Incorrect number of suit_plat_decode_component_number() calls"); + zassert_equal( + suit_mci_platform_specific_component_rights_validate_fake.call_count, 0, + "Incorrect number of suit_mci_platform_specific_component_rights_validate() calls"); + zassert_equal(suit_plat_decode_manifest_class_id_fake.call_count, 0, + "Incorrect number of suit_plat_decode_manifest_class_id() calls"); +} + +ZTEST(suit_plat_component_compatibility_tests, test_cand_mfst_type_root) +{ + suit_mci_manifest_class_id_validate_fake.custom_fake = + suit_mci_manifest_class_id_validate_correct_fake_func; + suit_plat_decode_component_type_fake.custom_fake = + suit_plat_decode_component_type_cand_img_correct_fake_func; + suit_storage_mpi_role_get_fake.custom_fake = suit_storage_mpi_role_get_root_fake_func; + suit_plat_decode_component_number_fake.custom_fake = + suit_plat_decode_component_number_correct_fake_func; + + int ret = suit_plat_component_compatibility_check(&sample_class_id, &valid_component_id); + + /* Manifest authentication fails */ + zassert_equal(SUIT_ERR_UNAUTHORIZED_COMPONENT, ret, "Authorization should have succeeded"); + + /* Check expected call counts for fake functions */ + zassert_equal(suit_mci_manifest_class_id_validate_fake.call_count, 1, + "Incorrect number of suit_mci_manifest_class_id_validate() calls"); + zassert_equal(suit_plat_decode_component_type_fake.call_count, 1, + "Incorrect number of suit_plat_decode_component_type() calls"); + zassert_equal(suit_storage_mpi_role_get_fake.call_count, 1, + "Incorrect number of suit_storage_mpi_role_get() calls"); + zassert_equal(suit_plat_decode_component_id_fake.call_count, 0, + "Incorrect number of suit_plat_decode_component_id() calls"); + zassert_equal(suit_mci_processor_start_rights_validate_fake.call_count, 0, + "Incorrect number of suit_mci_processor_start_rights_validate() calls"); + zassert_equal(suit_mci_memory_access_rights_validate_fake.call_count, 0, + "Incorrect number of suit_mci_memory_access_rights_validate() calls"); + zassert_equal(suit_plat_decode_component_number_fake.call_count, 1, + "Incorrect number of suit_plat_decode_component_number() calls"); + zassert_equal( + suit_mci_platform_specific_component_rights_validate_fake.call_count, 0, + "Incorrect number of suit_mci_platform_specific_component_rights_validate() calls"); + zassert_equal(suit_plat_decode_manifest_class_id_fake.call_count, 0, + "Incorrect number of suit_plat_decode_manifest_class_id() calls"); +} + +ZTEST(suit_plat_component_compatibility_tests, test_cand_img_type_app_OK) +{ + suit_mci_manifest_class_id_validate_fake.custom_fake = + suit_mci_manifest_class_id_validate_correct_fake_func; + suit_plat_decode_component_type_fake.custom_fake = + suit_plat_decode_component_type_cand_img_correct_fake_func; + suit_storage_mpi_role_get_fake.custom_fake = suit_storage_mpi_role_get_app_fake_func; suit_plat_decode_component_number_fake.custom_fake = suit_plat_decode_component_number_correct_fake_func; @@ -777,6 +1049,8 @@ ZTEST(suit_plat_component_compatibility_tests, test_cand_mfst_type_OK) "Incorrect number of suit_mci_manifest_class_id_validate() calls"); zassert_equal(suit_plat_decode_component_type_fake.call_count, 1, "Incorrect number of suit_plat_decode_component_type() calls"); + zassert_equal(suit_storage_mpi_role_get_fake.call_count, 1, + "Incorrect number of suit_storage_mpi_role_get() calls"); zassert_equal(suit_plat_decode_component_id_fake.call_count, 0, "Incorrect number of suit_plat_decode_component_id() calls"); zassert_equal(suit_mci_processor_start_rights_validate_fake.call_count, 0, @@ -799,6 +1073,7 @@ ZTEST(suit_plat_component_compatibility_tests, suit_mci_manifest_class_id_validate_correct_fake_func; suit_plat_decode_component_type_fake.custom_fake = suit_plat_decode_component_type_instld_mfst_correct_fake_func; + suit_storage_mpi_role_get_fake.custom_fake = suit_storage_mpi_role_get_app_fake_func; suit_plat_decode_manifest_class_id_fake.custom_fake = suit_plat_decode_manifest_class_id_invalid_fake_func; @@ -812,6 +1087,8 @@ ZTEST(suit_plat_component_compatibility_tests, "Incorrect number of suit_mci_manifest_class_id_validate() calls"); zassert_equal(suit_plat_decode_component_type_fake.call_count, 1, "Incorrect number of suit_plat_decode_component_type() calls"); + zassert_equal(suit_storage_mpi_role_get_fake.call_count, 1, + "Incorrect number of suit_storage_mpi_role_get() calls"); zassert_equal(suit_plat_decode_component_id_fake.call_count, 0, "Incorrect number of suit_plat_decode_component_id() calls"); zassert_equal(suit_mci_processor_start_rights_validate_fake.call_count, 0, @@ -836,6 +1113,7 @@ ZTEST(suit_plat_component_compatibility_tests, test_instld_mfst_type_invalid_rel suit_mci_manifest_class_id_validate_correct_fake_func; suit_plat_decode_component_type_fake.custom_fake = suit_plat_decode_component_type_instld_mfst_correct_fake_func; + suit_storage_mpi_role_get_fake.custom_fake = suit_storage_mpi_role_get_app_fake_func; suit_plat_decode_manifest_class_id_fake.custom_fake = suit_plat_decode_manifest_class_id_correct_fake_func; suit_mci_manifest_parent_child_declaration_validate_fake.custom_fake = @@ -851,6 +1129,8 @@ ZTEST(suit_plat_component_compatibility_tests, test_instld_mfst_type_invalid_rel "Incorrect number of suit_mci_manifest_class_id_validate() calls"); zassert_equal(suit_plat_decode_component_type_fake.call_count, 1, "Incorrect number of suit_plat_decode_component_type() calls"); + zassert_equal(suit_storage_mpi_role_get_fake.call_count, 1, + "Incorrect number of suit_storage_mpi_role_get() calls"); zassert_equal(suit_plat_decode_component_id_fake.call_count, 0, "Incorrect number of suit_plat_decode_component_id() calls"); zassert_equal(suit_mci_processor_start_rights_validate_fake.call_count, 0, @@ -875,6 +1155,7 @@ ZTEST(suit_plat_component_compatibility_tests, test_instld_mfst_type_OK) suit_mci_manifest_class_id_validate_correct_fake_func; suit_plat_decode_component_type_fake.custom_fake = suit_plat_decode_component_type_instld_mfst_correct_fake_func; + suit_storage_mpi_role_get_fake.custom_fake = suit_storage_mpi_role_get_app_fake_func; suit_plat_decode_manifest_class_id_fake.custom_fake = suit_plat_decode_manifest_class_id_correct_fake_func; suit_mci_manifest_parent_child_declaration_validate_fake.custom_fake = @@ -890,6 +1171,8 @@ ZTEST(suit_plat_component_compatibility_tests, test_instld_mfst_type_OK) "Incorrect number of suit_mci_manifest_class_id_validate() calls"); zassert_equal(suit_plat_decode_component_type_fake.call_count, 1, "Incorrect number of suit_plat_decode_component_type() calls"); + zassert_equal(suit_storage_mpi_role_get_fake.call_count, 1, + "Incorrect number of suit_storage_mpi_role_get() calls"); zassert_equal(suit_plat_decode_component_id_fake.call_count, 0, "Incorrect number of suit_plat_decode_component_id() calls"); zassert_equal(suit_mci_processor_start_rights_validate_fake.call_count, 0, @@ -914,6 +1197,7 @@ ZTEST(suit_plat_component_compatibility_tests, test_unsupported_type_err) suit_mci_manifest_class_id_validate_correct_fake_func; suit_plat_decode_component_type_fake.custom_fake = suit_plat_decode_component_type_unsupported_correct_fake_func; + suit_storage_mpi_role_get_fake.custom_fake = suit_storage_mpi_role_get_app_fake_func; int ret = suit_plat_component_compatibility_check(&sample_class_id, &valid_component_id); @@ -925,6 +1209,8 @@ ZTEST(suit_plat_component_compatibility_tests, test_unsupported_type_err) "Incorrect number of suit_mci_manifest_class_id_validate() calls"); zassert_equal(suit_plat_decode_component_type_fake.call_count, 1, "Incorrect number of suit_plat_decode_component_type() calls"); + zassert_equal(suit_storage_mpi_role_get_fake.call_count, 1, + "Incorrect number of suit_storage_mpi_role_get() calls"); zassert_equal(suit_plat_decode_component_id_fake.call_count, 0, "Incorrect number of suit_plat_decode_component_id() calls"); zassert_equal(suit_mci_processor_start_rights_validate_fake.call_count, 0, diff --git a/tests/tfm/tfm_psa_test/boards/nrf5340dk_nrf5340_cpuapp_ns.overlay b/tests/tfm/tfm_psa_test/boards/nrf5340dk_nrf5340_cpuapp_ns.overlay new file mode 100644 index 000000000000..774389839921 --- /dev/null +++ b/tests/tfm/tfm_psa_test/boards/nrf5340dk_nrf5340_cpuapp_ns.overlay @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ +&uart0 { + compatible = "nordic,nrf-uarte"; + current-speed = <115200>; + status = "okay"; + hw-flow-control; +}; + +&uart1 { + compatible = "nordic,nrf-uarte"; + current-speed = <115200>; + /* Set to disabled in application, since TF-M will be using it. */ + status = "disabled"; + hw-flow-control; +}; diff --git a/tests/tfm/tfm_psa_test/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay b/tests/tfm/tfm_psa_test/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay new file mode 100644 index 000000000000..b12de43265c5 --- /dev/null +++ b/tests/tfm/tfm_psa_test/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ +&uart20 { + compatible = "nordic,nrf-uarte"; + current-speed = <115200>; + status = "okay"; + hw-flow-control; +}; + +&uart30 { + compatible = "nordic,nrf-uarte"; + current-speed = <115200>; + /* Set to disabled in application, since TF-M will be using it. */ + status = "disabled"; + hw-flow-control; +}; diff --git a/tests/tfm/tfm_psa_test/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.overlay b/tests/tfm/tfm_psa_test/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.overlay deleted file mode 100644 index 55b26e75d668..000000000000 --- a/tests/tfm/tfm_psa_test/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.overlay +++ /dev/null @@ -1,11 +0,0 @@ -/* - * Copyright (c) 2023 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ -&uart20 { - compatible = "nordic,nrf-uarte"; - current-speed = <115200>; - status = "okay"; - hw-flow-control; -}; diff --git a/tests/tfm/tfm_psa_test/boards/nrf9151dk_nrf9151_ns.overlay b/tests/tfm/tfm_psa_test/boards/nrf9151dk_nrf9151_ns.overlay new file mode 100644 index 000000000000..774389839921 --- /dev/null +++ b/tests/tfm/tfm_psa_test/boards/nrf9151dk_nrf9151_ns.overlay @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ +&uart0 { + compatible = "nordic,nrf-uarte"; + current-speed = <115200>; + status = "okay"; + hw-flow-control; +}; + +&uart1 { + compatible = "nordic,nrf-uarte"; + current-speed = <115200>; + /* Set to disabled in application, since TF-M will be using it. */ + status = "disabled"; + hw-flow-control; +}; diff --git a/tests/tfm/tfm_psa_test/boards/nrf9160dk_nrf9160_ns.overlay b/tests/tfm/tfm_psa_test/boards/nrf9160dk_nrf9160_ns.overlay new file mode 100644 index 000000000000..774389839921 --- /dev/null +++ b/tests/tfm/tfm_psa_test/boards/nrf9160dk_nrf9160_ns.overlay @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ +&uart0 { + compatible = "nordic,nrf-uarte"; + current-speed = <115200>; + status = "okay"; + hw-flow-control; +}; + +&uart1 { + compatible = "nordic,nrf-uarte"; + current-speed = <115200>; + /* Set to disabled in application, since TF-M will be using it. */ + status = "disabled"; + hw-flow-control; +}; diff --git a/tests/tfm/tfm_psa_test/boards/nrf9161dk_nrf9161_ns.overlay b/tests/tfm/tfm_psa_test/boards/nrf9161dk_nrf9161_ns.overlay new file mode 100644 index 000000000000..774389839921 --- /dev/null +++ b/tests/tfm/tfm_psa_test/boards/nrf9161dk_nrf9161_ns.overlay @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ +&uart0 { + compatible = "nordic,nrf-uarte"; + current-speed = <115200>; + status = "okay"; + hw-flow-control; +}; + +&uart1 { + compatible = "nordic,nrf-uarte"; + current-speed = <115200>; + /* Set to disabled in application, since TF-M will be using it. */ + status = "disabled"; + hw-flow-control; +}; diff --git a/tests/tfm/tfm_psa_test/testcase.yaml b/tests/tfm/tfm_psa_test/testcase.yaml index 436b24261761..cd5aef7b13d3 100644 --- a/tests/tfm/tfm_psa_test/testcase.yaml +++ b/tests/tfm/tfm_psa_test/testcase.yaml @@ -1,6 +1,17 @@ common: - tags: tfm ci_tests_tfm + tags: sysbuild tfm ci_tests_tfm build_only: true + sysbuild: true + platform_allow: + - nrf5340dk/nrf5340/cpuapp/ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + integration_platforms: + - nrf5340dk/nrf5340/cpuapp/ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns harness: console harness_config: type: multi_line @@ -9,80 +20,45 @@ common: - "TOTAL FAILED *: 0" tests: tfm.psa_test_storage_lvl1: - sysbuild: true - tags: tfm_lvl1 sysbuild ci_tests_tfm + tags: tfm_lvl1 extra_args: - CONFIG_TFM_PSA_TEST_STORAGE=y - CONFIG_TFM_ISOLATION_LEVEL=1 timeout: 130 - platform_allow: > - nrf5340dk/nrf5340/cpuapp/ns - nrf54l15pdk/nrf54l15/cpuapp/ns - nrf9151dk/nrf9151/ns - nrf9160dk/nrf9160/ns - nrf9161dk/nrf9161/ns + platform_allow: + - nrf54l15dk/nrf54l15/cpuapp/ns integration_platforms: - - nrf5340dk/nrf5340/cpuapp/ns - - nrf54l15pdk/nrf54l15/cpuapp/ns - - nrf9151dk/nrf9151/ns - - nrf9160dk/nrf9160/ns - - nrf9161dk/nrf9161/ns + - nrf54l15dk/nrf54l15/cpuapp/ns tfm.psa_test_storage_lvl2: - sysbuild: true - tags: tfm_lvl2 sysbuild ci_tests_tfm + tags: tfm_lvl2 extra_args: - CONFIG_TFM_PSA_TEST_STORAGE=y timeout: 130 - platform_allow: > - nrf5340dk/nrf5340/cpuapp/ns - nrf54l15pdk/nrf54l15/cpuapp/ns - nrf9151dk/nrf9151/ns - nrf9160dk/nrf9160/ns - nrf9161dk/nrf9161/ns + platform_allow: + - nrf54l15dk/nrf54l15/cpuapp/ns integration_platforms: - - nrf5340dk/nrf5340/cpuapp/ns - - nrf54l15pdk/nrf54l15/cpuapp/ns - - nrf9151dk/nrf9151/ns - - nrf9160dk/nrf9160/ns - - nrf9161dk/nrf9161/ns + - nrf54l15dk/nrf54l15/cpuapp/ns tfm.psa_test_crypto_lvl1: - sysbuild: true - tags: tfm_lvl1 sysbuild ci_tests_tfm + tags: tfm_lvl1 extra_args: - CONFIG_TFM_PSA_TEST_CRYPTO=y - CONFIG_TFM_ISOLATION_LEVEL=1 timeout: 120 - platform_allow: > - nrf5340dk/nrf5340/cpuapp/ns - nrf54l15pdk/nrf54l15/cpuapp/ns - nrf9151dk/nrf9151/ns - nrf9160dk/nrf9160/ns - nrf9161dk/nrf9161/ns + platform_allow: + - nrf54l15dk/nrf54l15/cpuapp/ns integration_platforms: - - nrf5340dk/nrf5340/cpuapp/ns - - nrf54l15pdk/nrf54l15/cpuapp/ns - - nrf9151dk/nrf9151/ns - - nrf9160dk/nrf9160/ns - - nrf9161dk/nrf9161/ns + - nrf54l15dk/nrf54l15/cpuapp/ns tfm.psa_test_crypto_lvl2: - sysbuild: true - tags: tfm_lvl2 sysbuild ci_tests_tfm + tags: tfm_lvl2 extra_args: - CONFIG_TFM_PSA_TEST_CRYPTO=y timeout: 120 - platform_allow: > - nrf5340dk/nrf5340/cpuapp/ns - nrf9151dk/nrf9151/ns - nrf9160dk/nrf9160/ns - nrf9161dk/nrf9161/ns + platform_allow: + - nrf54l15dk/nrf54l15/cpuapp/ns integration_platforms: - - nrf5340dk/nrf5340/cpuapp/ns - - nrf9151dk/nrf9151/ns - - nrf9160dk/nrf9160/ns - - nrf9161dk/nrf9161/ns + - nrf54l15dk/nrf54l15/cpuapp/ns tfm.psa_test_initial_attestation_lvl1: - sysbuild: true - tags: tfm_lvl1 sysbuild ci_tests_tfm + tags: tfm_lvl1 extra_args: - CONFIG_TFM_PSA_TEST_INITIAL_ATTESTATION=y - CONFIG_TFM_ISOLATION_LEVEL=1 @@ -90,32 +66,11 @@ tests: - CONFIG_TFM_NRF_PROVISIONING=y - CONFIG_NRF_APPROTECT_LOCK=y - CONFIG_NRF_SECURE_APPROTECT_LOCK=y - platform_allow: > - nrf5340dk/nrf5340/cpuapp/ns - nrf9151dk/nrf9151/ns - nrf9160dk/nrf9160/ns - nrf9161dk/nrf9161/ns - integration_platforms: - - nrf5340dk/nrf5340/cpuapp/ns - - nrf9151dk/nrf9151/ns - - nrf9160dk/nrf9160/ns - - nrf9161dk/nrf9161/ns tfm.psa_test_initial_attestation_lvl2: - sysbuild: true - tags: tfm_lvl2 sysbuild ci_tests_tfm + tags: tfm_lvl2 extra_args: - CONFIG_TFM_PSA_TEST_INITIAL_ATTESTATION=y - CONFIG_TFM_PARTITION_INITIAL_ATTESTATION=y - CONFIG_TFM_NRF_PROVISIONING=y - CONFIG_NRF_APPROTECT_LOCK=y - CONFIG_NRF_SECURE_APPROTECT_LOCK=y - platform_allow: > - nrf5340dk/nrf5340/cpuapp/ns - nrf9151dk/nrf9151/ns - nrf9160dk/nrf9160/ns - nrf9161dk/nrf9161/ns - integration_platforms: - - nrf5340dk/nrf5340/cpuapp/ns - - nrf9151dk/nrf9151/ns - - nrf9160dk/nrf9160/ns - - nrf9161dk/nrf9161/ns diff --git a/tests/tfm/tfm_regression_test/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.conf b/tests/tfm/tfm_regression_test/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf similarity index 100% rename from tests/tfm/tfm_regression_test/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.conf rename to tests/tfm/tfm_regression_test/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf diff --git a/tests/tfm/tfm_regression_test/boards/nrf54l15dk_nrf54l15_ns.overlay b/tests/tfm/tfm_regression_test/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay similarity index 97% rename from tests/tfm/tfm_regression_test/boards/nrf54l15dk_nrf54l15_ns.overlay rename to tests/tfm/tfm_regression_test/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay index 51aa1b8dc034..e1b384c93818 100644 --- a/tests/tfm/tfm_regression_test/boards/nrf54l15dk_nrf54l15_ns.overlay +++ b/tests/tfm/tfm_regression_test/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause */ - &uart20 { +&uart20 { compatible = "nordic,nrf-uarte"; current-speed = <115200>; status = "okay"; diff --git a/tests/tfm/tfm_regression_test/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.overlay b/tests/tfm/tfm_regression_test/boards/nrf9151dk_nrf9151_ns.overlay similarity index 95% rename from tests/tfm/tfm_regression_test/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.overlay rename to tests/tfm/tfm_regression_test/boards/nrf9151dk_nrf9151_ns.overlay index 51aa1b8dc034..f7233d8553c1 100644 --- a/tests/tfm/tfm_regression_test/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.overlay +++ b/tests/tfm/tfm_regression_test/boards/nrf9151dk_nrf9151_ns.overlay @@ -3,14 +3,14 @@ * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause */ - &uart20 { +&uart0 { compatible = "nordic,nrf-uarte"; current-speed = <115200>; status = "okay"; hw-flow-control; }; -&uart30 { +&uart1 { compatible = "nordic,nrf-uarte"; current-speed = <115200>; /* Set to disabled in application, since TF-M will be using it. */ diff --git a/tests/tfm/tfm_psa_test/app.overlay b/tests/tfm/tfm_regression_test/boards/nrf9161dk_nrf9161_ns.overlay similarity index 89% rename from tests/tfm/tfm_psa_test/app.overlay rename to tests/tfm/tfm_regression_test/boards/nrf9161dk_nrf9161_ns.overlay index 2318e8eff54c..f7233d8553c1 100644 --- a/tests/tfm/tfm_psa_test/app.overlay +++ b/tests/tfm/tfm_regression_test/boards/nrf9161dk_nrf9161_ns.overlay @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Nordic Semiconductor ASA + * Copyright (c) 2024 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause */ diff --git a/tests/tfm/tfm_regression_test/testcase.yaml b/tests/tfm/tfm_regression_test/testcase.yaml index e21ec309a2cd..d33ec930c0a1 100644 --- a/tests/tfm/tfm_regression_test/testcase.yaml +++ b/tests/tfm/tfm_regression_test/testcase.yaml @@ -17,13 +17,13 @@ tests: timeout: 200 platform_allow: - nrf5340dk/nrf5340/cpuapp/ns - - nrf54l15pdk/nrf54l15/cpuapp/ns + - nrf54l15dk/nrf54l15/cpuapp/ns - nrf9151dk/nrf9151/ns - nrf9160dk/nrf9160/ns - nrf9161dk/nrf9161/ns integration_platforms: - nrf5340dk/nrf5340/cpuapp/ns - - nrf54l15pdk/nrf54l15/cpuapp/ns + - nrf54l15dk/nrf54l15/cpuapp/ns - nrf9151dk/nrf9151/ns - nrf9160dk/nrf9160/ns - nrf9161dk/nrf9161/ns @@ -78,9 +78,9 @@ tests: extra_args: CONFIG_PSA_CRYPTO_DRIVER_CRACEN=y CONFIG_PSA_CRYPTO_DRIVER_OBERON=n timeout: 200 platform_allow: - - nrf54l15pdk/nrf54l15/cpuapp/ns + - nrf54l15dk/nrf54l15/cpuapp/ns integration_platforms: - - nrf54l15pdk/nrf54l15/cpuapp/ns + - nrf54l15dk/nrf54l15/cpuapp/ns tfm.regression_sfn_lvl1: sysbuild: true tags: tfm_lvl1 sysbuild ci_tests_tfm @@ -88,13 +88,13 @@ tests: timeout: 200 platform_allow: - nrf5340dk/nrf5340/cpuapp/ns - - nrf54l15pdk/nrf54l15/cpuapp/ns + - nrf54l15dk/nrf54l15/cpuapp/ns - nrf9151dk/nrf9151/ns - nrf9160dk/nrf9160/ns - nrf9161dk/nrf9161/ns integration_platforms: - nrf5340dk/nrf5340/cpuapp/ns - - nrf54l15pdk/nrf54l15/cpuapp/ns + - nrf54l15dk/nrf54l15/cpuapp/ns - nrf9151dk/nrf9151/ns - nrf9160dk/nrf9160/ns - nrf9161dk/nrf9161/ns @@ -104,13 +104,13 @@ tests: extra_args: CONFIG_FPU=y CONFIG_FP_HARDABI=y platform_allow: - nrf5340dk/nrf5340/cpuapp/ns - - nrf54l15pdk/nrf54l15/cpuapp/ns + - nrf54l15dk/nrf54l15/cpuapp/ns - nrf9151dk/nrf9151/ns - nrf9160dk/nrf9160/ns - nrf9161dk/nrf9161/ns integration_platforms: - nrf5340dk/nrf5340/cpuapp/ns - - nrf54l15pdk/nrf54l15/cpuapp/ns + - nrf54l15dk/nrf54l15/cpuapp/ns - nrf9151dk/nrf9151/ns - nrf9160dk/nrf9160/ns - nrf9161dk/nrf9161/ns diff --git a/west.yml b/west.yml index 20fdff753465..78b85a3ea848 100644 --- a/west.yml +++ b/west.yml @@ -71,7 +71,7 @@ manifest: # https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/guides/modules.html - name: zephyr repo-path: sdk-zephyr - revision: ea7e265dadf63ab2def0813378f20f2da793877e + revision: ed414beb4617361fbf55f9a15fdf5f489aff6be2 import: # In addition to the zephyr repository itself, NCS also # imports the contents of zephyr/west.yml at the above @@ -131,7 +131,7 @@ manifest: compare-by-default: true - name: mcuboot repo-path: sdk-mcuboot - revision: 22adc04fc4b35a6ee477675c8a33e038a98258de + revision: 53a749016a67eedc3070708871a7377e197c38db path: bootloader/mcuboot - name: qcbor url: https://github.com/laurencelundblade/QCBOR @@ -148,19 +148,19 @@ manifest: - name: nrfxlib repo-path: sdk-nrfxlib path: nrfxlib - revision: 35863321fb3684292ddce606a1c72d3cf2b62222 + revision: ea7d680ce61310fa6198a23c7daf09369e5215aa - name: trusted-firmware-m repo-path: sdk-trusted-firmware-m path: modules/tee/tf-m/trusted-firmware-m - revision: 9573717cc8c078326fceb2869fe029e98615723b + revision: d76200476c9b6c137a6e5fc400264134ae589708 - name: psa-arch-tests repo-path: sdk-psa-arch-tests path: modules/tee/tf-m/psa-arch-tests - revision: 94a349db22cd0e44136c281724ffc71b6e7391c3 + revision: 3da9313e64806d352c519e3205e81cf959067588 - name: matter repo-path: sdk-connectedhomeip path: modules/lib/matter - revision: 5a55d6099f6fdbdebdac9c0d7ea41fcfb751e7f2 + revision: 171a1d323bf91ac7a655f93c70c18ebb6c1a2253 west-commands: scripts/west/west-commands.yml submodules: - name: nlio @@ -181,7 +181,7 @@ manifest: - name: nrf-802154 repo-path: sdk-nrf-802154 path: nrf-802154 - revision: 18a2e83559df139e0b5ca05823a55d637a76c7e6 + revision: 46675c05e69fd6bd8b5e820e470d9b7ed3322bb2 groups: - nrf-802154 - name: soc-hwmv1 @@ -194,7 +194,7 @@ manifest: # Only for internal Nordic development repo-path: dragoon.git remote: dragoon - revision: c77bddac04df4afa606834bbeace5e94b3fe79b9 + revision: 4940e2c06be50db3baa6485e49a6953d6535b67c submodules: true groups: - dragoon @@ -209,12 +209,12 @@ manifest: compare-by-default: false - name: sidewalk repo-path: sdk-sidewalk - revision: 4d57fc962da6cf35b97c2fcea05ccac70ab5819a + revision: 029f0cff6f5d2aff4697dae76aaab9f96a980c8c groups: - sidewalk - name: find-my repo-path: sdk-find-my - revision: c716e9692e80d21291706c204221b939c15fc77f + revision: 69729cd861eb905324c32670a41941064e566501 groups: - find-my - name: azure-sdk-for-c @@ -245,10 +245,10 @@ manifest: upstream-sha: c6eaeda5a1c1c5dbb24dce7e027340cb8893a77b compare-by-default: false - name: suit-generator - revision: 11ac20ff63e256aa3a0facccdf001be2463bfc2a + revision: 6d31d4f4c761b8fb7c6dc5c8a3c09bd354943957 path: modules/lib/suit-generator - name: suit-processor - revision: ee58d543994256d545c692e14badf3efa9830237 + revision: 4e03623523cefb125c77b12f3d876f14e83f2603 path: modules/lib/suit-processor - name: doc-internal repo-path: doc-internal